Skip to content

Commit

Permalink
Move docmaps/docmap route and tests in their intended location #3239
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiosironi committed May 15, 2024
1 parent 37649df commit 0a767ed
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 38 deletions.
6 changes: 0 additions & 6 deletions src/docmaps/docmap-index/dependencies.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/docmaps/docmap-index/view-model.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/http/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { pageHandler } from './page-handler';
import { ping } from './ping';
import { requireLoggedInUser } from './require-logged-in-user';
import { robots } from './robots';
import { docmapIndex } from '../docmaps/docmap-index';
import { evaluationContent, paramsCodec as evaluationContentParams } from '../evaluation-content';
import { CollectedPorts } from '../infrastructure';
import { aboutPage } from '../read-side/html-pages/about-page';
Expand Down Expand Up @@ -46,6 +45,7 @@ import { subscribeToListPage } from '../read-side/html-pages/subscribe-to-list-p
import { userPage as userFollowingPage, userPageParams as userFollowingPageParams } from '../read-side/html-pages/user-page/user-following-page';
import { userPage as userListsPage, userPageParams as userListsPageParams } from '../read-side/html-pages/user-page/user-lists-page';
import { generateDocmaps } from '../read-side/non-html-views/docmaps/docmap';
import { docmapIndex } from '../read-side/non-html-views/docmaps/docmap-index';
import { listFeed } from '../read-side/non-html-views/list/list-feed';
import { applicationStatus } from '../read-side/non-html-views/status';
import { statusGroups } from '../read-side/non-html-views/status-groups';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { filterByParams } from './filter-by-params';
import { identifyAllPossibleIndexEntries } from './identify-all-possible-index-entries';
import { Params } from './params';
import { DocmapIndexViewModel } from './view-model';
import { constructDocmapViewModel } from '../../read-side/non-html-views/docmaps/docmap/construct-docmap-view-model';
import { supportedGroups } from '../../read-side/non-html-views/docmaps/supported-groups';
import { constructDocmapViewModel } from '../docmap/construct-docmap-view-model';
import { supportedGroups } from '../supported-groups';

type ConstructDocmapIndexViewModel = (dependencies: Dependencies)
=> (params: Params)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Logger } from '../../../../shared-ports';
import { Ports as DocmapDependencies } from '../docmap/construct-docmap-view-model';

export type Dependencies = DocmapDependencies & {
logger: Logger,
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { StatusCodes } from 'http-status-codes';
import { constructViewModel } from './construct-view-model';
import { Dependencies } from './dependencies';
import { decodeParams } from './filter-by-params';
import { renderDocmap } from '../../read-side/non-html-views/docmaps/docmap/render-docmap';
import { renderDocmap } from '../docmap/render-docmap';

type DocmapIndexBody = {
articles?: ReadonlyArray<unknown>,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { flow, pipe } from 'fp-ts/function';
import * as S from 'fp-ts/string';
import { Dependencies } from './dependencies';
import * as ER from './error-response';
import { publisherAccountId } from '../../read-side/non-html-views/docmaps/docmap/publisher-account-id';
import * as DE from '../../types/data-error';
import { ExpressionDoi } from '../../types/expression-doi';
import * as GID from '../../types/group-id';
import { GroupId } from '../../types/group-id';
import * as DE from '../../../../types/data-error';
import { ExpressionDoi } from '../../../../types/expression-doi';
import * as GID from '../../../../types/group-id';
import { GroupId } from '../../../../types/group-id';
import { publisherAccountId } from '../docmap/publisher-account-id';

export type DocmapIndexEntryModel = {
expressionDoi: ExpressionDoi,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { DocmapViewModel } from '../docmap/view-model';

export type DocmapIndexViewModel = ReadonlyArray<DocmapViewModel>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import * as TE from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import { StatusCodes } from 'http-status-codes';
import { identity } from 'io-ts';
import { constructViewModel } from '../../../src/docmaps/docmap-index/construct-view-model';
import * as ER from '../../../src/docmaps/docmap-index/error-response';
import { Params } from '../../../src/docmaps/docmap-index/params';
import { publisherAccountId } from '../../../src/read-side/non-html-views/docmaps/docmap/publisher-account-id';
import { supportedGroups } from '../../../src/read-side/non-html-views/docmaps/supported-groups';
import { toExpressionDoi } from '../../../src/types/article-id';
import { TestFramework, createTestFramework } from '../../framework';
import { arbitraryString } from '../../helpers';
import { shouldNotBeCalled } from '../../should-not-be-called';
import { arbitraryArticleId } from '../../types/article-id.helper';
import { arbitraryEvaluationLocator } from '../../types/evaluation-locator.helper';
import { arbitraryGroupId } from '../../types/group-id.helper';
import { arbitraryAddGroupCommand } from '../../write-side/commands/add-group-command.helper';
import { arbitraryRecordEvaluationPublicationCommand } from '../../write-side/commands/record-evaluation-publication-command.helper';
import { publisherAccountId } from '../../../../../src/read-side/non-html-views/docmaps/docmap/publisher-account-id';
import { constructViewModel } from '../../../../../src/read-side/non-html-views/docmaps/docmap-index/construct-view-model';
import * as ER from '../../../../../src/read-side/non-html-views/docmaps/docmap-index/error-response';
import { Params } from '../../../../../src/read-side/non-html-views/docmaps/docmap-index/params';
import { supportedGroups } from '../../../../../src/read-side/non-html-views/docmaps/supported-groups';
import { toExpressionDoi } from '../../../../../src/types/article-id';
import { TestFramework, createTestFramework } from '../../../../framework';
import { arbitraryString } from '../../../../helpers';
import { shouldNotBeCalled } from '../../../../should-not-be-called';
import { arbitraryArticleId } from '../../../../types/article-id.helper';
import { arbitraryEvaluationLocator } from '../../../../types/evaluation-locator.helper';
import { arbitraryGroupId } from '../../../../types/group-id.helper';
import { arbitraryAddGroupCommand } from '../../../../write-side/commands/add-group-command.helper';
import { arbitraryRecordEvaluationPublicationCommand } from '../../../../write-side/commands/record-evaluation-publication-command.helper';

describe('construct-view-model', () => {
const defaultParams: Params = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { StatusCodes } from 'http-status-codes';
import { docmapIndex } from '../../../src/docmaps/docmap-index';
import { Dependencies } from '../../../src/docmaps/docmap-index/dependencies';
import * as GID from '../../../src/types/group-id';
import { dummyLogger } from '../../dummy-logger';
import { TestFramework, createTestFramework } from '../../framework';
import { arbitraryRecordEvaluationPublicationCommand } from '../../write-side/commands/record-evaluation-publication-command.helper';
import { docmapIndex } from '../../../../../src/read-side/non-html-views/docmaps/docmap-index';
import { Dependencies } from '../../../../../src/read-side/non-html-views/docmaps/docmap-index/dependencies';
import * as GID from '../../../../../src/types/group-id';
import { dummyLogger } from '../../../../dummy-logger';
import { TestFramework, createTestFramework } from '../../../../framework';
import { arbitraryRecordEvaluationPublicationCommand } from '../../../../write-side/commands/record-evaluation-publication-command.helper';

describe('docmap-index', () => {
const ncrcGroupId = GID.fromValidatedString('62f9b0d0-8d43-4766-a52a-ce02af61bc6a');
Expand Down

0 comments on commit 0a767ed

Please sign in to comment.