Skip to content

Commit

Permalink
Roll out digest language in the NCRC fetcher #3239
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiosironi committed May 15, 2024
1 parent b162459 commit 1ee0ea5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { fetchAccessMicrobiologyEvaluationDigest } from './access-microbiology';
import { fetchDoiEvaluationDigestByPublisher } from './fetch-doi-evaluation-digest-by-publisher';
import { fetchEvaluationFromAppropriateService } from './fetch-evaluation-from-appropriate-service';
import { fetchHypothesisAnnotation } from './hypothesis';
import { fetchNcrcReview } from './ncrc';
import { fetchNcrcEvaluationDigest } from './ncrc';
import { fetchPrelightsHighlight } from './prelights';
import { fetchRapidReview } from './rapid-reviews';
import { fetchZenodoRecord } from './zenodo';
Expand All @@ -22,7 +22,7 @@ export const createFetchEvaluationDigest = (queryExternalService: QueryExternalS
logger,
),
hypothesis: fetchHypothesisAnnotation(queryExternalService, logger),
ncrc: fetchNcrcReview(logger),
ncrc: fetchNcrcEvaluationDigest(logger),
prelights: fetchPrelightsHighlight(queryExternalService, logger),
rapidreviews: fetchRapidReview(queryExternalService, logger),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const constructFullText = (review: NcrcReview) => toHtmlFragment(`
</p>
`);

export const constructNcrcReview = (review: NcrcReview): SanitisedHtmlFragment => pipe(
export const constructNcrcEvaluationDigest = (review: NcrcReview): SanitisedHtmlFragment => pipe(
review,
constructFullText,
sanitise,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as TE from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import * as t from 'io-ts';
import * as PR from 'io-ts/PathReporter';
import { constructNcrcReview, NcrcReview } from './construct-ncrc-review';
import { constructNcrcEvaluationDigest, NcrcReview } from './construct-ncrc-evaluation-digest';
import { sheetId } from './sheet-id';
import { Logger } from '../../../shared-ports';
import * as DE from '../../../types/data-error';
Expand Down Expand Up @@ -146,10 +146,10 @@ const fetchNcrcSpreadsheetRow = (logger: Logger) => (evaluationUuid: string) =>
}),
);

export const fetchNcrcReview = (logger: Logger): EvaluationDigestFetcher => (evaluationUuid: string) => pipe(
export const fetchNcrcEvaluationDigest = (logger: Logger): EvaluationDigestFetcher => (evaluationUuid: string) => pipe(
evaluationUuid,
fetchNcrcSpreadsheetRow(logger),
TE.map(constructNcrcReview),
TE.map(constructNcrcEvaluationDigest),
);

const slugify = (value: string) => value.toLowerCase().replace(/\s/g, '-');
Expand Down
2 changes: 1 addition & 1 deletion src/third-parties/fetch-evaluation-digest/ncrc/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { fetchNcrcReview } from './fetch-ncrc-review';
export { fetchNcrcEvaluationDigest } from './fetch-ncrc-evaluation-digest';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { URL } from 'url';
import * as TE from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import { fetchNcrcHumanReadableOriginalUrl } from './fetch-evaluation-digest/ncrc/fetch-ncrc-review';
import { fetchNcrcHumanReadableOriginalUrl } from './fetch-evaluation-digest/ncrc/fetch-ncrc-evaluation-digest';
import { Logger } from '../shared-ports';
import * as DE from '../types/data-error';
import {
Expand Down

0 comments on commit 1ee0ea5

Please sign in to comment.