From d29d3f123d61e7422918db821032dda1c6282553 Mon Sep 17 00:00:00 2001 From: lucferbux Date: Fri, 8 Nov 2024 12:50:27 +0100 Subject: [PATCH] Refactor codebase to improve code handling --- clients/ui/frontend/src/app/App.tsx | 2 +- clients/ui/frontend/src/app/AppContext.ts | 2 +- .../app/context/useModelRegistryAPIState.tsx | 6 ++--- .../app/hooks/useModelArtifactsByVersionId.ts | 2 +- .../src/app/hooks/useModelRegistries.ts | 4 +-- .../src/app/hooks/useModelVersionById.ts | 2 +- .../useModelVersionsByRegisteredModel.ts | 2 +- .../src/app/hooks/useRegisteredModelById.ts | 2 +- .../src/app/hooks/useRegisteredModels.ts | 2 +- .../modelRegistry/ModelRegistryCoreLoader.tsx | 6 ++--- .../modelRegistry/ModelRegistryRoutes.tsx | 2 +- .../screens/InvalidModelRegistry.tsx | 2 +- .../ModelPropertiesDescriptionListGroup.tsx | 2 +- .../screens/ModelPropertiesTableRow.tsx | 4 +-- .../modelRegistry/screens/ModelRegistry.tsx | 6 ++--- .../screens/ModelRegistrySelector.tsx | 2 +- .../ModelVersionDetails.tsx | 2 +- .../ModelVersionDetailsView.tsx | 10 ++++---- .../ModelVersions/ModelDetailsView.tsx | 6 ++--- .../ModelVersions/ModelVersionListView.tsx | 6 ++--- .../screens/ModelVersions/ModelVersions.tsx | 2 +- .../ModelVersions/ModelVersionsTable.tsx | 4 +-- .../ModelVersionsTableColumns.ts | 2 +- .../ArchiveModelVersionDetails.tsx | 2 +- .../ModelVersionArchiveDetails.tsx | 2 +- .../ModelVersionsArchive.tsx | 2 +- .../ModelVersionsArchiveListView.tsx | 4 +-- .../ModelVersionsArchiveTable.tsx | 4 +-- .../screens/RegisterModel/RegisterModel.tsx | 6 ++--- .../screens/RegisterModel/RegisterVersion.tsx | 4 +-- .../RegistrationCommonFormSections.tsx | 4 +-- .../usePrefillRegisterVersionFields.ts | 2 +- .../RegisterModel/useRegisterModelData.ts | 2 +- .../RegisteredModelListView.tsx | 6 ++--- .../RegisteredModels/RegisteredModelTable.tsx | 4 +-- .../RegisteredModelsTableColumns.ts | 2 +- .../RegisteredModelsTableToolbar.tsx | 25 ++++++++----------- .../RegisteredModelArchiveDetails.tsx | 2 +- .../RegisteredModelsArchive.tsx | 2 +- .../RegisteredModelsArchiveListView.tsx | 4 +-- .../RegisteredModelsArchiveTable.tsx | 4 +-- .../screens/__tests__/utils.spec.ts | 2 +- .../components/ArchiveModelVersionModal.tsx | 2 +- .../ArchiveRegisteredModelModal.tsx | 2 +- .../screens/components/ModelLabels.tsx | 2 +- .../screens/components/ModelTimestamp.tsx | 2 +- .../components/RestoreModelVersionModal.tsx | 2 +- .../components/RestoreRegisteredModel.tsx | 2 +- .../app/pages/modelRegistry/screens/utils.ts | 4 +-- .../pages/settings/ModelRegistriesTable.tsx | 2 +- .../pages/settings/ModelRegistrySettings.tsx | 6 ++--- .../src/app/pages/settings/columns.ts | 2 +- clients/ui/frontend/src/app/types.ts | 2 +- clients/ui/frontend/src/app/useSettings.tsx | 6 ++--- .../frontend/src/app/useTimeBasedRefresh.ts | 2 +- clients/ui/frontend/src/app/utils.ts | 2 +- clients/ui/frontend/src/index.tsx | 2 +- .../api/__tests__/errorUtils.spec.ts | 6 ++--- .../api/__tests__/service.spec.ts | 10 ++++---- .../src/{app => shared}/api/apiUtils.ts | 4 +-- .../src/{app => shared}/api/errorUtils.ts | 4 +-- .../frontend/src/{app => shared}/api/k8s.ts | 6 ++--- .../src/{app => shared}/api/service.ts | 6 ++--- .../frontend/src/{app => shared}/api/types.ts | 0 .../src/{app => shared}/api/useAPIState.ts | 2 +- .../components/ApplicationsPage.tsx | 0 .../DashboardDescriptionListGroup.scss | 0 .../DashboardDescriptionListGroup.tsx | 2 +- .../components/DashboardEmptyTableView.tsx | 0 .../components/DashboardHelpTooltip.tsx | 0 .../components/DashboardModalFooter.tsx | 0 .../components/DashboardSearchField.tsx | 2 +- .../EditableLabelsDescriptionListGroup.tsx | 2 +- .../EditableTextDescriptionListGroup.tsx | 2 +- .../components/EmptyStateErrorMessage.tsx | 0 .../InlineTruncatedClipboardCopy.scss | 0 .../InlineTruncatedClipboardCopy.tsx | 0 .../components/MarkdownView.scss | 0 .../components/MarkdownView.tsx | 2 +- .../components/SimpleSelect.scss | 0 .../components/SimpleSelect.tsx | 0 .../components/ToastNotification.tsx | 0 .../components/ToastNotifications.tsx | 0 .../browserStorage/BrowserStorageContext.tsx | 4 +-- .../components/browserStorage/index.ts | 0 .../components/design/CollapsibleSection.tsx | 0 .../components/design/DividedGallery.scss | 0 .../components/design/DividedGallery.tsx | 0 .../components/design/DividedGalleryItem.tsx | 0 .../components/design/HeaderIcon.tsx | 2 +- .../components/design/InfoGalleryItem.tsx | 4 +-- .../components/design/ScrolledGallery.tsx | 0 .../components/design/TitleWithIcon.tsx | 2 +- .../components/design/TypeBorderCard.scss | 0 .../components/design/TypeBorderedCard.tsx | 2 +- .../components/design/utils.ts | 0 .../components/design/vars.scss | 0 .../components/pf-overrides/FormSection.scss | 0 .../components/pf-overrides/FormSection.tsx | 0 .../components/table/CheckboxTd.tsx | 0 .../components/table/Table.tsx | 2 +- .../components/table/TableBase.tsx | 2 +- .../table/TableRowTitleDescription.tsx | 2 +- .../table/__tests__/useCheckboxTable.spec.ts | 2 +- .../{app => shared}/components/table/const.ts | 0 .../{app => shared}/components/table/index.ts | 0 .../{app => shared}/components/table/types.ts | 0 .../components/table/useCheckboxTable.ts | 2 +- .../components/table/useCheckboxTableBase.ts | 0 .../components/table/useTableColumnSort.ts | 0 .../src/{ => shared}/style/MUI-theme.scss | 0 .../frontend/src/{ => shared}/typeHelpers.ts | 0 clients/ui/frontend/src/{ => shared}/types.ts | 2 +- .../src/{ => shared}/utilities/const.ts | 0 .../src/{ => shared}/utilities/markdown.ts | 0 .../src/{ => shared}/utilities/time.ts | 0 .../utilities/useDebounceCallback.ts | 0 .../utilities/useDeepCompareMemoize.ts | 0 .../utilities/useEventListener.ts | 0 .../{ => shared}/utilities/useFetchState.ts | 2 +- .../utilities/useGenericObjectState.ts | 2 +- 121 files changed, 139 insertions(+), 142 deletions(-) rename clients/ui/frontend/src/{app => shared}/api/__tests__/errorUtils.spec.ts (86%) rename clients/ui/frontend/src/{app => shared}/api/__tests__/service.spec.ts (98%) rename clients/ui/frontend/src/{app => shared}/api/apiUtils.ts (97%) rename clients/ui/frontend/src/{app => shared}/api/errorUtils.ts (86%) rename clients/ui/frontend/src/{app => shared}/api/k8s.ts (73%) rename clients/ui/frontend/src/{app => shared}/api/service.ts (98%) rename clients/ui/frontend/src/{app => shared}/api/types.ts (100%) rename clients/ui/frontend/src/{app => shared}/api/useAPIState.ts (94%) rename clients/ui/frontend/src/{app => shared}/components/ApplicationsPage.tsx (100%) rename clients/ui/frontend/src/{ => shared}/components/DashboardDescriptionListGroup.scss (100%) rename clients/ui/frontend/src/{ => shared}/components/DashboardDescriptionListGroup.tsx (98%) rename clients/ui/frontend/src/{app => shared}/components/DashboardEmptyTableView.tsx (100%) rename clients/ui/frontend/src/{ => shared}/components/DashboardHelpTooltip.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/DashboardModalFooter.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/DashboardSearchField.tsx (97%) rename clients/ui/frontend/src/{ => shared}/components/EditableLabelsDescriptionListGroup.tsx (99%) rename clients/ui/frontend/src/{ => shared}/components/EditableTextDescriptionListGroup.tsx (97%) rename clients/ui/frontend/src/{app => shared}/components/EmptyStateErrorMessage.tsx (100%) rename clients/ui/frontend/src/{ => shared}/components/InlineTruncatedClipboardCopy.scss (100%) rename clients/ui/frontend/src/{ => shared}/components/InlineTruncatedClipboardCopy.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/MarkdownView.scss (100%) rename clients/ui/frontend/src/{app => shared}/components/MarkdownView.tsx (92%) rename clients/ui/frontend/src/{app => shared}/components/SimpleSelect.scss (100%) rename clients/ui/frontend/src/{app => shared}/components/SimpleSelect.tsx (100%) rename clients/ui/frontend/src/{ => shared}/components/ToastNotification.tsx (100%) rename clients/ui/frontend/src/{ => shared}/components/ToastNotifications.tsx (100%) rename clients/ui/frontend/src/{ => shared}/components/browserStorage/BrowserStorageContext.tsx (96%) rename clients/ui/frontend/src/{ => shared}/components/browserStorage/index.ts (100%) rename clients/ui/frontend/src/{app => shared}/components/design/CollapsibleSection.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/design/DividedGallery.scss (100%) rename clients/ui/frontend/src/{app => shared}/components/design/DividedGallery.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/design/DividedGalleryItem.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/design/HeaderIcon.tsx (95%) rename clients/ui/frontend/src/{app => shared}/components/design/InfoGalleryItem.tsx (92%) rename clients/ui/frontend/src/{app => shared}/components/design/ScrolledGallery.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/design/TitleWithIcon.tsx (95%) rename clients/ui/frontend/src/{app => shared}/components/design/TypeBorderCard.scss (100%) rename clients/ui/frontend/src/{app => shared}/components/design/TypeBorderedCard.tsx (90%) rename clients/ui/frontend/src/{app => shared}/components/design/utils.ts (100%) rename clients/ui/frontend/src/{app => shared}/components/design/vars.scss (100%) rename clients/ui/frontend/src/{app => shared}/components/pf-overrides/FormSection.scss (100%) rename clients/ui/frontend/src/{app => shared}/components/pf-overrides/FormSection.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/table/CheckboxTd.tsx (100%) rename clients/ui/frontend/src/{app => shared}/components/table/Table.tsx (97%) rename clients/ui/frontend/src/{app => shared}/components/table/TableBase.tsx (99%) rename clients/ui/frontend/src/{app => shared}/components/table/TableRowTitleDescription.tsx (95%) rename clients/ui/frontend/src/{app => shared}/components/table/__tests__/useCheckboxTable.spec.ts (97%) rename clients/ui/frontend/src/{app => shared}/components/table/const.ts (100%) rename clients/ui/frontend/src/{app => shared}/components/table/index.ts (100%) rename clients/ui/frontend/src/{app => shared}/components/table/types.ts (100%) rename clients/ui/frontend/src/{app => shared}/components/table/useCheckboxTable.ts (91%) rename clients/ui/frontend/src/{app => shared}/components/table/useCheckboxTableBase.ts (100%) rename clients/ui/frontend/src/{app => shared}/components/table/useTableColumnSort.ts (100%) rename clients/ui/frontend/src/{ => shared}/style/MUI-theme.scss (100%) rename clients/ui/frontend/src/{ => shared}/typeHelpers.ts (100%) rename clients/ui/frontend/src/{ => shared}/types.ts (92%) rename clients/ui/frontend/src/{ => shared}/utilities/const.ts (100%) rename clients/ui/frontend/src/{ => shared}/utilities/markdown.ts (100%) rename clients/ui/frontend/src/{ => shared}/utilities/time.ts (100%) rename clients/ui/frontend/src/{ => shared}/utilities/useDebounceCallback.ts (100%) rename clients/ui/frontend/src/{ => shared}/utilities/useDeepCompareMemoize.ts (100%) rename clients/ui/frontend/src/{ => shared}/utilities/useEventListener.ts (100%) rename clients/ui/frontend/src/{ => shared}/utilities/useFetchState.ts (99%) rename clients/ui/frontend/src/{ => shared}/utilities/useGenericObjectState.ts (92%) diff --git a/clients/ui/frontend/src/app/App.tsx b/clients/ui/frontend/src/app/App.tsx index 430a9ff07..49ad79cd8 100644 --- a/clients/ui/frontend/src/app/App.tsx +++ b/clients/ui/frontend/src/app/App.tsx @@ -19,7 +19,7 @@ import { StackItem, } from '@patternfly/react-core'; import { BarsIcon } from '@patternfly/react-icons'; -import ToastNotifications from '~/components/ToastNotifications'; +import ToastNotifications from '~/shared/components/ToastNotifications'; import NavSidebar from './NavSidebar'; import AppRoutes from './AppRoutes'; import { AppContext } from './AppContext'; diff --git a/clients/ui/frontend/src/app/AppContext.ts b/clients/ui/frontend/src/app/AppContext.ts index e4ab9e4bb..1f4bd70aa 100644 --- a/clients/ui/frontend/src/app/AppContext.ts +++ b/clients/ui/frontend/src/app/AppContext.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { UserSettings, ConfigSettings } from '~/types'; +import { UserSettings, ConfigSettings } from '~/shared/types'; type AppContextProps = { config: ConfigSettings; diff --git a/clients/ui/frontend/src/app/context/useModelRegistryAPIState.tsx b/clients/ui/frontend/src/app/context/useModelRegistryAPIState.tsx index 9b1465ba0..d51592d9e 100644 --- a/clients/ui/frontend/src/app/context/useModelRegistryAPIState.tsx +++ b/clients/ui/frontend/src/app/context/useModelRegistryAPIState.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { APIState } from '~/app/api/types'; +import { APIState } from '~/shared/api/types'; import { ModelRegistryAPIs } from '~/app/types'; import { createModelArtifact, @@ -18,8 +18,8 @@ import { patchModelArtifact, patchModelVersion, patchRegisteredModel, -} from '~/app/api/service'; -import useAPIState from '~/app/api/useAPIState'; +} from '~/shared/api/service'; +import useAPIState from '~/shared/api/useAPIState'; export type ModelRegistryAPIState = APIState; diff --git a/clients/ui/frontend/src/app/hooks/useModelArtifactsByVersionId.ts b/clients/ui/frontend/src/app/hooks/useModelArtifactsByVersionId.ts index 5fb90a17a..843c138e4 100644 --- a/clients/ui/frontend/src/app/hooks/useModelArtifactsByVersionId.ts +++ b/clients/ui/frontend/src/app/hooks/useModelArtifactsByVersionId.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/utilities/useFetchState'; +import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/shared/utilities/useFetchState'; import { ModelArtifactList } from '~/app/types'; import { useModelRegistryAPI } from '~/app/hooks/useModelRegistryAPI'; diff --git a/clients/ui/frontend/src/app/hooks/useModelRegistries.ts b/clients/ui/frontend/src/app/hooks/useModelRegistries.ts index 705256a8f..34a16cfed 100644 --- a/clients/ui/frontend/src/app/hooks/useModelRegistries.ts +++ b/clients/ui/frontend/src/app/hooks/useModelRegistries.ts @@ -1,7 +1,7 @@ import * as React from 'react'; -import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/utilities/useFetchState'; +import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/shared/utilities/useFetchState'; import { ModelRegistry } from '~/app/types'; -import { getListModelRegistries } from '~/app/api/k8s'; +import { getListModelRegistries } from '~/shared/api/k8s'; const useModelRegistries = (): FetchState => { const listModelRegistries = React.useMemo(() => getListModelRegistries(''), []); diff --git a/clients/ui/frontend/src/app/hooks/useModelVersionById.ts b/clients/ui/frontend/src/app/hooks/useModelVersionById.ts index 19b7ecd97..64e8fe55f 100644 --- a/clients/ui/frontend/src/app/hooks/useModelVersionById.ts +++ b/clients/ui/frontend/src/app/hooks/useModelVersionById.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/utilities/useFetchState'; +import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/shared/utilities/useFetchState'; import { ModelVersion } from '~/app/types'; import { useModelRegistryAPI } from '~/app/hooks/useModelRegistryAPI'; diff --git a/clients/ui/frontend/src/app/hooks/useModelVersionsByRegisteredModel.ts b/clients/ui/frontend/src/app/hooks/useModelVersionsByRegisteredModel.ts index c8f82f9e3..45c5a3c2a 100644 --- a/clients/ui/frontend/src/app/hooks/useModelVersionsByRegisteredModel.ts +++ b/clients/ui/frontend/src/app/hooks/useModelVersionsByRegisteredModel.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/utilities/useFetchState'; +import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/shared/utilities/useFetchState'; import { ModelVersionList } from '~/app/types'; import { useModelRegistryAPI } from '~/app/hooks/useModelRegistryAPI'; diff --git a/clients/ui/frontend/src/app/hooks/useRegisteredModelById.ts b/clients/ui/frontend/src/app/hooks/useRegisteredModelById.ts index c2d45bc8b..414b7f435 100644 --- a/clients/ui/frontend/src/app/hooks/useRegisteredModelById.ts +++ b/clients/ui/frontend/src/app/hooks/useRegisteredModelById.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/utilities/useFetchState'; +import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/shared/utilities/useFetchState'; import { RegisteredModel } from '~/app/types'; import { useModelRegistryAPI } from '~/app/hooks/useModelRegistryAPI'; diff --git a/clients/ui/frontend/src/app/hooks/useRegisteredModels.ts b/clients/ui/frontend/src/app/hooks/useRegisteredModels.ts index 6553c7aea..3b58ec9d0 100644 --- a/clients/ui/frontend/src/app/hooks/useRegisteredModels.ts +++ b/clients/ui/frontend/src/app/hooks/useRegisteredModels.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/utilities/useFetchState'; +import useFetchState, { FetchState, FetchStateCallbackPromise } from '~/shared/utilities/useFetchState'; import { RegisteredModelList } from '~/app/types'; import { useModelRegistryAPI } from '~/app/hooks/useModelRegistryAPI'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryCoreLoader.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryCoreLoader.tsx index 0c4ec86f0..0e6cac17a 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryCoreLoader.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryCoreLoader.tsx @@ -2,11 +2,11 @@ import * as React from 'react'; import { Navigate, Outlet, useParams } from 'react-router-dom'; import { Bullseye, Alert, Popover, List, ListItem, Button } from '@patternfly/react-core'; import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; -import { ProjectObjectType, typedEmptyImage } from '~/app/components/design/utils'; +import { ProjectObjectType, typedEmptyImage } from '~/shared/components/design/utils'; import { ModelRegistryContextProvider } from '~/app/context/ModelRegistryContext'; -import TitleWithIcon from '~/app/components/design/TitleWithIcon'; +import TitleWithIcon from '~/shared/components/design/TitleWithIcon'; import EmptyModelRegistryState from './screens/components/EmptyModelRegistryState'; import InvalidModelRegistry from './screens/InvalidModelRegistry'; import ModelRegistrySelectorNavigator from './screens/ModelRegistrySelectorNavigator'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryRoutes.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryRoutes.tsx index 48f02ada4..f6fd0f486 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryRoutes.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryRoutes.tsx @@ -14,7 +14,7 @@ import ArchiveModelVersionDetails from './screens/ModelVersionsArchive/ArchiveMo import RegisteredModelsArchiveDetails from './screens/RegisteredModelsArchive/RegisteredModelArchiveDetails'; import RegisterModel from './screens/RegisterModel/RegisterModel'; import RegisterVersion from './screens/RegisterModel/RegisterVersion'; -import '~/style/MUI-theme.scss'; +import '~/shared/style/MUI-theme.scss'; const ModelRegistryRoutes: React.FC = () => ( diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/InvalidModelRegistry.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/InvalidModelRegistry.tsx index c1559a725..eb473f0ce 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/InvalidModelRegistry.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/InvalidModelRegistry.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import EmptyStateErrorMessage from '~/app/components/EmptyStateErrorMessage'; +import EmptyStateErrorMessage from '~/shared/components/EmptyStateErrorMessage'; import { modelRegistryUrl } from './routeUtils'; import ModelRegistrySelectorNavigator from './ModelRegistrySelectorNavigator'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup.tsx index 8416f3939..60a11b82c 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup.tsx @@ -4,7 +4,7 @@ import { Table, Tbody, Th, Thead, Tr } from '@patternfly/react-table'; import { PlusCircleIcon } from '@patternfly/react-icons'; import text from '@patternfly/react-styles/css/utilities/Text/text'; import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing'; -import DashboardDescriptionListGroup from '~/components/DashboardDescriptionListGroup'; +import DashboardDescriptionListGroup from '~/shared/components/DashboardDescriptionListGroup'; import { getProperties, mergeUpdatedProperty } from '~/app/pages/modelRegistry/screens/utils'; import { ModelRegistryCustomProperties } from '~/app/types'; import ModelPropertiesTableRow from '~/app/pages/modelRegistry/screens/ModelPropertiesTableRow'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesTableRow.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesTableRow.tsx index ef78584ba..3498f7bc5 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesTableRow.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelPropertiesTableRow.tsx @@ -11,8 +11,8 @@ import { TextInput, } from '@patternfly/react-core'; import { CheckIcon, TimesIcon } from '@patternfly/react-icons'; -import { KeyValuePair } from '~/types'; -import { EitherNotBoth } from '~/typeHelpers'; +import { KeyValuePair } from '~/shared/types'; +import { EitherNotBoth } from '~/shared/typeHelpers'; import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; type ModelPropertiesTableRowProps = { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistry.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistry.tsx index 75cf9f119..4c55f9f8d 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistry.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistry.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; -import TitleWithIcon from '~/app/components/design/TitleWithIcon'; -import { ProjectObjectType } from '~/app/components/design/utils'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +import TitleWithIcon from '~/shared/components/design/TitleWithIcon'; +import { ProjectObjectType } from '~/shared/components/design/utils'; import useRegisteredModels from '~/app/hooks/useRegisteredModels'; import { filterLiveModels } from '~/app/pages/modelRegistry/screens/utils'; import ModelRegistrySelectorNavigator from './ModelRegistrySelectorNavigator'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistrySelector.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistrySelector.tsx index 757eeed47..303135b4d 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistrySelector.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelRegistrySelector.tsx @@ -20,7 +20,7 @@ import { } from '@patternfly/react-core'; import truncateStyles from '@patternfly/react-styles/css/components/Truncate/truncate'; import { InfoCircleIcon, BlueprintIcon } from '@patternfly/react-icons'; -import { useBrowserStorage } from '~/components/browserStorage'; +import { useBrowserStorage } from '~/shared/components/browserStorage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; import { ModelRegistry } from '~/app/types'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetails.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetails.tsx index fe60a7b6a..8bbcd176b 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetails.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetails.tsx @@ -2,7 +2,7 @@ import React, { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router'; import { Breadcrumb, BreadcrumbItem, Flex, FlexItem, Truncate } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; import useRegisteredModelById from '~/app/hooks/useRegisteredModelById'; import useModelVersionById from '~/app/hooks/useModelVersionById'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.tsx index c541ea4fd..a88b77643 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.tsx @@ -1,13 +1,13 @@ import * as React from 'react'; import { DescriptionList, Flex, FlexItem, ContentVariants, Title } from '@patternfly/react-core'; -import DashboardDescriptionListGroup from '~/components/DashboardDescriptionListGroup'; -import EditableTextDescriptionListGroup from '~/components/EditableTextDescriptionListGroup'; -import EditableLabelsDescriptionListGroup from '~/components/EditableLabelsDescriptionListGroup'; +import DashboardDescriptionListGroup from '~/shared/components/DashboardDescriptionListGroup'; +import EditableTextDescriptionListGroup from '~/shared/components/EditableTextDescriptionListGroup'; +import EditableLabelsDescriptionListGroup from '~/shared/components/EditableLabelsDescriptionListGroup'; import { ModelVersion } from '~/app/types'; import useModelArtifactsByVersionId from '~/app/hooks/useModelArtifactsByVersionId'; import { ModelRegistryContext } from '~/app/context/ModelRegistryContext'; -import InlineTruncatedClipboardCopy from '~/components/InlineTruncatedClipboardCopy'; -import DashboardHelpTooltip from '~/components/DashboardHelpTooltip'; +import InlineTruncatedClipboardCopy from '~/shared/components/InlineTruncatedClipboardCopy'; +import DashboardHelpTooltip from '~/shared/components/DashboardHelpTooltip'; import { getLabels, mergeUpdatedLabels, diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx index f0360589c..0f97fc080 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx @@ -2,11 +2,11 @@ import * as React from 'react'; import { ClipboardCopy, DescriptionList, Flex, FlexItem, Content } from '@patternfly/react-core'; import { RegisteredModel } from '~/app/types'; import { ModelRegistryContext } from '~/app/context/ModelRegistryContext'; -import EditableTextDescriptionListGroup from '~/components/EditableTextDescriptionListGroup'; -import EditableLabelsDescriptionListGroup from '~/components/EditableLabelsDescriptionListGroup'; +import EditableTextDescriptionListGroup from '~/shared/components/EditableTextDescriptionListGroup'; +import EditableLabelsDescriptionListGroup from '~/shared/components/EditableLabelsDescriptionListGroup'; import { getLabels, mergeUpdatedLabels } from '~/app/pages/modelRegistry/screens/utils'; import ModelPropertiesDescriptionListGroup from '~/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup'; -import DashboardDescriptionListGroup from '~/components/DashboardDescriptionListGroup'; +import DashboardDescriptionListGroup from '~/shared/components/DashboardDescriptionListGroup'; import ModelTimestamp from '~/app/pages/modelRegistry/screens/components/ModelTimestamp'; type ModelDetailsViewProps = { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionListView.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionListView.tsx index efb41f568..90d3b0bea 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionListView.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionListView.tsx @@ -18,20 +18,20 @@ import { EllipsisVIcon, FilterIcon } from '@patternfly/react-icons'; import { useNavigate } from 'react-router'; import { ModelVersion, RegisteredModel } from '~/app/types'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; -import { SearchType } from '~/app/components/DashboardSearchField'; +import { SearchType } from '~/shared/components/DashboardSearchField'; import { filterModelVersions, sortModelVersionsByCreateTime, } from '~/app/pages/modelRegistry/screens/utils'; import EmptyModelRegistryState from '~/app/pages/modelRegistry/screens/components/EmptyModelRegistryState'; -import { ProjectObjectType, typedEmptyImage } from '~/app/components/design/utils'; +import { ProjectObjectType, typedEmptyImage } from '~/shared/components/design/utils'; import { modelVersionArchiveUrl, registerVersionForModelUrl, } from '~/app/pages/modelRegistry/screens/routeUtils'; import { asEnumMember } from '~/app/utils'; import ModelVersionsTable from '~/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable'; -import SimpleSelect from '~/app/components/SimpleSelect'; +import SimpleSelect from '~/shared/components/SimpleSelect'; import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; type ModelVersionListViewProps = { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersions.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersions.tsx index 1e1d48728..d6533550c 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersions.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersions.tsx @@ -3,7 +3,7 @@ import { useNavigate, useParams } from 'react-router'; import { Breadcrumb, BreadcrumbItem, Truncate } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; import { ModelVersionsTab } from '~/app/pages/modelRegistry/screens/ModelVersions/const'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import useModelVersionsByRegisteredModel from '~/app/hooks/useModelVersionsByRegisteredModel'; import useRegisteredModelById from '~/app/hooks/useRegisteredModelById'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable.tsx index 0911e0bdc..ea595e370 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; -import { Table } from '~/app/components/table'; +import { Table } from '~/shared/components/table'; import { ModelVersion } from '~/app/types'; import { mvColumns } from '~/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns'; -import DashboardEmptyTableView from '~/app/components/DashboardEmptyTableView'; +import DashboardEmptyTableView from '~/shared/components/DashboardEmptyTableView'; import ModelVersionsTableRow from '~/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableRow'; type ModelVersionsTableProps = { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns.ts b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns.ts index f98ea9129..479317c0c 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns.ts +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns.ts @@ -1,4 +1,4 @@ -import { SortableData } from '~/app/components/table'; +import { SortableData } from '~/shared/components/table'; import { ModelVersion } from '~/app/types'; export const mvColumns: SortableData[] = [ diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetails.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetails.tsx index 8a595c47d..586ac414e 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetails.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetails.tsx @@ -2,7 +2,7 @@ import React, { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router'; import { Button, Flex, FlexItem, Label, Content, Tooltip, Truncate } from '@patternfly/react-core'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; import useRegisteredModelById from '~/app/hooks/useRegisteredModelById'; import useModelVersionById from '~/app/hooks/useModelVersionById'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetails.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetails.tsx index fdb1f80f0..b6d2028ef 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetails.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetails.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router'; import { Button, Flex, FlexItem, Label, Content, Truncate } from '@patternfly/react-core'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; import { ModelRegistryContext } from '~/app/context/ModelRegistryContext'; import useRegisteredModelById from '~/app/hooks/useRegisteredModelById'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchive.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchive.tsx index 2245187ac..e456773e9 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchive.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchive.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useParams } from 'react-router'; import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; import useRegisteredModelById from '~/app/hooks/useRegisteredModelById'; import useModelVersionsByRegisteredModel from '~/app/hooks/useModelVersionsByRegisteredModel'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveListView.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveListView.tsx index fe53943c7..bca18327a 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveListView.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveListView.tsx @@ -9,8 +9,8 @@ import { } from '@patternfly/react-core'; import { FilterIcon } from '@patternfly/react-icons'; import { ModelVersion } from '~/app/types'; -import { SearchType } from '~/app/components/DashboardSearchField'; -import SimpleSelect from '~/app/components/SimpleSelect'; +import { SearchType } from '~/shared/components/DashboardSearchField'; +import SimpleSelect from '~/shared/components/SimpleSelect'; import { asEnumMember } from '~/app/utils'; import { filterModelVersions } from '~/app/pages/modelRegistry/screens/utils'; import EmptyModelRegistryState from '~/app/pages/modelRegistry/screens/components/EmptyModelRegistryState'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveTable.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveTable.tsx index 57f814b4f..932f50480 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveTable.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveTable.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { Table } from '~/app/components/table'; +import { Table } from '~/shared/components/table'; import { ModelVersion } from '~/app/types'; -import DashboardEmptyTableView from '~/app/components/DashboardEmptyTableView'; +import DashboardEmptyTableView from '~/shared/components/DashboardEmptyTableView'; import ModelVersionsTableRow from '~/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableRow'; import { mvColumns } from '~/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx index b9bf97642..0ccedb470 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.tsx @@ -14,10 +14,10 @@ import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing'; import { useParams, useNavigate } from 'react-router'; import { Link } from 'react-router-dom'; import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; -import FormSection from '~/app/components/pf-overrides/FormSection'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import FormSection from '~/shared/components/pf-overrides/FormSection'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { modelRegistryUrl, registeredModelUrl } from '~/app/pages/modelRegistry/screens/routeUtils'; -import { ValueOf } from '~/typeHelpers'; +import { ValueOf } from '~/shared/typeHelpers'; import { useRegisterModelData, RegistrationCommonFormData } from './useRegisterModelData'; import { isRegisterModelSubmitDisabled, registerModel } from './utils'; import { useRegistrationCommonState } from './useRegistrationCommonState'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterVersion.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterVersion.tsx index 2b73b2747..6a3524588 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterVersion.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegisterVersion.tsx @@ -12,10 +12,10 @@ import { import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing'; import { useParams, useNavigate } from 'react-router'; import { Link } from 'react-router-dom'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { modelRegistryUrl, registeredModelUrl } from '~/app/pages/modelRegistry/screens/routeUtils'; import useRegisteredModels from '~/app/hooks/useRegisteredModels'; -import { ValueOf } from '~/typeHelpers'; +import { ValueOf } from '~/shared/typeHelpers'; import { filterLiveModels } from '~/app/pages/modelRegistry/screens/utils'; import { RegistrationCommonFormData, useRegisterVersionData } from './useRegisterModelData'; import { isRegisterVersionSubmitDisabled, registerVersion } from './utils'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationCommonFormSections.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationCommonFormSections.tsx index acbb861f3..bf20ff477 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationCommonFormSections.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationCommonFormSections.tsx @@ -13,11 +13,11 @@ import { TextInputGroupMain, } from '@patternfly/react-core'; import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing'; -import { UpdateObjectAtPropAndValue } from '~/types'; +import { UpdateObjectAtPropAndValue } from '~/shared/types'; // import { DataConnection, UpdateObjectAtPropAndValue } from '~/pages/projects/types'; // import { convertAWSSecretData } from '~/pages/projects/screens/detail/data-connections/utils'; import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; -import FormSection from '~/app/components/pf-overrides/FormSection'; +import FormSection from '~/shared/components/pf-overrides/FormSection'; import { ModelVersion } from '~/app/types'; import { ModelLocationType, RegistrationCommonFormData } from './useRegisterModelData'; // import { ConnectionModal } from './ConnectionModal'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/usePrefillRegisterVersionFields.ts b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/usePrefillRegisterVersionFields.ts index 0f35fd72d..be9e3601b 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/usePrefillRegisterVersionFields.ts +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/usePrefillRegisterVersionFields.ts @@ -5,7 +5,7 @@ import { getLastCreatedItem, uriToObjectStorageFields, } from '~/app/pages/modelRegistry/screens/utils'; -import { UpdateObjectAtPropAndValue } from '~/types'; +import { UpdateObjectAtPropAndValue } from '~/shared/types'; import useModelArtifactsByVersionId from '~/app/hooks/useModelArtifactsByVersionId'; import useModelVersionsByRegisteredModel from '~/app/hooks/useModelVersionsByRegisteredModel'; import { RegisterVersionFormData, ModelLocationType } from './useRegisterModelData'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/useRegisterModelData.ts b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/useRegisterModelData.ts index b51a773a0..18d56b976 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/useRegisterModelData.ts +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisterModel/useRegisterModelData.ts @@ -1,4 +1,4 @@ -import useGenericObjectState, { GenericObjectState } from '~/utilities/useGenericObjectState'; +import useGenericObjectState, { GenericObjectState } from '~/shared/utilities/useGenericObjectState'; export enum ModelLocationType { ObjectStorage = 'Object storage', diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.tsx index 847d66ffd..9e4dc2d4c 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.tsx @@ -4,10 +4,10 @@ import { FilterIcon } from '@patternfly/react-icons'; import { useNavigate } from 'react-router-dom'; import { RegisteredModel } from '~/app/types'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; -import { SearchType } from '~/app/components/DashboardSearchField'; -import { ProjectObjectType, typedEmptyImage } from '~/app/components/design/utils'; +import { SearchType } from '~/shared/components/DashboardSearchField'; +import { ProjectObjectType, typedEmptyImage } from '~/shared/components/design/utils'; import { asEnumMember, filterRegisteredModels } from '~/app/utils'; -import SimpleSelect from '~/app/components/SimpleSelect'; +import SimpleSelect from '~/shared/components/SimpleSelect'; import { registeredModelArchiveUrl, registerModelUrl, diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTable.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTable.tsx index 12d377684..6ef939886 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTable.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTable.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { Table } from '~/app/components/table'; +import { Table } from '~/shared/components/table'; import { RegisteredModel } from '~/app/types'; -import DashboardEmptyTableView from '~/app/components/DashboardEmptyTableView'; +import DashboardEmptyTableView from '~/shared/components/DashboardEmptyTableView'; import { rmColumns } from './RegisteredModelsTableColumns'; import RegisteredModelTableRow from './RegisteredModelTableRow'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns.ts b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns.ts index bd7e4309e..7ca6bce8e 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns.ts +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns.ts @@ -1,4 +1,4 @@ -import { SortableData } from '~/app/components/table'; +import { SortableData } from '~/shared/components/table'; import { RegisteredModel } from '~/app/types'; export const rmColumns: SortableData[] = [ diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableToolbar.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableToolbar.tsx index 877d1fee0..08ad711b4 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableToolbar.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableToolbar.tsx @@ -52,20 +52,17 @@ const RegisteredModelsTableToolbar: React.FC ref={toggleRef} onClick={() => setIsRegisterNewVersionOpen(!isRegisterNewVersionOpen)} isExpanded={isRegisterNewVersionOpen} - splitButtonOptions={{ - variant: 'action', - items: [ - navigate(registerModelUrl(preferredModelRegistry?.name))} - > - Register model - , - ], - }} + splitButtonItems={[ + navigate(registerModelUrl(preferredModelRegistry?.name))} + > + Register model + , + ]} aria-label="Register model toggle" data-testid="register-model-split-button" /> diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetails.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetails.tsx index 711469e57..521e0a980 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetails.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetails.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router'; import { Button, Flex, FlexItem, Label, Content, Truncate } from '@patternfly/react-core'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; import { ModelRegistryContext } from '~/app/context/ModelRegistryContext'; import useRegisteredModelById from '~/app/hooks/useRegisteredModelById'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchive.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchive.tsx index 00aa63aba..17630f394 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchive.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchive.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import { ModelRegistrySelectorContext } from '~/app/context/ModelRegistrySelectorContext'; import { filterArchiveModels } from '~/app/pages/modelRegistry/screens/utils'; import useRegisteredModels from '~/app/hooks/useRegisteredModels'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveListView.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveListView.tsx index b84b73a31..50da0b1fd 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveListView.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveListView.tsx @@ -9,10 +9,10 @@ import { } from '@patternfly/react-core'; import { FilterIcon } from '@patternfly/react-icons'; import { RegisteredModel } from '~/app/types'; -import { SearchType } from '~/app/components/DashboardSearchField'; +import { SearchType } from '~/shared/components/DashboardSearchField'; import { filterRegisteredModels } from '~/app/pages/modelRegistry/screens/utils'; import EmptyModelRegistryState from '~/app/pages/modelRegistry/screens/components/EmptyModelRegistryState'; -import SimpleSelect from '~/app/components/SimpleSelect'; +import SimpleSelect from '~/shared/components/SimpleSelect'; import { asEnumMember } from '~/app/utils'; import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; import RegisteredModelsArchiveTable from './RegisteredModelsArchiveTable'; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveTable.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveTable.tsx index 4c6c66ed0..74f4ed4aa 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveTable.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveTable.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; -import { Table } from '~/app/components/table'; +import { Table } from '~/shared/components/table'; import { RegisteredModel } from '~/app/types'; import { rmColumns } from '~/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns'; -import DashboardEmptyTableView from '~/app/components/DashboardEmptyTableView'; +import DashboardEmptyTableView from '~/shared/components/DashboardEmptyTableView'; import RegisteredModelTableRow from '~/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTableRow'; type RegisteredModelsArchiveTableProps = { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/__tests__/utils.spec.ts b/clients/ui/frontend/src/app/pages/modelRegistry/screens/__tests__/utils.spec.ts index d4a102c08..77c5726eb 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/__tests__/utils.spec.ts +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/__tests__/utils.spec.ts @@ -18,7 +18,7 @@ import { mergeUpdatedProperty, sortModelVersionsByCreateTime, } from '~/app/pages/modelRegistry/screens/utils'; -import { SearchType } from '~/app/components/DashboardSearchField'; +import { SearchType } from '~/shared/components/DashboardSearchField'; describe('getLabels', () => { it('should return an empty array when customProperties is empty', () => { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveModelVersionModal.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveModelVersionModal.tsx index 4e1f8f59a..f4e018cb6 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveModelVersionModal.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveModelVersionModal.tsx @@ -8,7 +8,7 @@ import { ModalHeader, TextInput, } from '@patternfly/react-core'; -import DashboardModalFooter from '~/app/components/DashboardModalFooter'; +import DashboardModalFooter from '~/shared/components/DashboardModalFooter'; import { useNotification } from '~/app/hooks/useNotification'; interface ArchiveModelVersionModalProps { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveRegisteredModelModal.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveRegisteredModelModal.tsx index 3729255da..e5de53054 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveRegisteredModelModal.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ArchiveRegisteredModelModal.tsx @@ -8,7 +8,7 @@ import { ModalHeader, TextInput, } from '@patternfly/react-core'; -import DashboardModalFooter from '~/app/components/DashboardModalFooter'; +import DashboardModalFooter from '~/shared/components/DashboardModalFooter'; import { useNotification } from '~/app/hooks/useNotification'; interface ArchiveRegisteredModelModalProps { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelLabels.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelLabels.tsx index e888b6965..10983cc11 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelLabels.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelLabels.tsx @@ -2,7 +2,7 @@ import { Button, Label, LabelGroup, Popover, SearchInput, Content } from '@patte import { Modal, ModalVariant } from '@patternfly/react-core/deprecated'; import React from 'react'; import { ModelVersion, RegisteredModel } from '~/app/types'; -import useDebounceCallback from '~/utilities/useDebounceCallback'; +import useDebounceCallback from '~/shared/utilities/useDebounceCallback'; import { getLabels } from '~/app/pages/modelRegistry/screens/utils'; // Threshold count to decide whether to choose modal or popover diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelTimestamp.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelTimestamp.tsx index 7fbebbea6..faedff181 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelTimestamp.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/ModelTimestamp.tsx @@ -1,6 +1,6 @@ import { Timestamp, TimestampTooltipVariant } from '@patternfly/react-core'; import React from 'react'; -import { relativeTime } from '~/utilities/time'; +import { relativeTime } from '~/shared/utilities/time'; type ModelTimestampProps = { timeSinceEpoch?: string; diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreModelVersionModal.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreModelVersionModal.tsx index b83105098..e7dc7a341 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreModelVersionModal.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreModelVersionModal.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Form, Modal, ModalHeader, ModalBody, Alert } from '@patternfly/react-core'; -import DashboardModalFooter from '~/app/components/DashboardModalFooter'; +import DashboardModalFooter from '~/shared/components/DashboardModalFooter'; import { useNotification } from '~/app/hooks/useNotification'; interface RestoreModelVersionModalProps { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreRegisteredModel.tsx b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreRegisteredModel.tsx index ee5a23f0a..e1348b4ee 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreRegisteredModel.tsx +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/components/RestoreRegisteredModel.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Alert, Form, ModalHeader, Modal, ModalBody } from '@patternfly/react-core'; -import DashboardModalFooter from '~/app/components/DashboardModalFooter'; +import DashboardModalFooter from '~/shared/components/DashboardModalFooter'; import { useNotification } from '~/app/hooks/useNotification'; interface RestoreRegisteredModelModalProps { diff --git a/clients/ui/frontend/src/app/pages/modelRegistry/screens/utils.ts b/clients/ui/frontend/src/app/pages/modelRegistry/screens/utils.ts index d06779891..964cd1ea0 100644 --- a/clients/ui/frontend/src/app/pages/modelRegistry/screens/utils.ts +++ b/clients/ui/frontend/src/app/pages/modelRegistry/screens/utils.ts @@ -1,4 +1,4 @@ -import { SearchType } from '~/app/components/DashboardSearchField'; +import { SearchType } from '~/shared/components/DashboardSearchField'; import { ModelRegistryCustomProperties, ModelRegistryMetadataType, @@ -7,7 +7,7 @@ import { ModelVersion, RegisteredModel, } from '~/app/types'; -import { KeyValuePair } from '~/types'; +import { KeyValuePair } from '~/shared/types'; export type ObjectStorageFields = { endpoint: string; diff --git a/clients/ui/frontend/src/app/pages/settings/ModelRegistriesTable.tsx b/clients/ui/frontend/src/app/pages/settings/ModelRegistriesTable.tsx index 04aeb6089..5e1a001cf 100644 --- a/clients/ui/frontend/src/app/pages/settings/ModelRegistriesTable.tsx +++ b/clients/ui/frontend/src/app/pages/settings/ModelRegistriesTable.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { ModelRegistry } from '~/app/types'; -import { Table } from '~/app/components/table'; +import { Table } from '~/shared/components/table'; import { modelRegistryColumns } from './columns'; import ModelRegistriesTableRow from './ModelRegistriesTableRow'; diff --git a/clients/ui/frontend/src/app/pages/settings/ModelRegistrySettings.tsx b/clients/ui/frontend/src/app/pages/settings/ModelRegistrySettings.tsx index 9b3067c50..120ea680b 100644 --- a/clients/ui/frontend/src/app/pages/settings/ModelRegistrySettings.tsx +++ b/clients/ui/frontend/src/app/pages/settings/ModelRegistrySettings.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { EmptyState, EmptyStateBody, EmptyStateVariant } from '@patternfly/react-core'; import { PlusCircleIcon } from '@patternfly/react-icons'; -import ApplicationsPage from '~/app/components/ApplicationsPage'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; import useModelRegistries from '~/app/hooks/useModelRegistries'; -import TitleWithIcon from '~/app/components/design/TitleWithIcon'; -import { ProjectObjectType } from '~/app/components/design/utils'; +import TitleWithIcon from '~/shared/components/design/TitleWithIcon'; +import { ProjectObjectType } from '~/shared/components/design/utils'; import ModelRegistriesTable from './ModelRegistriesTable'; const ModelRegistrySettings: React.FC = () => { diff --git a/clients/ui/frontend/src/app/pages/settings/columns.ts b/clients/ui/frontend/src/app/pages/settings/columns.ts index eb50403d8..faf17b020 100644 --- a/clients/ui/frontend/src/app/pages/settings/columns.ts +++ b/clients/ui/frontend/src/app/pages/settings/columns.ts @@ -1,4 +1,4 @@ -import { SortableData } from '~/app/components/table'; +import { SortableData } from '~/shared/components/table'; import { ModelRegistry } from '~/app/types'; export const modelRegistryColumns: SortableData[] = [ diff --git a/clients/ui/frontend/src/app/types.ts b/clients/ui/frontend/src/app/types.ts index 9dd9cb4c8..a2c1dafb0 100644 --- a/clients/ui/frontend/src/app/types.ts +++ b/clients/ui/frontend/src/app/types.ts @@ -1,5 +1,5 @@ import { AlertVariant } from '@patternfly/react-core'; -import { APIOptions } from '~/app/api/types'; +import { APIOptions } from '~/shared/api/types'; export enum ModelState { LIVE = 'LIVE', diff --git a/clients/ui/frontend/src/app/useSettings.tsx b/clients/ui/frontend/src/app/useSettings.tsx index 3f169616c..29c8902a6 100644 --- a/clients/ui/frontend/src/app/useSettings.tsx +++ b/clients/ui/frontend/src/app/useSettings.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { POLL_INTERVAL } from '~/utilities/const'; -import { useDeepCompareMemoize } from '~/utilities/useDeepCompareMemoize'; -import { ConfigSettings, UserSettings } from '~/types'; +import { POLL_INTERVAL } from '~/shared/utilities/const'; +import { useDeepCompareMemoize } from '~/shared/utilities/useDeepCompareMemoize'; +import { ConfigSettings, UserSettings } from '~/shared/types'; import useTimeBasedRefresh from './useTimeBasedRefresh'; export const useSettings = (): { diff --git a/clients/ui/frontend/src/app/useTimeBasedRefresh.ts b/clients/ui/frontend/src/app/useTimeBasedRefresh.ts index 3ddd82a09..62a73eb00 100644 --- a/clients/ui/frontend/src/app/useTimeBasedRefresh.ts +++ b/clients/ui/frontend/src/app/useTimeBasedRefresh.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useBrowserStorage } from '~/components/browserStorage'; +import { useBrowserStorage } from '~/shared/components/browserStorage'; export type SetTime = (refreshDateMarker: Date) => void; diff --git a/clients/ui/frontend/src/app/utils.ts b/clients/ui/frontend/src/app/utils.ts index 3753a9ec2..cc2e412e3 100644 --- a/clients/ui/frontend/src/app/utils.ts +++ b/clients/ui/frontend/src/app/utils.ts @@ -1,4 +1,4 @@ -import { SearchType } from '~/app/components/DashboardSearchField'; +import { SearchType } from '~/shared/components/DashboardSearchField'; import { RegisteredModel } from '~/app/types'; export const asEnumMember = ( diff --git a/clients/ui/frontend/src/index.tsx b/clients/ui/frontend/src/index.tsx index 060875bd0..386ffa31d 100644 --- a/clients/ui/frontend/src/index.tsx +++ b/clients/ui/frontend/src/index.tsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client'; import { BrowserRouter as Router } from 'react-router-dom'; import { ThemeProvider, createTheme } from '@mui/material/styles'; import App from './app/App'; -import { BrowserStorageContextProvider } from './components/browserStorage/BrowserStorageContext'; +import { BrowserStorageContextProvider } from './shared/components/browserStorage/BrowserStorageContext'; import { NotificationContextProvider } from './app/context/NotificationContext'; const theme = createTheme({ cssVariables: true }); diff --git a/clients/ui/frontend/src/app/api/__tests__/errorUtils.spec.ts b/clients/ui/frontend/src/shared/api/__tests__/errorUtils.spec.ts similarity index 86% rename from clients/ui/frontend/src/app/api/__tests__/errorUtils.spec.ts rename to clients/ui/frontend/src/shared/api/__tests__/errorUtils.spec.ts index 921a3d7b9..54eb9df31 100644 --- a/clients/ui/frontend/src/app/api/__tests__/errorUtils.spec.ts +++ b/clients/ui/frontend/src/shared/api/__tests__/errorUtils.spec.ts @@ -1,6 +1,6 @@ -import { NotReadyError } from '~/utilities/useFetchState'; -import { APIError } from '~/app/api/types'; -import { handleRestFailures } from '~/app/api/errorUtils'; +import { NotReadyError } from '~/shared/utilities/useFetchState'; +import { APIError } from '~/shared/api/types'; +import { handleRestFailures } from '~/shared/api/errorUtils'; import { mockRegisteredModel } from '~/__mocks__/mockRegisteredModel'; import { mockBFFResponse } from '~/__mocks__/utils'; diff --git a/clients/ui/frontend/src/app/api/__tests__/service.spec.ts b/clients/ui/frontend/src/shared/api/__tests__/service.spec.ts similarity index 98% rename from clients/ui/frontend/src/app/api/__tests__/service.spec.ts rename to clients/ui/frontend/src/shared/api/__tests__/service.spec.ts index 85be9763d..07e1fbc88 100644 --- a/clients/ui/frontend/src/app/api/__tests__/service.spec.ts +++ b/clients/ui/frontend/src/shared/api/__tests__/service.spec.ts @@ -1,5 +1,5 @@ -import { isModelRegistryResponse, restCREATE, restGET, restPATCH } from '~/app/api/apiUtils'; -import { handleRestFailures } from '~/app/api/errorUtils'; +import { isModelRegistryResponse, restCREATE, restGET, restPATCH } from '~/shared/api/apiUtils'; +import { handleRestFailures } from '~/shared/api/errorUtils'; import { ModelState, ModelArtifactState } from '~/app/types'; import { createModelArtifact, @@ -18,13 +18,13 @@ import { getModelArtifactsByModelVersion, createModelVersionForRegisteredModel, createModelArtifactForModelVersion, -} from '~/app/api/service'; +} from '~/shared/api/service'; import { BFF_API_VERSION } from '~/app/const'; const mockRestPromise = Promise.resolve({ data: {} }); const mockRestResponse = {}; -jest.mock('~/app/api/apiUtils', () => ({ +jest.mock('~/shared/api/apiUtils', () => ({ restCREATE: jest.fn(() => mockRestPromise), restGET: jest.fn(() => mockRestPromise), restPATCH: jest.fn(() => mockRestPromise), @@ -32,7 +32,7 @@ jest.mock('~/app/api/apiUtils', () => ({ isModelRegistryResponse: jest.fn(() => true), })); -jest.mock('~/app/api/errorUtils', () => ({ +jest.mock('~/shared/api/errorUtils', () => ({ handleRestFailures: jest.fn(() => mockRestPromise), })); diff --git a/clients/ui/frontend/src/app/api/apiUtils.ts b/clients/ui/frontend/src/shared/api/apiUtils.ts similarity index 97% rename from clients/ui/frontend/src/app/api/apiUtils.ts rename to clients/ui/frontend/src/shared/api/apiUtils.ts index d14733c73..4e911c398 100644 --- a/clients/ui/frontend/src/app/api/apiUtils.ts +++ b/clients/ui/frontend/src/shared/api/apiUtils.ts @@ -1,5 +1,5 @@ -import { APIOptions } from '~/app/api/types'; -import { EitherOrNone } from '~/typeHelpers'; +import { APIOptions } from '~/shared/api/types'; +import { EitherOrNone } from '~/shared/typeHelpers'; import { ModelRegistryBody } from '~/app/types'; export const mergeRequestInit = ( diff --git a/clients/ui/frontend/src/app/api/errorUtils.ts b/clients/ui/frontend/src/shared/api/errorUtils.ts similarity index 86% rename from clients/ui/frontend/src/app/api/errorUtils.ts rename to clients/ui/frontend/src/shared/api/errorUtils.ts index 35fbdc2d9..be1b7ace9 100644 --- a/clients/ui/frontend/src/app/api/errorUtils.ts +++ b/clients/ui/frontend/src/shared/api/errorUtils.ts @@ -1,5 +1,5 @@ -import { APIError } from '~/app/api/types'; -import { isCommonStateError } from '~/utilities/useFetchState'; +import { APIError } from '~/shared/api/types'; +import { isCommonStateError } from '~/shared/utilities/useFetchState'; const isError = (e: unknown): e is APIError => typeof e === 'object' && e !== null && 'error' in e; diff --git a/clients/ui/frontend/src/app/api/k8s.ts b/clients/ui/frontend/src/shared/api/k8s.ts similarity index 73% rename from clients/ui/frontend/src/app/api/k8s.ts rename to clients/ui/frontend/src/shared/api/k8s.ts index 0b97eb891..61b83d767 100644 --- a/clients/ui/frontend/src/app/api/k8s.ts +++ b/clients/ui/frontend/src/shared/api/k8s.ts @@ -1,6 +1,6 @@ -import { APIOptions } from '~/app/api/types'; -import { handleRestFailures } from '~/app/api/errorUtils'; -import { isModelRegistryResponse, restGET } from '~/app/api/apiUtils'; +import { APIOptions } from '~/shared/api/types'; +import { handleRestFailures } from '~/shared/api/errorUtils'; +import { isModelRegistryResponse, restGET } from '~/shared/api/apiUtils'; import { ModelRegistry } from '~/app/types'; import { BFF_API_VERSION } from '~/app/const'; diff --git a/clients/ui/frontend/src/app/api/service.ts b/clients/ui/frontend/src/shared/api/service.ts similarity index 98% rename from clients/ui/frontend/src/app/api/service.ts rename to clients/ui/frontend/src/shared/api/service.ts index 3579877dc..b62c77216 100644 --- a/clients/ui/frontend/src/app/api/service.ts +++ b/clients/ui/frontend/src/shared/api/service.ts @@ -15,9 +15,9 @@ import { restCREATE, restGET, restPATCH, -} from '~/app/api/apiUtils'; -import { APIOptions } from '~/app/api/types'; -import { handleRestFailures } from '~/app/api/errorUtils'; +} from '~/shared/api/apiUtils'; +import { APIOptions } from '~/shared/api/types'; +import { handleRestFailures } from '~/shared/api/errorUtils'; export const createRegisteredModel = (hostPath: string) => diff --git a/clients/ui/frontend/src/app/api/types.ts b/clients/ui/frontend/src/shared/api/types.ts similarity index 100% rename from clients/ui/frontend/src/app/api/types.ts rename to clients/ui/frontend/src/shared/api/types.ts diff --git a/clients/ui/frontend/src/app/api/useAPIState.ts b/clients/ui/frontend/src/shared/api/useAPIState.ts similarity index 94% rename from clients/ui/frontend/src/app/api/useAPIState.ts rename to clients/ui/frontend/src/shared/api/useAPIState.ts index 4783e8cbe..e6c7ec879 100644 --- a/clients/ui/frontend/src/app/api/useAPIState.ts +++ b/clients/ui/frontend/src/shared/api/useAPIState.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { APIState } from '~/app/api/types'; +import { APIState } from '~/shared/api/types'; const useAPIState = ( hostPath: string | null, diff --git a/clients/ui/frontend/src/app/components/ApplicationsPage.tsx b/clients/ui/frontend/src/shared/components/ApplicationsPage.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/ApplicationsPage.tsx rename to clients/ui/frontend/src/shared/components/ApplicationsPage.tsx diff --git a/clients/ui/frontend/src/components/DashboardDescriptionListGroup.scss b/clients/ui/frontend/src/shared/components/DashboardDescriptionListGroup.scss similarity index 100% rename from clients/ui/frontend/src/components/DashboardDescriptionListGroup.scss rename to clients/ui/frontend/src/shared/components/DashboardDescriptionListGroup.scss diff --git a/clients/ui/frontend/src/components/DashboardDescriptionListGroup.tsx b/clients/ui/frontend/src/shared/components/DashboardDescriptionListGroup.tsx similarity index 98% rename from clients/ui/frontend/src/components/DashboardDescriptionListGroup.tsx rename to clients/ui/frontend/src/shared/components/DashboardDescriptionListGroup.tsx index 4d1409434..7a65b61cb 100644 --- a/clients/ui/frontend/src/components/DashboardDescriptionListGroup.tsx +++ b/clients/ui/frontend/src/shared/components/DashboardDescriptionListGroup.tsx @@ -14,7 +14,7 @@ import { import text from '@patternfly/react-styles/css/utilities/Text/text'; import { CheckIcon, PencilAltIcon, TimesIcon } from '@patternfly/react-icons'; -import '~/components/DashboardDescriptionListGroup.scss'; +import '~/shared/components/DashboardDescriptionListGroup.scss'; type EditableProps = { isEditing: boolean; diff --git a/clients/ui/frontend/src/app/components/DashboardEmptyTableView.tsx b/clients/ui/frontend/src/shared/components/DashboardEmptyTableView.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/DashboardEmptyTableView.tsx rename to clients/ui/frontend/src/shared/components/DashboardEmptyTableView.tsx diff --git a/clients/ui/frontend/src/components/DashboardHelpTooltip.tsx b/clients/ui/frontend/src/shared/components/DashboardHelpTooltip.tsx similarity index 100% rename from clients/ui/frontend/src/components/DashboardHelpTooltip.tsx rename to clients/ui/frontend/src/shared/components/DashboardHelpTooltip.tsx diff --git a/clients/ui/frontend/src/app/components/DashboardModalFooter.tsx b/clients/ui/frontend/src/shared/components/DashboardModalFooter.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/DashboardModalFooter.tsx rename to clients/ui/frontend/src/shared/components/DashboardModalFooter.tsx diff --git a/clients/ui/frontend/src/app/components/DashboardSearchField.tsx b/clients/ui/frontend/src/shared/components/DashboardSearchField.tsx similarity index 97% rename from clients/ui/frontend/src/app/components/DashboardSearchField.tsx rename to clients/ui/frontend/src/shared/components/DashboardSearchField.tsx index d084c2d5f..c43a2ba82 100644 --- a/clients/ui/frontend/src/app/components/DashboardSearchField.tsx +++ b/clients/ui/frontend/src/shared/components/DashboardSearchField.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { InputGroup, InputGroupItem, TextInput } from '@patternfly/react-core'; -import SimpleSelect from '~/app/components/SimpleSelect'; +import SimpleSelect from '~/shared/components/SimpleSelect'; import { asEnumMember } from '~/app/utils'; import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; diff --git a/clients/ui/frontend/src/components/EditableLabelsDescriptionListGroup.tsx b/clients/ui/frontend/src/shared/components/EditableLabelsDescriptionListGroup.tsx similarity index 99% rename from clients/ui/frontend/src/components/EditableLabelsDescriptionListGroup.tsx rename to clients/ui/frontend/src/shared/components/EditableLabelsDescriptionListGroup.tsx index 095bfdd72..392987637 100644 --- a/clients/ui/frontend/src/components/EditableLabelsDescriptionListGroup.tsx +++ b/clients/ui/frontend/src/shared/components/EditableLabelsDescriptionListGroup.tsx @@ -14,7 +14,7 @@ import { Modal } from '@patternfly/react-core/deprecated'; import { ExclamationCircleIcon } from '@patternfly/react-icons'; import DashboardDescriptionListGroup, { DashboardDescriptionListGroupProps, -} from '~/components/DashboardDescriptionListGroup'; +} from '~/shared/components/DashboardDescriptionListGroup'; type EditableTextDescriptionListGroupProps = Partial< Pick diff --git a/clients/ui/frontend/src/components/EditableTextDescriptionListGroup.tsx b/clients/ui/frontend/src/shared/components/EditableTextDescriptionListGroup.tsx similarity index 97% rename from clients/ui/frontend/src/components/EditableTextDescriptionListGroup.tsx rename to clients/ui/frontend/src/shared/components/EditableTextDescriptionListGroup.tsx index 17ed82a7d..832510205 100644 --- a/clients/ui/frontend/src/components/EditableTextDescriptionListGroup.tsx +++ b/clients/ui/frontend/src/shared/components/EditableTextDescriptionListGroup.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { ExpandableSection, TextArea } from '@patternfly/react-core'; import DashboardDescriptionListGroup, { DashboardDescriptionListGroupProps, -} from '~/components/DashboardDescriptionListGroup'; +} from '~/shared/components/DashboardDescriptionListGroup'; import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; type EditableTextDescriptionListGroupProps = Pick< diff --git a/clients/ui/frontend/src/app/components/EmptyStateErrorMessage.tsx b/clients/ui/frontend/src/shared/components/EmptyStateErrorMessage.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/EmptyStateErrorMessage.tsx rename to clients/ui/frontend/src/shared/components/EmptyStateErrorMessage.tsx diff --git a/clients/ui/frontend/src/components/InlineTruncatedClipboardCopy.scss b/clients/ui/frontend/src/shared/components/InlineTruncatedClipboardCopy.scss similarity index 100% rename from clients/ui/frontend/src/components/InlineTruncatedClipboardCopy.scss rename to clients/ui/frontend/src/shared/components/InlineTruncatedClipboardCopy.scss diff --git a/clients/ui/frontend/src/components/InlineTruncatedClipboardCopy.tsx b/clients/ui/frontend/src/shared/components/InlineTruncatedClipboardCopy.tsx similarity index 100% rename from clients/ui/frontend/src/components/InlineTruncatedClipboardCopy.tsx rename to clients/ui/frontend/src/shared/components/InlineTruncatedClipboardCopy.tsx diff --git a/clients/ui/frontend/src/app/components/MarkdownView.scss b/clients/ui/frontend/src/shared/components/MarkdownView.scss similarity index 100% rename from clients/ui/frontend/src/app/components/MarkdownView.scss rename to clients/ui/frontend/src/shared/components/MarkdownView.scss diff --git a/clients/ui/frontend/src/app/components/MarkdownView.tsx b/clients/ui/frontend/src/shared/components/MarkdownView.tsx similarity index 92% rename from clients/ui/frontend/src/app/components/MarkdownView.tsx rename to clients/ui/frontend/src/shared/components/MarkdownView.tsx index 4ece1204a..89a2eb77e 100644 --- a/clients/ui/frontend/src/app/components/MarkdownView.tsx +++ b/clients/ui/frontend/src/shared/components/MarkdownView.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import { markdownConverter } from '~/utilities/markdown'; +import { markdownConverter } from '~/shared/utilities/markdown'; import './MarkdownView.scss'; diff --git a/clients/ui/frontend/src/app/components/SimpleSelect.scss b/clients/ui/frontend/src/shared/components/SimpleSelect.scss similarity index 100% rename from clients/ui/frontend/src/app/components/SimpleSelect.scss rename to clients/ui/frontend/src/shared/components/SimpleSelect.scss diff --git a/clients/ui/frontend/src/app/components/SimpleSelect.tsx b/clients/ui/frontend/src/shared/components/SimpleSelect.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/SimpleSelect.tsx rename to clients/ui/frontend/src/shared/components/SimpleSelect.tsx diff --git a/clients/ui/frontend/src/components/ToastNotification.tsx b/clients/ui/frontend/src/shared/components/ToastNotification.tsx similarity index 100% rename from clients/ui/frontend/src/components/ToastNotification.tsx rename to clients/ui/frontend/src/shared/components/ToastNotification.tsx diff --git a/clients/ui/frontend/src/components/ToastNotifications.tsx b/clients/ui/frontend/src/shared/components/ToastNotifications.tsx similarity index 100% rename from clients/ui/frontend/src/components/ToastNotifications.tsx rename to clients/ui/frontend/src/shared/components/ToastNotifications.tsx diff --git a/clients/ui/frontend/src/components/browserStorage/BrowserStorageContext.tsx b/clients/ui/frontend/src/shared/components/browserStorage/BrowserStorageContext.tsx similarity index 96% rename from clients/ui/frontend/src/components/browserStorage/BrowserStorageContext.tsx rename to clients/ui/frontend/src/shared/components/browserStorage/BrowserStorageContext.tsx index 07b8bc84e..9b6107c9b 100644 --- a/clients/ui/frontend/src/components/browserStorage/BrowserStorageContext.tsx +++ b/clients/ui/frontend/src/shared/components/browserStorage/BrowserStorageContext.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { useDeepCompareMemoize } from '~/utilities/useDeepCompareMemoize'; -import { useEventListener } from '~/utilities/useEventListener'; +import { useDeepCompareMemoize } from '~/shared/utilities/useDeepCompareMemoize'; +import { useEventListener } from '~/shared/utilities/useEventListener'; type ValueMap = { [storageKey: string]: unknown }; export type BrowserStorageContextType = { diff --git a/clients/ui/frontend/src/components/browserStorage/index.ts b/clients/ui/frontend/src/shared/components/browserStorage/index.ts similarity index 100% rename from clients/ui/frontend/src/components/browserStorage/index.ts rename to clients/ui/frontend/src/shared/components/browserStorage/index.ts diff --git a/clients/ui/frontend/src/app/components/design/CollapsibleSection.tsx b/clients/ui/frontend/src/shared/components/design/CollapsibleSection.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/design/CollapsibleSection.tsx rename to clients/ui/frontend/src/shared/components/design/CollapsibleSection.tsx diff --git a/clients/ui/frontend/src/app/components/design/DividedGallery.scss b/clients/ui/frontend/src/shared/components/design/DividedGallery.scss similarity index 100% rename from clients/ui/frontend/src/app/components/design/DividedGallery.scss rename to clients/ui/frontend/src/shared/components/design/DividedGallery.scss diff --git a/clients/ui/frontend/src/app/components/design/DividedGallery.tsx b/clients/ui/frontend/src/shared/components/design/DividedGallery.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/design/DividedGallery.tsx rename to clients/ui/frontend/src/shared/components/design/DividedGallery.tsx diff --git a/clients/ui/frontend/src/app/components/design/DividedGalleryItem.tsx b/clients/ui/frontend/src/shared/components/design/DividedGalleryItem.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/design/DividedGalleryItem.tsx rename to clients/ui/frontend/src/shared/components/design/DividedGalleryItem.tsx diff --git a/clients/ui/frontend/src/app/components/design/HeaderIcon.tsx b/clients/ui/frontend/src/shared/components/design/HeaderIcon.tsx similarity index 95% rename from clients/ui/frontend/src/app/components/design/HeaderIcon.tsx rename to clients/ui/frontend/src/shared/components/design/HeaderIcon.tsx index e0e8ebf00..ce72a7502 100644 --- a/clients/ui/frontend/src/app/components/design/HeaderIcon.tsx +++ b/clients/ui/frontend/src/shared/components/design/HeaderIcon.tsx @@ -5,7 +5,7 @@ import { typedObjectImage, ProjectObjectType, SectionType, -} from '~/app/components/design/utils'; +} from '~/shared/components/design/utils'; interface HeaderIconProps { size?: number; diff --git a/clients/ui/frontend/src/app/components/design/InfoGalleryItem.tsx b/clients/ui/frontend/src/shared/components/design/InfoGalleryItem.tsx similarity index 92% rename from clients/ui/frontend/src/app/components/design/InfoGalleryItem.tsx rename to clients/ui/frontend/src/shared/components/design/InfoGalleryItem.tsx index eaf8d9f96..e71fc2cb5 100644 --- a/clients/ui/frontend/src/app/components/design/InfoGalleryItem.tsx +++ b/clients/ui/frontend/src/shared/components/design/InfoGalleryItem.tsx @@ -8,8 +8,8 @@ import { Stack, StackItem, } from '@patternfly/react-core'; -import { SectionType, sectionTypeBackgroundColor } from '~/app/components/design/utils'; -import DividedGalleryItem from '~/app/components/design/DividedGalleryItem'; +import { SectionType, sectionTypeBackgroundColor } from '~/shared/components/design/utils'; +import DividedGalleryItem from '~/shared/components/design/DividedGalleryItem'; const HEADER_ICON_SIZE = 40; const HEADER_ICON_PADDING = 2; diff --git a/clients/ui/frontend/src/app/components/design/ScrolledGallery.tsx b/clients/ui/frontend/src/shared/components/design/ScrolledGallery.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/design/ScrolledGallery.tsx rename to clients/ui/frontend/src/shared/components/design/ScrolledGallery.tsx diff --git a/clients/ui/frontend/src/app/components/design/TitleWithIcon.tsx b/clients/ui/frontend/src/shared/components/design/TitleWithIcon.tsx similarity index 95% rename from clients/ui/frontend/src/app/components/design/TitleWithIcon.tsx rename to clients/ui/frontend/src/shared/components/design/TitleWithIcon.tsx index 02893ae03..c40bd8089 100644 --- a/clients/ui/frontend/src/app/components/design/TitleWithIcon.tsx +++ b/clients/ui/frontend/src/shared/components/design/TitleWithIcon.tsx @@ -4,7 +4,7 @@ import { ProjectObjectType, typedBackgroundColor, typedObjectImage, -} from '~/app/components/design/utils'; +} from '~/shared/components/design/utils'; interface TitleWithIconProps { title: React.ReactNode; diff --git a/clients/ui/frontend/src/app/components/design/TypeBorderCard.scss b/clients/ui/frontend/src/shared/components/design/TypeBorderCard.scss similarity index 100% rename from clients/ui/frontend/src/app/components/design/TypeBorderCard.scss rename to clients/ui/frontend/src/shared/components/design/TypeBorderCard.scss diff --git a/clients/ui/frontend/src/app/components/design/TypeBorderedCard.tsx b/clients/ui/frontend/src/shared/components/design/TypeBorderedCard.tsx similarity index 90% rename from clients/ui/frontend/src/app/components/design/TypeBorderedCard.tsx rename to clients/ui/frontend/src/shared/components/design/TypeBorderedCard.tsx index a0e68e2ed..11fb115ca 100644 --- a/clients/ui/frontend/src/app/components/design/TypeBorderedCard.tsx +++ b/clients/ui/frontend/src/shared/components/design/TypeBorderedCard.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { css } from '@patternfly/react-styles'; import { Card, CardProps } from '@patternfly/react-core'; -import { ProjectObjectType, SectionType } from '~/app/components/design/utils'; +import { ProjectObjectType, SectionType } from '~/shared/components/design/utils'; import './TypeBorderCard.scss'; diff --git a/clients/ui/frontend/src/app/components/design/utils.ts b/clients/ui/frontend/src/shared/components/design/utils.ts similarity index 100% rename from clients/ui/frontend/src/app/components/design/utils.ts rename to clients/ui/frontend/src/shared/components/design/utils.ts diff --git a/clients/ui/frontend/src/app/components/design/vars.scss b/clients/ui/frontend/src/shared/components/design/vars.scss similarity index 100% rename from clients/ui/frontend/src/app/components/design/vars.scss rename to clients/ui/frontend/src/shared/components/design/vars.scss diff --git a/clients/ui/frontend/src/app/components/pf-overrides/FormSection.scss b/clients/ui/frontend/src/shared/components/pf-overrides/FormSection.scss similarity index 100% rename from clients/ui/frontend/src/app/components/pf-overrides/FormSection.scss rename to clients/ui/frontend/src/shared/components/pf-overrides/FormSection.scss diff --git a/clients/ui/frontend/src/app/components/pf-overrides/FormSection.tsx b/clients/ui/frontend/src/shared/components/pf-overrides/FormSection.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/pf-overrides/FormSection.tsx rename to clients/ui/frontend/src/shared/components/pf-overrides/FormSection.tsx diff --git a/clients/ui/frontend/src/app/components/table/CheckboxTd.tsx b/clients/ui/frontend/src/shared/components/table/CheckboxTd.tsx similarity index 100% rename from clients/ui/frontend/src/app/components/table/CheckboxTd.tsx rename to clients/ui/frontend/src/shared/components/table/CheckboxTd.tsx diff --git a/clients/ui/frontend/src/app/components/table/Table.tsx b/clients/ui/frontend/src/shared/components/table/Table.tsx similarity index 97% rename from clients/ui/frontend/src/app/components/table/Table.tsx rename to clients/ui/frontend/src/shared/components/table/Table.tsx index f702ff39b..c3f233356 100644 --- a/clients/ui/frontend/src/app/components/table/Table.tsx +++ b/clients/ui/frontend/src/shared/components/table/Table.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { TbodyProps } from '@patternfly/react-table'; -import { EitherNotBoth } from '~/typeHelpers'; +import { EitherNotBoth } from '~/shared/typeHelpers'; import TableBase, { MIN_PAGE_SIZE } from './TableBase'; import useTableColumnSort from './useTableColumnSort'; diff --git a/clients/ui/frontend/src/app/components/table/TableBase.tsx b/clients/ui/frontend/src/shared/components/table/TableBase.tsx similarity index 99% rename from clients/ui/frontend/src/app/components/table/TableBase.tsx rename to clients/ui/frontend/src/shared/components/table/TableBase.tsx index 30f845fca..bf2f730a7 100644 --- a/clients/ui/frontend/src/app/components/table/TableBase.tsx +++ b/clients/ui/frontend/src/shared/components/table/TableBase.tsx @@ -21,7 +21,7 @@ import { TbodyProps, InnerScrollContainer, } from '@patternfly/react-table'; -import { EitherNotBoth } from '~/typeHelpers'; +import { EitherNotBoth } from '~/shared/typeHelpers'; import { GetColumnSort, SortableData } from './types'; import { CHECKBOX_FIELD_ID, EXPAND_FIELD_ID, KEBAB_FIELD_ID } from './const'; diff --git a/clients/ui/frontend/src/app/components/table/TableRowTitleDescription.tsx b/clients/ui/frontend/src/shared/components/table/TableRowTitleDescription.tsx similarity index 95% rename from clients/ui/frontend/src/app/components/table/TableRowTitleDescription.tsx rename to clients/ui/frontend/src/shared/components/table/TableRowTitleDescription.tsx index be2d02e9b..2d4cf0aee 100644 --- a/clients/ui/frontend/src/app/components/table/TableRowTitleDescription.tsx +++ b/clients/ui/frontend/src/shared/components/table/TableRowTitleDescription.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Content } from '@patternfly/react-core'; -import MarkdownView from '~/app/components/MarkdownView'; +import MarkdownView from '~/shared/components/MarkdownView'; type TableRowTitleDescriptionProps = { title: React.ReactNode; diff --git a/clients/ui/frontend/src/app/components/table/__tests__/useCheckboxTable.spec.ts b/clients/ui/frontend/src/shared/components/table/__tests__/useCheckboxTable.spec.ts similarity index 97% rename from clients/ui/frontend/src/app/components/table/__tests__/useCheckboxTable.spec.ts rename to clients/ui/frontend/src/shared/components/table/__tests__/useCheckboxTable.spec.ts index 8744706eb..e503d6f2c 100644 --- a/clients/ui/frontend/src/app/components/table/__tests__/useCheckboxTable.spec.ts +++ b/clients/ui/frontend/src/shared/components/table/__tests__/useCheckboxTable.spec.ts @@ -1,6 +1,6 @@ import { act } from 'react'; import { testHook } from '~/__tests__/unit/testUtils/hooks'; -import { useCheckboxTable } from '~/app/components/table'; +import { useCheckboxTable } from '~/shared/components/table'; describe('useCheckboxTable', () => { it('should select/unselect all', () => { diff --git a/clients/ui/frontend/src/app/components/table/const.ts b/clients/ui/frontend/src/shared/components/table/const.ts similarity index 100% rename from clients/ui/frontend/src/app/components/table/const.ts rename to clients/ui/frontend/src/shared/components/table/const.ts diff --git a/clients/ui/frontend/src/app/components/table/index.ts b/clients/ui/frontend/src/shared/components/table/index.ts similarity index 100% rename from clients/ui/frontend/src/app/components/table/index.ts rename to clients/ui/frontend/src/shared/components/table/index.ts diff --git a/clients/ui/frontend/src/app/components/table/types.ts b/clients/ui/frontend/src/shared/components/table/types.ts similarity index 100% rename from clients/ui/frontend/src/app/components/table/types.ts rename to clients/ui/frontend/src/shared/components/table/types.ts diff --git a/clients/ui/frontend/src/app/components/table/useCheckboxTable.ts b/clients/ui/frontend/src/shared/components/table/useCheckboxTable.ts similarity index 91% rename from clients/ui/frontend/src/app/components/table/useCheckboxTable.ts rename to clients/ui/frontend/src/shared/components/table/useCheckboxTable.ts index f6680debf..d0538aa4b 100644 --- a/clients/ui/frontend/src/app/components/table/useCheckboxTable.ts +++ b/clients/ui/frontend/src/shared/components/table/useCheckboxTable.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useCheckboxTableBase } from '~/app/components/table'; +import { useCheckboxTableBase } from '~/shared/components/table'; import type Table from './Table'; type UseCheckboxTable = { diff --git a/clients/ui/frontend/src/app/components/table/useCheckboxTableBase.ts b/clients/ui/frontend/src/shared/components/table/useCheckboxTableBase.ts similarity index 100% rename from clients/ui/frontend/src/app/components/table/useCheckboxTableBase.ts rename to clients/ui/frontend/src/shared/components/table/useCheckboxTableBase.ts diff --git a/clients/ui/frontend/src/app/components/table/useTableColumnSort.ts b/clients/ui/frontend/src/shared/components/table/useTableColumnSort.ts similarity index 100% rename from clients/ui/frontend/src/app/components/table/useTableColumnSort.ts rename to clients/ui/frontend/src/shared/components/table/useTableColumnSort.ts diff --git a/clients/ui/frontend/src/style/MUI-theme.scss b/clients/ui/frontend/src/shared/style/MUI-theme.scss similarity index 100% rename from clients/ui/frontend/src/style/MUI-theme.scss rename to clients/ui/frontend/src/shared/style/MUI-theme.scss diff --git a/clients/ui/frontend/src/typeHelpers.ts b/clients/ui/frontend/src/shared/typeHelpers.ts similarity index 100% rename from clients/ui/frontend/src/typeHelpers.ts rename to clients/ui/frontend/src/shared/typeHelpers.ts diff --git a/clients/ui/frontend/src/types.ts b/clients/ui/frontend/src/shared/types.ts similarity index 92% rename from clients/ui/frontend/src/types.ts rename to clients/ui/frontend/src/shared/types.ts index dc3221320..fea8cf12d 100644 --- a/clients/ui/frontend/src/types.ts +++ b/clients/ui/frontend/src/shared/types.ts @@ -1,4 +1,4 @@ -import { ValueOf } from '~/typeHelpers'; +import { ValueOf } from '~/shared/typeHelpers'; // TODO: Get the status config params export type UserSettings = { diff --git a/clients/ui/frontend/src/utilities/const.ts b/clients/ui/frontend/src/shared/utilities/const.ts similarity index 100% rename from clients/ui/frontend/src/utilities/const.ts rename to clients/ui/frontend/src/shared/utilities/const.ts diff --git a/clients/ui/frontend/src/utilities/markdown.ts b/clients/ui/frontend/src/shared/utilities/markdown.ts similarity index 100% rename from clients/ui/frontend/src/utilities/markdown.ts rename to clients/ui/frontend/src/shared/utilities/markdown.ts diff --git a/clients/ui/frontend/src/utilities/time.ts b/clients/ui/frontend/src/shared/utilities/time.ts similarity index 100% rename from clients/ui/frontend/src/utilities/time.ts rename to clients/ui/frontend/src/shared/utilities/time.ts diff --git a/clients/ui/frontend/src/utilities/useDebounceCallback.ts b/clients/ui/frontend/src/shared/utilities/useDebounceCallback.ts similarity index 100% rename from clients/ui/frontend/src/utilities/useDebounceCallback.ts rename to clients/ui/frontend/src/shared/utilities/useDebounceCallback.ts diff --git a/clients/ui/frontend/src/utilities/useDeepCompareMemoize.ts b/clients/ui/frontend/src/shared/utilities/useDeepCompareMemoize.ts similarity index 100% rename from clients/ui/frontend/src/utilities/useDeepCompareMemoize.ts rename to clients/ui/frontend/src/shared/utilities/useDeepCompareMemoize.ts diff --git a/clients/ui/frontend/src/utilities/useEventListener.ts b/clients/ui/frontend/src/shared/utilities/useEventListener.ts similarity index 100% rename from clients/ui/frontend/src/utilities/useEventListener.ts rename to clients/ui/frontend/src/shared/utilities/useEventListener.ts diff --git a/clients/ui/frontend/src/utilities/useFetchState.ts b/clients/ui/frontend/src/shared/utilities/useFetchState.ts similarity index 99% rename from clients/ui/frontend/src/utilities/useFetchState.ts rename to clients/ui/frontend/src/shared/utilities/useFetchState.ts index aa688d349..6f302b6ce 100644 --- a/clients/ui/frontend/src/utilities/useFetchState.ts +++ b/clients/ui/frontend/src/shared/utilities/useFetchState.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { APIOptions } from '~/app/api/types'; +import { APIOptions } from '~/shared/api/types'; /** * Allows "I'm not ready" rejections if you lack a lazy provided prop diff --git a/clients/ui/frontend/src/utilities/useGenericObjectState.ts b/clients/ui/frontend/src/shared/utilities/useGenericObjectState.ts similarity index 92% rename from clients/ui/frontend/src/utilities/useGenericObjectState.ts rename to clients/ui/frontend/src/shared/utilities/useGenericObjectState.ts index a243bd820..a72d670ba 100644 --- a/clients/ui/frontend/src/utilities/useGenericObjectState.ts +++ b/clients/ui/frontend/src/shared/utilities/useGenericObjectState.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { UpdateObjectAtPropAndValue } from '~/types'; +import { UpdateObjectAtPropAndValue } from '~/shared/types'; export type GenericObjectState = [ data: T,