From 78dcba614d4a9e2a83c6835e7131ecf96fe1342f Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Sun, 13 Nov 2022 10:10:18 +0200 Subject: [PATCH] refactor(portainer): move to react [EE-3350] (#7915) --- .../create/createContainerController.js | 2 +- .../containers/edit/containerController.js | 2 +- ...ocker-features-configuration.controller.js | 2 +- .../EdgeDevicesDatatable.tsx | 2 +- .../EdgeDevicesDatatableContainer.tsx | 2 +- .../columns/heartbeat.tsx | 3 ++- .../EdgeDevicesView/EdgeDevicesView.tsx | 2 +- app/index.js | 7 ++++--- ...-create-custom-template-view.controller.js | 2 +- ...be-edit-custom-template-view.controller.js | 2 +- .../views/configure/configureController.js | 2 +- .../views/deploy/deployController.js | 2 +- .../storage-class-switch.controller.js | 2 +- .../create/createResourcePoolController.js | 2 +- .../edit/resourcePoolController.js | 2 +- .../constraintController.js | 2 +- app/portainer/__module.js | 4 +++- .../BEFeatureIndicator.controller.ts | 2 +- app/portainer/components/BoxSelector/utils.ts | 2 +- .../porAccessManagementController.js | 2 +- .../registriesDatatableController.js | 2 +- ...it-form-auto-update-fieldset.controller.js | 2 +- .../stack-redeploy-git-form.controller.js | 2 +- .../oauth-options.tsx | 2 +- .../oauth-settings.controller.js | 4 ++-- .../access-viewer/access-viewer.controller.js | 2 +- app/portainer/react/views/index.ts | 2 +- app/portainer/services/axios.ts | 2 +- app/portainer/services/notifications.ts | 2 +- .../ad-settings/ad-settings.controller.js | 4 ++-- .../ldap-settings-custom.controller.js | 2 +- .../ldap-settings-openldap.controller.js | 2 +- .../ldap/ldap-settings/ldap-options.tsx | 2 +- .../activity-logs-view.controller.js | 2 +- .../auth-logs-view.controller.js | 2 +- .../createCustomTemplateViewController.js | 2 +- .../customTemplatesViewController.js | 2 +- .../editCustomTemplateViewController.js | 2 +- .../access/endpointAccessController.js | 2 +- .../groups/access/groupAccessController.js | 2 +- .../views/settings/authentication/options.tsx | 2 +- app/portainer/views/settings/options.tsx | 2 +- .../views/settings/settingsController.js | 2 +- .../stacks/create/createStackController.js | 4 ++-- .../views/stacks/edit/stackController.js | 2 +- app/react-tools/withCurrentUser.tsx | 2 +- .../DashboardView/DashboardView.test.tsx | 2 +- .../azure/DashboardView/DashboardView.tsx | 2 +- .../CreateContainerInstanceForm.test.tsx | 2 +- .../CreateContainerInstanceForm.tsx | 4 ++-- .../CreateView/useLoadFormState.ts | 2 +- .../container-instances/ItemView/ItemView.tsx | 2 +- .../ListView/ContainersDatatable.tsx | 4 ++-- .../container-instances/ListView/ListView.tsx | 2 +- .../BEFeatureIndicator.stories.tsx | 4 ++-- .../BEFeatureIndicator/BEFeatureIndicator.tsx | 2 +- .../components/BEFeatureIndicator/utils.ts | 4 ++-- .../BoxSelector/BoxSelector.stories.tsx | 4 ++-- .../BoxSelector/BoxSelectorItem.stories.tsx | 4 ++-- .../BoxSelector/BoxSelectorItem.tsx | 2 +- .../BoxSelector/LimitedToBeIndicator.tsx | 2 +- app/react/components/BoxSelector/types.ts | 2 +- .../components}/EdgeIndicator.test.tsx | 10 +++++----- .../components}/EdgeIndicator.tsx | 0 .../PageHeader/HeaderContainer.stories.tsx | 2 +- .../PageHeader/HeaderTitle.test.tsx | 2 +- .../PageHeader/NotificationsMenu.tsx | 2 +- .../PageHeader/PageHeader.stories.tsx | 2 +- .../components/PageHeader/PageHeader.test.tsx | 2 +- app/react/components/PageHeader/UserMenu.tsx | 2 +- .../components/datatables/FilterSearchBar.tsx | 2 +- app/react/components/datatables/SearchBar.tsx | 2 +- .../datatables/useTableSettings.tsx | 2 +- .../form-components/SwitchField/Switch.tsx | 4 ++-- .../SwitchField/SwitchField.tsx | 2 +- .../form-components}/yup-file-validation.ts | 0 .../ContainersDatatableActions.tsx | 2 +- .../ContainersDatatable/columns/gpus.tsx | 2 +- .../columns/quick-actions.tsx | 4 ++-- .../ContainersDatatable/datatable-store.ts | 2 +- .../ContainerQuickActions.tsx | 2 +- .../docker/networks/ItemView/ItemView.tsx | 2 +- .../ItemView/NetworkContainersTable.test.tsx | 2 +- .../ItemView/NetworkContainersTable.tsx | 2 +- .../ItemView/NetworkDetailsTable.test.tsx | 2 +- .../networks/ItemView/NetworkDetailsTable.tsx | 2 +- .../hooks/useCurrentEnvironment.ts | 0 app/{portainer => react}/hooks/useDebounce.ts | 0 .../hooks/useEnvironmentId.ts | 0 .../hooks/useLocalStorage.ts | 0 .../hooks/usePaginationLimitState.ts | 0 app/{portainer => react}/hooks/useUIState.tsx | 2 +- app/{portainer => react}/hooks/useUser.tsx | 5 ++--- .../IngressClassDatatable/datatable-store.ts | 2 +- .../CreateIngressView/CreateIngressView.tsx | 2 +- .../IngressDatatable/IngressDataTable.tsx | 4 ++-- .../IngressDatatable/columns/name.tsx | 2 +- .../IngressDatatable/datatable-store.ts | 2 +- app/react/portainer/HomeView/.keep | 0 .../HomeView}/BackupFailedPanel.test.tsx | 0 .../portainer/HomeView}/BackupFailedPanel.tsx | 5 ++--- .../HomeView}/EdgeLoadingSpinner.module.css | 0 .../HomeView}/EdgeLoadingSpinner.tsx | 0 .../EnvironmentItem/AgentVersionTag.tsx | 0 .../EnvironmentItem/EnvironmentIcon.tsx | 0 .../EnvironmentItem.module.css | 0 .../EnvironmentItem.stories.tsx | 0 .../EnvironmentItem/EnvironmentItem.test.tsx | 4 ++-- .../EnvironmentItem/EnvironmentItem.tsx | 4 ++-- .../EnvironmentItem/EnvironmentStats.tsx | 0 .../EnvironmentStatsDocker.tsx | 0 .../EnvironmentItem/EnvironmentStatsItem.tsx | 0 .../EnvironmentStatsKubernetes.tsx | 0 .../EnvironmentStatusBadge.tsx | 0 .../EnvironmentList/EnvironmentItem/index.ts | 1 - .../EnvironmentList.module.css | 0 .../EnvironmentList/EnvironmentList.test.tsx | 2 +- .../EnvironmentList/EnvironmentList.tsx | 19 ++++++++----------- .../EnvironmentList}/HomepageFilter.tsx | 5 +++-- .../KubeconfigButton/KubeconfigButton.tsx | 0 .../KubeconfigPrompt.module.css | 0 .../KubeconfigButton/KubeconfigPrompt.tsx | 2 +- .../KubeconfigButton/KubeconfigSelection.ts | 0 .../EnvironmentList/KubeconfigButton/index.ts | 0 .../NoEnvironmentsInfoPanel.tsx | 0 .../SortbySelector.module.css | 0 .../EnvironmentList}/SortbySelector.tsx | 3 +-- .../HomeView}/EnvironmentList/index.ts | 0 .../HomeView/EnvironmentList/types.ts | 4 ++++ .../portainer/HomeView}/HomeView.tsx | 7 +++---- .../HomeView}/LicenseNodePanel.test.tsx | 3 +-- .../portainer/HomeView}/LicenseNodePanel.tsx | 9 ++++----- .../portainer/HomeView}/MotdPanel.tsx | 2 +- .../portainer/HomeView}/home.service.ts | 2 +- .../portainer/HomeView}/index.ts | 0 .../portainer/HomeView}/types.ts | 5 ----- .../AccessControlForm.stories.tsx | 2 +- .../AccessControlForm.test.tsx | 2 +- .../AccessControlForm/AccessControlForm.tsx | 2 +- .../AccessControlPanel/AccessControlPanel.tsx | 2 +- .../AccessControlPanelForm.tsx | 2 +- .../EditDetails/EditDetails.tsx | 2 +- .../environment-groups.service.ts | 2 +- .../environment-groups/queries.ts | 0 .../environments}/environment-groups/types.ts | 0 .../environment.service/create.ts | 2 +- .../environments/environment.service/index.ts | 2 +- app/react/portainer/environments/types.ts | 2 +- .../CreateView/CreateView.tsx | 2 +- .../update-schedules/ItemView/ItemView.tsx | 2 +- .../update-schedules/ListView/ListView.tsx | 2 +- .../ListView/datatable-store.ts | 2 +- .../environment-types.ts | 2 +- .../WizardDocker/APITab/TLSFieldset.tsx | 3 +-- .../WizardEndpointsList.tsx | 2 +- .../WizardKubernetes/WizardKubernetes.tsx | 2 +- .../shared/MetadataFieldset/GroupsField.tsx | 4 ++-- .../MetadataFieldset/MetadataFieldset.tsx | 2 +- .../wizard/components/Option/Option.tsx | 4 ++-- .../portainer/feature-flags/enums.ts | 0 .../portainer/feature-flags/feature-flags.css | 2 +- .../feature-flags/feature-flags.service.ts | 0 .../portainer/feature-flags/feature-ids.js | 0 .../portainer/feature-flags/index.ts | 0 .../limited-feature.directive.ts | 2 +- .../feature-flags/useRedirectFeatureFlag.ts | 0 .../notifications/NotificationsView.tsx | 2 +- .../notifications/datatable-store.ts | 2 +- .../notifications/notifications-store.ts | 2 +- .../DefaultRegistry/DefaultRegistryAction.tsx | 4 ++-- .../users/teams/ItemView/ItemView.tsx | 2 +- .../TeamAssociationSelector.stories.tsx | 2 +- .../TeamAssociationSelector.test.tsx | 2 +- .../TeamMembersList.stories.tsx | 2 +- .../TeamMembersList/TeamMembersList.test.tsx | 2 +- .../TeamMembersList/TeamMembersList.tsx | 2 +- .../TeamMembersList/team-role-column.tsx | 2 +- .../UsersList/UsersList.test.tsx | 2 +- .../UsersList/UsersList.tsx | 2 +- .../users/teams/ListView/ListView.tsx | 2 +- .../AzureSidebar/AzureSidebar.test.tsx | 2 +- app/react/sidebar/DockerSidebar.tsx | 6 +----- app/react/sidebar/EnvironmentSidebar.tsx | 2 +- app/react/sidebar/Footer/Footer.tsx | 2 +- .../sidebar/Footer/UpdateNotifications.tsx | 2 +- app/react/sidebar/Header.tsx | 2 +- .../KubectlShell/KubectlShell.tsx | 2 +- .../KubernetesSidebar/KubernetesSidebar.tsx | 2 +- app/react/sidebar/SettingsSidebar.tsx | 2 +- app/react/sidebar/Sidebar.tsx | 2 +- app/react/sidebar/useSidebarState.tsx | 2 +- app/setup-tests/server-handlers.ts | 2 +- 192 files changed, 200 insertions(+), 211 deletions(-) rename app/{portainer/home/EnvironmentList/EnvironmentItem => react/components}/EdgeIndicator.test.tsx (79%) rename app/{portainer/home/EnvironmentList/EnvironmentItem => react/components}/EdgeIndicator.tsx (100%) rename app/{portainer/helpers => react/components/form-components}/yup-file-validation.ts (100%) rename app/{portainer => react}/hooks/useCurrentEnvironment.ts (100%) rename app/{portainer => react}/hooks/useDebounce.ts (100%) rename app/{portainer => react}/hooks/useEnvironmentId.ts (100%) rename app/{portainer => react}/hooks/useLocalStorage.ts (100%) rename app/{portainer => react}/hooks/usePaginationLimitState.ts (100%) rename app/{portainer => react}/hooks/useUIState.tsx (93%) rename app/{portainer => react}/hooks/useUser.tsx (96%) delete mode 100644 app/react/portainer/HomeView/.keep rename app/{portainer/home => react/portainer/HomeView}/BackupFailedPanel.test.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/BackupFailedPanel.tsx (89%) rename app/{portainer/home => react/portainer/HomeView}/EdgeLoadingSpinner.module.css (100%) rename app/{portainer/home => react/portainer/HomeView}/EdgeLoadingSpinner.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/AgentVersionTag.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentIcon.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentItem.module.css (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentItem.stories.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentItem.test.tsx (92%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx (98%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentStats.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentStatsDocker.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentStatsItem.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentStatsKubernetes.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/EnvironmentStatusBadge.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentItem/index.ts (51%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentList.module.css (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentList.test.tsx (97%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/EnvironmentList.tsx (96%) rename app/{portainer/home => react/portainer/HomeView/EnvironmentList}/HomepageFilter.tsx (92%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/KubeconfigButton/KubeconfigButton.tsx (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/KubeconfigButton/KubeconfigPrompt.module.css (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/KubeconfigButton/KubeconfigPrompt.tsx (98%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/KubeconfigButton/KubeconfigSelection.ts (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/KubeconfigButton/index.ts (100%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/NoEnvironmentsInfoPanel.tsx (100%) rename app/react/{components/datatables => portainer/HomeView/EnvironmentList}/SortbySelector.module.css (100%) rename app/react/{components/datatables => portainer/HomeView/EnvironmentList}/SortbySelector.tsx (96%) rename app/{portainer/home => react/portainer/HomeView}/EnvironmentList/index.ts (100%) create mode 100644 app/react/portainer/HomeView/EnvironmentList/types.ts rename app/{portainer/home => react/portainer/HomeView}/HomeView.tsx (91%) rename app/{portainer/home => react/portainer/HomeView}/LicenseNodePanel.test.tsx (95%) rename app/{portainer/home => react/portainer/HomeView}/LicenseNodePanel.tsx (84%) rename app/{portainer/home => react/portainer/HomeView}/MotdPanel.tsx (95%) rename app/{portainer/home => react/portainer/HomeView}/home.service.ts (79%) rename app/{portainer/home => react/portainer/HomeView}/index.ts (100%) rename app/{portainer/home => react/portainer/HomeView}/types.ts (66%) rename app/{portainer => react/portainer/environments}/environment-groups/environment-groups.service.ts (90%) rename app/{portainer => react/portainer/environments}/environment-groups/queries.ts (100%) rename app/{portainer => react/portainer/environments}/environment-groups/types.ts (100%) rename app/{ => react}/portainer/feature-flags/enums.ts (100%) rename app/{ => react}/portainer/feature-flags/feature-flags.css (96%) rename app/{ => react}/portainer/feature-flags/feature-flags.service.ts (100%) rename app/{ => react}/portainer/feature-flags/feature-ids.js (100%) rename app/{ => react}/portainer/feature-flags/index.ts (100%) rename app/{ => react}/portainer/feature-flags/limited-feature.directive.ts (93%) rename app/{ => react}/portainer/feature-flags/useRedirectFeatureFlag.ts (100%) diff --git a/app/docker/views/containers/create/createContainerController.js b/app/docker/views/containers/create/createContainerController.js index ca47e145e..47bed8e49 100644 --- a/app/docker/views/containers/create/createContainerController.js +++ b/app/docker/views/containers/create/createContainerController.js @@ -3,7 +3,7 @@ import _ from 'lodash-es'; import { PorImageRegistryModel } from 'Docker/models/porImageRegistry'; import * as envVarsUtils from '@/portainer/helpers/env-vars'; -import { FeatureId } from 'Portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { ContainerCapabilities, ContainerCapability } from '../../../models/containerCapabilities'; import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel'; import { ContainerDetailsViewModel } from '../../../models/container'; diff --git a/app/docker/views/containers/edit/containerController.js b/app/docker/views/containers/edit/containerController.js index b4a6884d5..86e0c5235 100644 --- a/app/docker/views/containers/edit/containerController.js +++ b/app/docker/views/containers/edit/containerController.js @@ -2,7 +2,7 @@ import moment from 'moment'; import _ from 'lodash-es'; import { PorImageRegistryModel } from 'Docker/models/porImageRegistry'; import { confirmContainerDeletion } from '@/portainer/services/modal.service/prompt'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { ResourceControlType } from '@/react/portainer/access-control/types'; angular.module('portainer.docker').controller('ContainerController', [ diff --git a/app/docker/views/docker-features-configuration/docker-features-configuration.controller.js b/app/docker/views/docker-features-configuration/docker-features-configuration.controller.js index 8b61343cd..96759cecf 100644 --- a/app/docker/views/docker-features-configuration/docker-features-configuration.controller.js +++ b/app/docker/views/docker-features-configuration/docker-features-configuration.controller.js @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; export default class DockerFeaturesConfigurationController { /* @ngInject */ diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx index f46205f2d..f74678db3 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx @@ -4,7 +4,7 @@ import _ from 'lodash'; import { Environment } from '@/react/portainer/environments/types'; import { AMTDevicesDatatable } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable'; -import { EnvironmentGroup } from '@/portainer/environment-groups/types'; +import { EnvironmentGroup } from '@/react/portainer/environments/environment-groups/types'; import { PaginationControls } from '@@/PaginationControls'; import { diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx index 49a81337d..f9770a7c3 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { useEnvironmentList } from '@/react/portainer/environments/queries/useEnvironmentList'; import { EdgeTypes, Environment } from '@/react/portainer/environments/types'; -import { useDebounce } from '@/portainer/hooks/useDebounce'; +import { useDebounce } from '@/react/hooks/useDebounce'; import { useSearchBarState } from '@@/datatables/SearchBar'; import { diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/heartbeat.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/heartbeat.tsx index b3adba5ec..53d4f0450 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/heartbeat.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/heartbeat.tsx @@ -1,7 +1,8 @@ import { CellProps, Column } from 'react-table'; import { Environment } from '@/react/portainer/environments/types'; -import { EdgeIndicator } from '@/portainer/home/EnvironmentList/EnvironmentItem/EdgeIndicator'; + +import { EdgeIndicator } from '@@/EdgeIndicator'; export const heartbeat: Column = { Header: 'Heartbeat', diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx index ff2e0a5d9..8a71da7b2 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { useSettings } from '@/react/portainer/settings/queries'; -import { useGroups } from '@/portainer/environment-groups/queries'; +import { useGroups } from '@/react/portainer/environments/environment-groups/queries'; import { PageHeader } from '@@/PageHeader'; import { ViewLoading } from '@@/ViewLoading'; diff --git a/app/index.js b/app/index.js index 7ffa7c2e2..64dc29183 100644 --- a/app/index.js +++ b/app/index.js @@ -6,8 +6,11 @@ import angular from 'angular'; import { UI_ROUTER_REACT_HYBRID } from '@uirouter/react-hybrid'; import './matomo-setup'; -import analyticsModule from './angulartics.matomo'; +import { Edition } from '@/react/portainer/feature-flags/enums'; +import { init as initFeatureService } from '@/react/portainer/feature-flags/feature-flags.service'; + +import analyticsModule from './angulartics.matomo'; import './agent'; import { azureModule } from './azure'; import './docker/__module'; @@ -17,8 +20,6 @@ import './portainer/__module'; import { onStartupAngular } from './app'; import { configApp } from './config'; -import { init as initFeatureService } from './portainer/feature-flags/feature-flags.service'; -import { Edition } from './portainer/feature-flags/enums'; import { nomadModule } from './nomad'; initFeatureService(Edition[process.env.PORTAINER_EDITION]); diff --git a/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js b/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js index 66309f0e8..0fa7e7440 100644 --- a/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js +++ b/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js @@ -1,6 +1,6 @@ import { AccessControlFormData } from '@/portainer/components/accessControlForm/porAccessControlFormModel'; import { getTemplateVariables, intersectVariables } from '@/react/portainer/custom-templates/components/utils'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { editor, upload } from '@@/BoxSelector/common-options/build-methods'; class KubeCreateCustomTemplateViewController { diff --git a/app/kubernetes/custom-templates/kube-edit-custom-template-view/kube-edit-custom-template-view.controller.js b/app/kubernetes/custom-templates/kube-edit-custom-template-view/kube-edit-custom-template-view.controller.js index fe6fb26f1..2b8b3aed9 100644 --- a/app/kubernetes/custom-templates/kube-edit-custom-template-view/kube-edit-custom-template-view.controller.js +++ b/app/kubernetes/custom-templates/kube-edit-custom-template-view/kube-edit-custom-template-view.controller.js @@ -1,6 +1,6 @@ import { ResourceControlViewModel } from '@/react/portainer/access-control/models/ResourceControlViewModel'; import { AccessControlFormData } from '@/portainer/components/accessControlForm/porAccessControlFormModel'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { getTemplateVariables, intersectVariables } from '@/react/portainer/custom-templates/components/utils'; class KubeEditCustomTemplateViewController { diff --git a/app/kubernetes/views/configure/configureController.js b/app/kubernetes/views/configure/configureController.js index e42d212a7..063217d8b 100644 --- a/app/kubernetes/views/configure/configureController.js +++ b/app/kubernetes/views/configure/configureController.js @@ -4,7 +4,7 @@ import { KubernetesStorageClass, KubernetesStorageClassAccessPolicies } from 'Ku import { KubernetesFormValidationReferences } from 'Kubernetes/models/application/formValues'; import { KubernetesIngressClassTypes } from 'Kubernetes/ingress/constants'; import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { getIngressControllerClassMap, updateIngressControllerClassMap } from '@/react/kubernetes/cluster/ingressClass/utils'; diff --git a/app/kubernetes/views/deploy/deployController.js b/app/kubernetes/views/deploy/deployController.js index 413a987b3..9c5aa18c5 100644 --- a/app/kubernetes/views/deploy/deployController.js +++ b/app/kubernetes/views/deploy/deployController.js @@ -6,7 +6,7 @@ import uuidv4 from 'uuid/v4'; import PortainerError from '@/portainer/error'; import { KubernetesDeployManifestTypes, KubernetesDeployBuildMethods, KubernetesDeployRequestMethods, RepositoryMechanismTypes } from 'Kubernetes/models/deploy'; import { renderTemplate } from '@/react/portainer/custom-templates/components/utils'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { compose, kubernetes } from '@@/BoxSelector/common-options/deployment-methods'; import { editor, git, template, url } from '@@/BoxSelector/common-options/build-methods'; diff --git a/app/kubernetes/views/resource-pools/components/storage-class-switch/storage-class-switch.controller.js b/app/kubernetes/views/resource-pools/components/storage-class-switch/storage-class-switch.controller.js index ddfc63312..155db49a7 100644 --- a/app/kubernetes/views/resource-pools/components/storage-class-switch/storage-class-switch.controller.js +++ b/app/kubernetes/views/resource-pools/components/storage-class-switch/storage-class-switch.controller.js @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; class StorageClassSwitchController { /* @ngInject */ diff --git a/app/kubernetes/views/resource-pools/create/createResourcePoolController.js b/app/kubernetes/views/resource-pools/create/createResourcePoolController.js index 6384f4e03..a9e593a30 100644 --- a/app/kubernetes/views/resource-pools/create/createResourcePoolController.js +++ b/app/kubernetes/views/resource-pools/create/createResourcePoolController.js @@ -6,7 +6,7 @@ import { KubernetesResourcePoolFormValues, KubernetesResourcePoolIngressClassHos import { KubernetesIngressConverter } from 'Kubernetes/ingress/converter'; import { KubernetesFormValidationReferences } from 'Kubernetes/models/application/formValues'; import { KubernetesIngressClassTypes } from 'Kubernetes/ingress/constants'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { getIngressControllerClassMap, updateIngressControllerClassMap } from '@/react/kubernetes/cluster/ingressClass/utils'; class KubernetesCreateResourcePoolController { diff --git a/app/kubernetes/views/resource-pools/edit/resourcePoolController.js b/app/kubernetes/views/resource-pools/edit/resourcePoolController.js index 39d85d287..8c8901b41 100644 --- a/app/kubernetes/views/resource-pools/edit/resourcePoolController.js +++ b/app/kubernetes/views/resource-pools/edit/resourcePoolController.js @@ -12,7 +12,7 @@ import { KubernetesFormValidationReferences } from 'Kubernetes/models/applicatio import { KubernetesIngressClassTypes } from 'Kubernetes/ingress/constants'; import KubernetesResourceQuotaConverter from 'Kubernetes/converters/resourceQuota'; import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { updateIngressControllerClassMap, getIngressControllerClassMap } from '@/react/kubernetes/cluster/ingressClass/utils'; class KubernetesResourcePoolController { diff --git a/app/kubernetes/views/security-constraint/constraintController.js b/app/kubernetes/views/security-constraint/constraintController.js index a94623fab..d8a8b94cf 100644 --- a/app/kubernetes/views/security-constraint/constraintController.js +++ b/app/kubernetes/views/security-constraint/constraintController.js @@ -1,5 +1,5 @@ import angular from 'angular'; -import { FeatureId } from 'Portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; angular.module('portainer.kubernetes').controller('KubernetesSecurityConstraintController', [ '$scope', diff --git a/app/portainer/__module.js b/app/portainer/__module.js index 4e9b38c96..479d90746 100644 --- a/app/portainer/__module.js +++ b/app/portainer/__module.js @@ -1,9 +1,11 @@ import _ from 'lodash-es'; +import featureFlagModule from '@/react/portainer/feature-flags'; + import './rbac'; + import componentsModule from './components'; import settingsModule from './settings'; -import featureFlagModule from './feature-flags'; import userActivityModule from './user-activity'; import servicesModule from './services'; import { reactModule } from './react'; diff --git a/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts b/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts index f8fe0a4a4..79f9b50ad 100644 --- a/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts +++ b/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { getFeatureDetails } from '@@/BEFeatureIndicator/utils'; diff --git a/app/portainer/components/BoxSelector/utils.ts b/app/portainer/components/BoxSelector/utils.ts index 6fb1dbc09..ca3e963b9 100644 --- a/app/portainer/components/BoxSelector/utils.ts +++ b/app/portainer/components/BoxSelector/utils.ts @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { BoxSelectorOption } from '@@/BoxSelector/types'; import { IconProps } from '@@/Icon'; diff --git a/app/portainer/components/accessManagement/porAccessManagementController.js b/app/portainer/components/accessManagement/porAccessManagementController.js index 4e0456234..d306a1b8c 100644 --- a/app/portainer/components/accessManagement/porAccessManagementController.js +++ b/app/portainer/components/accessManagement/porAccessManagementController.js @@ -2,7 +2,7 @@ import _ from 'lodash-es'; import angular from 'angular'; import { RoleTypes } from '@/portainer/rbac/models/role'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; class PorAccessManagementController { /* @ngInject */ diff --git a/app/portainer/components/datatables/registries-datatable/registriesDatatableController.js b/app/portainer/components/datatables/registries-datatable/registriesDatatableController.js index 166f1a802..da737c8e2 100644 --- a/app/portainer/components/datatables/registries-datatable/registriesDatatableController.js +++ b/app/portainer/components/datatables/registries-datatable/registriesDatatableController.js @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { PortainerEndpointTypes } from 'Portainer/models/endpoint/models'; angular.module('portainer.docker').controller('RegistriesDatatableController', RegistriesDatatableController); diff --git a/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.controller.js b/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.controller.js index 76f654425..c84d8c973 100644 --- a/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.controller.js +++ b/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.controller.js @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; class GitFormAutoUpdateFieldsetController { /* @ngInject */ diff --git a/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js b/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js index 6401b2516..9499c8576 100644 --- a/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js +++ b/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js @@ -1,6 +1,6 @@ import uuidv4 from 'uuid/v4'; import { RepositoryMechanismTypes } from 'Kubernetes/models/deploy'; -import { FeatureId } from 'Portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; class StackRedeployGitFormController { /* @ngInject */ constructor($async, $state, $compile, $scope, StackService, ModalService, Notifications, WebhookHelper, FormHelper) { diff --git a/app/portainer/oauth/components/oauth-providers-selector/oauth-options.tsx b/app/portainer/oauth/components/oauth-providers-selector/oauth-options.tsx index 8bfc61df8..a0f64a108 100644 --- a/app/portainer/oauth/components/oauth-providers-selector/oauth-options.tsx +++ b/app/portainer/oauth/components/oauth-providers-selector/oauth-options.tsx @@ -1,6 +1,6 @@ import { Edit } from 'react-feather'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import Microsoft from '@/assets/ico/vendor/microsoft.svg?c'; import Google from '@/assets/ico/vendor/google.svg?c'; import Github from '@/assets/ico/vendor/github.svg?c'; diff --git a/app/portainer/oauth/components/oauth-settings/oauth-settings.controller.js b/app/portainer/oauth/components/oauth-settings/oauth-settings.controller.js index 19ac94a50..096512792 100644 --- a/app/portainer/oauth/components/oauth-settings/oauth-settings.controller.js +++ b/app/portainer/oauth/components/oauth-settings/oauth-settings.controller.js @@ -1,6 +1,6 @@ import { baseHref } from '@/portainer/helpers/pathHelper'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import providers, { getProviderByUrl } from './providers'; const MS_TENANT_ID_PLACEHOLDER = 'TENANT_ID'; diff --git a/app/portainer/rbac/components/access-viewer/access-viewer.controller.js b/app/portainer/rbac/components/access-viewer/access-viewer.controller.js index 01d97fd81..7124b6230 100644 --- a/app/portainer/rbac/components/access-viewer/access-viewer.controller.js +++ b/app/portainer/rbac/components/access-viewer/access-viewer.controller.js @@ -1,5 +1,5 @@ import _ from 'lodash-es'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { getEnvironments } from '@/react/portainer/environments/environment.service'; import AccessViewerPolicyModel from '../../models/access'; diff --git a/app/portainer/react/views/index.ts b/app/portainer/react/views/index.ts index ccb0336fc..5151d263e 100644 --- a/app/portainer/react/views/index.ts +++ b/app/portainer/react/views/index.ts @@ -1,6 +1,6 @@ import angular from 'angular'; -import { HomeView } from '@/portainer/home'; +import { HomeView } from '@/react/portainer/HomeView'; import { withCurrentUser } from '@/react-tools/withCurrentUser'; import { r2a } from '@/react-tools/react2angular'; import { withReactQuery } from '@/react-tools/withReactQuery'; diff --git a/app/portainer/services/axios.ts b/app/portainer/services/axios.ts index 0b6531f98..5448feb48 100644 --- a/app/portainer/services/axios.ts +++ b/app/portainer/services/axios.ts @@ -3,7 +3,7 @@ import { loadProgressBar } from 'axios-progress-bar'; import 'axios-progress-bar/dist/nprogress.css'; import PortainerError from '@/portainer/error'; -import { get as localStorageGet } from '@/portainer/hooks/useLocalStorage'; +import { get as localStorageGet } from '@/react/hooks/useLocalStorage'; import { portainerAgentManagerOperation, diff --git a/app/portainer/services/notifications.ts b/app/portainer/services/notifications.ts index c9531b5c9..63fd85697 100644 --- a/app/portainer/services/notifications.ts +++ b/app/portainer/services/notifications.ts @@ -4,7 +4,7 @@ import sanitize from 'sanitize-html'; import jwtDecode from 'jwt-decode'; import { v4 as uuid } from 'uuid'; -import { get as localStorageGet } from '@/portainer/hooks/useLocalStorage'; +import { get as localStorageGet } from '@/react/hooks/useLocalStorage'; import { notificationsStore } from '@/react/portainer/notifications/notifications-store'; import { ToastNotification } from '@/react/portainer/notifications/types'; diff --git a/app/portainer/settings/authentication/ldap/ad-settings/ad-settings.controller.js b/app/portainer/settings/authentication/ldap/ad-settings/ad-settings.controller.js index 4c4e844c2..502a71669 100644 --- a/app/portainer/settings/authentication/ldap/ad-settings/ad-settings.controller.js +++ b/app/portainer/settings/authentication/ldap/ad-settings/ad-settings.controller.js @@ -1,7 +1,7 @@ import _ from 'lodash-es'; -import { FeatureId } from '@/portainer/feature-flags/enums'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; export default class AdSettingsController { /* @ngInject */ diff --git a/app/portainer/settings/authentication/ldap/ldap-settings-custom/ldap-settings-custom.controller.js b/app/portainer/settings/authentication/ldap/ldap-settings-custom/ldap-settings-custom.controller.js index 0ee280ccf..59072ab22 100644 --- a/app/portainer/settings/authentication/ldap/ldap-settings-custom/ldap-settings-custom.controller.js +++ b/app/portainer/settings/authentication/ldap/ldap-settings-custom/ldap-settings-custom.controller.js @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; export default class LdapSettingsCustomController { constructor() { diff --git a/app/portainer/settings/authentication/ldap/ldap-settings-openldap/ldap-settings-openldap.controller.js b/app/portainer/settings/authentication/ldap/ldap-settings-openldap/ldap-settings-openldap.controller.js index 249a13fe5..6fb83cabe 100644 --- a/app/portainer/settings/authentication/ldap/ldap-settings-openldap/ldap-settings-openldap.controller.js +++ b/app/portainer/settings/authentication/ldap/ldap-settings-openldap/ldap-settings-openldap.controller.js @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; export default class LdapSettingsOpenLDAPController { /* @ngInject */ diff --git a/app/portainer/settings/authentication/ldap/ldap-settings/ldap-options.tsx b/app/portainer/settings/authentication/ldap/ldap-settings/ldap-options.tsx index 6b44625f6..c336a2e30 100644 --- a/app/portainer/settings/authentication/ldap/ldap-settings/ldap-options.tsx +++ b/app/portainer/settings/authentication/ldap/ldap-settings/ldap-options.tsx @@ -1,6 +1,6 @@ import { Edit } from 'react-feather'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import Openldap from '@/assets/ico/vendor/openldap.svg?c'; import { BadgeIcon } from '@@/BadgeIcon'; diff --git a/app/portainer/user-activity/activity-logs-view/activity-logs-view.controller.js b/app/portainer/user-activity/activity-logs-view/activity-logs-view.controller.js index 475a6f3c9..bd4547b71 100644 --- a/app/portainer/user-activity/activity-logs-view/activity-logs-view.controller.js +++ b/app/portainer/user-activity/activity-logs-view/activity-logs-view.controller.js @@ -1,6 +1,6 @@ import moment from 'moment'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; export default class ActivityLogsViewController { /* @ngInject */ constructor($async, $scope, Notifications) { diff --git a/app/portainer/user-activity/auth-logs-view/auth-logs-view.controller.js b/app/portainer/user-activity/auth-logs-view/auth-logs-view.controller.js index 9d9b4d668..45c74c7bf 100644 --- a/app/portainer/user-activity/auth-logs-view/auth-logs-view.controller.js +++ b/app/portainer/user-activity/auth-logs-view/auth-logs-view.controller.js @@ -1,6 +1,6 @@ import moment from 'moment'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; export default class AuthLogsViewController { /* @ngInject */ diff --git a/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateViewController.js b/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateViewController.js index b70e42911..e0b184cbc 100644 --- a/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateViewController.js +++ b/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateViewController.js @@ -2,7 +2,7 @@ import _ from 'lodash'; import { AccessControlFormData } from 'Portainer/components/accessControlForm/porAccessControlFormModel'; import { TEMPLATE_NAME_VALIDATION_REGEX } from '@/constants'; import { getTemplateVariables, intersectVariables } from '@/react/portainer/custom-templates/components/utils'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; class CreateCustomTemplateViewController { /* @ngInject */ diff --git a/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js b/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js index 61076380b..ae8426d81 100644 --- a/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js +++ b/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js @@ -2,7 +2,7 @@ import _ from 'lodash-es'; import { AccessControlFormData } from 'Portainer/components/accessControlForm/porAccessControlFormModel'; import { TEMPLATE_NAME_VALIDATION_REGEX } from '@/constants'; import { renderTemplate } from '@/react/portainer/custom-templates/components/utils'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; class CustomTemplatesViewController { /* @ngInject */ diff --git a/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js b/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js index 9b3568586..b12b2ab6d 100644 --- a/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js +++ b/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js @@ -3,7 +3,7 @@ import { ResourceControlViewModel } from '@/react/portainer/access-control/model import { AccessControlFormData } from 'Portainer/components/accessControlForm/porAccessControlFormModel'; import { getTemplateVariables, intersectVariables } from '@/react/portainer/custom-templates/components/utils'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; class EditCustomTemplateViewController { /* @ngInject */ diff --git a/app/portainer/views/endpoints/access/endpointAccessController.js b/app/portainer/views/endpoints/access/endpointAccessController.js index 190291c62..0cdbbe70b 100644 --- a/app/portainer/views/endpoints/access/endpointAccessController.js +++ b/app/portainer/views/endpoints/access/endpointAccessController.js @@ -1,6 +1,6 @@ import angular from 'angular'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; class EndpointAccessController { /* @ngInject */ diff --git a/app/portainer/views/groups/access/groupAccessController.js b/app/portainer/views/groups/access/groupAccessController.js index c4169480c..8bd6d5954 100644 --- a/app/portainer/views/groups/access/groupAccessController.js +++ b/app/portainer/views/groups/access/groupAccessController.js @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; angular.module('portainer.app').controller('GroupAccessController', [ '$scope', diff --git a/app/portainer/views/settings/authentication/options.tsx b/app/portainer/views/settings/authentication/options.tsx index 01141cf2e..0bb0be2ec 100644 --- a/app/portainer/views/settings/authentication/options.tsx +++ b/app/portainer/views/settings/authentication/options.tsx @@ -1,6 +1,6 @@ import { ArrowDownCircle } from 'react-feather'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import Microsoft from '@/assets/ico/vendor/microsoft.svg?c'; import Ldap from '@/assets/ico/ldap.svg?c'; import OAuth from '@/assets/ico/oauth.svg?c'; diff --git a/app/portainer/views/settings/options.tsx b/app/portainer/views/settings/options.tsx index 45fc6e3b7..7e5942c89 100644 --- a/app/portainer/views/settings/options.tsx +++ b/app/portainer/views/settings/options.tsx @@ -1,6 +1,6 @@ import { DownloadCloud, UploadCloud } from 'react-feather'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { BadgeIcon } from '@@/BadgeIcon'; diff --git a/app/portainer/views/settings/settingsController.js b/app/portainer/views/settings/settingsController.js index 085580f87..64816d1e4 100644 --- a/app/portainer/views/settings/settingsController.js +++ b/app/portainer/views/settings/settingsController.js @@ -1,6 +1,6 @@ import angular from 'angular'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { options } from './options'; angular.module('portainer.app').controller('SettingsController', [ diff --git a/app/portainer/views/stacks/create/createStackController.js b/app/portainer/views/stacks/create/createStackController.js index c62d193a8..9a17f1bdf 100644 --- a/app/portainer/views/stacks/create/createStackController.js +++ b/app/portainer/views/stacks/create/createStackController.js @@ -4,8 +4,8 @@ import uuidv4 from 'uuid/v4'; import { AccessControlFormData } from '@/portainer/components/accessControlForm/porAccessControlFormModel'; import { STACK_NAME_VALIDATION_REGEX } from '@/constants'; import { RepositoryMechanismTypes } from '@/kubernetes/models/deploy'; -import { FeatureId } from 'Portainer/feature-flags/enums'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { renderTemplate } from '@/react/portainer/custom-templates/components/utils'; angular diff --git a/app/portainer/views/stacks/edit/stackController.js b/app/portainer/views/stacks/edit/stackController.js index cb9dffac6..4c7fd5e7f 100644 --- a/app/portainer/views/stacks/edit/stackController.js +++ b/app/portainer/views/stacks/edit/stackController.js @@ -1,6 +1,6 @@ import { ResourceControlType } from '@/react/portainer/access-control/types'; import { AccessControlFormData } from 'Portainer/components/accessControlForm/porAccessControlFormModel'; -import { FeatureId } from 'Portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { getEnvironments } from '@/react/portainer/environments/environment.service'; import { StackStatus, StackType } from '@/react/docker/stacks/types'; import { extractContainerNames } from '@/portainer/helpers/stackHelper'; diff --git a/app/react-tools/withCurrentUser.tsx b/app/react-tools/withCurrentUser.tsx index 3176c4487..ca8bd3391 100644 --- a/app/react-tools/withCurrentUser.tsx +++ b/app/react-tools/withCurrentUser.tsx @@ -1,6 +1,6 @@ import { ComponentType } from 'react'; -import { UserProvider } from '@/portainer/hooks/useUser'; +import { UserProvider } from '@/react/hooks/useUser'; export function withCurrentUser( WrappedComponent: ComponentType diff --git a/app/react/azure/DashboardView/DashboardView.test.tsx b/app/react/azure/DashboardView/DashboardView.test.tsx index 07376133e..8695201a9 100644 --- a/app/react/azure/DashboardView/DashboardView.test.tsx +++ b/app/react/azure/DashboardView/DashboardView.test.tsx @@ -1,5 +1,5 @@ import { renderWithQueryClient, within } from '@/react-tools/test-utils'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { server, rest } from '@/setup-tests/server'; import { diff --git a/app/react/azure/DashboardView/DashboardView.tsx b/app/react/azure/DashboardView/DashboardView.tsx index 52ef97d13..0682bd5ac 100644 --- a/app/react/azure/DashboardView/DashboardView.tsx +++ b/app/react/azure/DashboardView/DashboardView.tsx @@ -1,6 +1,6 @@ import { Package } from 'react-feather'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { PageHeader } from '@@/PageHeader'; import { DashboardItem } from '@@/DashboardItem'; diff --git a/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.test.tsx b/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.test.tsx index 2d01601a2..6811f21cf 100644 --- a/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.test.tsx +++ b/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.test.tsx @@ -1,6 +1,6 @@ import userEvent from '@testing-library/user-event'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { renderWithQueryClient } from '@/react-tools/test-utils'; diff --git a/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.tsx b/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.tsx index 3f83fca30..a0cd736d1 100644 --- a/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.tsx +++ b/app/react/azure/container-instances/CreateView/CreateContainerInstanceForm.tsx @@ -3,9 +3,9 @@ import { useRouter } from '@uirouter/react'; import { ContainerInstanceFormValues } from '@/react/azure/types'; import * as notifications from '@/portainer/services/notifications'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { AccessControlForm } from '@/react/portainer/access-control/AccessControlForm'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { FormControl } from '@@/form-components/FormControl'; import { Input, Select } from '@@/form-components/Input'; diff --git a/app/react/azure/container-instances/CreateView/useLoadFormState.ts b/app/react/azure/container-instances/CreateView/useLoadFormState.ts index 416944433..7e3f41e10 100644 --- a/app/react/azure/container-instances/CreateView/useLoadFormState.ts +++ b/app/react/azure/container-instances/CreateView/useLoadFormState.ts @@ -6,7 +6,7 @@ import { Subscription, } from '@/react/azure/types'; import { parseAccessControlFormData } from '@/react/portainer/access-control/utils'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { useProvider } from '@/react/azure/queries/useProvider'; import { useResourceGroups } from '@/react/azure/queries/useResourceGroups'; import { useSubscriptions } from '@/react/azure/queries/useSubscriptions'; diff --git a/app/react/azure/container-instances/ItemView/ItemView.tsx b/app/react/azure/container-instances/ItemView/ItemView.tsx index 4840ce78a..54aeecf05 100644 --- a/app/react/azure/container-instances/ItemView/ItemView.tsx +++ b/app/react/azure/container-instances/ItemView/ItemView.tsx @@ -1,7 +1,7 @@ import { useCurrentStateAndParams } from '@uirouter/react'; import { useQueryClient } from 'react-query'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { AccessControlPanel } from '@/react/portainer/access-control/AccessControlPanel/AccessControlPanel'; import { ResourceControlViewModel } from '@/react/portainer/access-control/models/ResourceControlViewModel'; import { ResourceControlType } from '@/react/portainer/access-control/types'; diff --git a/app/react/azure/container-instances/ListView/ContainersDatatable.tsx b/app/react/azure/container-instances/ListView/ContainersDatatable.tsx index b16ea057d..889c18455 100644 --- a/app/react/azure/container-instances/ListView/ContainersDatatable.tsx +++ b/app/react/azure/container-instances/ListView/ContainersDatatable.tsx @@ -8,9 +8,9 @@ import { import { useRowSelectColumn } from '@lineup-lite/hooks'; import { Box, Plus, Trash2 } from 'react-feather'; -import { useDebounce } from '@/portainer/hooks/useDebounce'; +import { useDebounce } from '@/react/hooks/useDebounce'; import { ContainerGroup } from '@/react/azure/types'; -import { Authorized } from '@/portainer/hooks/useUser'; +import { Authorized } from '@/react/hooks/useUser'; import { confirmDeletionAsync } from '@/portainer/services/modal.service/confirm'; import { PaginationControls } from '@@/PaginationControls'; diff --git a/app/react/azure/container-instances/ListView/ListView.tsx b/app/react/azure/container-instances/ListView/ListView.tsx index 3698ffda3..21f0b726e 100644 --- a/app/react/azure/container-instances/ListView/ListView.tsx +++ b/app/react/azure/container-instances/ListView/ListView.tsx @@ -1,7 +1,7 @@ import { useMutation, useQueryClient } from 'react-query'; import { deleteContainerGroup } from '@/react/azure/services/container-groups.service'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { notifyError, notifySuccess } from '@/portainer/services/notifications'; import { EnvironmentId } from '@/react/portainer/environments/types'; import { promiseSequence } from '@/portainer/helpers/promise-utils'; diff --git a/app/react/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx b/app/react/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx index d4bf97338..2df7cdc17 100644 --- a/app/react/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx +++ b/app/react/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx @@ -1,7 +1,7 @@ import { Meta } from '@storybook/react'; -import { Edition, FeatureId } from '@/portainer/feature-flags/enums'; -import { init as initFeatureService } from '@/portainer/feature-flags/feature-flags.service'; +import { Edition, FeatureId } from '@/react/portainer/feature-flags/enums'; +import { init as initFeatureService } from '@/react/portainer/feature-flags/feature-flags.service'; import { BEFeatureIndicator, Props } from './BEFeatureIndicator'; diff --git a/app/react/components/BEFeatureIndicator/BEFeatureIndicator.tsx b/app/react/components/BEFeatureIndicator/BEFeatureIndicator.tsx index f521089ab..e511e5e63 100644 --- a/app/react/components/BEFeatureIndicator/BEFeatureIndicator.tsx +++ b/app/react/components/BEFeatureIndicator/BEFeatureIndicator.tsx @@ -4,7 +4,7 @@ import { Briefcase } from 'react-feather'; import './BEFeatureIndicator.css'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { getFeatureDetails } from './utils'; diff --git a/app/react/components/BEFeatureIndicator/utils.ts b/app/react/components/BEFeatureIndicator/utils.ts index b2933c7b1..2e210bd67 100644 --- a/app/react/components/BEFeatureIndicator/utils.ts +++ b/app/react/components/BEFeatureIndicator/utils.ts @@ -1,5 +1,5 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; const BE_URL = 'https://www.portainer.io/business-upsell?from='; diff --git a/app/react/components/BoxSelector/BoxSelector.stories.tsx b/app/react/components/BoxSelector/BoxSelector.stories.tsx index f19ad17cd..5414553cc 100644 --- a/app/react/components/BoxSelector/BoxSelector.stories.tsx +++ b/app/react/components/BoxSelector/BoxSelector.stories.tsx @@ -1,8 +1,8 @@ import { Meta } from '@storybook/react'; import { useState } from 'react'; -import { init as initFeatureService } from '@/portainer/feature-flags/feature-flags.service'; -import { Edition, FeatureId } from '@/portainer/feature-flags/enums'; +import { init as initFeatureService } from '@/react/portainer/feature-flags/feature-flags.service'; +import { Edition, FeatureId } from '@/react/portainer/feature-flags/enums'; import { BoxSelector } from './BoxSelector'; import { BoxSelectorOption } from './types'; diff --git a/app/react/components/BoxSelector/BoxSelectorItem.stories.tsx b/app/react/components/BoxSelector/BoxSelectorItem.stories.tsx index a3c518cda..ed311794b 100644 --- a/app/react/components/BoxSelector/BoxSelectorItem.stories.tsx +++ b/app/react/components/BoxSelector/BoxSelectorItem.stories.tsx @@ -1,7 +1,7 @@ import { Meta } from '@storybook/react'; -import { init as initFeatureService } from '@/portainer/feature-flags/feature-flags.service'; -import { Edition, FeatureId } from '@/portainer/feature-flags/enums'; +import { init as initFeatureService } from '@/react/portainer/feature-flags/feature-flags.service'; +import { Edition, FeatureId } from '@/react/portainer/feature-flags/enums'; import { BoxSelectorItem } from './BoxSelectorItem'; import { BoxSelectorOption } from './types'; diff --git a/app/react/components/BoxSelector/BoxSelectorItem.tsx b/app/react/components/BoxSelector/BoxSelectorItem.tsx index 13ec5dcf0..04d2cc995 100644 --- a/app/react/components/BoxSelector/BoxSelectorItem.tsx +++ b/app/react/components/BoxSelector/BoxSelectorItem.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { Icon } from '@/react/components/Icon'; import './BoxSelectorItem.css'; diff --git a/app/react/components/BoxSelector/LimitedToBeIndicator.tsx b/app/react/components/BoxSelector/LimitedToBeIndicator.tsx index a4f72b16f..dcf7553df 100644 --- a/app/react/components/BoxSelector/LimitedToBeIndicator.tsx +++ b/app/react/components/BoxSelector/LimitedToBeIndicator.tsx @@ -1,7 +1,7 @@ import ReactTooltip from 'react-tooltip'; import { HelpCircle } from 'react-feather'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { getFeatureDetails } from '@@/BEFeatureIndicator/utils'; diff --git a/app/react/components/BoxSelector/types.ts b/app/react/components/BoxSelector/types.ts index e224be53c..67f2a5585 100644 --- a/app/react/components/BoxSelector/types.ts +++ b/app/react/components/BoxSelector/types.ts @@ -1,4 +1,4 @@ -import type { FeatureId } from '@/portainer/feature-flags/enums'; +import type { FeatureId } from '@/react/portainer/feature-flags/enums'; import { IconProps } from '@@/Icon'; diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EdgeIndicator.test.tsx b/app/react/components/EdgeIndicator.test.tsx similarity index 79% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EdgeIndicator.test.tsx rename to app/react/components/EdgeIndicator.test.tsx index 9f2265d98..6bb45895e 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentItem/EdgeIndicator.test.tsx +++ b/app/react/components/EdgeIndicator.test.tsx @@ -12,12 +12,12 @@ test('when edge id is not set, should show unassociated label', async () => { expect(unassociatedLabel).toBeVisible(); }); -// test('given edge id and last checkin is set, should show heartbeat', async () => { -// const { queryByLabelText } = await renderComponent('id', 1); +test('given edge id and last checkin is set, should show heartbeat', async () => { + const { queryByLabelText } = await renderComponent('id', 1); -// expect(queryByLabelText('edge-heartbeat')).toBeVisible(); -// expect(queryByLabelText('edge-last-checkin')).toBeVisible(); -// }); + expect(queryByLabelText('edge-heartbeat')).toBeVisible(); + expect(queryByLabelText('edge-last-checkin')).toBeVisible(); +}); async function renderComponent( edgeId = '', diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EdgeIndicator.tsx b/app/react/components/EdgeIndicator.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EdgeIndicator.tsx rename to app/react/components/EdgeIndicator.tsx diff --git a/app/react/components/PageHeader/HeaderContainer.stories.tsx b/app/react/components/PageHeader/HeaderContainer.stories.tsx index e870c6188..94de49d52 100644 --- a/app/react/components/PageHeader/HeaderContainer.stories.tsx +++ b/app/react/components/PageHeader/HeaderContainer.stories.tsx @@ -1,7 +1,7 @@ import { Meta, Story } from '@storybook/react'; import { useMemo } from 'react'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { HeaderContainer } from './HeaderContainer'; diff --git a/app/react/components/PageHeader/HeaderTitle.test.tsx b/app/react/components/PageHeader/HeaderTitle.test.tsx index ca4374c8c..817083a7d 100644 --- a/app/react/components/PageHeader/HeaderTitle.test.tsx +++ b/app/react/components/PageHeader/HeaderTitle.test.tsx @@ -1,4 +1,4 @@ -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { render } from '@/react-tools/test-utils'; diff --git a/app/react/components/PageHeader/NotificationsMenu.tsx b/app/react/components/PageHeader/NotificationsMenu.tsx index 879416216..390c2a6ad 100644 --- a/app/react/components/PageHeader/NotificationsMenu.tsx +++ b/app/react/components/PageHeader/NotificationsMenu.tsx @@ -11,7 +11,7 @@ import { useEffect, useState } from 'react'; import { useStore } from 'zustand'; import { AutomationTestingProps } from '@/types'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { ToastNotification } from '@/react/portainer/notifications/types'; import { Icon } from '@@/Icon'; diff --git a/app/react/components/PageHeader/PageHeader.stories.tsx b/app/react/components/PageHeader/PageHeader.stories.tsx index b36e448e9..05ffaecfc 100644 --- a/app/react/components/PageHeader/PageHeader.stories.tsx +++ b/app/react/components/PageHeader/PageHeader.stories.tsx @@ -1,7 +1,7 @@ import { Meta, Story } from '@storybook/react'; import { useMemo } from 'react'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { PageHeader } from './PageHeader'; diff --git a/app/react/components/PageHeader/PageHeader.test.tsx b/app/react/components/PageHeader/PageHeader.test.tsx index 65674006a..8400c5799 100644 --- a/app/react/components/PageHeader/PageHeader.test.tsx +++ b/app/react/components/PageHeader/PageHeader.test.tsx @@ -1,4 +1,4 @@ -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { render } from '@/react-tools/test-utils'; diff --git a/app/react/components/PageHeader/UserMenu.tsx b/app/react/components/PageHeader/UserMenu.tsx index 5b11a72cd..e1637647d 100644 --- a/app/react/components/PageHeader/UserMenu.tsx +++ b/app/react/components/PageHeader/UserMenu.tsx @@ -9,7 +9,7 @@ import clsx from 'clsx'; import { User, ChevronDown } from 'react-feather'; import { AutomationTestingProps } from '@/types'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import styles from './HeaderTitle.module.css'; diff --git a/app/react/components/datatables/FilterSearchBar.tsx b/app/react/components/datatables/FilterSearchBar.tsx index acc7a42c6..44a655326 100644 --- a/app/react/components/datatables/FilterSearchBar.tsx +++ b/app/react/components/datatables/FilterSearchBar.tsx @@ -1,6 +1,6 @@ import { Search } from 'react-feather'; -import { useLocalStorage } from '@/portainer/hooks/useLocalStorage'; +import { useLocalStorage } from '@/react/hooks/useLocalStorage'; interface Props { value: string; diff --git a/app/react/components/datatables/SearchBar.tsx b/app/react/components/datatables/SearchBar.tsx index c056f9f84..a885865e4 100644 --- a/app/react/components/datatables/SearchBar.tsx +++ b/app/react/components/datatables/SearchBar.tsx @@ -2,7 +2,7 @@ import { Search } from 'react-feather'; import { useEffect, useMemo, useState } from 'react'; import _ from 'lodash'; -import { useLocalStorage } from '@/portainer/hooks/useLocalStorage'; +import { useLocalStorage } from '@/react/hooks/useLocalStorage'; import { AutomationTestingProps } from '@/types'; interface Props extends AutomationTestingProps { diff --git a/app/react/components/datatables/useTableSettings.tsx b/app/react/components/datatables/useTableSettings.tsx index db2d6076f..4a3ce47f4 100644 --- a/app/react/components/datatables/useTableSettings.tsx +++ b/app/react/components/datatables/useTableSettings.tsx @@ -8,7 +8,7 @@ import { useState, } from 'react'; -import { useLocalStorage } from '@/portainer/hooks/useLocalStorage'; +import { useLocalStorage } from '@/react/hooks/useLocalStorage'; interface TableSettingsContextInterface { settings: T; diff --git a/app/react/components/form-components/SwitchField/Switch.tsx b/app/react/components/form-components/SwitchField/Switch.tsx index 9673242bf..4d815a978 100644 --- a/app/react/components/form-components/SwitchField/Switch.tsx +++ b/app/react/components/form-components/SwitchField/Switch.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { BEFeatureIndicator } from '@@/BEFeatureIndicator'; diff --git a/app/react/components/form-components/SwitchField/SwitchField.tsx b/app/react/components/form-components/SwitchField/SwitchField.tsx index a45aa8d3d..df78067ad 100644 --- a/app/react/components/form-components/SwitchField/SwitchField.tsx +++ b/app/react/components/form-components/SwitchField/SwitchField.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { Tooltip } from '@@/Tip/Tooltip'; diff --git a/app/portainer/helpers/yup-file-validation.ts b/app/react/components/form-components/yup-file-validation.ts similarity index 100% rename from app/portainer/helpers/yup-file-validation.ts rename to app/react/components/form-components/yup-file-validation.ts diff --git a/app/react/docker/containers/ListView/ContainersDatatable/ContainersDatatableActions.tsx b/app/react/docker/containers/ListView/ContainersDatatable/ContainersDatatableActions.tsx index c23dd8078..ec38d513f 100644 --- a/app/react/docker/containers/ListView/ContainersDatatable/ContainersDatatableActions.tsx +++ b/app/react/docker/containers/ListView/ContainersDatatable/ContainersDatatableActions.tsx @@ -10,7 +10,7 @@ import { } from 'react-feather'; import * as notifications from '@/portainer/services/notifications'; -import { useAuthorizations, Authorized } from '@/portainer/hooks/useUser'; +import { useAuthorizations, Authorized } from '@/react/hooks/useUser'; import { confirmContainerDeletion } from '@/portainer/services/modal.service/prompt'; import { setPortainerAgentTargetHeader } from '@/portainer/services/http-request.helper'; import { diff --git a/app/react/docker/containers/ListView/ContainersDatatable/columns/gpus.tsx b/app/react/docker/containers/ListView/ContainersDatatable/columns/gpus.tsx index 80e7938bb..f03172541 100644 --- a/app/react/docker/containers/ListView/ContainersDatatable/columns/gpus.tsx +++ b/app/react/docker/containers/ListView/ContainersDatatable/columns/gpus.tsx @@ -1,7 +1,7 @@ import { CellProps, Column } from 'react-table'; import type { DockerContainer } from '@/react/docker/containers/types'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { useContainerGpus } from '@/react/docker/containers/queries/gpus'; export const gpus: Column = { diff --git a/app/react/docker/containers/ListView/ContainersDatatable/columns/quick-actions.tsx b/app/react/docker/containers/ListView/ContainersDatatable/columns/quick-actions.tsx index bb1c5675e..bb72af80e 100644 --- a/app/react/docker/containers/ListView/ContainersDatatable/columns/quick-actions.tsx +++ b/app/react/docker/containers/ListView/ContainersDatatable/columns/quick-actions.tsx @@ -1,8 +1,8 @@ import { CellProps, Column } from 'react-table'; -import { useAuthorizations } from '@/portainer/hooks/useUser'; +import { useAuthorizations } from '@/react/hooks/useUser'; import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper'; -import { useCurrentEnvironment } from '@/portainer/hooks/useCurrentEnvironment'; +import { useCurrentEnvironment } from '@/react/hooks/useCurrentEnvironment'; import { ContainerQuickActions } from '@/react/docker/containers/components/ContainerQuickActions'; import { DockerContainer } from '@/react/docker/containers/types'; diff --git a/app/react/docker/containers/ListView/ContainersDatatable/datatable-store.ts b/app/react/docker/containers/ListView/ContainersDatatable/datatable-store.ts index bc04b9bb4..8fbaccdfa 100644 --- a/app/react/docker/containers/ListView/ContainersDatatable/datatable-store.ts +++ b/app/react/docker/containers/ListView/ContainersDatatable/datatable-store.ts @@ -1,7 +1,7 @@ import create from 'zustand'; import { persist } from 'zustand/middleware'; -import { keyBuilder } from '@/portainer/hooks/useLocalStorage'; +import { keyBuilder } from '@/react/hooks/useLocalStorage'; import { paginationSettings, sortableSettings, diff --git a/app/react/docker/containers/components/ContainerQuickActions/ContainerQuickActions.tsx b/app/react/docker/containers/components/ContainerQuickActions/ContainerQuickActions.tsx index a0d230841..0e6e0fa96 100644 --- a/app/react/docker/containers/components/ContainerQuickActions/ContainerQuickActions.tsx +++ b/app/react/docker/containers/components/ContainerQuickActions/ContainerQuickActions.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import { ContainerStatus } from '@/react/docker/containers/types'; -import { Authorized } from '@/portainer/hooks/useUser'; +import { Authorized } from '@/react/hooks/useUser'; import { Icon } from '@@/Icon'; import { Link } from '@@/Link'; diff --git a/app/react/docker/networks/ItemView/ItemView.tsx b/app/react/docker/networks/ItemView/ItemView.tsx index b18bca3c7..5754ecde6 100644 --- a/app/react/docker/networks/ItemView/ItemView.tsx +++ b/app/react/docker/networks/ItemView/ItemView.tsx @@ -3,7 +3,7 @@ import { useRouter, useCurrentStateAndParams } from '@uirouter/react'; import { useQueryClient } from 'react-query'; import _ from 'lodash'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { confirmDeletionAsync } from '@/portainer/services/modal.service/confirm'; import { AccessControlPanel } from '@/react/portainer/access-control/AccessControlPanel/AccessControlPanel'; import { ResourceControlType } from '@/react/portainer/access-control/types'; diff --git a/app/react/docker/networks/ItemView/NetworkContainersTable.test.tsx b/app/react/docker/networks/ItemView/NetworkContainersTable.test.tsx index 17cb912a9..6295494ad 100644 --- a/app/react/docker/networks/ItemView/NetworkContainersTable.test.tsx +++ b/app/react/docker/networks/ItemView/NetworkContainersTable.test.tsx @@ -1,5 +1,5 @@ import { renderWithQueryClient } from '@/react-tools/test-utils'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { NetworkContainer } from '../types'; diff --git a/app/react/docker/networks/ItemView/NetworkContainersTable.tsx b/app/react/docker/networks/ItemView/NetworkContainersTable.tsx index 01e22b822..e6afdcedb 100644 --- a/app/react/docker/networks/ItemView/NetworkContainersTable.tsx +++ b/app/react/docker/networks/ItemView/NetworkContainersTable.tsx @@ -1,4 +1,4 @@ -import { Authorized } from '@/portainer/hooks/useUser'; +import { Authorized } from '@/react/hooks/useUser'; import { EnvironmentId } from '@/react/portainer/environments/types'; import { Icon } from '@/react/components/Icon'; diff --git a/app/react/docker/networks/ItemView/NetworkDetailsTable.test.tsx b/app/react/docker/networks/ItemView/NetworkDetailsTable.test.tsx index 8d5004103..1b2be8f72 100644 --- a/app/react/docker/networks/ItemView/NetworkDetailsTable.test.tsx +++ b/app/react/docker/networks/ItemView/NetworkDetailsTable.test.tsx @@ -1,5 +1,5 @@ import { render } from '@/react-tools/test-utils'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { DockerNetwork } from '../types'; diff --git a/app/react/docker/networks/ItemView/NetworkDetailsTable.tsx b/app/react/docker/networks/ItemView/NetworkDetailsTable.tsx index 762c85c10..c81e18ca0 100644 --- a/app/react/docker/networks/ItemView/NetworkDetailsTable.tsx +++ b/app/react/docker/networks/ItemView/NetworkDetailsTable.tsx @@ -1,7 +1,7 @@ import { Fragment } from 'react'; import DockerNetworkHelper from '@/docker/helpers/networkHelper'; -import { Authorized } from '@/portainer/hooks/useUser'; +import { Authorized } from '@/react/hooks/useUser'; import { Table, TableContainer, TableTitle } from '@@/datatables'; import { DetailsTable } from '@@/DetailsTable'; diff --git a/app/portainer/hooks/useCurrentEnvironment.ts b/app/react/hooks/useCurrentEnvironment.ts similarity index 100% rename from app/portainer/hooks/useCurrentEnvironment.ts rename to app/react/hooks/useCurrentEnvironment.ts diff --git a/app/portainer/hooks/useDebounce.ts b/app/react/hooks/useDebounce.ts similarity index 100% rename from app/portainer/hooks/useDebounce.ts rename to app/react/hooks/useDebounce.ts diff --git a/app/portainer/hooks/useEnvironmentId.ts b/app/react/hooks/useEnvironmentId.ts similarity index 100% rename from app/portainer/hooks/useEnvironmentId.ts rename to app/react/hooks/useEnvironmentId.ts diff --git a/app/portainer/hooks/useLocalStorage.ts b/app/react/hooks/useLocalStorage.ts similarity index 100% rename from app/portainer/hooks/useLocalStorage.ts rename to app/react/hooks/useLocalStorage.ts diff --git a/app/portainer/hooks/usePaginationLimitState.ts b/app/react/hooks/usePaginationLimitState.ts similarity index 100% rename from app/portainer/hooks/usePaginationLimitState.ts rename to app/react/hooks/usePaginationLimitState.ts diff --git a/app/portainer/hooks/useUIState.tsx b/app/react/hooks/useUIState.tsx similarity index 93% rename from app/portainer/hooks/useUIState.tsx rename to app/react/hooks/useUIState.tsx index 6ff7b2994..b300510d3 100644 --- a/app/portainer/hooks/useUIState.tsx +++ b/app/react/hooks/useUIState.tsx @@ -1,7 +1,7 @@ import create from 'zustand'; import { persist } from 'zustand/middleware'; -import { keyBuilder } from '@/portainer/hooks/useLocalStorage'; +import { keyBuilder } from '@/react/hooks/useLocalStorage'; interface UIState { dismissedInfoPanels: Record; diff --git a/app/portainer/hooks/useUser.tsx b/app/react/hooks/useUser.tsx similarity index 96% rename from app/portainer/hooks/useUser.tsx rename to app/react/hooks/useUser.tsx index 9c9d8517c..97e6ad06b 100644 --- a/app/portainer/hooks/useUser.tsx +++ b/app/react/hooks/useUser.tsx @@ -12,9 +12,8 @@ import { import { isAdmin } from '@/portainer/users/user.helpers'; import { EnvironmentId } from '@/react/portainer/environments/types'; - -import { getUser } from '../users/user.service'; -import { User, UserId } from '../users/types'; +import { getUser } from '@/portainer/users/user.service'; +import { User, UserId } from '@/portainer/users/types'; import { useLocalStorage } from './useLocalStorage'; diff --git a/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/datatable-store.ts b/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/datatable-store.ts index ef4064d1a..ee4ac76c1 100644 --- a/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/datatable-store.ts +++ b/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/datatable-store.ts @@ -1,7 +1,7 @@ import create from 'zustand'; import { persist } from 'zustand/middleware'; -import { keyBuilder } from '@/portainer/hooks/useLocalStorage'; +import { keyBuilder } from '@/react/hooks/useLocalStorage'; import { paginationSettings, sortableSettings, diff --git a/app/react/kubernetes/ingresses/CreateIngressView/CreateIngressView.tsx b/app/react/kubernetes/ingresses/CreateIngressView/CreateIngressView.tsx index 90622d189..5426b423d 100644 --- a/app/react/kubernetes/ingresses/CreateIngressView/CreateIngressView.tsx +++ b/app/react/kubernetes/ingresses/CreateIngressView/CreateIngressView.tsx @@ -2,7 +2,7 @@ import { useState, useEffect, useMemo, ReactNode } from 'react'; import { useCurrentStateAndParams, useRouter } from '@uirouter/react'; import { v4 as uuidv4 } from 'uuid'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { useConfigurations } from '@/react/kubernetes/configs/queries'; import { useNamespaces } from '@/react/kubernetes/namespaces/queries'; import { useServices } from '@/react/kubernetes/networks/services/queries'; diff --git a/app/react/kubernetes/ingresses/IngressDatatable/IngressDataTable.tsx b/app/react/kubernetes/ingresses/IngressDatatable/IngressDataTable.tsx index f4f201873..901714a88 100644 --- a/app/react/kubernetes/ingresses/IngressDatatable/IngressDataTable.tsx +++ b/app/react/kubernetes/ingresses/IngressDatatable/IngressDataTable.tsx @@ -1,9 +1,9 @@ import { Plus, Trash2 } from 'react-feather'; import { useRouter } from '@uirouter/react'; -import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; +import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { useNamespaces } from '@/react/kubernetes/namespaces/queries'; -import { useAuthorizations, Authorized } from '@/portainer/hooks/useUser'; +import { useAuthorizations, Authorized } from '@/react/hooks/useUser'; import { confirmDeletionAsync } from '@/portainer/services/modal.service/confirm'; import { Datatable } from '@@/datatables'; diff --git a/app/react/kubernetes/ingresses/IngressDatatable/columns/name.tsx b/app/react/kubernetes/ingresses/IngressDatatable/columns/name.tsx index f816c38bc..69dff5771 100644 --- a/app/react/kubernetes/ingresses/IngressDatatable/columns/name.tsx +++ b/app/react/kubernetes/ingresses/IngressDatatable/columns/name.tsx @@ -1,6 +1,6 @@ import { CellProps, Column } from 'react-table'; -import { Authorized } from '@/portainer/hooks/useUser'; +import { Authorized } from '@/react/hooks/useUser'; import { Link } from '@@/Link'; diff --git a/app/react/kubernetes/ingresses/IngressDatatable/datatable-store.ts b/app/react/kubernetes/ingresses/IngressDatatable/datatable-store.ts index 5f5384eed..a90b92fe4 100644 --- a/app/react/kubernetes/ingresses/IngressDatatable/datatable-store.ts +++ b/app/react/kubernetes/ingresses/IngressDatatable/datatable-store.ts @@ -1,7 +1,7 @@ import create from 'zustand'; import { persist } from 'zustand/middleware'; -import { keyBuilder } from '@/portainer/hooks/useLocalStorage'; +import { keyBuilder } from '@/react/hooks/useLocalStorage'; import { paginationSettings, sortableSettings, diff --git a/app/react/portainer/HomeView/.keep b/app/react/portainer/HomeView/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/portainer/home/BackupFailedPanel.test.tsx b/app/react/portainer/HomeView/BackupFailedPanel.test.tsx similarity index 100% rename from app/portainer/home/BackupFailedPanel.test.tsx rename to app/react/portainer/HomeView/BackupFailedPanel.test.tsx diff --git a/app/portainer/home/BackupFailedPanel.tsx b/app/react/portainer/HomeView/BackupFailedPanel.tsx similarity index 89% rename from app/portainer/home/BackupFailedPanel.tsx rename to app/react/portainer/HomeView/BackupFailedPanel.tsx index a30f3662e..a187bd0d9 100644 --- a/app/portainer/home/BackupFailedPanel.tsx +++ b/app/react/portainer/HomeView/BackupFailedPanel.tsx @@ -1,14 +1,13 @@ import { useQuery } from 'react-query'; import { error as notifyError } from '@/portainer/services/notifications'; +import { getBackupStatus } from '@/portainer/services/api/backup.service'; +import { isoDate } from '@/portainer/filters/filters'; import { InformationPanel } from '@@/InformationPanel'; import { TextTip } from '@@/Tip/TextTip'; import { Link } from '@@/Link'; -import { getBackupStatus } from '../services/api/backup.service'; -import { isoDate } from '../filters/filters'; - export function BackupFailedPanel() { const { status, isLoading } = useBackupStatus(); diff --git a/app/portainer/home/EdgeLoadingSpinner.module.css b/app/react/portainer/HomeView/EdgeLoadingSpinner.module.css similarity index 100% rename from app/portainer/home/EdgeLoadingSpinner.module.css rename to app/react/portainer/HomeView/EdgeLoadingSpinner.module.css diff --git a/app/portainer/home/EdgeLoadingSpinner.tsx b/app/react/portainer/HomeView/EdgeLoadingSpinner.tsx similarity index 100% rename from app/portainer/home/EdgeLoadingSpinner.tsx rename to app/react/portainer/HomeView/EdgeLoadingSpinner.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/AgentVersionTag.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/AgentVersionTag.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/AgentVersionTag.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/AgentVersionTag.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentIcon.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentIcon.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentIcon.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentIcon.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.module.css b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.module.css similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.module.css rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.module.css diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.stories.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.stories.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.stories.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.stories.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.test.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.test.tsx similarity index 92% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.test.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.test.tsx index 3fb17b7af..11bae48f2 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.test.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.test.tsx @@ -1,9 +1,9 @@ import { EnvironmentGroup, EnvironmentGroupId, -} from '@/portainer/environment-groups/types'; +} from '@/react/portainer/environments/environment-groups/types'; import { Environment } from '@/react/portainer/environments/types'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { Tag } from '@/portainer/tags/types'; import { createMockEnvironment } from '@/react-tools/test-mocks'; diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx similarity index 98% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx index 8215cb1aa..a12253d29 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx @@ -18,14 +18,14 @@ import { } from '@/react/portainer/environments/utils'; import type { TagId } from '@/portainer/tags/types'; import { useTags } from '@/portainer/tags/queries'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { Icon } from '@@/Icon'; import { Link } from '@@/Link'; import { Button } from '@@/buttons'; +import { EdgeIndicator } from '@@/EdgeIndicator'; import { EnvironmentIcon } from './EnvironmentIcon'; -import { EdgeIndicator } from './EdgeIndicator'; import { EnvironmentStats } from './EnvironmentStats'; import styles from './EnvironmentItem.module.css'; import { EnvironmentStatusBadge } from './EnvironmentStatusBadge'; diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStats.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStats.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStats.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStats.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatsDocker.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatsDocker.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatsDocker.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatsDocker.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatsItem.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatsItem.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatsItem.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatsItem.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatsKubernetes.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatsKubernetes.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatsKubernetes.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatsKubernetes.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatusBadge.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatusBadge.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentStatusBadge.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentStatusBadge.tsx diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/index.ts b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/index.ts similarity index 51% rename from app/portainer/home/EnvironmentList/EnvironmentItem/index.ts rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/index.ts index 2f113ae64..86e32a538 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentItem/index.ts +++ b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/index.ts @@ -1,2 +1 @@ export { EnvironmentItem } from './EnvironmentItem'; -export { EdgeIndicator } from './EdgeIndicator'; diff --git a/app/portainer/home/EnvironmentList/EnvironmentList.module.css b/app/react/portainer/HomeView/EnvironmentList/EnvironmentList.module.css similarity index 100% rename from app/portainer/home/EnvironmentList/EnvironmentList.module.css rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentList.module.css diff --git a/app/portainer/home/EnvironmentList/EnvironmentList.test.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentList.test.tsx similarity index 97% rename from app/portainer/home/EnvironmentList/EnvironmentList.test.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentList.test.tsx index 9cdf468d8..98cc458a3 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentList.test.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/EnvironmentList.test.tsx @@ -1,5 +1,5 @@ import { Environment } from '@/react/portainer/environments/types'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { renderWithQueryClient } from '@/react-tools/test-utils'; import { rest, server } from '@/setup-tests/server'; diff --git a/app/portainer/home/EnvironmentList/EnvironmentList.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentList.tsx similarity index 96% rename from app/portainer/home/EnvironmentList/EnvironmentList.tsx rename to app/react/portainer/HomeView/EnvironmentList/EnvironmentList.tsx index 267651189..a216d582a 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentList.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/EnvironmentList.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx'; import { RefreshCcw } from 'react-feather'; import _ from 'lodash'; -import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState'; +import { usePaginationLimitState } from '@/react/hooks/usePaginationLimitState'; import { Environment, EnvironmentType, @@ -11,26 +11,20 @@ import { PlatformType, EdgeTypes, } from '@/react/portainer/environments/types'; -import { EnvironmentGroupId } from '@/portainer/environment-groups/types'; -import { - HomepageFilter, - useHomePageFilter, -} from '@/portainer/home/HomepageFilter'; -import { useDebounce } from '@/portainer/hooks/useDebounce'; +import { EnvironmentGroupId } from '@/react/portainer/environments/environment-groups/types'; +import { useDebounce } from '@/react/hooks/useDebounce'; import { refetchIfAnyOffline, useEnvironmentList, } from '@/react/portainer/environments/queries/useEnvironmentList'; -import { useGroups } from '@/portainer/environment-groups/queries'; +import { useGroups } from '@/react/portainer/environments/environment-groups/queries'; import { useTags } from '@/portainer/tags/queries'; -import { Filter } from '@/portainer/home/types'; import { useAgentVersionsList } from '@/react/portainer/environments/queries/useAgentVersionsList'; import { EnvironmentsQueryParams } from '@/react/portainer/environments/environment.service'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { TableFooter } from '@@/datatables/TableFooter'; import { TableActions, TableContainer, TableTitle } from '@@/datatables'; -import { SortbySelector } from '@@/datatables/SortbySelector'; import { FilterSearchBar, useSearchBarState, @@ -38,6 +32,9 @@ import { import { Button } from '@@/buttons'; import { PaginationControls } from '@@/PaginationControls'; +import { SortbySelector } from './SortbySelector'; +import { HomepageFilter, useHomePageFilter } from './HomepageFilter'; +import { Filter } from './types'; import { EnvironmentItem } from './EnvironmentItem'; import { KubeconfigButton } from './KubeconfigButton'; import { NoEnvironmentsInfoPanel } from './NoEnvironmentsInfoPanel'; diff --git a/app/portainer/home/HomepageFilter.tsx b/app/react/portainer/HomeView/EnvironmentList/HomepageFilter.tsx similarity index 92% rename from app/portainer/home/HomepageFilter.tsx rename to app/react/portainer/HomeView/EnvironmentList/HomepageFilter.tsx index 0b5811104..779b0a0a6 100644 --- a/app/portainer/home/HomepageFilter.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/HomepageFilter.tsx @@ -1,10 +1,11 @@ import { components, OptionProps } from 'react-select'; -import { useLocalStorage } from '@/portainer/hooks/useLocalStorage'; -import { Filter } from '@/portainer/home/types'; +import { useLocalStorage } from '@/react/hooks/useLocalStorage'; import { Select } from '@@/form-components/ReactSelect'; +import { Filter } from './types'; + interface Props { filterOptions?: Filter[]; onChange: (filterOptions: Filter[]) => void; diff --git a/app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigButton.tsx b/app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigButton.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigButton.tsx rename to app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigButton.tsx diff --git a/app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigPrompt.module.css b/app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigPrompt.module.css similarity index 100% rename from app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigPrompt.module.css rename to app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigPrompt.module.css diff --git a/app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigPrompt.tsx b/app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigPrompt.tsx similarity index 98% rename from app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigPrompt.tsx rename to app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigPrompt.tsx index 0411d9f7f..d1b1c2eeb 100644 --- a/app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigPrompt.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigPrompt.tsx @@ -6,7 +6,7 @@ import { DialogOverlay } from '@reach/dialog'; import { downloadKubeconfigFile } from '@/react/kubernetes/services/kubeconfig.service'; import * as notifications from '@/portainer/services/notifications'; import { EnvironmentType } from '@/react/portainer/environments/types'; -import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState'; +import { usePaginationLimitState } from '@/react/hooks/usePaginationLimitState'; import { usePublicSettings } from '@/react/portainer/settings/queries'; import { Query, diff --git a/app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigSelection.ts b/app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigSelection.ts similarity index 100% rename from app/portainer/home/EnvironmentList/KubeconfigButton/KubeconfigSelection.ts rename to app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/KubeconfigSelection.ts diff --git a/app/portainer/home/EnvironmentList/KubeconfigButton/index.ts b/app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/index.ts similarity index 100% rename from app/portainer/home/EnvironmentList/KubeconfigButton/index.ts rename to app/react/portainer/HomeView/EnvironmentList/KubeconfigButton/index.ts diff --git a/app/portainer/home/EnvironmentList/NoEnvironmentsInfoPanel.tsx b/app/react/portainer/HomeView/EnvironmentList/NoEnvironmentsInfoPanel.tsx similarity index 100% rename from app/portainer/home/EnvironmentList/NoEnvironmentsInfoPanel.tsx rename to app/react/portainer/HomeView/EnvironmentList/NoEnvironmentsInfoPanel.tsx diff --git a/app/react/components/datatables/SortbySelector.module.css b/app/react/portainer/HomeView/EnvironmentList/SortbySelector.module.css similarity index 100% rename from app/react/components/datatables/SortbySelector.module.css rename to app/react/portainer/HomeView/EnvironmentList/SortbySelector.module.css diff --git a/app/react/components/datatables/SortbySelector.tsx b/app/react/portainer/HomeView/EnvironmentList/SortbySelector.tsx similarity index 96% rename from app/react/components/datatables/SortbySelector.tsx rename to app/react/portainer/HomeView/EnvironmentList/SortbySelector.tsx index 60848cbd2..b644a7506 100644 --- a/app/react/components/datatables/SortbySelector.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/SortbySelector.tsx @@ -1,9 +1,8 @@ import { useEffect, useState } from 'react'; -import { Filter } from '@/portainer/home/types'; - import { Select } from '@@/form-components/ReactSelect'; +import { Filter } from './types'; import styles from './SortbySelector.module.css'; interface Props { diff --git a/app/portainer/home/EnvironmentList/index.ts b/app/react/portainer/HomeView/EnvironmentList/index.ts similarity index 100% rename from app/portainer/home/EnvironmentList/index.ts rename to app/react/portainer/HomeView/EnvironmentList/index.ts diff --git a/app/react/portainer/HomeView/EnvironmentList/types.ts b/app/react/portainer/HomeView/EnvironmentList/types.ts new file mode 100644 index 000000000..755ef9247 --- /dev/null +++ b/app/react/portainer/HomeView/EnvironmentList/types.ts @@ -0,0 +1,4 @@ +export interface Filter { + value: T; + label: string; +} diff --git a/app/portainer/home/HomeView.tsx b/app/react/portainer/HomeView/HomeView.tsx similarity index 91% rename from app/portainer/home/HomeView.tsx rename to app/react/portainer/HomeView/HomeView.tsx index d1e656f56..4bef996ab 100644 --- a/app/portainer/home/HomeView.tsx +++ b/app/react/portainer/HomeView/HomeView.tsx @@ -4,13 +4,12 @@ import { useState } from 'react'; import { Environment } from '@/react/portainer/environments/types'; import { snapshotEndpoints } from '@/react/portainer/environments/environment.service'; import { isEdgeEnvironment } from '@/react/portainer/environments/utils'; +import * as notifications from '@/portainer/services/notifications'; +import { confirmAsync } from '@/portainer/services/modal.service/confirm'; +import { buildTitle } from '@/portainer/services/modal.service/utils'; import { PageHeader } from '@@/PageHeader'; -import * as notifications from '../services/notifications'; -import { confirmAsync } from '../services/modal.service/confirm'; -import { buildTitle } from '../services/modal.service/utils'; - import { EnvironmentList } from './EnvironmentList'; import { EdgeLoadingSpinner } from './EdgeLoadingSpinner'; import { MotdPanel } from './MotdPanel'; diff --git a/app/portainer/home/LicenseNodePanel.test.tsx b/app/react/portainer/HomeView/LicenseNodePanel.test.tsx similarity index 95% rename from app/portainer/home/LicenseNodePanel.test.tsx rename to app/react/portainer/HomeView/LicenseNodePanel.test.tsx index 3878f99e3..ecff5594f 100644 --- a/app/portainer/home/LicenseNodePanel.test.tsx +++ b/app/react/portainer/HomeView/LicenseNodePanel.test.tsx @@ -1,7 +1,6 @@ import { server, rest } from '@/setup-tests/server'; import { renderWithQueryClient } from '@/react-tools/test-utils'; - -import { LicenseType } from '../license-management/types'; +import { LicenseType } from '@/portainer/license-management/types'; import { LicenseNodePanel } from './LicenseNodePanel'; diff --git a/app/portainer/home/LicenseNodePanel.tsx b/app/react/portainer/HomeView/LicenseNodePanel.tsx similarity index 84% rename from app/portainer/home/LicenseNodePanel.tsx rename to app/react/portainer/HomeView/LicenseNodePanel.tsx index 9acc766ec..b801102f8 100644 --- a/app/portainer/home/LicenseNodePanel.tsx +++ b/app/react/portainer/HomeView/LicenseNodePanel.tsx @@ -1,13 +1,12 @@ import { useQuery } from 'react-query'; import { error as notifyError } from '@/portainer/services/notifications'; +import { LicenseType } from '@/portainer/license-management/types'; +import { useLicenseInfo } from '@/portainer/license-management/use-license.service'; +import { getNodesCount } from '@/portainer/services/api/status.service'; -import { InformationPanel } from '@@/InformationPanel'; import { TextTip } from '@@/Tip/TextTip'; - -import { LicenseType } from '../license-management/types'; -import { useLicenseInfo } from '../license-management/use-license.service'; -import { getNodesCount } from '../services/api/status.service'; +import { InformationPanel } from '@@/InformationPanel'; export function LicenseNodePanel() { const nodesValid = useNodesValid(); diff --git a/app/portainer/home/MotdPanel.tsx b/app/react/portainer/HomeView/MotdPanel.tsx similarity index 95% rename from app/portainer/home/MotdPanel.tsx rename to app/react/portainer/HomeView/MotdPanel.tsx index 83198e514..21f837f65 100644 --- a/app/portainer/home/MotdPanel.tsx +++ b/app/react/portainer/HomeView/MotdPanel.tsx @@ -1,7 +1,7 @@ import { useQuery } from 'react-query'; import _ from 'lodash'; -import { useUIState } from '@/portainer/hooks/useUIState'; +import { useUIState } from '@/react/hooks/useUIState'; import { InformationPanel } from '@@/InformationPanel'; diff --git a/app/portainer/home/home.service.ts b/app/react/portainer/HomeView/home.service.ts similarity index 79% rename from app/portainer/home/home.service.ts rename to app/react/portainer/HomeView/home.service.ts index 41eaa8c20..bcb5138a0 100644 --- a/app/portainer/home/home.service.ts +++ b/app/react/portainer/HomeView/home.service.ts @@ -1,4 +1,4 @@ -import axios, { parseAxiosError } from '../services/axios'; +import axios, { parseAxiosError } from '@/portainer/services/axios'; import { Motd } from './types'; diff --git a/app/portainer/home/index.ts b/app/react/portainer/HomeView/index.ts similarity index 100% rename from app/portainer/home/index.ts rename to app/react/portainer/HomeView/index.ts diff --git a/app/portainer/home/types.ts b/app/react/portainer/HomeView/types.ts similarity index 66% rename from app/portainer/home/types.ts rename to app/react/portainer/HomeView/types.ts index 3bc8cb401..b18b96981 100644 --- a/app/portainer/home/types.ts +++ b/app/react/portainer/HomeView/types.ts @@ -5,8 +5,3 @@ export interface Motd { Style?: string; ContentLayout?: Record; } - -export interface Filter { - value: T; - label: string; -} diff --git a/app/react/portainer/access-control/AccessControlForm/AccessControlForm.stories.tsx b/app/react/portainer/access-control/AccessControlForm/AccessControlForm.stories.tsx index 726fba1dc..4606e795b 100644 --- a/app/react/portainer/access-control/AccessControlForm/AccessControlForm.stories.tsx +++ b/app/react/portainer/access-control/AccessControlForm/AccessControlForm.stories.tsx @@ -2,7 +2,7 @@ import { Meta, Story } from '@storybook/react'; import { useMemo, useState } from 'react'; import { QueryClient, QueryClientProvider } from 'react-query'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { parseAccessControlFormData } from '../utils'; diff --git a/app/react/portainer/access-control/AccessControlForm/AccessControlForm.test.tsx b/app/react/portainer/access-control/AccessControlForm/AccessControlForm.test.tsx index 0775d8999..8ace6514f 100644 --- a/app/react/portainer/access-control/AccessControlForm/AccessControlForm.test.tsx +++ b/app/react/portainer/access-control/AccessControlForm/AccessControlForm.test.tsx @@ -1,5 +1,5 @@ import { server, rest } from '@/setup-tests/server'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { renderWithQueryClient, within } from '@/react-tools/test-utils'; import { Team, TeamId } from '@/react/portainer/users/teams/types'; diff --git a/app/react/portainer/access-control/AccessControlForm/AccessControlForm.tsx b/app/react/portainer/access-control/AccessControlForm/AccessControlForm.tsx index 41e502457..a70c57806 100644 --- a/app/react/portainer/access-control/AccessControlForm/AccessControlForm.tsx +++ b/app/react/portainer/access-control/AccessControlForm/AccessControlForm.tsx @@ -1,6 +1,6 @@ import { FormikErrors } from 'formik'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; import { SwitchField } from '@@/form-components/SwitchField'; diff --git a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx index 3742dd426..b62dcdb20 100644 --- a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx +++ b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx @@ -1,6 +1,6 @@ import { useReducer } from 'react'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { Icon } from '@/react/components/Icon'; import { TeamMembership, TeamRole } from '@/react/portainer/users/teams/types'; import { useUserMembership } from '@/portainer/users/queries'; diff --git a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx index de6b64af4..db26cf040 100644 --- a/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx +++ b/app/react/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx'; import { useMutation } from 'react-query'; import { object } from 'yup'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { confirmAsync } from '@/portainer/services/modal.service/confirm'; import { notifySuccess } from '@/portainer/services/notifications'; import { EnvironmentId } from '@/react/portainer/environments/types'; diff --git a/app/react/portainer/access-control/EditDetails/EditDetails.tsx b/app/react/portainer/access-control/EditDetails/EditDetails.tsx index 18fb4d3a1..0bb725286 100644 --- a/app/react/portainer/access-control/EditDetails/EditDetails.tsx +++ b/app/react/portainer/access-control/EditDetails/EditDetails.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react'; import { FormikErrors } from 'formik'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { EnvironmentId } from '@/react/portainer/environments/types'; import { BoxSelector } from '@@/BoxSelector'; diff --git a/app/portainer/environment-groups/environment-groups.service.ts b/app/react/portainer/environments/environment-groups/environment-groups.service.ts similarity index 90% rename from app/portainer/environment-groups/environment-groups.service.ts rename to app/react/portainer/environments/environment-groups/environment-groups.service.ts index a0c664cf9..12dd97e6b 100644 --- a/app/portainer/environment-groups/environment-groups.service.ts +++ b/app/react/portainer/environments/environment-groups/environment-groups.service.ts @@ -1,4 +1,4 @@ -import axios, { parseAxiosError } from '../services/axios'; +import axios, { parseAxiosError } from '@/portainer/services/axios'; import { EnvironmentGroup, EnvironmentGroupId } from './types'; diff --git a/app/portainer/environment-groups/queries.ts b/app/react/portainer/environments/environment-groups/queries.ts similarity index 100% rename from app/portainer/environment-groups/queries.ts rename to app/react/portainer/environments/environment-groups/queries.ts diff --git a/app/portainer/environment-groups/types.ts b/app/react/portainer/environments/environment-groups/types.ts similarity index 100% rename from app/portainer/environment-groups/types.ts rename to app/react/portainer/environments/environment-groups/types.ts diff --git a/app/react/portainer/environments/environment.service/create.ts b/app/react/portainer/environments/environment.service/create.ts index d11f4cc33..f565be622 100644 --- a/app/react/portainer/environments/environment.service/create.ts +++ b/app/react/portainer/environments/environment.service/create.ts @@ -1,6 +1,6 @@ import { Gpu } from '@/react/portainer/environments/wizard/EnvironmentsCreationView/shared/Hardware/GpusList'; import axios, { parseAxiosError } from '@/portainer/services/axios'; -import { type EnvironmentGroupId } from '@/portainer/environment-groups/types'; +import { type EnvironmentGroupId } from '@/react/portainer/environments/environment-groups/types'; import { type TagId } from '@/portainer/tags/types'; import { type Environment, EnvironmentCreationTypes } from '../types'; diff --git a/app/react/portainer/environments/environment.service/index.ts b/app/react/portainer/environments/environment.service/index.ts index b5e6030cc..f9ae49365 100644 --- a/app/react/portainer/environments/environment.service/index.ts +++ b/app/react/portainer/environments/environment.service/index.ts @@ -1,5 +1,5 @@ import axios, { parseAxiosError } from '@/portainer/services/axios'; -import { type EnvironmentGroupId } from '@/portainer/environment-groups/types'; +import { type EnvironmentGroupId } from '@/react/portainer/environments/environment-groups/types'; import { type TagId } from '@/portainer/tags/types'; import { UserId } from '@/portainer/users/types'; import { TeamId } from '@/react/portainer/users/teams/types'; diff --git a/app/react/portainer/environments/types.ts b/app/react/portainer/environments/types.ts index 44aa83292..a30d254ca 100644 --- a/app/react/portainer/environments/types.ts +++ b/app/react/portainer/environments/types.ts @@ -1,5 +1,5 @@ import { TagId } from '@/portainer/tags/types'; -import { EnvironmentGroupId } from '@/portainer/environment-groups/types'; +import { EnvironmentGroupId } from '@/react/portainer/environments/environment-groups/types'; export type EnvironmentId = number; diff --git a/app/react/portainer/environments/update-schedules/CreateView/CreateView.tsx b/app/react/portainer/environments/update-schedules/CreateView/CreateView.tsx index f6a0a03ea..4286f2188 100644 --- a/app/react/portainer/environments/update-schedules/CreateView/CreateView.tsx +++ b/app/react/portainer/environments/update-schedules/CreateView/CreateView.tsx @@ -6,7 +6,7 @@ import { notifySuccess } from '@/portainer/services/notifications'; import { useRedirectFeatureFlag, FeatureFlag, -} from '@/portainer/feature-flags/useRedirectFeatureFlag'; +} from '@/react/portainer/feature-flags/useRedirectFeatureFlag'; import { PageHeader } from '@@/PageHeader'; import { Widget } from '@@/Widget'; diff --git a/app/react/portainer/environments/update-schedules/ItemView/ItemView.tsx b/app/react/portainer/environments/update-schedules/ItemView/ItemView.tsx index 3d0fca091..1c5d71a6e 100644 --- a/app/react/portainer/environments/update-schedules/ItemView/ItemView.tsx +++ b/app/react/portainer/environments/update-schedules/ItemView/ItemView.tsx @@ -8,7 +8,7 @@ import { notifySuccess } from '@/portainer/services/notifications'; import { useRedirectFeatureFlag, FeatureFlag, -} from '@/portainer/feature-flags/useRedirectFeatureFlag'; +} from '@/react/portainer/feature-flags/useRedirectFeatureFlag'; import { PageHeader } from '@@/PageHeader'; import { Widget } from '@@/Widget'; diff --git a/app/react/portainer/environments/update-schedules/ListView/ListView.tsx b/app/react/portainer/environments/update-schedules/ListView/ListView.tsx index c57416aac..7017c8fd6 100644 --- a/app/react/portainer/environments/update-schedules/ListView/ListView.tsx +++ b/app/react/portainer/environments/update-schedules/ListView/ListView.tsx @@ -3,7 +3,7 @@ import { Clock, Trash2 } from 'react-feather'; import { FeatureFlag, useRedirectFeatureFlag, -} from '@/portainer/feature-flags/useRedirectFeatureFlag'; +} from '@/react/portainer/feature-flags/useRedirectFeatureFlag'; import { notifySuccess } from '@/portainer/services/notifications'; import { confirmDeletionAsync } from '@/portainer/services/modal.service/confirm'; diff --git a/app/react/portainer/environments/update-schedules/ListView/datatable-store.ts b/app/react/portainer/environments/update-schedules/ListView/datatable-store.ts index 4a07d742e..e56959605 100644 --- a/app/react/portainer/environments/update-schedules/ListView/datatable-store.ts +++ b/app/react/portainer/environments/update-schedules/ListView/datatable-store.ts @@ -1,7 +1,7 @@ import create from 'zustand'; import { persist } from 'zustand/middleware'; -import { keyBuilder } from '@/portainer/hooks/useLocalStorage'; +import { keyBuilder } from '@/react/hooks/useLocalStorage'; import { paginationSettings, sortableSettings, diff --git a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/environment-types.ts b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/environment-types.ts index dd6f13d36..47d0abc01 100644 --- a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/environment-types.ts +++ b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/environment-types.ts @@ -1,4 +1,4 @@ -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import KaaSIcon from './kaas-icon.svg?c'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/TLSFieldset.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/TLSFieldset.tsx index 96a03b9a6..8217a526e 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/TLSFieldset.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/TLSFieldset.tsx @@ -1,7 +1,6 @@ import { useFormikContext } from 'formik'; -import { file, withFileSize } from '@/portainer/helpers/yup-file-validation'; - +import { file, withFileSize } from '@@/form-components/yup-file-validation'; import { FileUploadField } from '@@/form-components/FileUpload'; import { SwitchField } from '@@/form-components/SwitchField'; import { FormControl } from '@@/form-components/FormControl'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx index 60d5c57bb..8132f07df 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx @@ -6,7 +6,6 @@ import { stripProtocol, } from '@/portainer/filters/filters'; import { EnvironmentId } from '@/react/portainer/environments/types'; -import { EdgeIndicator } from '@/portainer/home/EnvironmentList/EnvironmentItem'; import { isEdgeEnvironment, isUnassociatedEdgeEnvironment, @@ -16,6 +15,7 @@ import { useEnvironmentList, } from '@/react/portainer/environments/queries/useEnvironmentList'; +import { EdgeIndicator } from '@@/EdgeIndicator'; import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; import styles from './WizardEndpointsList.module.css'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx index 44c0b99df..8442c7f3a 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx @@ -5,7 +5,7 @@ import { EnvironmentCreationTypes, } from '@/react/portainer/environments/types'; import { commandsTabs } from '@/react/edge/components/EdgeScriptForm/scripts'; -import { FeatureId } from '@/portainer/feature-flags/enums'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; import { BoxSelectorOption } from '@@/BoxSelector/types'; import { BoxSelector } from '@@/BoxSelector'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/GroupsField.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/GroupsField.tsx index 5d8d5d826..6dff2a13b 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/GroupsField.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/GroupsField.tsx @@ -1,7 +1,7 @@ import { useField } from 'formik'; -import { useGroups } from '@/portainer/environment-groups/queries'; -import { EnvironmentGroupId } from '@/portainer/environment-groups/types'; +import { useGroups } from '@/react/portainer/environments/environment-groups/queries'; +import { EnvironmentGroupId } from '@/react/portainer/environments/environment-groups/types'; import { FormControl } from '@@/form-components/FormControl'; import { Select } from '@@/form-components/Input'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/MetadataFieldset.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/MetadataFieldset.tsx index cef7e2b3e..117955fdc 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/MetadataFieldset.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/MetadataFieldset.tsx @@ -1,6 +1,6 @@ import { useField } from 'formik'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { TagSelector } from '@@/TagSelector'; import { FormSection } from '@@/form-components/FormSection'; diff --git a/app/react/portainer/environments/wizard/components/Option/Option.tsx b/app/react/portainer/environments/wizard/components/Option/Option.tsx index f9c1c8293..97f5aff2f 100644 --- a/app/react/portainer/environments/wizard/components/Option/Option.tsx +++ b/app/react/portainer/environments/wizard/components/Option/Option.tsx @@ -1,8 +1,8 @@ import clsx from 'clsx'; import { ComponentType } from 'react'; -import { FeatureId } from '@/portainer/feature-flags/enums'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { BEFeatureIndicator } from '@@/BEFeatureIndicator'; diff --git a/app/portainer/feature-flags/enums.ts b/app/react/portainer/feature-flags/enums.ts similarity index 100% rename from app/portainer/feature-flags/enums.ts rename to app/react/portainer/feature-flags/enums.ts diff --git a/app/portainer/feature-flags/feature-flags.css b/app/react/portainer/feature-flags/feature-flags.css similarity index 96% rename from app/portainer/feature-flags/feature-flags.css rename to app/react/portainer/feature-flags/feature-flags.css index 464f680ac..ad395d581 100644 --- a/app/portainer/feature-flags/feature-flags.css +++ b/app/react/portainer/feature-flags/feature-flags.css @@ -63,7 +63,7 @@ div.limited-be { } .overlay { - background-image: url(../../assets/ico/lock.svg); + background-image: url(~@/assets/ico/lock.svg); background-repeat: no-repeat; background-position: center; } diff --git a/app/portainer/feature-flags/feature-flags.service.ts b/app/react/portainer/feature-flags/feature-flags.service.ts similarity index 100% rename from app/portainer/feature-flags/feature-flags.service.ts rename to app/react/portainer/feature-flags/feature-flags.service.ts diff --git a/app/portainer/feature-flags/feature-ids.js b/app/react/portainer/feature-flags/feature-ids.js similarity index 100% rename from app/portainer/feature-flags/feature-ids.js rename to app/react/portainer/feature-flags/feature-ids.js diff --git a/app/portainer/feature-flags/index.ts b/app/react/portainer/feature-flags/index.ts similarity index 100% rename from app/portainer/feature-flags/index.ts rename to app/react/portainer/feature-flags/index.ts diff --git a/app/portainer/feature-flags/limited-feature.directive.ts b/app/react/portainer/feature-flags/limited-feature.directive.ts similarity index 93% rename from app/portainer/feature-flags/limited-feature.directive.ts rename to app/react/portainer/feature-flags/limited-feature.directive.ts index df823fb89..bed534ab1 100644 --- a/app/portainer/feature-flags/limited-feature.directive.ts +++ b/app/react/portainer/feature-flags/limited-feature.directive.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { IAttributes, IDirective, IScope } from 'angular'; -import { FeatureState } from '@/portainer/feature-flags/enums'; +import { FeatureState } from '@/react/portainer/feature-flags/enums'; import { selectShow } from './feature-flags.service'; diff --git a/app/portainer/feature-flags/useRedirectFeatureFlag.ts b/app/react/portainer/feature-flags/useRedirectFeatureFlag.ts similarity index 100% rename from app/portainer/feature-flags/useRedirectFeatureFlag.ts rename to app/react/portainer/feature-flags/useRedirectFeatureFlag.ts diff --git a/app/react/portainer/notifications/NotificationsView.tsx b/app/react/portainer/notifications/NotificationsView.tsx index 90dca55b0..c8f038e2f 100644 --- a/app/react/portainer/notifications/NotificationsView.tsx +++ b/app/react/portainer/notifications/NotificationsView.tsx @@ -4,7 +4,7 @@ import { useCurrentStateAndParams } from '@uirouter/react'; import { withCurrentUser } from '@/react-tools/withCurrentUser'; import { react2angular } from '@/react-tools/react2angular'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { withUIRouter } from '@/react-tools/withUIRouter'; import { withReactQuery } from '@/react-tools/withReactQuery'; diff --git a/app/react/portainer/notifications/datatable-store.ts b/app/react/portainer/notifications/datatable-store.ts index d0e0e4c81..6290f52c6 100644 --- a/app/react/portainer/notifications/datatable-store.ts +++ b/app/react/portainer/notifications/datatable-store.ts @@ -1,7 +1,7 @@ import create from 'zustand'; import { persist } from 'zustand/middleware'; -import { keyBuilder } from '@/portainer/hooks/useLocalStorage'; +import { keyBuilder } from '@/react/hooks/useLocalStorage'; import { paginationSettings, sortableSettings, diff --git a/app/react/portainer/notifications/notifications-store.ts b/app/react/portainer/notifications/notifications-store.ts index ef9a75c4a..62c6aa064 100644 --- a/app/react/portainer/notifications/notifications-store.ts +++ b/app/react/portainer/notifications/notifications-store.ts @@ -1,7 +1,7 @@ import create from 'zustand/vanilla'; import { persist } from 'zustand/middleware'; -import { keyBuilder } from '@/portainer/hooks/useLocalStorage'; +import { keyBuilder } from '@/react/hooks/useLocalStorage'; import { ToastNotification } from './types'; diff --git a/app/react/portainer/registries/ListView/DefaultRegistry/DefaultRegistryAction.tsx b/app/react/portainer/registries/ListView/DefaultRegistry/DefaultRegistryAction.tsx index 8f76b49ee..5222f36bb 100644 --- a/app/react/portainer/registries/ListView/DefaultRegistry/DefaultRegistryAction.tsx +++ b/app/react/portainer/registries/ListView/DefaultRegistry/DefaultRegistryAction.tsx @@ -1,8 +1,8 @@ import { Eye, EyeOff } from 'react-feather'; import { notifySuccess } from '@/portainer/services/notifications'; -import { FeatureId } from '@/portainer/feature-flags/enums'; -import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { FeatureId } from '@/react/portainer/feature-flags/enums'; +import { isLimitedToBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { usePublicSettings, useUpdateDefaultRegistrySettingsMutation, diff --git a/app/react/portainer/users/teams/ItemView/ItemView.tsx b/app/react/portainer/users/teams/ItemView/ItemView.tsx index 712346a73..71221cc12 100644 --- a/app/react/portainer/users/teams/ItemView/ItemView.tsx +++ b/app/react/portainer/users/teams/ItemView/ItemView.tsx @@ -1,7 +1,7 @@ import { useRouter } from '@uirouter/react'; import { useUsers } from '@/portainer/users/queries'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { usePublicSettings } from '@/react/portainer/settings/queries'; import { TextTip } from '@@/Tip/TextTip'; diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.stories.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.stories.tsx index e6099f206..d4d4142f7 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.stories.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.stories.tsx @@ -4,7 +4,7 @@ import { useMemo, useState } from 'react'; import { createMockUsers } from '@/react-tools/test-mocks'; import { Role, User } from '@/portainer/users/types'; import { UserViewModel } from '@/portainer/models/user'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { TeamMembership, TeamRole } from '../../types'; diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.test.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.test.tsx index c7410dacc..ea84853a2 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.test.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamAssociationSelector.test.tsx @@ -1,4 +1,4 @@ -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { renderWithQueryClient } from '@/react-tools/test-utils'; diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.stories.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.stories.tsx index 0858f56c4..6f2e53f1e 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.stories.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.stories.tsx @@ -1,7 +1,7 @@ import { Meta } from '@storybook/react'; import { useMemo, useState } from 'react'; -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { createMockUsers } from '@/react-tools/test-mocks'; import { UserViewModel } from '@/portainer/models/user'; import { Role } from '@/portainer/users/types'; diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.test.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.test.tsx index 88d67af73..20cdbac85 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.test.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.test.tsx @@ -1,4 +1,4 @@ -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { renderWithQueryClient } from '@/react-tools/test-utils'; diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.tsx index 8cf5257f4..8ee732b34 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/TeamMembersList.tsx @@ -9,7 +9,7 @@ import { Users, UserX } from 'react-feather'; import { User, UserId } from '@/portainer/users/types'; import { TeamId, TeamRole } from '@/react/portainer/users/teams/types'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { notifySuccess } from '@/portainer/services/notifications'; import { useRemoveMemberMutation, diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/team-role-column.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/team-role-column.tsx index e7aad5ea5..e2e05e9e8 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/team-role-column.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/team-role-column.tsx @@ -2,7 +2,7 @@ import { CellProps, Column } from 'react-table'; import { User as UserIcon, UserPlus, UserX } from 'react-feather'; import { User } from '@/portainer/users/types'; -import { useUser as useCurrentUser } from '@/portainer/hooks/useUser'; +import { useUser as useCurrentUser } from '@/react/hooks/useUser'; import { TeamRole } from '@/react/portainer/users/teams/types'; import { notifySuccess } from '@/portainer/services/notifications'; import { diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.test.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.test.tsx index c115fda0e..00cfc1aee 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.test.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.test.tsx @@ -1,4 +1,4 @@ -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { renderWithQueryClient } from '@/react-tools/test-utils'; diff --git a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.tsx b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.tsx index d568e0808..617428c86 100644 --- a/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.tsx +++ b/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/UsersList/UsersList.tsx @@ -8,7 +8,7 @@ import { useMemo, useState } from 'react'; import { UserPlus, Users } from 'react-feather'; import { User, UserId } from '@/portainer/users/types'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { notifySuccess } from '@/portainer/services/notifications'; import { useAddMemberMutation } from '@/react/portainer/users/teams/queries'; import { TeamId } from '@/react/portainer/users/teams/types'; diff --git a/app/react/portainer/users/teams/ListView/ListView.tsx b/app/react/portainer/users/teams/ListView/ListView.tsx index c40c2f0ea..53c9a48bb 100644 --- a/app/react/portainer/users/teams/ListView/ListView.tsx +++ b/app/react/portainer/users/teams/ListView/ListView.tsx @@ -1,5 +1,5 @@ import { useUsers } from '@/portainer/users/queries'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { PageHeader } from '@@/PageHeader'; diff --git a/app/react/sidebar/AzureSidebar/AzureSidebar.test.tsx b/app/react/sidebar/AzureSidebar/AzureSidebar.test.tsx index 4beb383ee..d3df19b0e 100644 --- a/app/react/sidebar/AzureSidebar/AzureSidebar.test.tsx +++ b/app/react/sidebar/AzureSidebar/AzureSidebar.test.tsx @@ -1,4 +1,4 @@ -import { UserContext } from '@/portainer/hooks/useUser'; +import { UserContext } from '@/react/hooks/useUser'; import { UserViewModel } from '@/portainer/models/user'; import { render, within } from '@/react-tools/test-utils'; diff --git a/app/react/sidebar/DockerSidebar.tsx b/app/react/sidebar/DockerSidebar.tsx index 552c4b979..7975fa1ab 100644 --- a/app/react/sidebar/DockerSidebar.tsx +++ b/app/react/sidebar/DockerSidebar.tsx @@ -16,11 +16,7 @@ import { type EnvironmentId, EnvironmentStatus, } from '@/react/portainer/environments/types'; -import { - Authorized, - useUser, - isEnvironmentAdmin, -} from '@/portainer/hooks/useUser'; +import { Authorized, useUser, isEnvironmentAdmin } from '@/react/hooks/useUser'; import { useInfo, useVersion } from '@/docker/services/system.service'; import { SidebarItem } from './SidebarItem'; diff --git a/app/react/sidebar/EnvironmentSidebar.tsx b/app/react/sidebar/EnvironmentSidebar.tsx index febd9a4bf..2f760de14 100644 --- a/app/react/sidebar/EnvironmentSidebar.tsx +++ b/app/react/sidebar/EnvironmentSidebar.tsx @@ -11,7 +11,7 @@ import { } from '@/react/portainer/environments/types'; import { getPlatformType } from '@/react/portainer/environments/utils'; import { useEnvironment } from '@/react/portainer/environments/queries/useEnvironment'; -import { useLocalStorage } from '@/portainer/hooks/useLocalStorage'; +import { useLocalStorage } from '@/react/hooks/useLocalStorage'; import { EndpointProviderInterface } from '@/portainer/services/endpointProvider'; import { getPlatformIcon } from '../portainer/environments/utils/get-platform-icon'; diff --git a/app/react/sidebar/Footer/Footer.tsx b/app/react/sidebar/Footer/Footer.tsx index dd19ce370..f16f43e3b 100644 --- a/app/react/sidebar/Footer/Footer.tsx +++ b/app/react/sidebar/Footer/Footer.tsx @@ -1,7 +1,7 @@ import { PropsWithChildren } from 'react'; import clsx from 'clsx'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { UpdateNotification } from './UpdateNotifications'; import { BuildInfoModalButton } from './BuildInfoModal'; diff --git a/app/react/sidebar/Footer/UpdateNotifications.tsx b/app/react/sidebar/Footer/UpdateNotifications.tsx index 8ba18380c..0f629ce37 100644 --- a/app/react/sidebar/Footer/UpdateNotifications.tsx +++ b/app/react/sidebar/Footer/UpdateNotifications.tsx @@ -2,7 +2,7 @@ import { useQuery } from 'react-query'; import clsx from 'clsx'; import { getVersionStatus } from '@/portainer/services/api/status.service'; -import { useUIState } from '@/portainer/hooks/useUIState'; +import { useUIState } from '@/react/hooks/useUIState'; import { Icon } from '@@/Icon'; diff --git a/app/react/sidebar/Header.tsx b/app/react/sidebar/Header.tsx index a4c82a6bc..849d3154d 100644 --- a/app/react/sidebar/Header.tsx +++ b/app/react/sidebar/Header.tsx @@ -1,7 +1,7 @@ import { ChevronsLeft, ChevronsRight } from 'react-feather'; import clsx from 'clsx'; -import { isBE } from '@/portainer/feature-flags/feature-flags.service'; +import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import smallLogo from '@/assets/ico/logomark.svg'; import { Link } from '@@/Link'; diff --git a/app/react/sidebar/KubernetesSidebar/KubectlShell/KubectlShell.tsx b/app/react/sidebar/KubernetesSidebar/KubectlShell/KubectlShell.tsx index 1915bd703..76074c92f 100644 --- a/app/react/sidebar/KubernetesSidebar/KubectlShell/KubectlShell.tsx +++ b/app/react/sidebar/KubernetesSidebar/KubectlShell/KubectlShell.tsx @@ -10,7 +10,7 @@ import { } from '@/portainer/services/terminal-window'; import { EnvironmentId } from '@/react/portainer/environments/types'; import { error as notifyError } from '@/portainer/services/notifications'; -import { useLocalStorage } from '@/portainer/hooks/useLocalStorage'; +import { useLocalStorage } from '@/react/hooks/useLocalStorage'; import { Icon } from '@@/Icon'; import { Button } from '@@/buttons'; diff --git a/app/react/sidebar/KubernetesSidebar/KubernetesSidebar.tsx b/app/react/sidebar/KubernetesSidebar/KubernetesSidebar.tsx index 5ccec29ca..94af5808c 100644 --- a/app/react/sidebar/KubernetesSidebar/KubernetesSidebar.tsx +++ b/app/react/sidebar/KubernetesSidebar/KubernetesSidebar.tsx @@ -1,7 +1,7 @@ import { Box, Edit, Layers, Lock, Server } from 'react-feather'; import { EnvironmentId } from '@/react/portainer/environments/types'; -import { Authorized } from '@/portainer/hooks/useUser'; +import { Authorized } from '@/react/hooks/useUser'; import Helm from '@/assets/ico/vendor/helm.svg?c'; import Route from '@/assets/ico/route.svg?c'; diff --git a/app/react/sidebar/SettingsSidebar.tsx b/app/react/sidebar/SettingsSidebar.tsx index 974cca075..5758246a3 100644 --- a/app/react/sidebar/SettingsSidebar.tsx +++ b/app/react/sidebar/SettingsSidebar.tsx @@ -12,7 +12,7 @@ import { usePublicSettings } from '@/react/portainer/settings/queries'; import { FeatureFlag, useFeatureFlag, -} from '@/portainer/feature-flags/useRedirectFeatureFlag'; +} from '@/react/portainer/feature-flags/useRedirectFeatureFlag'; import { SidebarItem } from './SidebarItem'; import { SidebarSection } from './SidebarSection'; diff --git a/app/react/sidebar/Sidebar.tsx b/app/react/sidebar/Sidebar.tsx index efb8e9ac7..6d1eb1652 100644 --- a/app/react/sidebar/Sidebar.tsx +++ b/app/react/sidebar/Sidebar.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import { Home } from 'react-feather'; -import { useUser } from '@/portainer/hooks/useUser'; +import { useUser } from '@/react/hooks/useUser'; import { useIsTeamLeader } from '@/portainer/users/queries'; import { usePublicSettings } from '@/react/portainer/settings/queries'; diff --git a/app/react/sidebar/useSidebarState.tsx b/app/react/sidebar/useSidebarState.tsx index 0859b1b87..c7f37f606 100644 --- a/app/react/sidebar/useSidebarState.tsx +++ b/app/react/sidebar/useSidebarState.tsx @@ -12,7 +12,7 @@ import { import angular, { IScope } from 'angular'; import _ from 'lodash'; -import * as storage from '@/portainer/hooks/useLocalStorage'; +import * as storage from '@/react/hooks/useLocalStorage'; // using bootstrap breakpoint - https://getbootstrap.com/docs/5.0/layout/breakpoints/#min-width const mobileWidth = 992; diff --git a/app/setup-tests/server-handlers.ts b/app/setup-tests/server-handlers.ts index 819a025bb..4894637a4 100644 --- a/app/setup-tests/server-handlers.ts +++ b/app/setup-tests/server-handlers.ts @@ -5,7 +5,7 @@ import { LicenseInfo, LicenseType, } from '@/portainer/license-management/types'; -import { EnvironmentGroup } from '@/portainer/environment-groups/types'; +import { EnvironmentGroup } from '@/react/portainer/environments/environment-groups/types'; import { Tag } from '@/portainer/tags/types'; import { StatusResponse } from '@/portainer/services/api/status.service'; import { createMockTeams } from '@/react-tools/test-mocks';