From 32b3a6d83f72f9a1b7511c0fcdf30a201a229bbb Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:27:20 +0200 Subject: [PATCH 01/34] Move client `schema` package into `api/schema` --- .github/labeler.yml | 2 +- .github/workflows/lint_openapi_schema.yml | 2 +- Makefile | 2 +- client/src/{ => api}/schema/__mocks__/fetcher.ts | 10 +++++----- client/src/{ => api}/schema/__mocks__/index.ts | 0 client/src/{ => api}/schema/fetcher.ts | 0 client/src/{ => api}/schema/index.ts | 0 client/src/{ => api}/schema/mockFetcher.test.ts | 4 ++-- client/src/{ => api}/schema/schema.ts | 0 client/src/components/Common/ExportRDMForm.test.ts | 4 ++-- .../src/components/Common/models/exportRecordModel.ts | 2 +- .../components/Common/models/testData/exportData.ts | 2 +- client/src/components/Dataset/services.ts | 2 +- client/src/components/Datatypes/model.ts | 2 +- client/src/components/Datatypes/services.ts | 2 +- client/src/components/FilesDialog/FilesDialog.test.ts | 4 ++-- client/src/components/FilesDialog/services.ts | 4 ++-- .../src/components/Form/Elements/FormDirectory.test.js | 4 ++-- .../Archiving/HistoryArchiveExportSelector.test.ts | 4 ++-- .../History/Archiving/HistoryArchiveWizard.test.ts | 4 ++-- .../src/components/History/Content/GenericElement.vue | 2 +- client/src/components/History/Content/model/states.ts | 2 +- .../HistoryOperations/SelectionOperations.test.js | 4 ++-- .../components/History/Export/HistoryExport.test.ts | 6 +++--- client/src/components/History/Export/services.ts | 4 ++-- client/src/components/History/Modals/SelectorModal.vue | 2 +- client/src/components/HistoryExport/Index.test.js | 4 ++-- client/src/components/HistoryImport.test.js | 4 ++-- client/src/components/Masthead/Masthead.test.js | 4 ++-- client/src/components/Masthead/QuotaMeter.test.ts | 4 ++-- .../components/NewUserWelcome/NewUserWelcome.test.js | 4 ++-- .../Notifications/Broadcasts/BroadcastContainer.vue | 2 +- client/src/components/Notifications/index.ts | 2 +- client/src/components/Notifications/test-utils.ts | 2 +- client/src/components/ObjectStore/ObjectStoreBadge.vue | 2 +- .../src/components/ObjectStore/ObjectStoreBadges.vue | 2 +- .../ObjectStore/ShowSelectedObjectStore.test.js | 4 ++-- client/src/components/ObjectStore/services.ts | 2 +- client/src/components/ObjectStore/types.ts | 2 +- client/src/components/Page/PageDropdown.test.ts | 4 ++-- client/src/components/Page/services.ts | 2 +- client/src/components/StsDownloadButton.test.js | 4 ++-- client/src/components/Tool/ToolCard.test.js | 2 +- client/src/components/Tool/ToolForm.test.js | 4 ++-- .../Toolshed/RepositoryDetails/Index.test.js | 4 ++-- client/src/components/Upload/UploadModal.test.js | 2 +- client/src/components/Upload/services.ts | 2 +- .../components/User/DiskUsage/DiskUsageSummary.test.ts | 4 ++-- .../src/components/User/DiskUsage/DiskUsageSummary.vue | 2 +- .../Management/Cleanup/model/CleanableSummary.ts | 2 +- .../Management/Cleanup/model/CleanupOperation.ts | 2 +- .../Management/Cleanup/model/CleanupResult.ts | 2 +- .../components/User/DiskUsage/Management/services.ts | 2 +- .../User/DiskUsage/Quota/model/QuotaUsage.ts | 2 +- .../User/DiskUsage/Visualizations/service.ts | 2 +- .../User/Notifications/NotificationsPreferences.vue | 2 +- .../components/User/Notifications/model/services.ts | 2 +- .../components/Workflow/Editor/Forms/FormTool.test.js | 2 +- client/src/components/admin/JobLock.vue | 2 +- .../admin/Notifications/BroadcastForm.test.ts | 4 ++-- .../components/admin/Notifications/BroadcastForm.vue | 2 +- .../components/admin/Notifications/BroadcastsList.vue | 2 +- .../admin/Notifications/NotificationForm.test.ts | 2 +- .../admin/Notifications/NotificationForm.vue | 2 +- .../admin/Notifications/broadcasts.services.ts | 2 +- .../admin/Notifications/notifications.services.ts | 2 +- .../src/components/admin/Notifications/test.utils.ts | 2 +- client/src/composables/datatypes.ts | 2 +- client/src/composables/fileSources.test.ts | 4 ++-- client/src/composables/shortTermStorage.ts | 2 +- client/src/composables/taskMonitor.test.ts | 4 ++-- client/src/composables/taskMonitor.ts | 2 +- client/src/stores/broadcastsStore.ts | 2 +- client/src/stores/collectionAttributesStore.test.ts | 4 ++-- client/src/stores/collectionElementsStore.test.ts | 4 ++-- client/src/stores/configurationStore.ts | 2 +- client/src/stores/historyStore.ts | 2 +- client/src/stores/notificationsStore.ts | 2 +- client/src/stores/services/broadcasts.service.ts | 2 +- client/src/stores/services/dataset.service.ts | 2 +- .../src/stores/services/datasetCollection.service.ts | 2 +- client/src/stores/services/historyArchive.services.ts | 2 +- client/src/stores/services/index.ts | 2 +- client/src/stores/services/notifications.service.ts | 2 +- client/src/stores/userStore.ts | 2 +- doc/source/api_doc.rst | 2 +- 86 files changed, 113 insertions(+), 113 deletions(-) rename client/src/{ => api}/schema/__mocks__/fetcher.ts (89%) rename client/src/{ => api}/schema/__mocks__/index.ts (100%) rename client/src/{ => api}/schema/fetcher.ts (100%) rename client/src/{ => api}/schema/index.ts (100%) rename client/src/{ => api}/schema/mockFetcher.test.ts (94%) rename client/src/{ => api}/schema/schema.ts (100%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 0736c48376fb..fc5c7eb38d11 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -63,7 +63,7 @@ area/toolshed: - lib/toolshed/**/* - templates/webapps/tool_shed/**/* area/UI-UX: - - all: ["client/src/**/*", "!client/src/schema/schema.ts"] + - all: ["client/src/**/*", "!client/src/api/schema/schema.ts"] any: ["templates/**/*"] area/util: - lib/galaxy/util/**/* diff --git a/.github/workflows/lint_openapi_schema.yml b/.github/workflows/lint_openapi_schema.yml index 02cfb35e640d..32ddedf5cd7d 100644 --- a/.github/workflows/lint_openapi_schema.yml +++ b/.github/workflows/lint_openapi_schema.yml @@ -57,7 +57,7 @@ jobs: - name: Check for changes run: | if [[ `git status --porcelain` ]]; then - echo "Rebuilding client/src/schema/schema.ts resulted in changes, run 'make update-client-api-schema' and commit results" + echo "Rebuilding client/src/api/schema/schema.ts resulted in changes, run 'make update-client-api-schema' and commit results" exit 1 fi working-directory: 'galaxy root' diff --git a/Makefile b/Makefile index f20548df435e..28f320e6f44a 100644 --- a/Makefile +++ b/Makefile @@ -189,7 +189,7 @@ remove-api-schema: rm _shed_schema.yaml update-client-api-schema: client-node-deps build-api-schema - $(IN_VENV) cd client && node openapi_to_schema.mjs ../_schema.yaml > src/schema/schema.ts && npx prettier --write src/schema/schema.ts + $(IN_VENV) cd client && node openapi_to_schema.mjs ../_schema.yaml > src/api/schema/schema.ts && npx prettier --write src/api/schema/schema.ts $(IN_VENV) cd client && node openapi_to_schema.mjs ../_shed_schema.yaml > ../lib/tool_shed/webapp/frontend/src/schema/schema.ts && npx prettier --write ../lib/tool_shed/webapp/frontend/src/schema/schema.ts $(MAKE) remove-api-schema diff --git a/client/src/schema/__mocks__/fetcher.ts b/client/src/api/schema/__mocks__/fetcher.ts similarity index 89% rename from client/src/schema/__mocks__/fetcher.ts rename to client/src/api/schema/__mocks__/fetcher.ts index c8ddabf907ec..5af41cc7e146 100644 --- a/client/src/schema/__mocks__/fetcher.ts +++ b/client/src/api/schema/__mocks__/fetcher.ts @@ -1,10 +1,10 @@ -import type { paths } from "@/schema"; +import type { paths } from "@/api/schema"; -jest.mock("@/schema", () => ({ +jest.mock("@/api/schema", () => ({ fetcher: mockFetcher, })); -jest.mock("@/schema/fetcher", () => ({ +jest.mock("@/api/schema/fetcher", () => ({ fetcher: mockFetcher, })); @@ -60,9 +60,9 @@ function setMockReturn(path: Path | RegExp, method: Method, value: any) { } /** - * Mock implementation for the fetcher found in `@/schema/fetcher` + * Mock implementation for the fetcher found in `@/api/schema/fetcher` * - * You need to call `jest.mock("@/schema")` and/or `jest.mock("@/schema/fetcher")` + * You need to call `jest.mock("@/api/schema")` and/or `jest.mock("@/api/schema/fetcher")` * (depending on what module the file you are testing imported) * in order for this mock to take effect. * diff --git a/client/src/schema/__mocks__/index.ts b/client/src/api/schema/__mocks__/index.ts similarity index 100% rename from client/src/schema/__mocks__/index.ts rename to client/src/api/schema/__mocks__/index.ts diff --git a/client/src/schema/fetcher.ts b/client/src/api/schema/fetcher.ts similarity index 100% rename from client/src/schema/fetcher.ts rename to client/src/api/schema/fetcher.ts diff --git a/client/src/schema/index.ts b/client/src/api/schema/index.ts similarity index 100% rename from client/src/schema/index.ts rename to client/src/api/schema/index.ts diff --git a/client/src/schema/mockFetcher.test.ts b/client/src/api/schema/mockFetcher.test.ts similarity index 94% rename from client/src/schema/mockFetcher.test.ts rename to client/src/api/schema/mockFetcher.test.ts index ac48c08105ff..e4eddd5a3f58 100644 --- a/client/src/schema/mockFetcher.test.ts +++ b/client/src/api/schema/mockFetcher.test.ts @@ -1,8 +1,8 @@ -import { fetcher } from "@/schema"; +import { fetcher } from "@/api/schema"; import { mockFetcher } from "./__mocks__/fetcher"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); mockFetcher.path("/api/configuration").method("get").mock("CONFIGURATION"); diff --git a/client/src/schema/schema.ts b/client/src/api/schema/schema.ts similarity index 100% rename from client/src/schema/schema.ts rename to client/src/api/schema/schema.ts diff --git a/client/src/components/Common/ExportRDMForm.test.ts b/client/src/components/Common/ExportRDMForm.test.ts index 7f19404d7ab1..fab42a9ce793 100644 --- a/client/src/components/Common/ExportRDMForm.test.ts +++ b/client/src/components/Common/ExportRDMForm.test.ts @@ -2,14 +2,14 @@ import { getLocalVue } from "@tests/jest/helpers"; import { mount, Wrapper } from "@vue/test-utils"; import flushPromises from "flush-promises"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { CreatedEntry } from "../FilesDialog/services"; import ExportRDMForm from "./ExportRDMForm.vue"; import FilesInput from "@/components/FilesDialog/FilesInput.vue"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); const localVue = getLocalVue(true); diff --git a/client/src/components/Common/models/exportRecordModel.ts b/client/src/components/Common/models/exportRecordModel.ts index 82a4458c5e3b..78c07ce5ed83 100644 --- a/client/src/components/Common/models/exportRecordModel.ts +++ b/client/src/components/Common/models/exportRecordModel.ts @@ -1,6 +1,6 @@ import { formatDistanceToNow, parseISO } from "date-fns"; -import type { components } from "@/schema"; +import type { components } from "@/api/schema"; type ExportObjectRequestMetadata = components["schemas"]["ExportObjectRequestMetadata"]; diff --git a/client/src/components/Common/models/testData/exportData.ts b/client/src/components/Common/models/testData/exportData.ts index 8253bff39751..665e51b70e94 100644 --- a/client/src/components/Common/models/testData/exportData.ts +++ b/client/src/components/Common/models/testData/exportData.ts @@ -1,5 +1,5 @@ +import type { components } from "@/api/schema"; import { ExportRecordModel } from "@/components/Common/models/exportRecordModel"; -import type { components } from "@/schema"; type ObjectExportTaskResponse = components["schemas"]["ObjectExportTaskResponse"]; type ExportObjectRequestMetadata = components["schemas"]["ExportObjectRequestMetadata"]; diff --git a/client/src/components/Dataset/services.ts b/client/src/components/Dataset/services.ts index 05bd948482f8..2bcfb6c3624d 100644 --- a/client/src/components/Dataset/services.ts +++ b/client/src/components/Dataset/services.ts @@ -1,6 +1,6 @@ import type { FetchArgType } from "openapi-typescript-fetch"; -import { fetcher } from "@/schema"; +import { fetcher } from "@/api/schema"; import { withPrefix } from "@/utils/redirect"; const _getDatasets = fetcher.path("/api/datasets").method("get").create(); diff --git a/client/src/components/Datatypes/model.ts b/client/src/components/Datatypes/model.ts index 8d1e47f82bc0..45334ba8d255 100644 --- a/client/src/components/Datatypes/model.ts +++ b/client/src/components/Datatypes/model.ts @@ -1,4 +1,4 @@ -import type { components } from "@/schema"; +import type { components } from "@/api/schema"; export type DatatypesCombinedMap = components["schemas"]["DatatypesCombinedMap"]; diff --git a/client/src/components/Datatypes/services.ts b/client/src/components/Datatypes/services.ts index 59f984757685..7a1b1198fdeb 100644 --- a/client/src/components/Datatypes/services.ts +++ b/client/src/components/Datatypes/services.ts @@ -1,4 +1,4 @@ -import { fetcher } from "@/schema/fetcher"; +import { fetcher } from "@/api/schema/fetcher"; const getTypesAndMappings = fetcher.path("/api/datatypes/types_and_mapping").method("get").create(); diff --git a/client/src/components/FilesDialog/FilesDialog.test.ts b/client/src/components/FilesDialog/FilesDialog.test.ts index 9318e275b9fd..c59e1a4ca8e7 100644 --- a/client/src/components/FilesDialog/FilesDialog.test.ts +++ b/client/src/components/FilesDialog/FilesDialog.test.ts @@ -1,8 +1,8 @@ import { createLocalVue, shallowMount, Wrapper } from "@vue/test-utils"; import flushPromises from "flush-promises"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { selectionStates } from "@/components/SelectionDialog/selectionStates"; -import { mockFetcher } from "@/schema/__mocks__"; import { BaseRecordItem } from "./model"; import { @@ -26,7 +26,7 @@ import DataDialogTable from "@/components/SelectionDialog/DataDialogTable.vue"; import SelectionDialog from "@/components/SelectionDialog/SelectionDialog.vue"; jest.mock("app"); -jest.mock("@/schema"); +jest.mock("@/api/schema"); jest.mock("@/composables/config", () => ({ useConfig: jest.fn(() => ({ diff --git a/client/src/components/FilesDialog/services.ts b/client/src/components/FilesDialog/services.ts index 116429bc7f32..8c5ce5c58514 100644 --- a/client/src/components/FilesDialog/services.ts +++ b/client/src/components/FilesDialog/services.ts @@ -1,5 +1,5 @@ -import type { components } from "@/schema"; -import { fetcher } from "@/schema/fetcher"; +import type { components } from "@/api/schema"; +import { fetcher } from "@/api/schema/fetcher"; /** The browsing mode: * - `file` - allows to select files or directories contained in a source (default) diff --git a/client/src/components/Form/Elements/FormDirectory.test.js b/client/src/components/Form/Elements/FormDirectory.test.js index c12171e233bc..589456f27836 100644 --- a/client/src/components/Form/Elements/FormDirectory.test.js +++ b/client/src/components/Form/Elements/FormDirectory.test.js @@ -5,13 +5,13 @@ import flushPromises from "flush-promises"; import { createPinia } from "pinia"; import { getLocalVue } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import FormDirectory from "./FormDirectory"; const localVue = getLocalVue(); jest.mock("app"); -jest.mock("@/schema"); +jest.mock("@/api/schema"); describe("DirectoryPathEditableBreadcrumb", () => { let wrapper; diff --git a/client/src/components/History/Archiving/HistoryArchiveExportSelector.test.ts b/client/src/components/History/Archiving/HistoryArchiveExportSelector.test.ts index 9356c6c5f610..1aa6eb2f20f4 100644 --- a/client/src/components/History/Archiving/HistoryArchiveExportSelector.test.ts +++ b/client/src/components/History/Archiving/HistoryArchiveExportSelector.test.ts @@ -5,6 +5,7 @@ import { BFormCheckbox } from "bootstrap-vue"; import flushPromises from "flush-promises"; import { getLocalVue } from "tests/jest/helpers"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { FAILED_FILE_SOURCE_STORE_RESPONSE, FILE_SOURCE_STORE_RESPONSE, @@ -12,12 +13,11 @@ import { RECENT_FILE_SOURCE_STORE_RESPONSE, RECENT_STS_DOWNLOAD_RESPONSE, } from "@/components/Common/models/testData/exportData"; -import { mockFetcher } from "@/schema/__mocks__"; import type { HistorySummary } from "@/stores/historyStore"; import HistoryArchiveExportSelector from "./HistoryArchiveExportSelector.vue"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); const localVue = getLocalVue(true); diff --git a/client/src/components/History/Archiving/HistoryArchiveWizard.test.ts b/client/src/components/History/Archiving/HistoryArchiveWizard.test.ts index 0f86fb02fc14..f6b1cb207b71 100644 --- a/client/src/components/History/Archiving/HistoryArchiveWizard.test.ts +++ b/client/src/components/History/Archiving/HistoryArchiveWizard.test.ts @@ -4,12 +4,12 @@ import flushPromises from "flush-promises"; import { setActivePinia } from "pinia"; import { getLocalVue } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { type HistorySummary, useHistoryStore } from "@/stores/historyStore"; import HistoryArchiveWizard from "./HistoryArchiveWizard.vue"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); jest.mock("@/composables/config", () => ({ useConfig: jest.fn(() => ({ diff --git a/client/src/components/History/Content/GenericElement.vue b/client/src/components/History/Content/GenericElement.vue index 7205c0e19685..4bc176276084 100644 --- a/client/src/components/History/Content/GenericElement.vue +++ b/client/src/components/History/Content/GenericElement.vue @@ -2,7 +2,7 @@ import type { PropType } from "vue"; import Vue, { ref } from "vue"; -import type { components } from "@/schema"; +import type { components } from "@/api/schema"; import ContentItem from "./ContentItem.vue"; diff --git a/client/src/components/History/Content/model/states.ts b/client/src/components/History/Content/model/states.ts index 67eab750bbce..4dc6bd81b8a4 100644 --- a/client/src/components/History/Content/model/states.ts +++ b/client/src/components/History/Content/model/states.ts @@ -1,4 +1,4 @@ -import { components } from "@/schema"; +import { components } from "@/api/schema"; type DatasetState = components["schemas"]["DatasetState"]; // The 'failed' state is for the collection job state summary, not a dataset state. diff --git a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.test.js b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.test.js index f8c61e5d0c54..7cb65453957c 100644 --- a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.test.js +++ b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.test.js @@ -5,11 +5,11 @@ import flushPromises from "flush-promises"; import { createPinia } from "pinia"; import { getLocalVue } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import SelectionOperations from "./SelectionOperations.vue"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); const localVue = getLocalVue(); diff --git a/client/src/components/History/Export/HistoryExport.test.ts b/client/src/components/History/Export/HistoryExport.test.ts index 712446f67b6e..e5def4424dae 100644 --- a/client/src/components/History/Export/HistoryExport.test.ts +++ b/client/src/components/History/Export/HistoryExport.test.ts @@ -4,13 +4,13 @@ import { shallowMount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { setActivePinia } from "pinia"; +import type { components } from "@/api/schema"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { EXPIRED_STS_DOWNLOAD_RECORD, FILE_SOURCE_STORE_RECORD, RECENT_STS_DOWNLOAD_RECORD, } from "@/components/Common/models/testData/exportData"; -import type { components } from "@/schema"; -import { mockFetcher } from "@/schema/__mocks__"; import { type HistorySummary, useHistoryStore } from "@/stores/historyStore"; import { getExportRecords } from "./services"; @@ -19,7 +19,7 @@ import HistoryExport from "./HistoryExport.vue"; const localVue = getLocalVue(true); -jest.mock("@/schema"); +jest.mock("@/api/schema"); jest.mock("./services"); const mockGetExportRecords = getExportRecords as jest.MockedFunction; mockGetExportRecords.mockResolvedValue([]); diff --git a/client/src/components/History/Export/services.ts b/client/src/components/History/Export/services.ts index 636c88771cb6..263df6585b98 100644 --- a/client/src/components/History/Export/services.ts +++ b/client/src/components/History/Export/services.ts @@ -1,8 +1,8 @@ +import type { components } from "@/api/schema"; +import { fetcher } from "@/api/schema"; import type { ObjectExportTaskResponse } from "@/components/Common/models/exportRecordModel"; import { ExportRecordModel } from "@/components/Common/models/exportRecordModel"; import { DEFAULT_EXPORT_PARAMS } from "@/composables/shortTermStorage"; -import type { components } from "@/schema"; -import { fetcher } from "@/schema"; type ModelStoreFormat = components["schemas"]["ModelStoreFormat"]; diff --git a/client/src/components/History/Modals/SelectorModal.vue b/client/src/components/History/Modals/SelectorModal.vue index 400dc12bc743..5f88283912d1 100644 --- a/client/src/components/History/Modals/SelectorModal.vue +++ b/client/src/components/History/Modals/SelectorModal.vue @@ -10,7 +10,7 @@ import { storeToRefs } from "pinia"; import { computed, onMounted, onUnmounted, type PropType, type Ref, ref, watch } from "vue"; import { useRouter } from "vue-router/composables"; -import type { components } from "@/schema"; +import type { components } from "@/api/schema"; import { useHistoryStore } from "@/stores/historyStore"; import { useUserStore } from "@/stores/userStore"; import Filtering, { compare, contains, expandNameTag, toDate } from "@/utils/filtering"; diff --git a/client/src/components/HistoryExport/Index.test.js b/client/src/components/HistoryExport/Index.test.js index b4471b350e81..7fe9ed063905 100644 --- a/client/src/components/HistoryExport/Index.test.js +++ b/client/src/components/HistoryExport/Index.test.js @@ -1,11 +1,11 @@ import { shallowMount } from "@vue/test-utils"; import { getLocalVue } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import Index from "./Index.vue"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); const localVue = getLocalVue(); diff --git a/client/src/components/HistoryImport.test.js b/client/src/components/HistoryImport.test.js index 99a6a232f325..588080aebb7d 100644 --- a/client/src/components/HistoryImport.test.js +++ b/client/src/components/HistoryImport.test.js @@ -5,7 +5,7 @@ import { waitOnJob } from "components/JobStates/wait"; import flushPromises from "flush-promises"; import { getLocalVue, wait } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import HistoryImport from "./HistoryImport.vue"; @@ -15,7 +15,7 @@ const TEST_HISTORY_URI = "/api/histories"; const TEST_SOURCE_URL = "http://galaxy.example/import"; const TEST_PLUGINS_URL = "/api/remote_files/plugins"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); jest.mock("components/JobStates/wait"); describe("HistoryImport.vue", () => { diff --git a/client/src/components/Masthead/Masthead.test.js b/client/src/components/Masthead/Masthead.test.js index 25908fedb015..58a7a88137fa 100644 --- a/client/src/components/Masthead/Masthead.test.js +++ b/client/src/components/Masthead/Masthead.test.js @@ -5,7 +5,7 @@ import { PiniaVuePlugin, setActivePinia } from "pinia"; import { useEntryPointStore } from "stores/entryPointStore"; import { getLocalVue } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { loadWebhookMenuItems } from "./_webhooks"; import { getActiveTab } from "./utilities"; @@ -17,7 +17,7 @@ jest.mock("./_webhooks"); jest.mock("vue-router/composables", () => ({ useRoute: jest.fn(() => ({ name: "Home" })), })); -jest.mock("@/schema"); +jest.mock("@/api/schema"); describe("Masthead.vue", () => { let wrapper; diff --git a/client/src/components/Masthead/QuotaMeter.test.ts b/client/src/components/Masthead/QuotaMeter.test.ts index fb32389fe0fa..583543cb38ad 100644 --- a/client/src/components/Masthead/QuotaMeter.test.ts +++ b/client/src/components/Masthead/QuotaMeter.test.ts @@ -3,12 +3,12 @@ import { mount } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { getLocalVue } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { useUserStore } from "@/stores/userStore"; import QuotaMeter from "./QuotaMeter.vue"; -jest.mock("@/schema"); +jest.mock("@/api/schema"); const localVue = getLocalVue(); diff --git a/client/src/components/NewUserWelcome/NewUserWelcome.test.js b/client/src/components/NewUserWelcome/NewUserWelcome.test.js index a6da93e531cd..d030776dc7b8 100644 --- a/client/src/components/NewUserWelcome/NewUserWelcome.test.js +++ b/client/src/components/NewUserWelcome/NewUserWelcome.test.js @@ -2,7 +2,7 @@ import { mount } from "@vue/test-utils"; import { createPinia } from "pinia"; import { getLocalVue } from "tests/jest/helpers"; -import { mockFetcher } from "@/schema/__mocks__"; +import { mockFetcher } from "@/api/schema/__mocks__"; import { getResource } from "./getResource"; import testData from "./testData.json"; @@ -11,7 +11,7 @@ import NewUserWelcome from "./NewUserWelcome.vue"; const localVue = getLocalVue(); -jest.mock("@/schema"); +jest.mock("@/api/schema"); jest.mock("./getResource"); // mock resource connector diff --git a/client/src/components/Notifications/Broadcasts/BroadcastContainer.vue b/client/src/components/Notifications/Broadcasts/BroadcastContainer.vue index 3dec6c18928f..5669e709c1cd 100644 --- a/client/src/components/Notifications/Broadcasts/BroadcastContainer.vue +++ b/client/src/components/Notifications/Broadcasts/BroadcastContainer.vue @@ -7,8 +7,8 @@ import { storeToRefs } from "pinia"; import { computed } from "vue"; import { useRouter } from "vue-router/composables"; +import { type components } from "@/api/schema"; import { useMarkdown } from "@/composables/markdown"; -import { type components } from "@/schema"; import { type BroadcastNotification, useBroadcastsStore } from "@/stores/broadcastsStore"; import Heading from "@/components/Common/Heading.vue"; diff --git a/client/src/components/Notifications/index.ts b/client/src/components/Notifications/index.ts index 3ec984ca6117..935d31bf7a12 100644 --- a/client/src/components/Notifications/index.ts +++ b/client/src/components/Notifications/index.ts @@ -1,4 +1,4 @@ -import { type components } from "@/schema"; +import { type components } from "@/api/schema"; export type BaseUserNotification = components["schemas"]["UserNotificationResponse"]; diff --git a/client/src/components/Notifications/test-utils.ts b/client/src/components/Notifications/test-utils.ts index 50af596eaf67..10917de03f51 100644 --- a/client/src/components/Notifications/test-utils.ts +++ b/client/src/components/Notifications/test-utils.ts @@ -1,5 +1,5 @@ +import type { components } from "@/api/schema"; import type { MessageNotification, SharedItemNotification, UserNotification } from "@/components/Notifications/index"; -import type { components } from "@/schema"; type NotificationVariants = components["schemas"]["NotificationVariant"]; type NewSharedItemNotificationContentItemType = components["schemas"]["NewSharedItemNotificationContent"]["item_type"]; diff --git a/client/src/components/ObjectStore/ObjectStoreBadge.vue b/client/src/components/ObjectStore/ObjectStoreBadge.vue index 02ca556b1f88..29f4db692934 100644 --- a/client/src/components/ObjectStore/ObjectStoreBadge.vue +++ b/client/src/components/ObjectStore/ObjectStoreBadge.vue @@ -4,7 +4,7 @@ import "./badgeIcons"; import { FontAwesomeIcon, FontAwesomeLayers } from "@fortawesome/vue-fontawesome"; import { computed } from "vue"; -import type { components } from "@/schema"; +import type { components } from "@/api/schema"; import ConfigurationMarkdown from "./ConfigurationMarkdown.vue"; diff --git a/client/src/components/ObjectStore/ObjectStoreBadges.vue b/client/src/components/ObjectStore/ObjectStoreBadges.vue index 3c0625889df1..042ce1bb469c 100644 --- a/client/src/components/ObjectStore/ObjectStoreBadges.vue +++ b/client/src/components/ObjectStore/ObjectStoreBadges.vue @@ -1,5 +1,5 @@