From 18252ab85491f8ef7e034c01b3cc72ca173d3db6 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Fri, 17 Jun 2022 19:18:42 +0300 Subject: [PATCH] refactor(app): move react components to react codebase [EE-3179] (#6971) --- .eslintrc.yml | 17 +++++- .../CreateContainerInstanceForm.tsx | 11 ++-- .../PortsMappingField.tsx | 10 ++-- .../useLoadFormState.ts | 3 +- .../CreateContainerInstanceView.tsx | 5 +- app/azure/Dashboard/DashboardView.tsx | 5 +- .../ContainerQuickActions.tsx | 3 +- .../ContainersDatatable.tsx | 40 ++++++------- .../ContainersDatatableActions.tsx | 5 +- .../ContainersDatatableContainer.tsx | 3 +- .../ContainersDatatableSettings.tsx | 7 ++- .../ContainersDatatable/columns/name.tsx | 3 +- .../columns/quick-actions.tsx | 3 +- .../ContainersDatatable/columns/state.tsx | 3 +- app/docker/containers/types.ts | 3 +- .../networks/edit/NetworkContainersTable.tsx | 9 +-- .../networks/edit/NetworkDetailsTable.tsx | 7 ++- .../networks/edit/NetworkDetailsView.tsx | 3 +- .../networks/edit/NetworkOptionsTable.tsx | 4 +- .../AMTDevicesDatatable.tsx | 10 +--- .../AMTDevicesDatatable/columns/actions.tsx | 5 +- .../EdgeDevicesDatatable.tsx | 25 ++++---- .../EdgeDevicesDatatableActions.tsx | 5 +- .../EdgeDevicesDatatableContainer.tsx | 11 ++-- .../EdgeDevicesDatatableSettings.tsx | 4 +- .../EdgeDevicesDatatable/columns/actions.tsx | 3 +- .../EdgeDevicesDatatable/columns/group.tsx | 3 +- .../EdgeDevicesDatatable/columns/name.tsx | 5 +- .../EdgeDevicesDatatable/types.ts | 2 +- .../EdgeDevicesView/EdgeDevicesView.tsx | 5 +- .../WaitingRoomView/Datatable/Datatable.tsx | 16 +++-- .../WaitingRoomView/Datatable/types.ts | 2 +- .../WaitingRoomView/WaitingRoomView.tsx | 5 +- .../components/EdgeCheckInIntervalField.tsx | 5 +- .../AccessControlForm/AccessControlForm.tsx | 5 +- .../AccessControlPanel/AccessControlPanel.tsx | 5 +- .../AccessControlPanelDetails.tsx | 5 +- .../AccessControlPanelForm.tsx | 5 +- .../EditDetails/EditDetails.tsx | 5 +- .../access-control/EditDetails/TeamsField.tsx | 7 ++- .../access-control/EditDetails/UsersField.tsx | 7 ++- .../access-control/EditDetails/useOptions.ts | 3 +- .../BEFeatureIndicator.controller.ts | 2 +- .../components/BEFeatureIndicator/index.ts | 6 +- app/portainer/components/BoxSelector/index.ts | 9 ++- app/portainer/components/BoxSelector/utils.ts | 14 +++++ app/portainer/components/Button/index.ts | 5 -- .../components/InformationPanel/index.ts | 2 - .../components/PageHeader/HeaderContainer.ts | 4 ++ .../components/PageHeader/HeaderContent.ts | 8 +++ .../components/PageHeader/HeaderTitle.ts | 11 ++++ app/portainer/components/PageHeader/index.ts | 16 ++--- .../components/ReactExample.module.css | 3 - .../components/ReactExample.stories.tsx | 24 -------- app/portainer/components/ReactExample.tsx | 59 ------------------- .../components/Tip/TextTip/TextTip.module.css | 0 app/portainer/components/Tip/Tooltip/index.ts | 5 +- app/portainer/components/ViewLoading/index.ts | 1 - .../form-components/FileUpload/index.ts | 2 - .../form-components/SwitchField/index.ts | 1 - .../components/form-components/index.js | 11 +--- app/portainer/components/index.js | 18 ++---- .../SidebarMenuItem/SidebarMenuItem.tsx | 2 +- app/portainer/components/widget/index.ts | 18 +++--- .../components/widget/rd-widget-body.ts | 14 +++++ ...mHeader.tsx => rd-widget-custom-header.ts} | 0 .../components/widget/rd-widget-footer.ts | 7 +++ .../components/widget/rd-widget-taskbar.ts | 14 +++++ .../components/widget/rd-widget-title.ts | 22 +++++++ app/portainer/components/widget/rd-widget.ts | 4 ++ app/portainer/home/BackupFailedPanel.tsx | 7 ++- .../EnvironmentItem/EnvironmentItem.tsx | 5 +- .../home/EnvironmentList/EnvironmentList.tsx | 23 ++++---- .../home/EnvironmentList/KubeconfigButton.tsx | 3 +- .../home/EnvironmentList/KubeconfigPrompt.tsx | 7 ++- .../NoEnvironmentsInfoPanel.tsx | 6 +- app/portainer/home/HomeView.tsx | 3 +- app/portainer/home/HomepageFilter.tsx | 3 +- app/portainer/home/LicenseNodePanel.tsx | 5 +- app/portainer/home/MotdPanel.tsx | 2 +- .../react/components/file-upload-field.ts | 12 ++++ app/portainer/react/components/index.ts | 18 +++++- .../react/components/switch-field.ts | 15 +++++ app/portainer/react/views/index.ts | 12 +++- .../services/modal.service/prompt.ts | 2 +- .../components/SaveAuthSettingsButton.tsx | 4 +- .../internal-auth/InternalAuth.tsx | 3 +- .../AutoEnvCreationSettingsForm.tsx | 9 +-- .../AutomaticEdgeEnvCreation.tsx | 3 +- .../EnableWaitingRoomSwitch.tsx | 5 +- .../EdgeComputeSettings.tsx | 13 ++-- .../FDOProfilesDatatable.tsx | 15 ++--- .../FDOProfilesDatatableActions.tsx | 5 +- .../FDOProfilesDatatableContainer.tsx | 2 +- .../edge-compute/SettingsFDO/SettingsFDO.tsx | 15 ++--- .../SettingsOpenAMT/SettingsOpenAMT.tsx | 15 ++--- .../teams/CreateTeamForm/CreateTeamForm.tsx | 11 ++-- .../views/account/CreateAccessToken/index.ts | 9 --- .../BEFeatureIndicator/BEFeatureIndicator.css | 0 .../BEFeatureIndicator.stories.tsx | 0 .../BEFeatureIndicator/BEFeatureIndicator.tsx | 0 .../components/BEFeatureIndicator/index.ts | 1 + .../components/BEFeatureIndicator/utils.ts | 0 .../components/BoxSelector/BoxSelector.css | 0 .../BoxSelector/BoxSelector.module.css | 0 .../BoxSelector/BoxSelector.stories.tsx | 0 .../BoxSelector/BoxSelector.test.tsx | 0 .../components/BoxSelector/BoxSelector.tsx | 13 ---- .../BoxSelector/BoxSelectorItem.css | 0 .../BoxSelector/BoxSelectorItem.stories.tsx | 0 .../BoxSelector/BoxSelectorItem.tsx | 0 app/react/components/BoxSelector/index.ts | 2 + .../components/BoxSelector/types.ts | 0 .../components/Code/Code.module.css | 0 .../components/Code/Code.stories.tsx | 0 .../components/Code/Code.test.tsx | 0 .../components/Code/Code.tsx | 4 +- .../components/Code/index.ts | 0 .../DashboardItem}/DashboardItem.stories.tsx | 2 +- .../DashboardItem}/DashboardItem.test.tsx | 0 .../DashboardItem}/DashboardItem.tsx | 2 +- app/react/components/DashboardItem/index.ts | 1 + .../components/DetailsTable/DetailsRow.tsx | 0 .../DetailsTable/DetailsTable.stories.tsx | 0 .../DetailsTable/DetailsTable.test.tsx | 0 .../components/DetailsTable/DetailsTable.tsx | 0 .../components/DetailsTable/index.tsx | 0 .../components}/InformationPanel.tsx | 4 +- app/{portainer => react}/components/Link.tsx | 0 .../components/NavTabs/NavTabs.module.css | 0 .../components/NavTabs/NavTabs.stories.tsx | 0 .../components/NavTabs/NavTabs.test.tsx | 0 .../components/NavTabs/NavTabs.tsx | 0 app/react/components/NavTabs/index.ts | 1 + .../PageHeader/Breadcrumbs/Breadcrumbs.css | 0 .../Breadcrumbs/Breadcrumbs.stories.tsx | 0 .../Breadcrumbs/Breadcrumbs.test.tsx | 0 .../PageHeader/Breadcrumbs/Breadcrumbs.tsx | 2 +- .../PageHeader/Breadcrumbs/index.ts} | 0 .../components/PageHeader/HeaderContainer.css | 0 .../PageHeader/HeaderContainer.stories.tsx | 0 .../components/PageHeader/HeaderContainer.tsx | 5 -- .../PageHeader/HeaderContent.module.css | 0 .../PageHeader/HeaderContent.test.tsx | 0 .../components/PageHeader/HeaderContent.tsx | 11 +--- .../PageHeader/HeaderTitle.test.tsx | 0 .../components/PageHeader/HeaderTitle.tsx | 11 ---- .../PageHeader/PageHeader.module.css | 0 .../PageHeader/PageHeader.stories.tsx | 0 .../components/PageHeader/PageHeader.test.tsx | 0 .../components/PageHeader/PageHeader.tsx | 2 +- .../__snapshots__/HeaderContent.test.tsx.snap | 0 .../__snapshots__/HeaderTitle.test.tsx.snap | 0 app/react/components/PageHeader/index.ts | 7 +++ .../ItemsPerPageSelector.tsx | 0 .../PaginationControls}/PageButton.tsx | 0 .../PaginationControls}/PageInput.tsx | 4 +- .../PaginationControls}/PageSelector.tsx | 0 .../PaginationControls.tsx | 0 .../calculatePageNumber.ts | 0 .../PaginationControls}/generatePagesArray.ts | 0 .../components/PaginationControls}/index.ts | 0 .../pagination-controls.css | 0 .../components/PasswordCheckHint.tsx | 6 -- .../components/Stepper/Stepper.stories.tsx | 2 +- .../components/TagSelector/TagSelector.tsx | 10 ++-- .../TeamsSelector/TeamsSelector.mocks.ts | 0 .../TeamsSelector/TeamsSelector.stories.tsx | 0 .../TeamsSelector/TeamsSelector.tsx | 3 +- .../components/TeamsSelector/index.ts | 0 .../Tip/TextTip/TextTip.stories.tsx | 0 .../components/Tip/TextTip/TextTip.test.tsx | 0 .../components/Tip/TextTip/TextTip.tsx | 0 .../components/Tip/TextTip/index.ts | 0 .../components/Tip/Tooltip/Tooltip.module.css | 0 .../Tip/Tooltip/Tooltip.stories.tsx | 0 .../components/Tip/Tooltip/Tooltip.tsx | 0 app/react/components/Tip/Tooltip/index.ts | 1 + .../UsersSelector/UsersSelector.mocks.ts | 0 .../UsersSelector/UsersSelector.stories.tsx | 0 .../UsersSelector/UsersSelector.tsx | 3 +- .../components/UsersSelector/index.ts | 0 .../ViewLoading/ViewLoading.module.css | 0 .../ViewLoading/ViewLoading.stories.tsx | 0 .../components/ViewLoading/ViewLoading.tsx | 4 -- app/react/components/ViewLoading/index.ts | 1 + .../components/Widget}/Loading.tsx | 4 -- .../components/Widget}/Widget.stories.tsx | 0 .../components/Widget}/Widget.tsx | 5 -- .../components/Widget}/WidgetBody.tsx | 15 ----- .../components/Widget}/WidgetFooter.tsx | 8 --- .../components/Widget}/WidgetTaskbar.tsx | 15 ----- .../components/Widget}/WidgetTitle.tsx | 23 -------- app/react/components/Widget/index.ts | 31 ++++++++++ .../components/buttons}/AddButton.module.css | 0 .../components/buttons}/AddButton.stories.tsx | 0 .../components/buttons}/AddButton.test.tsx | 0 .../components/buttons}/AddButton.tsx | 0 .../components/buttons}/Button.stories.tsx | 0 .../components/buttons}/Button.test.tsx | 0 .../components/buttons}/Button.tsx | 0 .../buttons}/ButtonGroup.stories.tsx | 0 .../components/buttons}/ButtonGroup.test.tsx | 0 .../components/buttons}/ButtonGroup.tsx | 0 .../buttons}/CopyButton/CopyButton.module.css | 0 .../CopyButton/CopyButton.stories.tsx | 0 .../buttons}/CopyButton/CopyButton.test.tsx | 0 .../buttons}/CopyButton/CopyButton.tsx | 0 .../components/buttons}/CopyButton/index.ts | 0 .../components/buttons}/CopyButton/useCopy.ts | 0 .../buttons}/LoadingButton.stories.tsx | 0 .../buttons}/LoadingButton.test.tsx | 0 .../components/buttons}/LoadingButton.tsx | 0 app/react/components/buttons/index.ts | 5 ++ .../datatables}/ActionsMenu.module.css | 0 .../components/datatables}/ActionsMenu.tsx | 0 .../datatables}/ActionsMenuTitle.module.css | 0 .../datatables}/ActionsMenuTitle.tsx | 0 .../datatables}/ColumnVisibilityMenu.tsx | 2 +- .../datatables}/ExpandingCell.module.css | 0 .../components/datatables}/ExpandingCell.tsx | 0 .../components/datatables}/Filter.tsx | 0 .../datatables}/FilterSearchBar.module.css | 0 .../datatables}/FilterSearchBar.tsx | 0 .../datatables}/InnerDatatable.module.css | 0 .../components/datatables}/InnerDatatable.tsx | 0 .../datatables}/QuickActionsSettings.tsx | 2 +- .../components/datatables}/SearchBar.tsx | 0 .../datatables}/SelectedRowsCount.tsx | 0 .../datatables}/SortbySelector.module.css | 0 .../components/datatables}/SortbySelector.tsx | 3 +- .../components/datatables}/Table.tsx | 0 .../components/datatables}/TableActions.tsx | 0 .../components/datatables}/TableContainer.tsx | 2 +- .../components/datatables}/TableContent.tsx | 0 .../components/datatables}/TableFooter.tsx | 0 .../datatables}/TableHeaderCell.module.css | 0 .../datatables}/TableHeaderCell.tsx | 2 +- .../components/datatables}/TableHeaderRow.tsx | 0 .../components/datatables}/TableRow.tsx | 0 .../datatables}/TableSettingsMenu.tsx | 0 .../TableSettingsMenuAutoRefresh.module.css | 0 .../TableSettingsMenuAutoRefresh.tsx | 2 +- .../components/datatables}/TableTitle.tsx | 0 .../datatables}/TableTitleActions.tsx | 0 .../components/datatables}/filter-types.ts | 0 .../components/datatables}/index.tsx | 0 .../components/datatables/types.ts | 0 .../components/datatables}/useRepeater.ts | 0 .../components/datatables}/useRowSelect.ts | 0 .../datatables}/useTableSettings.tsx | 0 .../ButtonSelector/ButtonSelector.module.css | 0 .../ButtonSelector/ButtonSelector.stories.tsx | 0 .../ButtonSelector/ButtonSelector.tsx | 2 +- .../components/form-components/Checkbox.tsx | 0 .../FileUpload/FileUploadField.module.css | 0 .../FileUpload/FileUploadField.stories.tsx | 0 .../FileUpload/FileUploadField.test.tsx | 0 .../FileUpload/FileUploadField.tsx | 12 +--- .../FileUpload/FileUploadForm.stories.tsx | 0 .../FileUpload/FileUploadForm.test.tsx | 0 .../FileUpload/FileUploadForm.tsx | 4 +- .../form-components/FileUpload/index.ts | 2 + .../FormControl/FormControl.module.css | 0 .../FormControl/FormControl.stories.tsx | 0 .../FormControl/FormControl.test.tsx | 0 .../FormControl/FormControl.tsx | 2 +- .../form-components/FormControl/index.ts | 0 .../components/form-components/FormError.tsx | 0 .../FormSection/FormSection.stories.tsx | 0 .../FormSection/FormSection.tsx | 0 .../form-components/FormSection/index.ts | 0 .../FormSectionTitle.stories.tsx | 0 .../FormSectionTitle.test.tsx | 0 .../FormSectionTitle/FormSectionTitle.tsx | 0 .../form-components/FormSectionTitle/index.ts | 0 .../form-components/Input/Input.stories.tsx | 0 .../form-components/Input/Input.tsx | 0 .../form-components/Input/Select.stories.tsx | 0 .../form-components/Input/Select.tsx | 0 .../form-components/Input/Textarea.tsx | 0 .../components/form-components/Input/index.ts | 0 .../InputGroup/InputGroup.stories.tsx | 0 .../form-components/InputGroup/InputGroup.tsx | 0 .../InputGroup/InputGroupAddon.tsx | 0 .../InputGroup/InputGroupButtonWrapper.tsx | 0 .../form-components/InputGroup/index.ts | 0 .../InputList/InputList.module.css | 0 .../InputList/InputList.stories.tsx | 0 .../form-components/InputList/InputList.tsx | 6 +- .../form-components/InputList/index.ts | 0 .../form-components/InputList/utils.test.ts | 0 .../form-components/InputList/utils.ts | 0 .../form-components/ReactSelect.module.css | 0 .../form-components/ReactSelect.tsx | 0 .../form-components/Slider/Slider.module.css | 0 .../form-components/Slider/Slider.stories.tsx | 0 .../form-components/Slider/Slider.test.tsx | 0 .../form-components/Slider/Slider.tsx | 0 .../form-components/SwitchField/Switch.css | 0 .../SwitchField/Switch.module.css | 0 .../SwitchField/Switch.stories.tsx | 0 .../SwitchField/Switch.test.tsx | 0 .../form-components/SwitchField/Switch.tsx | 3 +- .../SwitchField/SwitchField.module.css | 0 .../SwitchField/SwitchField.stories.tsx | 0 .../SwitchField/SwitchField.test.tsx | 0 .../SwitchField/SwitchField.tsx | 16 +---- .../form-components/SwitchField/index.ts | 1 + .../EdgeScriptSettingsFieldset.tsx | 10 ++-- .../EdgeScriptForm/NomadTokenField.tsx | 6 +- .../components/EdgeScriptForm/OsSelector.tsx | 2 +- .../components/EdgeScriptForm/ScriptTabs.tsx | 7 ++- .../CreateAccessToken.test.tsx | 0 .../CreateAccessToken.tsx | 16 ++--- .../account/CreateAccessTokenView/index.ts | 1 + ...ustomTemplatesVariablesDefinitionField.tsx | 8 +-- .../CustomTemplatesVariablesField.tsx | 6 +- .../EndpointTypeView.tsx | 7 ++- .../EnvironmentSelector.tsx | 2 +- .../EnvironmentsCreationView.tsx | 11 ++-- .../WizardAzure/WizardAzure.tsx | 10 ++-- .../WizardDocker/APITab/APIForm.tsx | 7 ++- .../WizardDocker/APITab/DeploymentScripts.tsx | 7 ++- .../WizardDocker/APITab/TLSFieldset.tsx | 7 ++- .../AgentTab/DeploymentScripts.tsx | 7 ++- .../WizardDocker/SocketTab/SocketForm.tsx | 9 +-- .../WizardDocker/WizardDocker.tsx | 6 +- .../WizardEndpointsList.tsx | 3 +- .../WizardKubernetes/DeploymentScripts.tsx | 9 +-- .../WizardKubernetes/KubeConfigTeaserForm.tsx | 10 ++-- .../WizardKubernetes/WizardKubernetes.tsx | 7 ++- .../shared/AgentForm/AgentForm.tsx | 3 +- .../shared/AgentForm/EnvironmentUrlField.tsx | 4 +- .../EdgeAgentForm/EdgeAgentForm.tsx | 5 +- .../EdgeAgentForm/PortainerUrlField.tsx | 4 +- .../shared/EdgeAgentTab/EdgeAgentTab.tsx | 3 +- .../shared/MetadataFieldset/GroupsField.tsx | 5 +- .../MetadataFieldset/MetadataFieldset.tsx | 5 +- .../shared/MoreSettingsSection.tsx | 2 +- .../shared/NameField.tsx | 5 +- .../environments/wizard/HomeView/HomeView.tsx | 7 ++- .../wizard/components/Option/Option.tsx | 3 +- jest.config.js | 3 +- tsconfig.json | 1 + webpack/webpack.common.js | 3 +- 346 files changed, 642 insertions(+), 644 deletions(-) create mode 100644 app/portainer/components/BoxSelector/utils.ts delete mode 100644 app/portainer/components/Button/index.ts create mode 100644 app/portainer/components/PageHeader/HeaderContainer.ts create mode 100644 app/portainer/components/PageHeader/HeaderContent.ts create mode 100644 app/portainer/components/PageHeader/HeaderTitle.ts delete mode 100644 app/portainer/components/ReactExample.module.css delete mode 100644 app/portainer/components/ReactExample.stories.tsx delete mode 100644 app/portainer/components/ReactExample.tsx delete mode 100644 app/portainer/components/Tip/TextTip/TextTip.module.css delete mode 100644 app/portainer/components/ViewLoading/index.ts delete mode 100644 app/portainer/components/form-components/FileUpload/index.ts delete mode 100644 app/portainer/components/form-components/SwitchField/index.ts create mode 100644 app/portainer/components/widget/rd-widget-body.ts rename app/portainer/components/widget/{WidgetCustomHeader.tsx => rd-widget-custom-header.ts} (100%) create mode 100644 app/portainer/components/widget/rd-widget-footer.ts create mode 100644 app/portainer/components/widget/rd-widget-taskbar.ts create mode 100644 app/portainer/components/widget/rd-widget-title.ts create mode 100644 app/portainer/components/widget/rd-widget.ts create mode 100644 app/portainer/react/components/file-upload-field.ts create mode 100644 app/portainer/react/components/switch-field.ts delete mode 100644 app/portainer/views/account/CreateAccessToken/index.ts rename app/{portainer => react}/components/BEFeatureIndicator/BEFeatureIndicator.css (100%) rename app/{portainer => react}/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx (100%) rename app/{portainer => react}/components/BEFeatureIndicator/BEFeatureIndicator.tsx (100%) create mode 100644 app/react/components/BEFeatureIndicator/index.ts rename app/{portainer => react}/components/BEFeatureIndicator/utils.ts (100%) rename app/{portainer => react}/components/BoxSelector/BoxSelector.css (100%) rename app/{portainer => react}/components/BoxSelector/BoxSelector.module.css (100%) rename app/{portainer => react}/components/BoxSelector/BoxSelector.stories.tsx (100%) rename app/{portainer => react}/components/BoxSelector/BoxSelector.test.tsx (100%) rename app/{portainer => react}/components/BoxSelector/BoxSelector.tsx (74%) rename app/{portainer => react}/components/BoxSelector/BoxSelectorItem.css (100%) rename app/{portainer => react}/components/BoxSelector/BoxSelectorItem.stories.tsx (100%) rename app/{portainer => react}/components/BoxSelector/BoxSelectorItem.tsx (100%) create mode 100644 app/react/components/BoxSelector/index.ts rename app/{portainer => react}/components/BoxSelector/types.ts (100%) rename app/{portainer => react}/components/Code/Code.module.css (100%) rename app/{portainer => react}/components/Code/Code.stories.tsx (100%) rename app/{portainer => react}/components/Code/Code.test.tsx (100%) rename app/{portainer => react}/components/Code/Code.tsx (88%) rename app/{portainer => react}/components/Code/index.ts (100%) rename app/{portainer/components/Dashboard => react/components/DashboardItem}/DashboardItem.stories.tsx (93%) rename app/{portainer/components/Dashboard => react/components/DashboardItem}/DashboardItem.test.tsx (100%) rename app/{portainer/components/Dashboard => react/components/DashboardItem}/DashboardItem.tsx (90%) create mode 100644 app/react/components/DashboardItem/index.ts rename app/{portainer => react}/components/DetailsTable/DetailsRow.tsx (100%) rename app/{portainer => react}/components/DetailsTable/DetailsTable.stories.tsx (100%) rename app/{portainer => react}/components/DetailsTable/DetailsTable.test.tsx (100%) rename app/{portainer => react}/components/DetailsTable/DetailsTable.tsx (100%) rename app/{portainer => react}/components/DetailsTable/index.tsx (100%) rename app/{portainer/components/InformationPanel => react/components}/InformationPanel.tsx (93%) rename app/{portainer => react}/components/Link.tsx (100%) rename app/{portainer => react}/components/NavTabs/NavTabs.module.css (100%) rename app/{portainer => react}/components/NavTabs/NavTabs.stories.tsx (100%) rename app/{portainer => react}/components/NavTabs/NavTabs.test.tsx (100%) rename app/{portainer => react}/components/NavTabs/NavTabs.tsx (100%) create mode 100644 app/react/components/NavTabs/index.ts rename app/{portainer => react}/components/PageHeader/Breadcrumbs/Breadcrumbs.css (100%) rename app/{portainer => react}/components/PageHeader/Breadcrumbs/Breadcrumbs.stories.tsx (100%) rename app/{portainer => react}/components/PageHeader/Breadcrumbs/Breadcrumbs.test.tsx (100%) rename app/{portainer => react}/components/PageHeader/Breadcrumbs/Breadcrumbs.tsx (93%) rename app/{portainer/components/PageHeader/Breadcrumbs/index.tsx => react/components/PageHeader/Breadcrumbs/index.ts} (100%) rename app/{portainer => react}/components/PageHeader/HeaderContainer.css (100%) rename app/{portainer => react}/components/PageHeader/HeaderContainer.stories.tsx (100%) rename app/{portainer => react}/components/PageHeader/HeaderContainer.tsx (87%) rename app/{portainer => react}/components/PageHeader/HeaderContent.module.css (100%) rename app/{portainer => react}/components/PageHeader/HeaderContent.test.tsx (100%) rename app/{portainer => react}/components/PageHeader/HeaderContent.tsx (84%) rename app/{portainer => react}/components/PageHeader/HeaderTitle.test.tsx (100%) rename app/{portainer => react}/components/PageHeader/HeaderTitle.tsx (74%) rename app/{portainer => react}/components/PageHeader/PageHeader.module.css (100%) rename app/{portainer => react}/components/PageHeader/PageHeader.stories.tsx (100%) rename app/{portainer => react}/components/PageHeader/PageHeader.test.tsx (100%) rename app/{portainer => react}/components/PageHeader/PageHeader.tsx (96%) rename app/{portainer => react}/components/PageHeader/__snapshots__/HeaderContent.test.tsx.snap (100%) rename app/{portainer => react}/components/PageHeader/__snapshots__/HeaderTitle.test.tsx.snap (100%) create mode 100644 app/react/components/PageHeader/index.ts rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/ItemsPerPageSelector.tsx (100%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/PageButton.tsx (100%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/PageInput.tsx (94%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/PageSelector.tsx (100%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/PaginationControls.tsx (100%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/calculatePageNumber.ts (100%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/generatePagesArray.ts (100%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/index.ts (100%) rename app/{portainer/components/pagination-controls => react/components/PaginationControls}/pagination-controls.css (100%) rename app/{portainer => react}/components/PasswordCheckHint.tsx (82%) rename app/{portainer => react}/components/TeamsSelector/TeamsSelector.mocks.ts (100%) rename app/{portainer => react}/components/TeamsSelector/TeamsSelector.stories.tsx (100%) rename app/{portainer => react}/components/TeamsSelector/TeamsSelector.tsx (91%) rename app/{portainer => react}/components/TeamsSelector/index.ts (100%) rename app/{portainer => react}/components/Tip/TextTip/TextTip.stories.tsx (100%) rename app/{portainer => react}/components/Tip/TextTip/TextTip.test.tsx (100%) rename app/{portainer => react}/components/Tip/TextTip/TextTip.tsx (100%) rename app/{portainer => react}/components/Tip/TextTip/index.ts (100%) rename app/{portainer => react}/components/Tip/Tooltip/Tooltip.module.css (100%) rename app/{portainer => react}/components/Tip/Tooltip/Tooltip.stories.tsx (100%) rename app/{portainer => react}/components/Tip/Tooltip/Tooltip.tsx (100%) create mode 100644 app/react/components/Tip/Tooltip/index.ts rename app/{portainer => react}/components/UsersSelector/UsersSelector.mocks.ts (100%) rename app/{portainer => react}/components/UsersSelector/UsersSelector.stories.tsx (100%) rename app/{portainer => react}/components/UsersSelector/UsersSelector.tsx (91%) rename app/{portainer => react}/components/UsersSelector/index.ts (100%) rename app/{portainer => react}/components/ViewLoading/ViewLoading.module.css (100%) rename app/{portainer => react}/components/ViewLoading/ViewLoading.stories.tsx (100%) rename app/{portainer => react}/components/ViewLoading/ViewLoading.tsx (83%) create mode 100644 app/react/components/ViewLoading/index.ts rename app/{portainer/components/widget => react/components/Widget}/Loading.tsx (58%) rename app/{portainer/components/widget => react/components/Widget}/Widget.stories.tsx (100%) rename app/{portainer/components/widget => react/components/Widget}/Widget.tsx (81%) rename app/{portainer/components/widget => react/components/Widget}/WidgetBody.tsx (58%) rename app/{portainer/components/widget => react/components/Widget}/WidgetFooter.tsx (61%) rename app/{portainer/components/widget => react/components/Widget}/WidgetTaskbar.tsx (59%) rename app/{portainer/components/widget => react/components/Widget}/WidgetTitle.tsx (55%) create mode 100644 app/react/components/Widget/index.ts rename app/{portainer/components/Button => react/components/buttons}/AddButton.module.css (100%) rename app/{portainer/components/Button => react/components/buttons}/AddButton.stories.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/AddButton.test.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/AddButton.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/Button.stories.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/Button.test.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/Button.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/ButtonGroup.stories.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/ButtonGroup.test.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/ButtonGroup.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/CopyButton/CopyButton.module.css (100%) rename app/{portainer/components/Button => react/components/buttons}/CopyButton/CopyButton.stories.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/CopyButton/CopyButton.test.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/CopyButton/CopyButton.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/CopyButton/index.ts (100%) rename app/{portainer/components/Button => react/components/buttons}/CopyButton/useCopy.ts (100%) rename app/{portainer/components/Button => react/components/buttons}/LoadingButton.stories.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/LoadingButton.test.tsx (100%) rename app/{portainer/components/Button => react/components/buttons}/LoadingButton.tsx (100%) create mode 100644 app/react/components/buttons/index.ts rename app/{portainer/components/datatables/components => react/components/datatables}/ActionsMenu.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/ActionsMenu.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/ActionsMenuTitle.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/ActionsMenuTitle.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/ColumnVisibilityMenu.tsx (95%) rename app/{portainer/components/datatables/components => react/components/datatables}/ExpandingCell.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/ExpandingCell.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/Filter.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/FilterSearchBar.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/FilterSearchBar.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/InnerDatatable.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/InnerDatatable.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/QuickActionsSettings.tsx (93%) rename app/{portainer/components/datatables/components => react/components/datatables}/SearchBar.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/SelectedRowsCount.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/SortbySelector.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/SortbySelector.tsx (95%) rename app/{portainer/components/datatables/components => react/components/datatables}/Table.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableActions.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableContainer.tsx (89%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableContent.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableFooter.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableHeaderCell.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableHeaderCell.tsx (97%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableHeaderRow.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableRow.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableSettingsMenu.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableSettingsMenuAutoRefresh.module.css (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableSettingsMenuAutoRefresh.tsx (95%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableTitle.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/TableTitleActions.tsx (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/filter-types.ts (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/index.tsx (100%) rename app/{portainer => react}/components/datatables/types.ts (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/useRepeater.ts (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/useRowSelect.ts (100%) rename app/{portainer/components/datatables/components => react/components/datatables}/useTableSettings.tsx (100%) rename app/{portainer => react}/components/form-components/ButtonSelector/ButtonSelector.module.css (100%) rename app/{portainer => react}/components/form-components/ButtonSelector/ButtonSelector.stories.tsx (100%) rename app/{portainer => react}/components/form-components/ButtonSelector/ButtonSelector.tsx (94%) rename app/{portainer => react}/components/form-components/Checkbox.tsx (100%) rename app/{portainer => react}/components/form-components/FileUpload/FileUploadField.module.css (100%) rename app/{portainer => react}/components/form-components/FileUpload/FileUploadField.stories.tsx (100%) rename app/{portainer => react}/components/form-components/FileUpload/FileUploadField.test.tsx (100%) rename app/{portainer => react}/components/form-components/FileUpload/FileUploadField.tsx (85%) rename app/{portainer => react}/components/form-components/FileUpload/FileUploadForm.stories.tsx (100%) rename app/{portainer => react}/components/form-components/FileUpload/FileUploadForm.test.tsx (100%) rename app/{portainer => react}/components/form-components/FileUpload/FileUploadForm.tsx (82%) create mode 100644 app/react/components/form-components/FileUpload/index.ts rename app/{portainer => react}/components/form-components/FormControl/FormControl.module.css (100%) rename app/{portainer => react}/components/form-components/FormControl/FormControl.stories.tsx (100%) rename app/{portainer => react}/components/form-components/FormControl/FormControl.test.tsx (100%) rename app/{portainer => react}/components/form-components/FormControl/FormControl.tsx (96%) rename app/{portainer => react}/components/form-components/FormControl/index.ts (100%) rename app/{portainer => react}/components/form-components/FormError.tsx (100%) rename app/{portainer => react}/components/form-components/FormSection/FormSection.stories.tsx (100%) rename app/{portainer => react}/components/form-components/FormSection/FormSection.tsx (100%) rename app/{portainer => react}/components/form-components/FormSection/index.ts (100%) rename app/{portainer => react}/components/form-components/FormSectionTitle/FormSectionTitle.stories.tsx (100%) rename app/{portainer => react}/components/form-components/FormSectionTitle/FormSectionTitle.test.tsx (100%) rename app/{portainer => react}/components/form-components/FormSectionTitle/FormSectionTitle.tsx (100%) rename app/{portainer => react}/components/form-components/FormSectionTitle/index.ts (100%) rename app/{portainer => react}/components/form-components/Input/Input.stories.tsx (100%) rename app/{portainer => react}/components/form-components/Input/Input.tsx (100%) rename app/{portainer => react}/components/form-components/Input/Select.stories.tsx (100%) rename app/{portainer => react}/components/form-components/Input/Select.tsx (100%) rename app/{portainer => react}/components/form-components/Input/Textarea.tsx (100%) rename app/{portainer => react}/components/form-components/Input/index.ts (100%) rename app/{portainer => react}/components/form-components/InputGroup/InputGroup.stories.tsx (100%) rename app/{portainer => react}/components/form-components/InputGroup/InputGroup.tsx (100%) rename app/{portainer => react}/components/form-components/InputGroup/InputGroupAddon.tsx (100%) rename app/{portainer => react}/components/form-components/InputGroup/InputGroupButtonWrapper.tsx (100%) rename app/{portainer => react}/components/form-components/InputGroup/index.ts (100%) rename app/{portainer => react}/components/form-components/InputList/InputList.module.css (100%) rename app/{portainer => react}/components/form-components/InputList/InputList.stories.tsx (100%) rename app/{portainer => react}/components/form-components/InputList/InputList.tsx (96%) rename app/{portainer => react}/components/form-components/InputList/index.ts (100%) rename app/{portainer => react}/components/form-components/InputList/utils.test.ts (100%) rename app/{portainer => react}/components/form-components/InputList/utils.ts (100%) rename app/{portainer => react}/components/form-components/ReactSelect.module.css (100%) rename app/{portainer => react}/components/form-components/ReactSelect.tsx (100%) rename app/{portainer => react}/components/form-components/Slider/Slider.module.css (100%) rename app/{portainer => react}/components/form-components/Slider/Slider.stories.tsx (100%) rename app/{portainer => react}/components/form-components/Slider/Slider.test.tsx (100%) rename app/{portainer => react}/components/form-components/Slider/Slider.tsx (100%) rename app/{portainer => react}/components/form-components/SwitchField/Switch.css (100%) rename app/{portainer => react}/components/form-components/SwitchField/Switch.module.css (100%) rename app/{portainer => react}/components/form-components/SwitchField/Switch.stories.tsx (100%) rename app/{portainer => react}/components/form-components/SwitchField/Switch.test.tsx (100%) rename app/{portainer => react}/components/form-components/SwitchField/Switch.tsx (93%) rename app/{portainer => react}/components/form-components/SwitchField/SwitchField.module.css (100%) rename app/{portainer => react}/components/form-components/SwitchField/SwitchField.stories.tsx (100%) rename app/{portainer => react}/components/form-components/SwitchField/SwitchField.test.tsx (100%) rename app/{portainer => react}/components/form-components/SwitchField/SwitchField.tsx (79%) create mode 100644 app/react/components/form-components/SwitchField/index.ts rename app/{portainer/views/account/CreateAccessToken => react/portainer/account/CreateAccessTokenView}/CreateAccessToken.test.tsx (100%) rename app/{portainer/views/account/CreateAccessToken => react/portainer/account/CreateAccessTokenView}/CreateAccessToken.tsx (84%) create mode 100644 app/react/portainer/account/CreateAccessTokenView/index.ts diff --git a/.eslintrc.yml b/.eslintrc.yml index 7a34eedcb..5915e45b0 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -31,7 +31,12 @@ rules: [ 'error', { - pathGroups: [{ pattern: '@/**', group: 'internal' }, { pattern: '{Kubernetes,Portainer,Agent,Azure,Docker}/**', group: 'internal' }], + pathGroups: + [ + { pattern: '@@/**', group: 'internal', position: 'after' }, + { pattern: '@/**', group: 'internal' }, + { pattern: '{Kubernetes,Portainer,Agent,Azure,Docker}/**', group: 'internal' }, + ], groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], pathGroupsExcludedImportTypes: ['internal'], }, @@ -41,6 +46,7 @@ settings: 'import/resolver': alias: map: + - ['@@', './app/react/components'] - ['@', './app'] extensions: ['.js', '.ts', '.tsx'] @@ -68,7 +74,14 @@ overrides: version: 'detect' rules: import/order: - ['error', { pathGroups: [{ pattern: '@/**', group: 'internal' }], groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], 'newlines-between': 'always' }] + [ + 'error', + { + pathGroups: [{ pattern: '@@/**', group: 'internal', position: 'after' }, { pattern: '@/**', group: 'internal' }], + groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], + 'newlines-between': 'always', + }, + ] func-style: [error, 'declaration'] import/prefer-default-export: off no-use-before-define: ['error', { functions: false }] diff --git a/app/azure/ContainerInstances/CreateContainerInstanceForm/CreateContainerInstanceForm.tsx b/app/azure/ContainerInstances/CreateContainerInstanceForm/CreateContainerInstanceForm.tsx index 3c2d723de..090f5b9ea 100644 --- a/app/azure/ContainerInstances/CreateContainerInstanceForm/CreateContainerInstanceForm.tsx +++ b/app/azure/ContainerInstances/CreateContainerInstanceForm/CreateContainerInstanceForm.tsx @@ -1,16 +1,17 @@ import { Field, Form, Formik } from 'formik'; import { useCurrentStateAndParams, useRouter } from '@uirouter/react'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input, Select } from '@/portainer/components/form-components/Input'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; -import { InputListError } from '@/portainer/components/form-components/InputList/InputList'; import { ContainerInstanceFormValues } from '@/azure/types'; import * as notifications from '@/portainer/services/notifications'; import { useUser } from '@/portainer/hooks/useUser'; import { AccessControlForm } from '@/portainer/access-control/AccessControlForm'; +import { FormControl } from '@@/form-components/FormControl'; +import { Input, Select } from '@@/form-components/Input'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { InputListError } from '@@/form-components/InputList/InputList'; + import { validationSchema } from './CreateContainerInstanceForm.validation'; import { PortMapping, PortsMappingField } from './PortsMappingField'; import { useLoadFormState } from './useLoadFormState'; diff --git a/app/azure/ContainerInstances/CreateContainerInstanceForm/PortsMappingField.tsx b/app/azure/ContainerInstances/CreateContainerInstanceForm/PortsMappingField.tsx index d49dd768c..1c50529a7 100644 --- a/app/azure/ContainerInstances/CreateContainerInstanceForm/PortsMappingField.tsx +++ b/app/azure/ContainerInstances/CreateContainerInstanceForm/PortsMappingField.tsx @@ -1,11 +1,11 @@ -import { ButtonSelector } from '@/portainer/components/form-components/ButtonSelector/ButtonSelector'; -import { FormError } from '@/portainer/components/form-components/FormError'; -import { InputGroup } from '@/portainer/components/form-components/InputGroup'; -import { InputList } from '@/portainer/components/form-components/InputList'; +import { ButtonSelector } from '@@/form-components/ButtonSelector/ButtonSelector'; +import { FormError } from '@@/form-components/FormError'; +import { InputGroup } from '@@/form-components/InputGroup'; +import { InputList } from '@@/form-components/InputList'; import { InputListError, ItemProps, -} from '@/portainer/components/form-components/InputList/InputList'; +} from '@@/form-components/InputList/InputList'; import styles from './PortsMappingField.module.css'; diff --git a/app/azure/ContainerInstances/CreateContainerInstanceForm/useLoadFormState.ts b/app/azure/ContainerInstances/CreateContainerInstanceForm/useLoadFormState.ts index 60ab74a02..ad421b9a8 100644 --- a/app/azure/ContainerInstances/CreateContainerInstanceForm/useLoadFormState.ts +++ b/app/azure/ContainerInstances/CreateContainerInstanceForm/useLoadFormState.ts @@ -4,13 +4,14 @@ import { useEffect } from 'react'; import * as notifications from '@/portainer/services/notifications'; import PortainerError from '@/portainer/error'; import { EnvironmentId } from '@/portainer/environments/types'; -import { Option } from '@/portainer/components/form-components/Input/Select'; import { getResourceGroups } from '@/azure/services/resource-groups.service'; import { getSubscriptions } from '@/azure/services/subscription.service'; import { getContainerInstanceProvider } from '@/azure/services/provider.service'; import { ContainerInstanceFormValues, Subscription } from '@/azure/types'; import { parseAccessControlFormData } from '@/portainer/access-control/utils'; +import { Option } from '@@/form-components/Input/Select'; + import { getSubscriptionLocations, getSubscriptionResourceGroups, diff --git a/app/azure/ContainerInstances/CreateContainerInstanceView.tsx b/app/azure/ContainerInstances/CreateContainerInstanceView.tsx index 0a6264d50..f23144392 100644 --- a/app/azure/ContainerInstances/CreateContainerInstanceView.tsx +++ b/app/azure/ContainerInstances/CreateContainerInstanceView.tsx @@ -1,7 +1,8 @@ -import { PageHeader } from '@/portainer/components/PageHeader'; -import { Widget, WidgetBody } from '@/portainer/components/widget'; import { r2a } from '@/react-tools/react2angular'; +import { PageHeader } from '@@/PageHeader'; +import { Widget, WidgetBody } from '@@/Widget'; + import { CreateContainerInstanceForm } from './CreateContainerInstanceForm'; export function CreateContainerInstanceView() { diff --git a/app/azure/Dashboard/DashboardView.tsx b/app/azure/Dashboard/DashboardView.tsx index 4bd1f695c..b60c04517 100644 --- a/app/azure/Dashboard/DashboardView.tsx +++ b/app/azure/Dashboard/DashboardView.tsx @@ -1,12 +1,13 @@ import { useEffect } from 'react'; import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; -import { PageHeader } from '@/portainer/components/PageHeader'; -import { DashboardItem } from '@/portainer/components/Dashboard/DashboardItem'; import { error as notifyError } from '@/portainer/services/notifications'; import PortainerError from '@/portainer/error'; import { r2a } from '@/react-tools/react2angular'; +import { DashboardItem } from '@@/DashboardItem'; +import { PageHeader } from '@@/PageHeader'; + import { useResourceGroups, useSubscriptions } from '../queries'; export function DashboardView() { diff --git a/app/docker/components/container-quick-actions/ContainerQuickActions.tsx b/app/docker/components/container-quick-actions/ContainerQuickActions.tsx index 41e411bef..654de6263 100644 --- a/app/docker/components/container-quick-actions/ContainerQuickActions.tsx +++ b/app/docker/components/container-quick-actions/ContainerQuickActions.tsx @@ -1,10 +1,11 @@ import clsx from 'clsx'; import { Authorized } from '@/portainer/hooks/useUser'; -import { Link } from '@/portainer/components/Link'; import { react2angular } from '@/react-tools/react2angular'; import { DockerContainerStatus } from '@/docker/containers/types'; +import { Link } from '@@/Link'; + import styles from './ContainerQuickActions.module.css'; interface QuickActionsState { diff --git a/app/docker/containers/components/ContainersDatatable/ContainersDatatable.tsx b/app/docker/containers/components/ContainersDatatable/ContainersDatatable.tsx index 18503d259..8e80699d5 100644 --- a/app/docker/containers/components/ContainersDatatable/ContainersDatatable.tsx +++ b/app/docker/containers/components/ContainersDatatable/ContainersDatatable.tsx @@ -9,11 +9,18 @@ import { } from 'react-table'; import { useRowSelectColumn } from '@lineup-lite/hooks'; -import { PaginationControls } from '@/portainer/components/pagination-controls'; +import { useDebounce } from '@/portainer/hooks/useDebounce'; +import type { + ContainersTableSettings, + DockerContainer, +} from '@/docker/containers/types'; +import { useEnvironment } from '@/portainer/environments/useEnvironment'; + +import { PaginationControls } from '@@/PaginationControls'; import { QuickActionsSettings, buildAction, -} from '@/portainer/components/datatables/components/QuickActionsSettings'; +} from '@@/datatables/QuickActionsSettings'; import { Table, TableActions, @@ -23,25 +30,16 @@ import { TableSettingsMenu, TableTitle, TableTitleActions, -} from '@/portainer/components/datatables/components'; -import { multiple } from '@/portainer/components/datatables/components/filter-types'; -import { useTableSettings } from '@/portainer/components/datatables/components/useTableSettings'; -import { ColumnVisibilityMenu } from '@/portainer/components/datatables/components/ColumnVisibilityMenu'; -import { useRepeater } from '@/portainer/components/datatables/components/useRepeater'; -import { useDebounce } from '@/portainer/hooks/useDebounce'; -import { - SearchBar, - useSearchBarState, -} from '@/portainer/components/datatables/components/SearchBar'; -import type { - ContainersTableSettings, - DockerContainer, -} from '@/docker/containers/types'; -import { useEnvironment } from '@/portainer/environments/useEnvironment'; -import { useRowSelect } from '@/portainer/components/datatables/components/useRowSelect'; -import { Checkbox } from '@/portainer/components/form-components/Checkbox'; -import { TableFooter } from '@/portainer/components/datatables/components/TableFooter'; -import { SelectedRowsCount } from '@/portainer/components/datatables/components/SelectedRowsCount'; +} from '@@/datatables'; +import { multiple } from '@@/datatables/filter-types'; +import { useTableSettings } from '@@/datatables/useTableSettings'; +import { ColumnVisibilityMenu } from '@@/datatables/ColumnVisibilityMenu'; +import { useRepeater } from '@@/datatables/useRepeater'; +import { SearchBar, useSearchBarState } from '@@/datatables/SearchBar'; +import { useRowSelect } from '@@/datatables/useRowSelect'; +import { Checkbox } from '@@/form-components/Checkbox'; +import { TableFooter } from '@@/datatables/TableFooter'; +import { SelectedRowsCount } from '@@/datatables/SelectedRowsCount'; import { ContainersDatatableActions } from './ContainersDatatableActions'; import { ContainersDatatableSettings } from './ContainersDatatableSettings'; diff --git a/app/docker/containers/components/ContainersDatatable/ContainersDatatableActions.tsx b/app/docker/containers/components/ContainersDatatable/ContainersDatatableActions.tsx index 0c0679baf..bd6c69e69 100644 --- a/app/docker/containers/components/ContainersDatatable/ContainersDatatableActions.tsx +++ b/app/docker/containers/components/ContainersDatatable/ContainersDatatableActions.tsx @@ -2,7 +2,6 @@ import { useRouter } from '@uirouter/react'; import * as notifications from '@/portainer/services/notifications'; import { useAuthorizations, Authorized } from '@/portainer/hooks/useUser'; -import { Link } from '@/portainer/components/Link'; import { confirmContainerDeletion } from '@/portainer/services/modal.service/prompt'; import { setPortainerAgentTargetHeader } from '@/portainer/services/http-request.helper'; import type { ContainerId, DockerContainer } from '@/docker/containers/types'; @@ -16,7 +15,9 @@ import { stopContainer, } from '@/docker/containers/containers.service'; import type { EnvironmentId } from '@/portainer/environments/types'; -import { ButtonGroup, Button } from '@/portainer/components/Button'; + +import { Link } from '@@/Link'; +import { ButtonGroup, Button } from '@@/buttons'; type ContainerServiceAction = ( endpointId: EnvironmentId, diff --git a/app/docker/containers/components/ContainersDatatable/ContainersDatatableContainer.tsx b/app/docker/containers/components/ContainersDatatable/ContainersDatatableContainer.tsx index 03dbc678b..97e8562e0 100644 --- a/app/docker/containers/components/ContainersDatatable/ContainersDatatableContainer.tsx +++ b/app/docker/containers/components/ContainersDatatable/ContainersDatatableContainer.tsx @@ -1,8 +1,9 @@ import { react2angular } from '@/react-tools/react2angular'; import { EnvironmentProvider } from '@/portainer/environments/useEnvironment'; -import { TableSettingsProvider } from '@/portainer/components/datatables/components/useTableSettings'; import type { Environment } from '@/portainer/environments/types'; +import { TableSettingsProvider } from '@@/datatables/useTableSettings'; + import { ContainersDatatable, ContainerTableProps, diff --git a/app/docker/containers/components/ContainersDatatable/ContainersDatatableSettings.tsx b/app/docker/containers/components/ContainersDatatable/ContainersDatatableSettings.tsx index 0062390ee..0e551b394 100644 --- a/app/docker/containers/components/ContainersDatatable/ContainersDatatableSettings.tsx +++ b/app/docker/containers/components/ContainersDatatable/ContainersDatatableSettings.tsx @@ -1,8 +1,9 @@ -import { TableSettingsMenuAutoRefresh } from '@/portainer/components/datatables/components/TableSettingsMenuAutoRefresh'; -import { useTableSettings } from '@/portainer/components/datatables/components/useTableSettings'; -import { Checkbox } from '@/portainer/components/form-components/Checkbox'; import type { ContainersTableSettings } from '@/docker/containers/types'; +import { TableSettingsMenuAutoRefresh } from '@@/datatables/TableSettingsMenuAutoRefresh'; +import { useTableSettings } from '@@/datatables/useTableSettings'; +import { Checkbox } from '@@/form-components/Checkbox'; + interface Props { isRefreshVisible: boolean; } diff --git a/app/docker/containers/components/ContainersDatatable/columns/name.tsx b/app/docker/containers/components/ContainersDatatable/columns/name.tsx index 380624ff8..beb7d3791 100644 --- a/app/docker/containers/components/ContainersDatatable/columns/name.tsx +++ b/app/docker/containers/components/ContainersDatatable/columns/name.tsx @@ -3,12 +3,13 @@ import _ from 'lodash'; import { useSref } from '@uirouter/react'; import { useEnvironment } from '@/portainer/environments/useEnvironment'; -import { useTableSettings } from '@/portainer/components/datatables/components/useTableSettings'; import type { ContainersTableSettings, DockerContainer, } from '@/docker/containers/types'; +import { useTableSettings } from '@@/datatables/useTableSettings'; + export const name: Column = { Header: 'Name', accessor: (row) => { diff --git a/app/docker/containers/components/ContainersDatatable/columns/quick-actions.tsx b/app/docker/containers/components/ContainersDatatable/columns/quick-actions.tsx index 04921be12..5304178aa 100644 --- a/app/docker/containers/components/ContainersDatatable/columns/quick-actions.tsx +++ b/app/docker/containers/components/ContainersDatatable/columns/quick-actions.tsx @@ -1,6 +1,5 @@ import { CellProps, Column } from 'react-table'; -import { useTableSettings } from '@/portainer/components/datatables/components/useTableSettings'; import { useEnvironment } from '@/portainer/environments/useEnvironment'; import { useAuthorizations } from '@/portainer/hooks/useUser'; import { ContainerQuickActions } from '@/docker/components/container-quick-actions/ContainerQuickActions'; @@ -10,6 +9,8 @@ import type { } from '@/docker/containers/types'; import { EnvironmentStatus } from '@/portainer/environments/types'; +import { useTableSettings } from '@@/datatables/useTableSettings'; + export const quickActions: Column = { Header: 'Quick Actions', id: 'actions', diff --git a/app/docker/containers/components/ContainersDatatable/columns/state.tsx b/app/docker/containers/components/ContainersDatatable/columns/state.tsx index cadd67832..b6219d151 100644 --- a/app/docker/containers/components/ContainersDatatable/columns/state.tsx +++ b/app/docker/containers/components/ContainersDatatable/columns/state.tsx @@ -2,12 +2,13 @@ import { Column } from 'react-table'; import clsx from 'clsx'; import _ from 'lodash'; -import { DefaultFilter } from '@/portainer/components/datatables/components/Filter'; import type { DockerContainer, DockerContainerStatus, } from '@/docker/containers/types'; +import { DefaultFilter } from '@@/datatables/Filter'; + export const state: Column = { Header: 'State', accessor: 'Status', diff --git a/app/docker/containers/types.ts b/app/docker/containers/types.ts index ef876d5dc..5e62b4ad3 100644 --- a/app/docker/containers/types.ts +++ b/app/docker/containers/types.ts @@ -1,11 +1,12 @@ import { ResourceControlViewModel } from '@/portainer/access-control/models/ResourceControlViewModel'; + import { PaginationTableSettings, RefreshableTableSettings, SettableColumnsTableSettings, SettableQuickActionsTableSettings, SortableTableSettings, -} from '@/portainer/components/datatables/types'; +} from '@@/datatables/types'; export type DockerContainerStatus = | 'paused' diff --git a/app/docker/networks/edit/NetworkContainersTable.tsx b/app/docker/networks/edit/NetworkContainersTable.tsx index 316f1f8e4..cb18ba10e 100644 --- a/app/docker/networks/edit/NetworkContainersTable.tsx +++ b/app/docker/networks/edit/NetworkContainersTable.tsx @@ -1,9 +1,10 @@ -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; -import { DetailsTable } from '@/portainer/components/DetailsTable'; -import { Button } from '@/portainer/components/Button'; import { Authorized } from '@/portainer/hooks/useUser'; import { EnvironmentId } from '@/portainer/environments/types'; -import { Link } from '@/portainer/components/Link'; + +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { DetailsTable } from '@@/DetailsTable'; +import { Button } from '@@/buttons'; +import { Link } from '@@/Link'; import { NetworkContainer, NetworkId } from '../types'; import { useDisconnectContainer } from '../queries'; diff --git a/app/docker/networks/edit/NetworkDetailsTable.tsx b/app/docker/networks/edit/NetworkDetailsTable.tsx index 9bb4de2ea..321661d55 100644 --- a/app/docker/networks/edit/NetworkDetailsTable.tsx +++ b/app/docker/networks/edit/NetworkDetailsTable.tsx @@ -1,11 +1,12 @@ import { Fragment } from 'react'; import DockerNetworkHelper from 'Docker/helpers/networkHelper'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; -import { DetailsTable } from '@/portainer/components/DetailsTable'; -import { Button } from '@/portainer/components/Button'; import { Authorized } from '@/portainer/hooks/useUser'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { DetailsTable } from '@@/DetailsTable'; +import { Button } from '@@/buttons'; + import { isSystemNetwork } from '../network.helper'; import { DockerNetwork, IPConfig } from '../types'; diff --git a/app/docker/networks/edit/NetworkDetailsView.tsx b/app/docker/networks/edit/NetworkDetailsView.tsx index bcd0a9769..f8c18196f 100644 --- a/app/docker/networks/edit/NetworkDetailsView.tsx +++ b/app/docker/networks/edit/NetworkDetailsView.tsx @@ -4,12 +4,13 @@ import { useQueryClient } from 'react-query'; import _ from 'lodash'; import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId'; -import { PageHeader } from '@/portainer/components/PageHeader'; import { confirmDeletionAsync } from '@/portainer/services/modal.service/confirm'; import { AccessControlPanel } from '@/portainer/access-control/AccessControlPanel/AccessControlPanel'; import { ResourceControlType } from '@/portainer/access-control/types'; import { DockerContainer } from '@/docker/containers/types'; +import { PageHeader } from '@@/PageHeader'; + import { useNetwork, useDeleteNetwork } from '../queries'; import { isSystemNetwork } from '../network.helper'; import { useContainers } from '../../containers/queries'; diff --git a/app/docker/networks/edit/NetworkOptionsTable.tsx b/app/docker/networks/edit/NetworkOptionsTable.tsx index 8eb159449..7763a09b2 100644 --- a/app/docker/networks/edit/NetworkOptionsTable.tsx +++ b/app/docker/networks/edit/NetworkOptionsTable.tsx @@ -1,5 +1,5 @@ -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; -import { DetailsTable } from '@/portainer/components/DetailsTable'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { DetailsTable } from '@@/DetailsTable'; import { NetworkOptions } from '../types'; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable.tsx b/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable.tsx index 4aaec5656..b6bb34561 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable.tsx @@ -1,18 +1,14 @@ import { usePagination, useTable } from 'react-table'; -import { - Table, - TableContainer, - TableHeaderRow, - TableRow, -} from '@/portainer/components/datatables/components'; -import { InnerDatatable } from '@/portainer/components/datatables/components/InnerDatatable'; import { Device } from '@/portainer/hostmanagement/open-amt/model'; import { useAMTDevices } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/useAMTDevices'; import { RowProvider } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/columns/RowContext'; import { EnvironmentId } from '@/portainer/environments/types'; import PortainerError from '@/portainer/error'; +import { InnerDatatable } from '@@/datatables/InnerDatatable'; +import { Table, TableContainer, TableHeaderRow, TableRow } from '@@/datatables'; + import { useColumns } from './columns'; export interface AMTDevicesTableProps { diff --git a/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/columns/actions.tsx b/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/columns/actions.tsx index 0082f5ae2..c0a619969 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/columns/actions.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/columns/actions.tsx @@ -4,11 +4,12 @@ import { MenuItem, MenuLink } from '@reach/menu-button'; import { useQueryClient } from 'react-query'; import { Device } from '@/portainer/hostmanagement/open-amt/model'; -import { ActionsMenu } from '@/portainer/components/datatables/components/ActionsMenu'; import { confirmAsync } from '@/portainer/services/modal.service/confirm'; import { executeDeviceAction } from '@/portainer/hostmanagement/open-amt/open-amt.service'; import * as notifications from '@/portainer/services/notifications'; -import { ActionsMenuTitle } from '@/portainer/components/datatables/components/ActionsMenuTitle'; + +import { ActionsMenu } from '@@/datatables/ActionsMenu'; +import { ActionsMenuTitle } from '@@/datatables/ActionsMenuTitle'; import { useRowContext } from './RowContext'; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx index c327a0245..fcd5aab89 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatable.tsx @@ -3,7 +3,10 @@ import { useRowSelectColumn } from '@lineup-lite/hooks'; import _ from 'lodash'; import { Environment } from '@/portainer/environments/types'; -import { PaginationControls } from '@/portainer/components/pagination-controls'; +import { AMTDevicesDatatable } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable'; +import { EnvironmentGroup } from '@/portainer/environment-groups/types'; + +import { PaginationControls } from '@@/PaginationControls'; import { Table, TableActions, @@ -13,17 +16,15 @@ import { TableSettingsMenu, TableTitle, TableTitleActions, -} from '@/portainer/components/datatables/components'; -import { multiple } from '@/portainer/components/datatables/components/filter-types'; -import { useTableSettings } from '@/portainer/components/datatables/components/useTableSettings'; -import { ColumnVisibilityMenu } from '@/portainer/components/datatables/components/ColumnVisibilityMenu'; -import { SearchBar } from '@/portainer/components/datatables/components/SearchBar'; -import { useRowSelect } from '@/portainer/components/datatables/components/useRowSelect'; -import { TableFooter } from '@/portainer/components/datatables/components/TableFooter'; -import { SelectedRowsCount } from '@/portainer/components/datatables/components/SelectedRowsCount'; -import { AMTDevicesDatatable } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; -import { EnvironmentGroup } from '@/portainer/environment-groups/types'; +} from '@@/datatables'; +import { multiple } from '@@/datatables/filter-types'; +import { useTableSettings } from '@@/datatables/useTableSettings'; +import { ColumnVisibilityMenu } from '@@/datatables/ColumnVisibilityMenu'; +import { SearchBar } from '@@/datatables/SearchBar'; +import { useRowSelect } from '@@/datatables/useRowSelect'; +import { TableFooter } from '@@/datatables/TableFooter'; +import { SelectedRowsCount } from '@@/datatables/SelectedRowsCount'; +import { TextTip } from '@@/Tip/TextTip'; import { EdgeDevicesDatatableActions } from './EdgeDevicesDatatableActions'; import { EdgeDevicesDatatableSettings } from './EdgeDevicesDatatableSettings'; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableActions.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableActions.tsx index 809d6d868..8e6be8cee 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableActions.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableActions.tsx @@ -1,13 +1,14 @@ import { useRouter } from '@uirouter/react'; import type { Environment } from '@/portainer/environments/types'; -import { Button } from '@/portainer/components/Button'; import { confirmAsync } from '@/portainer/services/modal.service/confirm'; import { promptAsync } from '@/portainer/services/modal.service/prompt'; import * as notifications from '@/portainer/services/notifications'; import { activateDevice } from '@/portainer/hostmanagement/open-amt/open-amt.service'; import { deleteEndpoint } from '@/portainer/environments/environment.service'; -import { Link } from '@/portainer/components/Link'; + +import { Button } from '@@/buttons'; +import { Link } from '@@/Link'; interface Props { selectedItems: Environment[]; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx index 16f1a2181..06249f082 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableContainer.tsx @@ -1,13 +1,14 @@ import { useState } from 'react'; +import { useEnvironmentList } from '@/portainer/environments/queries/useEnvironmentList'; +import { Environment } from '@/portainer/environments/types'; +import { useDebounce } from '@/portainer/hooks/useDebounce'; + +import { useSearchBarState } from '@@/datatables/SearchBar'; import { TableSettingsProvider, useTableSettings, -} from '@/portainer/components/datatables/components/useTableSettings'; -import { useEnvironmentList } from '@/portainer/environments/queries/useEnvironmentList'; -import { Environment } from '@/portainer/environments/types'; -import { useSearchBarState } from '@/portainer/components/datatables/components/SearchBar'; -import { useDebounce } from '@/portainer/hooks/useDebounce'; +} from '@@/datatables/useTableSettings'; import { EdgeDevicesDatatable, diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableSettings.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableSettings.tsx index 03ac90388..759f21c25 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableSettings.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/EdgeDevicesDatatableSettings.tsx @@ -1,5 +1,5 @@ -import { TableSettingsMenuAutoRefresh } from '@/portainer/components/datatables/components/TableSettingsMenuAutoRefresh'; -import { useTableSettings } from '@/portainer/components/datatables/components/useTableSettings'; +import { TableSettingsMenuAutoRefresh } from '@@/datatables/TableSettingsMenuAutoRefresh'; +import { useTableSettings } from '@@/datatables/useTableSettings'; import { EdgeDeviceTableSettings } from './types'; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/actions.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/actions.tsx index d647abfa4..19c282c1b 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/actions.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/actions.tsx @@ -3,11 +3,12 @@ import { MenuItem, MenuLink } from '@reach/menu-button'; import { useRouter, useSref } from '@uirouter/react'; import { Environment } from '@/portainer/environments/types'; -import { ActionsMenu } from '@/portainer/components/datatables/components/ActionsMenu'; import { snapshotEndpoint } from '@/portainer/environments/environment.service'; import * as notifications from '@/portainer/services/notifications'; import { getRoute } from '@/portainer/environments/utils'; +import { ActionsMenu } from '@@/datatables/ActionsMenu'; + export const actions: Column = { Header: 'Actions', accessor: () => 'actions', diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/group.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/group.tsx index d876d2116..69d8dcf38 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/group.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/group.tsx @@ -1,7 +1,8 @@ import { Column } from 'react-table'; import { Environment } from '@/portainer/environments/types'; -import { DefaultFilter } from '@/portainer/components/datatables/components/Filter'; + +import { DefaultFilter } from '@@/datatables/Filter'; import { useRowContext } from './RowContext'; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/name.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/name.tsx index 2a8551f7b..65db6a6ef 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/name.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/columns/name.tsx @@ -1,8 +1,9 @@ import { CellProps, Column } from 'react-table'; import { Environment } from '@/portainer/environments/types'; -import { Link } from '@/portainer/components/Link'; -import { ExpandingCell } from '@/portainer/components/datatables/components/ExpandingCell'; + +import { Link } from '@@/Link'; +import { ExpandingCell } from '@@/datatables/ExpandingCell'; import { useRowContext } from './RowContext'; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/types.ts b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/types.ts index fa314b2cd..89a71ace3 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/types.ts +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesDatatable/types.ts @@ -3,7 +3,7 @@ import { RefreshableTableSettings, SettableColumnsTableSettings, SortableTableSettings, -} from '@/portainer/components/datatables/types'; +} from '@@/datatables/types'; export interface Pagination { pageLimit: number; diff --git a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx index 11ab06296..8a3a88911 100644 --- a/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx +++ b/app/edge/EdgeDevices/EdgeDevicesView/EdgeDevicesView.tsx @@ -1,10 +1,11 @@ import { useState } from 'react'; -import { PageHeader } from '@/portainer/components/PageHeader'; import { useSettings } from '@/portainer/settings/queries'; import { useGroups } from '@/portainer/environment-groups/queries'; import { r2a } from '@/react-tools/react2angular'; -import { ViewLoading } from '@/portainer/components/ViewLoading'; + +import { PageHeader } from '@@/PageHeader'; +import { ViewLoading } from '@@/ViewLoading'; import { EdgeDevicesDatatableContainer } from './EdgeDevicesDatatable/EdgeDevicesDatatableContainer'; diff --git a/app/edge/EdgeDevices/WaitingRoomView/Datatable/Datatable.tsx b/app/edge/EdgeDevices/WaitingRoomView/Datatable/Datatable.tsx index c2904f9e5..90cbb15ab 100644 --- a/app/edge/EdgeDevices/WaitingRoomView/Datatable/Datatable.tsx +++ b/app/edge/EdgeDevices/WaitingRoomView/Datatable/Datatable.tsx @@ -8,18 +8,16 @@ import { } from 'react-table'; import { useRowSelectColumn } from '@lineup-lite/hooks'; -import { Button } from '@/portainer/components/Button'; -import { Table } from '@/portainer/components/datatables/components'; -import { - SearchBar, - useSearchBarState, -} from '@/portainer/components/datatables/components/SearchBar'; -import { SelectedRowsCount } from '@/portainer/components/datatables/components/SelectedRowsCount'; -import { PaginationControls } from '@/portainer/components/pagination-controls'; import { Environment } from '@/portainer/environments/types'; -import { useTableSettings } from '@/portainer/components/datatables/components/useTableSettings'; import { notifySuccess } from '@/portainer/services/notifications'; +import { Button } from '@@/buttons'; +import { Table } from '@@/datatables'; +import { SearchBar, useSearchBarState } from '@@/datatables/SearchBar'; +import { SelectedRowsCount } from '@@/datatables/SelectedRowsCount'; +import { PaginationControls } from '@@/PaginationControls'; +import { useTableSettings } from '@@/datatables/useTableSettings'; + import { useAssociateDeviceMutation } from '../queries'; import { TableSettings } from './types'; diff --git a/app/edge/EdgeDevices/WaitingRoomView/Datatable/types.ts b/app/edge/EdgeDevices/WaitingRoomView/Datatable/types.ts index 1d319b77d..42f219859 100644 --- a/app/edge/EdgeDevices/WaitingRoomView/Datatable/types.ts +++ b/app/edge/EdgeDevices/WaitingRoomView/Datatable/types.ts @@ -1,7 +1,7 @@ import { PaginationTableSettings, SortableTableSettings, -} from '@/portainer/components/datatables/types'; +} from '@@/datatables/types'; export interface TableSettings extends SortableTableSettings, diff --git a/app/edge/EdgeDevices/WaitingRoomView/WaitingRoomView.tsx b/app/edge/EdgeDevices/WaitingRoomView/WaitingRoomView.tsx index 02d0f8c6d..e05a6692b 100644 --- a/app/edge/EdgeDevices/WaitingRoomView/WaitingRoomView.tsx +++ b/app/edge/EdgeDevices/WaitingRoomView/WaitingRoomView.tsx @@ -1,10 +1,11 @@ import { useRouter } from '@uirouter/react'; -import { TableSettingsProvider } from '@/portainer/components/datatables/components/useTableSettings'; -import { PageHeader } from '@/portainer/components/PageHeader'; import { useEnvironmentList } from '@/portainer/environments/queries/useEnvironmentList'; import { r2a } from '@/react-tools/react2angular'; +import { TableSettingsProvider } from '@@/datatables/useTableSettings'; +import { PageHeader } from '@@/PageHeader'; + import { DataTable } from './Datatable/Datatable'; import { TableSettings } from './Datatable/types'; diff --git a/app/edge/components/EdgeCheckInIntervalField.tsx b/app/edge/components/EdgeCheckInIntervalField.tsx index 0b4e3aca2..97272420b 100644 --- a/app/edge/components/EdgeCheckInIntervalField.tsx +++ b/app/edge/components/EdgeCheckInIntervalField.tsx @@ -1,10 +1,11 @@ import { useEffect, useState } from 'react'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Select } from '@/portainer/components/form-components/Input'; import { useSettings } from '@/portainer/settings/queries'; import { r2a } from '@/react-tools/react2angular'; +import { FormControl } from '@@/form-components/FormControl'; +import { Select } from '@@/form-components/Input'; + interface Props { value: number; onChange(value: number): void; diff --git a/app/portainer/access-control/AccessControlForm/AccessControlForm.tsx b/app/portainer/access-control/AccessControlForm/AccessControlForm.tsx index 375e727a3..dcc436f19 100644 --- a/app/portainer/access-control/AccessControlForm/AccessControlForm.tsx +++ b/app/portainer/access-control/AccessControlForm/AccessControlForm.tsx @@ -1,10 +1,11 @@ import { FormikErrors } from 'formik'; import { useUser } from '@/portainer/hooks/useUser'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { SwitchField } from '@/portainer/components/form-components/SwitchField'; import { EditDetails } from '@/portainer/access-control/EditDetails/EditDetails'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { SwitchField } from '@@/form-components/SwitchField'; + import { ResourceControlOwnership, AccessControlFormData } from '../types'; export interface Props { diff --git a/app/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx b/app/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx index 0a35479d9..5c9fed378 100644 --- a/app/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx +++ b/app/portainer/access-control/AccessControlPanel/AccessControlPanel.tsx @@ -1,12 +1,13 @@ import { useReducer } from 'react'; -import { Button } from '@/portainer/components/Button'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; import { useUser } from '@/portainer/hooks/useUser'; import { r2a } from '@/react-tools/react2angular'; import { TeamMembership, Role } from '@/portainer/teams/types'; import { useUserMembership } from '@/portainer/users/queries'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { Button } from '@@/buttons'; + import { ResourceControlType, ResourceId } from '../types'; import { ResourceControlViewModel } from '../models/ResourceControlViewModel'; diff --git a/app/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx b/app/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx index ec3c2a526..dfe05384f 100644 --- a/app/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx +++ b/app/portainer/access-control/AccessControlPanel/AccessControlPanelDetails.tsx @@ -3,13 +3,14 @@ import { PropsWithChildren } from 'react'; import _ from 'lodash'; import { ownershipIcon, truncate } from '@/portainer/filters/filters'; -import { Tooltip } from '@/portainer/components/Tip/Tooltip'; -import { Link } from '@/portainer/components/Link'; import { UserId } from '@/portainer/users/types'; import { TeamId } from '@/portainer/teams/types'; import { useTeams } from '@/portainer/teams/queries'; import { useUsers } from '@/portainer/users/queries'; +import { Link } from '@@/Link'; +import { Tooltip } from '@@/Tip/Tooltip'; + import { ResourceControlOwnership, ResourceControlType, diff --git a/app/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx b/app/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx index 857f27c42..3fdc8c1d9 100644 --- a/app/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx +++ b/app/portainer/access-control/AccessControlPanel/AccessControlPanelForm.tsx @@ -4,11 +4,12 @@ import { useMutation } from 'react-query'; import { object } from 'yup'; import { useUser } from '@/portainer/hooks/useUser'; -import { Button } from '@/portainer/components/Button'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; import { confirmAsync } from '@/portainer/services/modal.service/confirm'; import { notifySuccess } from '@/portainer/services/notifications'; +import { Button } from '@@/buttons'; +import { LoadingButton } from '@@/buttons/LoadingButton'; + import { EditDetails } from '../EditDetails'; import { parseAccessControlFormData } from '../utils'; import { validationSchema } from '../AccessControlForm/AccessControlForm.validation'; diff --git a/app/portainer/access-control/EditDetails/EditDetails.tsx b/app/portainer/access-control/EditDetails/EditDetails.tsx index 51060dd86..50126076a 100644 --- a/app/portainer/access-control/EditDetails/EditDetails.tsx +++ b/app/portainer/access-control/EditDetails/EditDetails.tsx @@ -1,9 +1,10 @@ import { useCallback } from 'react'; import { FormikErrors } from 'formik'; -import { BoxSelector } from '@/portainer/components/BoxSelector'; import { useUser } from '@/portainer/hooks/useUser'; -import { FormError } from '@/portainer/components/form-components/FormError'; + +import { BoxSelector } from '@@/BoxSelector'; +import { FormError } from '@@/form-components/FormError'; import { ResourceControlOwnership, AccessControlFormData } from '../types'; diff --git a/app/portainer/access-control/EditDetails/TeamsField.tsx b/app/portainer/access-control/EditDetails/TeamsField.tsx index d25e0578b..456b40de8 100644 --- a/app/portainer/access-control/EditDetails/TeamsField.tsx +++ b/app/portainer/access-control/EditDetails/TeamsField.tsx @@ -1,8 +1,9 @@ -import { TeamsSelector } from '@/portainer/components/TeamsSelector'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Link } from '@/portainer/components/Link'; import { Team } from '@/portainer/teams/types'; +import { TeamsSelector } from '@@/TeamsSelector'; +import { FormControl } from '@@/form-components/FormControl'; +import { Link } from '@@/Link'; + interface Props { name: string; teams: Team[]; diff --git a/app/portainer/access-control/EditDetails/UsersField.tsx b/app/portainer/access-control/EditDetails/UsersField.tsx index 4df3bfc2a..301f44eab 100644 --- a/app/portainer/access-control/EditDetails/UsersField.tsx +++ b/app/portainer/access-control/EditDetails/UsersField.tsx @@ -1,8 +1,9 @@ -import { UsersSelector } from '@/portainer/components/UsersSelector'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Link } from '@/portainer/components/Link'; import { User } from '@/portainer/users/types'; +import { UsersSelector } from '@@/UsersSelector'; +import { FormControl } from '@@/form-components/FormControl'; +import { Link } from '@@/Link'; + interface Props { name: string; users: User[]; diff --git a/app/portainer/access-control/EditDetails/useOptions.ts b/app/portainer/access-control/EditDetails/useOptions.ts index ecaa246fd..d5c10b26e 100644 --- a/app/portainer/access-control/EditDetails/useOptions.ts +++ b/app/portainer/access-control/EditDetails/useOptions.ts @@ -2,10 +2,11 @@ import _ from 'lodash'; import { useEffect, useState } from 'react'; import { buildOption } from '@/portainer/components/BoxSelector'; -import { BoxSelectorOption } from '@/portainer/components/BoxSelector/types'; import { ownershipIcon } from '@/portainer/filters/filters'; import { Team } from '@/portainer/teams/types'; +import { BoxSelectorOption } from '@@/BoxSelector/types'; + import { ResourceControlOwnership } from '../types'; const publicOption: BoxSelectorOption = { diff --git a/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts b/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts index 3520699ed..f8fe0a4a4 100644 --- a/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts +++ b/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.controller.ts @@ -1,6 +1,6 @@ import { FeatureId } from '@/portainer/feature-flags/enums'; -import { getFeatureDetails } from './utils'; +import { getFeatureDetails } from '@@/BEFeatureIndicator/utils'; export default class BeIndicatorController { limitedToBE?: boolean; diff --git a/app/portainer/components/BEFeatureIndicator/index.ts b/app/portainer/components/BEFeatureIndicator/index.ts index 05a1f628f..4d253c1a6 100644 --- a/app/portainer/components/BEFeatureIndicator/index.ts +++ b/app/portainer/components/BEFeatureIndicator/index.ts @@ -1,8 +1,6 @@ import controller from './BEFeatureIndicator.controller'; -import './BEFeatureIndicator.css'; - -export const beFeatureIndicatorAngular = { +export const beFeatureIndicator = { templateUrl: './BEFeatureIndicator.html', controller, bindings: { @@ -10,5 +8,3 @@ export const beFeatureIndicatorAngular = { }, transclude: true, }; - -export { BEFeatureIndicator } from './BEFeatureIndicator'; diff --git a/app/portainer/components/BoxSelector/index.ts b/app/portainer/components/BoxSelector/index.ts index 2334bd23a..4180703d5 100644 --- a/app/portainer/components/BoxSelector/index.ts +++ b/app/portainer/components/BoxSelector/index.ts @@ -2,12 +2,11 @@ import angular from 'angular'; import { react2angular } from '@/react-tools/react2angular'; -import { BoxSelector, buildOption } from './BoxSelector'; +import { BoxSelector } from '@@/BoxSelector'; + import { BoxSelectorAngular } from './BoxSelectorAngular'; -export { type BoxSelectorOption } from './types'; - -export { BoxSelector, buildOption }; +export { buildOption } from './utils'; const BoxSelectorReact = react2angular(BoxSelector, [ 'value', 'onChange', @@ -15,7 +14,7 @@ const BoxSelectorReact = react2angular(BoxSelector, [ 'radioName', ]); -export default angular +export const boxSelectorModule = angular .module('app.portainer.component.box-selector', []) .component('boxSelectorReact', BoxSelectorReact) .component('boxSelector', BoxSelectorAngular).name; diff --git a/app/portainer/components/BoxSelector/utils.ts b/app/portainer/components/BoxSelector/utils.ts new file mode 100644 index 000000000..e444df69e --- /dev/null +++ b/app/portainer/components/BoxSelector/utils.ts @@ -0,0 +1,14 @@ +import { FeatureId } from '@/portainer/feature-flags/enums'; + +import { BoxSelectorOption } from '@@/BoxSelector/types'; + +export function buildOption( + id: string, + icon: string, + label: string, + description: string, + value: T, + feature?: FeatureId +): BoxSelectorOption { + return { id, icon, label, description, value, feature }; +} diff --git a/app/portainer/components/Button/index.ts b/app/portainer/components/Button/index.ts deleted file mode 100644 index 216ec6bfc..000000000 --- a/app/portainer/components/Button/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Button } from './Button'; -import { AddButton } from './AddButton'; -import { ButtonGroup } from './ButtonGroup'; - -export { Button, AddButton, ButtonGroup }; diff --git a/app/portainer/components/InformationPanel/index.ts b/app/portainer/components/InformationPanel/index.ts index 95218ede0..68b1a8020 100644 --- a/app/portainer/components/InformationPanel/index.ts +++ b/app/portainer/components/InformationPanel/index.ts @@ -1,3 +1 @@ -export { InformationPanel } from './InformationPanel'; - export { InformationPanelAngular } from './InformationPanelAngular'; diff --git a/app/portainer/components/PageHeader/HeaderContainer.ts b/app/portainer/components/PageHeader/HeaderContainer.ts new file mode 100644 index 000000000..260074ac4 --- /dev/null +++ b/app/portainer/components/PageHeader/HeaderContainer.ts @@ -0,0 +1,4 @@ +export const Header = { + transclude: true, + templateUrl: './HeaderContainer.html', +}; diff --git a/app/portainer/components/PageHeader/HeaderContent.ts b/app/portainer/components/PageHeader/HeaderContent.ts new file mode 100644 index 000000000..f66fc11ea --- /dev/null +++ b/app/portainer/components/PageHeader/HeaderContent.ts @@ -0,0 +1,8 @@ +import controller from './HeaderContent.controller'; + +export const HeaderContent = { + requires: '^rdHeader', + transclude: true, + templateUrl: './HeaderContent.html', + controller, +}; diff --git a/app/portainer/components/PageHeader/HeaderTitle.ts b/app/portainer/components/PageHeader/HeaderTitle.ts new file mode 100644 index 000000000..7cd135876 --- /dev/null +++ b/app/portainer/components/PageHeader/HeaderTitle.ts @@ -0,0 +1,11 @@ +import controller from './HeaderTitle.controller'; + +export const HeaderTitle = { + requires: '^rdHeader', + bindings: { + titleText: '@', + }, + transclude: true, + templateUrl: './HeaderTitle.html', + controller, +}; diff --git a/app/portainer/components/PageHeader/index.ts b/app/portainer/components/PageHeader/index.ts index ad1421b13..55f1efc7c 100644 --- a/app/portainer/components/PageHeader/index.ts +++ b/app/portainer/components/PageHeader/index.ts @@ -1,16 +1,12 @@ import angular from 'angular'; -import { Breadcrumbs } from './Breadcrumbs'; -import { PageHeader } from './PageHeader'; -import { HeaderContainer, HeaderAngular } from './HeaderContainer'; -import { HeaderContent, HeaderContentAngular } from './HeaderContent'; -import { HeaderTitle, HeaderTitleAngular } from './HeaderTitle'; - -export { PageHeader, Breadcrumbs, HeaderContainer, HeaderContent, HeaderTitle }; +import { Header } from './HeaderContainer'; +import { HeaderContent } from './HeaderContent'; +import { HeaderTitle } from './HeaderTitle'; export const pageHeaderModule = angular .module('portainer.app.components.header', []) - .component('rdHeader', HeaderAngular) - .component('rdHeaderContent', HeaderContentAngular) - .component('rdHeaderTitle', HeaderTitleAngular).name; + .component('rdHeader', Header) + .component('rdHeaderContent', HeaderContent) + .component('rdHeaderTitle', HeaderTitle).name; diff --git a/app/portainer/components/ReactExample.module.css b/app/portainer/components/ReactExample.module.css deleted file mode 100644 index d168e5304..000000000 --- a/app/portainer/components/ReactExample.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.red-bg { - background: red; -} diff --git a/app/portainer/components/ReactExample.stories.tsx b/app/portainer/components/ReactExample.stories.tsx deleted file mode 100644 index 9cf00eca8..000000000 --- a/app/portainer/components/ReactExample.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { UIRouter, pushStateLocationPlugin } from '@uirouter/react'; -import { Meta } from '@storybook/react'; - -import { ReactExample } from './ReactExample'; - -const meta: Meta = { - title: 'ReactExample', - component: ReactExample, -}; - -export default meta; -export { Example }; - -interface Props { - text: string; -} - -function Example({ text }: Props) { - return ( - - - - ); -} diff --git a/app/portainer/components/ReactExample.tsx b/app/portainer/components/ReactExample.tsx deleted file mode 100644 index 63a7573f2..000000000 --- a/app/portainer/components/ReactExample.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { useSref } from '@uirouter/react'; -import { Trans, useTranslation } from 'react-i18next'; - -import i18n from '@/i18n'; -import { react2angular } from '@/react-tools/react2angular'; - -import { Link } from './Link'; -import styles from './ReactExample.module.css'; - -export interface ReactExampleProps { - /** - * Example text to displayed in the component. - */ - text: string; -} - -const lngs = { - en: { nativeName: 'English' }, - de: { nativeName: 'Deutsch' }, - he: { nativeName: 'Hebrew' }, -}; - -export function ReactExample({ text }: ReactExampleProps) { - const route = 'portainer.registries'; - const { onClick, href } = useSref(route); - const { t } = useTranslation(); - - return ( -
-
{text}
- -
- - - Registries Link - - -
- {Object.entries(lngs).map(([lng, lngConfig]) => ( - - ))} -
- ); -} - -export const ReactExampleAngular = react2angular(ReactExample, ['text']); diff --git a/app/portainer/components/Tip/TextTip/TextTip.module.css b/app/portainer/components/Tip/TextTip/TextTip.module.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/portainer/components/Tip/Tooltip/index.ts b/app/portainer/components/Tip/Tooltip/index.ts index f6672ef55..842b84132 100644 --- a/app/portainer/components/Tip/Tooltip/index.ts +++ b/app/portainer/components/Tip/Tooltip/index.ts @@ -1,4 +1 @@ -import { Tooltip } from './Tooltip'; -import { TooltipAngular } from './TooltipAngular'; - -export { Tooltip, TooltipAngular }; +export { TooltipAngular } from './TooltipAngular'; diff --git a/app/portainer/components/ViewLoading/index.ts b/app/portainer/components/ViewLoading/index.ts deleted file mode 100644 index 2be09c0c9..000000000 --- a/app/portainer/components/ViewLoading/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ViewLoading, ViewLoadingAngular } from './ViewLoading'; diff --git a/app/portainer/components/form-components/FileUpload/index.ts b/app/portainer/components/form-components/FileUpload/index.ts deleted file mode 100644 index 4845fd08e..000000000 --- a/app/portainer/components/form-components/FileUpload/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { FileUploadField, FileUploadFieldAngular } from './FileUploadField'; -export { FileUploadForm } from './FileUploadForm'; diff --git a/app/portainer/components/form-components/SwitchField/index.ts b/app/portainer/components/form-components/SwitchField/index.ts deleted file mode 100644 index e743e7352..000000000 --- a/app/portainer/components/form-components/SwitchField/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { SwitchField, SwitchFieldAngular } from './SwitchField'; diff --git a/app/portainer/components/form-components/index.js b/app/portainer/components/form-components/index.js index f76d3babb..a60a7555b 100644 --- a/app/portainer/components/form-components/index.js +++ b/app/portainer/components/form-components/index.js @@ -3,13 +3,4 @@ import angular from 'angular'; import { webEditorForm } from './web-editor-form'; import { fileUploadForm } from './file-upload-form'; -import { SwitchFieldAngular } from './SwitchField'; - -import { FileUploadFieldAngular } from './FileUpload'; - -export default angular - .module('portainer.app.components.form', []) - .component('webEditorForm', webEditorForm) - .component('fileUploadForm', fileUploadForm) - .component('fileUploadField', FileUploadFieldAngular) - .component('porSwitchField', SwitchFieldAngular).name; +export default angular.module('portainer.app.components.form', []).component('webEditorForm', webEditorForm).component('fileUploadForm', fileUploadForm).name; diff --git a/app/portainer/components/index.js b/app/portainer/components/index.js index 43e617290..cf75413c2 100644 --- a/app/portainer/components/index.js +++ b/app/portainer/components/index.js @@ -1,28 +1,20 @@ import angular from 'angular'; -import { CreateAccessTokenAngular } from '../views/account/CreateAccessToken'; - +import formComponentsModule from './form-components'; import sidebarModule from './sidebar'; import gitFormModule from './forms/git-form'; import porAccessManagementModule from './accessManagement'; -import formComponentsModule from './form-components'; import widgetModule from './widget'; -import boxSelectorModule from './BoxSelector'; +import { boxSelectorModule } from './BoxSelector'; import { pageHeaderModule } from './PageHeader'; -import { ReactExampleAngular } from './ReactExample'; import { TooltipAngular } from './Tip/Tooltip'; -import { beFeatureIndicatorAngular } from './BEFeatureIndicator'; +import { beFeatureIndicator } from './BEFeatureIndicator'; import { InformationPanelAngular } from './InformationPanel'; -import { PasswordCheckHintAngular } from './PasswordCheckHint'; -import { ViewLoadingAngular } from './ViewLoading'; export default angular .module('portainer.app.components', [pageHeaderModule, boxSelectorModule, widgetModule, sidebarModule, gitFormModule, porAccessManagementModule, formComponentsModule]) .component('informationPanel', InformationPanelAngular) - .component('viewLoading', ViewLoadingAngular) + .component('portainerTooltip', TooltipAngular) - .component('reactExample', ReactExampleAngular) - .component('beFeatureIndicator', beFeatureIndicatorAngular) - .component('passwordCheckHint', PasswordCheckHintAngular) - .component('createAccessToken', CreateAccessTokenAngular).name; + .component('beFeatureIndicator', beFeatureIndicator).name; diff --git a/app/portainer/components/sidebar/SidebarMenuItem/SidebarMenuItem.tsx b/app/portainer/components/sidebar/SidebarMenuItem/SidebarMenuItem.tsx index f196da7ac..f0269c267 100644 --- a/app/portainer/components/sidebar/SidebarMenuItem/SidebarMenuItem.tsx +++ b/app/portainer/components/sidebar/SidebarMenuItem/SidebarMenuItem.tsx @@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react'; import clsx from 'clsx'; import { UISrefActive } from '@uirouter/react'; -import { Link } from '@/portainer/components/Link'; +import { Link } from '@@/Link'; import '../sidebar.css'; import styles from './SidebarMenuItem.module.css'; diff --git a/app/portainer/components/widget/index.ts b/app/portainer/components/widget/index.ts index 2b32cb47c..eed2348c5 100644 --- a/app/portainer/components/widget/index.ts +++ b/app/portainer/components/widget/index.ts @@ -1,18 +1,14 @@ import angular from 'angular'; -import { LoadingAngular } from './Loading'; -import { rdWidget, Widget } from './Widget'; -import { rdWidgetBody, WidgetBody } from './WidgetBody'; -import { rdWidgetCustomHeader } from './WidgetCustomHeader'; -import { rdWidgetFooter, WidgetFooter } from './WidgetFooter'; -import { rdWidgetTitle, WidgetTitle } from './WidgetTitle'; -import { rdWidgetTaskbar, WidgetTaskbar } from './WidgetTaskbar'; - -export { Widget, WidgetBody, WidgetFooter, WidgetTitle, WidgetTaskbar }; +import { rdWidgetBody } from './rd-widget-body'; +import { rdWidget } from './rd-widget'; +import { rdWidgetCustomHeader } from './rd-widget-custom-header'; +import { rdWidgetFooter } from './rd-widget-footer'; +import { rdWidgetTaskbar } from './rd-widget-taskbar'; +import { rdWidgetTitle } from './rd-widget-title'; export default angular - .module('portainer.shared.components.widget', []) - .component('rdLoading', LoadingAngular) + .module('portainer.app.components.widget', []) .component('rdWidget', rdWidget) .component('rdWidgetBody', rdWidgetBody) .component('rdWidgetCustomHeader', rdWidgetCustomHeader) diff --git a/app/portainer/components/widget/rd-widget-body.ts b/app/portainer/components/widget/rd-widget-body.ts new file mode 100644 index 000000000..7b7370f5f --- /dev/null +++ b/app/portainer/components/widget/rd-widget-body.ts @@ -0,0 +1,14 @@ +export const rdWidgetBody = { + requires: '^rdWidget', + bindings: { + loading: '@?', + classes: '@?', + }, + transclude: true, + template: ` +
+ +
+
+ `, +}; diff --git a/app/portainer/components/widget/WidgetCustomHeader.tsx b/app/portainer/components/widget/rd-widget-custom-header.ts similarity index 100% rename from app/portainer/components/widget/WidgetCustomHeader.tsx rename to app/portainer/components/widget/rd-widget-custom-header.ts diff --git a/app/portainer/components/widget/rd-widget-footer.ts b/app/portainer/components/widget/rd-widget-footer.ts new file mode 100644 index 000000000..153d843e0 --- /dev/null +++ b/app/portainer/components/widget/rd-widget-footer.ts @@ -0,0 +1,7 @@ +export const rdWidgetFooter = { + requires: '^rdWidget', + transclude: true, + template: ` + + `, +}; diff --git a/app/portainer/components/widget/rd-widget-taskbar.ts b/app/portainer/components/widget/rd-widget-taskbar.ts new file mode 100644 index 000000000..ac0e1d1cc --- /dev/null +++ b/app/portainer/components/widget/rd-widget-taskbar.ts @@ -0,0 +1,14 @@ +export const rdWidgetTaskbar = { + requires: '^rdWidget', + bindings: { + classes: '@?', + }, + transclude: true, + template: ` +
+
+
+
+
+ `, +}; diff --git a/app/portainer/components/widget/rd-widget-title.ts b/app/portainer/components/widget/rd-widget-title.ts new file mode 100644 index 000000000..8bab12f0a --- /dev/null +++ b/app/portainer/components/widget/rd-widget-title.ts @@ -0,0 +1,22 @@ +export const rdWidgetTitle = { + requires: '^rdWidget', + bindings: { + titleText: '@', + icon: '@', + classes: '@?', + }, + transclude: { + title: '?headerTitle', + }, + template: ` +
+
+ + + {{ $ctrl.titleText }} + + +
+
+`, +}; diff --git a/app/portainer/components/widget/rd-widget.ts b/app/portainer/components/widget/rd-widget.ts new file mode 100644 index 000000000..d4cbffc6f --- /dev/null +++ b/app/portainer/components/widget/rd-widget.ts @@ -0,0 +1,4 @@ +export const rdWidget = { + transclude: true, + template: `
`, +}; diff --git a/app/portainer/home/BackupFailedPanel.tsx b/app/portainer/home/BackupFailedPanel.tsx index ed7917bd3..a30f3662e 100644 --- a/app/portainer/home/BackupFailedPanel.tsx +++ b/app/portainer/home/BackupFailedPanel.tsx @@ -2,11 +2,12 @@ import { useQuery } from 'react-query'; import { error as notifyError } from '@/portainer/services/notifications'; -import { InformationPanel } from '../components/InformationPanel'; -import { TextTip } from '../components/Tip/TextTip'; +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'; -import { Link } from '../components/Link'; export function BackupFailedPanel() { const { status, isLoading } = useBackupStatus(); diff --git a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx b/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx index b76e68b93..d1c8a3d1d 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx +++ b/app/portainer/home/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx @@ -13,11 +13,12 @@ import { isEdgeEnvironment, } from '@/portainer/environments/utils'; import type { TagId } from '@/portainer/tags/types'; -import { Button } from '@/portainer/components/Button'; -import { Link } from '@/portainer/components/Link'; import { useIsAdmin } from '@/portainer/hooks/useUser'; import { useTags } from '@/portainer/tags/queries'; +import { Button } from '@@/buttons'; +import { Link } from '@@/Link'; + import { EnvironmentIcon } from './EnvironmentIcon'; import { EdgeIndicator } from './EdgeIndicator'; import { EnvironmentStats } from './EnvironmentStats'; diff --git a/app/portainer/home/EnvironmentList/EnvironmentList.tsx b/app/portainer/home/EnvironmentList/EnvironmentList.tsx index 3c64d0060..c16db5fac 100644 --- a/app/portainer/home/EnvironmentList/EnvironmentList.tsx +++ b/app/portainer/home/EnvironmentList/EnvironmentList.tsx @@ -1,7 +1,6 @@ import { ReactNode, useEffect, useState } from 'react'; import clsx from 'clsx'; -import { PaginationControls } from '@/portainer/components/pagination-controls'; import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState'; import { Environment, @@ -9,23 +8,11 @@ import { EnvironmentStatus, } from '@/portainer/environments/types'; import { EnvironmentGroupId } from '@/portainer/environment-groups/types'; -import { Button } from '@/portainer/components/Button'; import { useIsAdmin } from '@/portainer/hooks/useUser'; -import { - FilterSearchBar, - useSearchBarState, -} from '@/portainer/components/datatables/components/FilterSearchBar'; -import { SortbySelector } from '@/portainer/components/datatables/components/SortbySelector'; import { HomepageFilter, useHomePageFilter, } from '@/portainer/home/HomepageFilter'; -import { - TableActions, - TableContainer, - TableTitle, -} from '@/portainer/components/datatables/components'; -import { TableFooter } from '@/portainer/components/datatables/components/TableFooter'; import { useDebounce } from '@/portainer/hooks/useDebounce'; import { refetchIfAnyOffline, @@ -35,6 +22,16 @@ import { useGroups } from '@/portainer/environment-groups/queries'; import { useTags } from '@/portainer/tags/queries'; import { Filter } from '@/portainer/home/types'; +import { TableFooter } from '@@/datatables/TableFooter'; +import { TableActions, TableContainer, TableTitle } from '@@/datatables'; +import { SortbySelector } from '@@/datatables/SortbySelector'; +import { + FilterSearchBar, + useSearchBarState, +} from '@@/datatables/FilterSearchBar'; +import { Button } from '@@/buttons'; +import { PaginationControls } from '@@/PaginationControls'; + import { EnvironmentItem } from './EnvironmentItem'; import { KubeconfigButton } from './KubeconfigButton'; import styles from './EnvironmentList.module.css'; diff --git a/app/portainer/home/EnvironmentList/KubeconfigButton.tsx b/app/portainer/home/EnvironmentList/KubeconfigButton.tsx index bdc18d77a..0d62e70e8 100644 --- a/app/portainer/home/EnvironmentList/KubeconfigButton.tsx +++ b/app/portainer/home/EnvironmentList/KubeconfigButton.tsx @@ -4,7 +4,8 @@ import { Environment } from '@/portainer/environments/types'; import { EnvironmentsQueryParams } from '@/portainer/environments/environment.service/index'; import { isKubernetesEnvironment } from '@/portainer/environments/utils'; import { trackEvent } from '@/angulartics.matomo/analytics-services'; -import { Button } from '@/portainer/components/Button'; + +import { Button } from '@@/buttons'; import { KubeconfigPrompt } from './KubeconfigPrompt'; import '@reach/dialog/styles.css'; diff --git a/app/portainer/home/EnvironmentList/KubeconfigPrompt.tsx b/app/portainer/home/EnvironmentList/KubeconfigPrompt.tsx index 8a6493226..ab83ebc0f 100644 --- a/app/portainer/home/EnvironmentList/KubeconfigPrompt.tsx +++ b/app/portainer/home/EnvironmentList/KubeconfigPrompt.tsx @@ -4,14 +4,15 @@ import { DialogOverlay } from '@reach/dialog'; import * as kcService from '@/kubernetes/services/kubeconfig.service'; import * as notifications from '@/portainer/services/notifications'; -import { Button } from '@/portainer/components/Button'; -import { Checkbox } from '@/portainer/components/form-components/Checkbox'; import { EnvironmentType } from '@/portainer/environments/types'; import { EnvironmentsQueryParams } from '@/portainer/environments/environment.service/index'; -import { PaginationControls } from '@/portainer/components/pagination-controls'; import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState'; import { useEnvironmentList } from '@/portainer/environments/queries/useEnvironmentList'; +import { PaginationControls } from '@@/PaginationControls'; +import { Checkbox } from '@@/form-components/Checkbox'; +import { Button } from '@@/buttons'; + import { useSelection } from './KubeconfigSelection'; import styles from './KubeconfigPrompt.module.css'; import '@reach/dialog/styles.css'; diff --git a/app/portainer/home/EnvironmentList/NoEnvironmentsInfoPanel.tsx b/app/portainer/home/EnvironmentList/NoEnvironmentsInfoPanel.tsx index bf2b6b57c..c4999fc6c 100644 --- a/app/portainer/home/EnvironmentList/NoEnvironmentsInfoPanel.tsx +++ b/app/portainer/home/EnvironmentList/NoEnvironmentsInfoPanel.tsx @@ -1,6 +1,6 @@ -import { InformationPanel } from '@/portainer/components/InformationPanel'; -import { Link } from '@/portainer/components/Link'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; +import { InformationPanel } from '@@/InformationPanel'; +import { Link } from '@@/Link'; +import { TextTip } from '@@/Tip/TextTip'; export function NoEnvironmentsInfoPanel({ isAdmin }: { isAdmin: boolean }) { return ( diff --git a/app/portainer/home/HomeView.tsx b/app/portainer/home/HomeView.tsx index 5084a00fc..fa7e775bd 100644 --- a/app/portainer/home/HomeView.tsx +++ b/app/portainer/home/HomeView.tsx @@ -3,7 +3,8 @@ import { useState } from 'react'; import { r2a } from '@/react-tools/react2angular'; -import { PageHeader } from '../components/PageHeader'; +import { PageHeader } from '@@/PageHeader'; + import * as notifications from '../services/notifications'; import { Environment } from '../environments/types'; import { snapshotEndpoints } from '../environments/environment.service'; diff --git a/app/portainer/home/HomepageFilter.tsx b/app/portainer/home/HomepageFilter.tsx index a5439d681..65ba759ab 100644 --- a/app/portainer/home/HomepageFilter.tsx +++ b/app/portainer/home/HomepageFilter.tsx @@ -1,9 +1,10 @@ import { components, OptionProps } from 'react-select'; import { useLocalStorage } from '@/portainer/hooks/useLocalStorage'; -import { Select } from '@/portainer/components/form-components/ReactSelect'; import { Filter } from '@/portainer/home/types'; +import { Select } from '@@/form-components/ReactSelect'; + interface Props { filterOptions: Filter[]; onChange: (filterOptions: Filter[]) => void; diff --git a/app/portainer/home/LicenseNodePanel.tsx b/app/portainer/home/LicenseNodePanel.tsx index 96e653287..9acc766ec 100644 --- a/app/portainer/home/LicenseNodePanel.tsx +++ b/app/portainer/home/LicenseNodePanel.tsx @@ -2,8 +2,9 @@ import { useQuery } from 'react-query'; import { error as notifyError } from '@/portainer/services/notifications'; -import { InformationPanel } from '../components/InformationPanel'; -import { TextTip } from '../components/Tip/TextTip'; +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'; diff --git a/app/portainer/home/MotdPanel.tsx b/app/portainer/home/MotdPanel.tsx index 55eed8b6b..4f7f6f8dd 100644 --- a/app/portainer/home/MotdPanel.tsx +++ b/app/portainer/home/MotdPanel.tsx @@ -3,7 +3,7 @@ import _ from 'lodash'; import { useUIState } from '@/portainer/hooks/UIStateProvider'; -import { InformationPanel } from '../components/InformationPanel/InformationPanel'; +import { InformationPanel } from '@@/InformationPanel'; import { getMotd } from './home.service'; diff --git a/app/portainer/react/components/file-upload-field.ts b/app/portainer/react/components/file-upload-field.ts new file mode 100644 index 000000000..3675111d8 --- /dev/null +++ b/app/portainer/react/components/file-upload-field.ts @@ -0,0 +1,12 @@ +import { r2a } from '@/react-tools/react2angular'; + +import { FileUploadField } from '@@/form-components/FileUpload'; + +export const fileUploadField = r2a(FileUploadField, [ + 'onChange', + 'value', + 'title', + 'required', + 'accept', + 'inputId', +]); diff --git a/app/portainer/react/components/index.ts b/app/portainer/react/components/index.ts index 154591246..db2ac4027 100644 --- a/app/portainer/react/components/index.ts +++ b/app/portainer/react/components/index.ts @@ -1,8 +1,14 @@ import angular from 'angular'; import { r2a } from '@/react-tools/react2angular'; -import { TagSelector } from '@/react/components/TagSelector'; +import { TagSelector } from '@@/TagSelector'; +import { Loading } from '@@/Widget/Loading'; +import { PasswordCheckHint } from '@@/PasswordCheckHint'; +import { ViewLoading } from '@@/ViewLoading'; + +import { fileUploadField } from './file-upload-field'; +import { switchField } from './switch-field'; import { customTemplatesModule } from './custom-templates'; export const componentsModule = angular @@ -10,4 +16,12 @@ export const componentsModule = angular .component( 'tagSelector', r2a(TagSelector, ['allowCreate', 'onChange', 'value']) - ).name; + ) + .component('fileUploadField', fileUploadField) + .component('porSwitchField', switchField) + .component( + 'passwordCheckHint', + r2a(PasswordCheckHint, ['forceChangePassword', 'passwordValid']) + ) + .component('rdLoading', r2a(Loading, [])) + .component('viewLoading', r2a(ViewLoading, ['message'])).name; diff --git a/app/portainer/react/components/switch-field.ts b/app/portainer/react/components/switch-field.ts new file mode 100644 index 000000000..f5e132c04 --- /dev/null +++ b/app/portainer/react/components/switch-field.ts @@ -0,0 +1,15 @@ +import { r2a } from '@/react-tools/react2angular'; + +import { SwitchField } from '@@/form-components/SwitchField'; + +export const switchField = r2a(SwitchField, [ + 'tooltip', + 'checked', + 'label', + 'name', + 'labelClass', + 'dataCy', + 'disabled', + 'onChange', + 'featureId', +]); diff --git a/app/portainer/react/views/index.ts b/app/portainer/react/views/index.ts index 1b5abbb0b..18d7f8b19 100644 --- a/app/portainer/react/views/index.ts +++ b/app/portainer/react/views/index.ts @@ -1,7 +1,13 @@ import angular from 'angular'; +import { r2a } from '@/react-tools/react2angular'; +import { CreateAccessToken } from '@/react/portainer/account/CreateAccessTokenView'; + import { wizardModule } from './wizard'; -export const viewsModule = angular.module('portainer.app.react.views', [ - wizardModule, -]).name; +export const viewsModule = angular + .module('portainer.app.react.views', [wizardModule]) + .component( + 'createAccessToken', + r2a(CreateAccessToken, ['onSubmit', 'onError']) + ).name; diff --git a/app/portainer/services/modal.service/prompt.ts b/app/portainer/services/modal.service/prompt.ts index e9a6382d0..cc597dfd8 100644 --- a/app/portainer/services/modal.service/prompt.ts +++ b/app/portainer/services/modal.service/prompt.ts @@ -1,6 +1,6 @@ import sanitize from 'sanitize-html'; import bootbox from 'bootbox'; -import '@/portainer/components/BoxSelector/BoxSelectorItem.css'; +import '@@/BoxSelector/BoxSelectorItem.css'; import { applyBoxCSS, ButtonsOptions, confirmButtons } from './utils'; diff --git a/app/portainer/settings/authentication/components/SaveAuthSettingsButton.tsx b/app/portainer/settings/authentication/components/SaveAuthSettingsButton.tsx index b9525caa0..1765be496 100644 --- a/app/portainer/settings/authentication/components/SaveAuthSettingsButton.tsx +++ b/app/portainer/settings/authentication/components/SaveAuthSettingsButton.tsx @@ -1,5 +1,5 @@ -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; export interface Props { onSubmit(): void; diff --git a/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx b/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx index 51cc1bf00..ef684fd60 100644 --- a/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx +++ b/app/portainer/settings/authentication/internal-auth/InternalAuth.tsx @@ -1,7 +1,8 @@ -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; import { react2angular } from '@/react-tools/react2angular'; import { confirm } from '@/portainer/services/modal.service/confirm'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; + import { SaveAuthSettingsButton } from '../components/SaveAuthSettingsButton'; import { Settings } from '../../types'; diff --git a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx index 191f1d232..751efb719 100644 --- a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx +++ b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx @@ -2,14 +2,15 @@ import { Field, Form, Formik } from 'formik'; import * as yup from 'yup'; import { useCallback, useEffect } from 'react'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { Input } from '@/portainer/components/form-components/Input'; import { baseHref } from '@/portainer/helpers/pathHelper'; import { notifySuccess } from '@/portainer/services/notifications'; import { useUpdateSettingsMutation } from '@/portainer/settings/queries'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { FormControl } from '@@/form-components/FormControl'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { Input } from '@@/form-components/Input'; + import { Settings } from '../types'; import { EnabledWaitingRoomSwitch } from './EnableWaitingRoomSwitch'; diff --git a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutomaticEdgeEnvCreation.tsx b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutomaticEdgeEnvCreation.tsx index 0806419f6..11ebd9603 100644 --- a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutomaticEdgeEnvCreation.tsx +++ b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutomaticEdgeEnvCreation.tsx @@ -1,12 +1,13 @@ import { useMutation } from 'react-query'; import { useEffect } from 'react'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; import { generateKey } from '@/portainer/environments/environment.service/edge'; import { useSettings } from '@/portainer/settings/queries'; import { EdgeScriptForm } from '@/react/edge/components/EdgeScriptForm'; import { commandsTabs } from '@/react/edge/components/EdgeScriptForm/scripts'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; + import { AutoEnvCreationSettingsForm } from './AutoEnvCreationSettingsForm'; const commands = { diff --git a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/EnableWaitingRoomSwitch.tsx b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/EnableWaitingRoomSwitch.tsx index a67691aa3..59b5b31a7 100644 --- a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/EnableWaitingRoomSwitch.tsx +++ b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/EnableWaitingRoomSwitch.tsx @@ -1,9 +1,10 @@ import { useField } from 'formik'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Switch } from '@/portainer/components/form-components/SwitchField/Switch'; import { confirmAsync } from '@/portainer/services/modal.service/confirm'; +import { FormControl } from '@@/form-components/FormControl'; +import { Switch } from '@@/form-components/SwitchField/Switch'; + export function EnabledWaitingRoomSwitch() { const [inputProps, meta, helpers] = useField('TrustOnFirstConnect'); diff --git a/app/portainer/settings/edge-compute/EdgeComputeSettings/EdgeComputeSettings.tsx b/app/portainer/settings/edge-compute/EdgeComputeSettings/EdgeComputeSettings.tsx index 8ab89223e..d367d28be 100644 --- a/app/portainer/settings/edge-compute/EdgeComputeSettings/EdgeComputeSettings.tsx +++ b/app/portainer/settings/edge-compute/EdgeComputeSettings/EdgeComputeSettings.tsx @@ -1,12 +1,13 @@ import { Formik, Form } from 'formik'; -import { Switch } from '@/portainer/components/form-components/SwitchField/Switch'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; import { EdgeCheckinIntervalField } from '@/edge/components/EdgeCheckInIntervalField'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; + +import { Switch } from '@@/form-components/SwitchField/Switch'; +import { FormControl } from '@@/form-components/FormControl'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { TextTip } from '@@/Tip/TextTip'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; import { Settings } from '../types'; diff --git a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatable.tsx b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatable.tsx index 6f8739ab5..2c409922d 100644 --- a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatable.tsx +++ b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatable.tsx @@ -1,14 +1,15 @@ import { useTable, usePagination, useSortBy } from 'react-table'; import { useRowSelectColumn } from '@lineup-lite/hooks'; import { FDOProfilesDatatableActions } from 'Portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions'; -import { SelectedRowsCount } from 'Portainer/components/datatables/components/SelectedRowsCount'; -import { PaginationControls } from 'Portainer/components/pagination-controls'; -import { TableFooter } from 'Portainer/components/datatables/components/TableFooter'; -import { useTableSettings } from 'Portainer/components/datatables/components/useTableSettings'; -import { useRowSelect } from 'Portainer/components/datatables/components/useRowSelect'; import { Profile } from '@/portainer/hostmanagement/fdo/model'; import PortainerError from '@/portainer/error'; + +import { PaginationControls } from '@@/PaginationControls'; +import { SelectedRowsCount } from '@@/datatables/SelectedRowsCount'; +import { TableFooter } from '@@/datatables/TableFooter'; +import { useTableSettings } from '@@/datatables/useTableSettings'; +import { useRowSelect } from '@@/datatables/useRowSelect'; import { Table, TableActions, @@ -16,11 +17,11 @@ import { TableHeaderRow, TableRow, TableTitle, -} from '@/portainer/components/datatables/components'; +} from '@@/datatables'; import { PaginationTableSettings, SortableTableSettings, -} from '@/portainer/components/datatables/types'; +} from '@@/datatables/types'; import { useFDOProfiles } from './useFDOProfiles'; import { useColumns } from './columns'; diff --git a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx index 4bf77564c..6aa281ec5 100644 --- a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx +++ b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx @@ -1,9 +1,7 @@ import { useQueryClient } from 'react-query'; import { useRouter } from '@uirouter/react'; -import { Button } from '@/portainer/components/Button'; import { Profile } from '@/portainer/hostmanagement/fdo/model'; -import { Link } from '@/portainer/components/Link'; import { confirmAsync } from '@/portainer/services/modal.service/confirm'; import * as notifications from '@/portainer/services/notifications'; import { @@ -11,6 +9,9 @@ import { duplicateProfile, } from '@/portainer/hostmanagement/fdo/fdo.service'; +import { Link } from '@@/Link'; +import { Button } from '@@/buttons'; + interface Props { isFDOEnabled: boolean; selectedItems: Profile[]; diff --git a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableContainer.tsx b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableContainer.tsx index f8153d715..a0b61e5cd 100644 --- a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableContainer.tsx +++ b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableContainer.tsx @@ -1,4 +1,4 @@ -import { TableSettingsProvider } from '@/portainer/components/datatables/components/useTableSettings'; +import { TableSettingsProvider } from '@@/datatables/useTableSettings'; import { FDOProfilesDatatable, diff --git a/app/portainer/settings/edge-compute/SettingsFDO/SettingsFDO.tsx b/app/portainer/settings/edge-compute/SettingsFDO/SettingsFDO.tsx index fc60b97e4..28fe41505 100644 --- a/app/portainer/settings/edge-compute/SettingsFDO/SettingsFDO.tsx +++ b/app/portainer/settings/edge-compute/SettingsFDO/SettingsFDO.tsx @@ -1,16 +1,17 @@ import { useEffect, useState } from 'react'; import { Formik, Field, Form } from 'formik'; -import { Switch } from '@/portainer/components/form-components/SwitchField/Switch'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; -import { Input } from '@/portainer/components/form-components/Input'; import { FDOConfiguration } from '@/portainer/hostmanagement/fdo/model'; import { FDOProfilesDatatableContainer } from '@/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableContainer'; +import { Switch } from '@@/form-components/SwitchField/Switch'; +import { FormControl } from '@@/form-components/FormControl'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { TextTip } from '@@/Tip/TextTip'; +import { Input } from '@@/form-components/Input'; + import styles from './SettingsFDO.module.css'; import { validationSchema } from './SettingsFDO.validation'; diff --git a/app/portainer/settings/edge-compute/SettingsOpenAMT/SettingsOpenAMT.tsx b/app/portainer/settings/edge-compute/SettingsOpenAMT/SettingsOpenAMT.tsx index c50a835dc..27b358504 100644 --- a/app/portainer/settings/edge-compute/SettingsOpenAMT/SettingsOpenAMT.tsx +++ b/app/portainer/settings/edge-compute/SettingsOpenAMT/SettingsOpenAMT.tsx @@ -1,15 +1,16 @@ import { useState } from 'react'; import { Formik, Field, Form } from 'formik'; -import { Switch } from '@/portainer/components/form-components/SwitchField/Switch'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; -import { Input } from '@/portainer/components/form-components/Input'; -import { FileUploadField } from '@/portainer/components/form-components/FileUpload'; import { OpenAMTConfiguration } from '@/portainer/hostmanagement/open-amt/model'; +import { Switch } from '@@/form-components/SwitchField/Switch'; +import { FormControl } from '@@/form-components/FormControl'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { TextTip } from '@@/Tip/TextTip'; +import { Input } from '@@/form-components/Input'; +import { FileUploadField } from '@@/form-components/FileUpload'; + import { validationSchema } from './SettingsOpenAMT.validation'; export interface Settings { diff --git a/app/portainer/teams/CreateTeamForm/CreateTeamForm.tsx b/app/portainer/teams/CreateTeamForm/CreateTeamForm.tsx index 1d5757bce..9089fc38c 100644 --- a/app/portainer/teams/CreateTeamForm/CreateTeamForm.tsx +++ b/app/portainer/teams/CreateTeamForm/CreateTeamForm.tsx @@ -1,12 +1,13 @@ import { Formik, Field, Form } from 'formik'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; import { UserViewModel } from '@/portainer/models/user'; import { TeamViewModel } from '@/portainer/models/team'; -import { Input } from '@/portainer/components/form-components/Input'; -import { UsersSelector } from '@/portainer/components/UsersSelector'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; + +import { FormControl } from '@@/form-components/FormControl'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { Input } from '@@/form-components/Input'; +import { UsersSelector } from '@@/UsersSelector'; +import { LoadingButton } from '@@/buttons/LoadingButton'; import { validationSchema } from './CreateTeamForm.validation'; diff --git a/app/portainer/views/account/CreateAccessToken/index.ts b/app/portainer/views/account/CreateAccessToken/index.ts deleted file mode 100644 index f12a8e87c..000000000 --- a/app/portainer/views/account/CreateAccessToken/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { react2angular } from '@/react-tools/react2angular'; - -import { CreateAccessToken } from './CreateAccessToken'; - -const CreateAccessTokenAngular = react2angular(CreateAccessToken, [ - 'onSubmit', - 'onError', -]); -export { CreateAccessToken, CreateAccessTokenAngular }; diff --git a/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.css b/app/react/components/BEFeatureIndicator/BEFeatureIndicator.css similarity index 100% rename from app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.css rename to app/react/components/BEFeatureIndicator/BEFeatureIndicator.css diff --git a/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx b/app/react/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx similarity index 100% rename from app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx rename to app/react/components/BEFeatureIndicator/BEFeatureIndicator.stories.tsx diff --git a/app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.tsx b/app/react/components/BEFeatureIndicator/BEFeatureIndicator.tsx similarity index 100% rename from app/portainer/components/BEFeatureIndicator/BEFeatureIndicator.tsx rename to app/react/components/BEFeatureIndicator/BEFeatureIndicator.tsx diff --git a/app/react/components/BEFeatureIndicator/index.ts b/app/react/components/BEFeatureIndicator/index.ts new file mode 100644 index 000000000..de5e2b703 --- /dev/null +++ b/app/react/components/BEFeatureIndicator/index.ts @@ -0,0 +1 @@ +export { BEFeatureIndicator } from './BEFeatureIndicator'; diff --git a/app/portainer/components/BEFeatureIndicator/utils.ts b/app/react/components/BEFeatureIndicator/utils.ts similarity index 100% rename from app/portainer/components/BEFeatureIndicator/utils.ts rename to app/react/components/BEFeatureIndicator/utils.ts diff --git a/app/portainer/components/BoxSelector/BoxSelector.css b/app/react/components/BoxSelector/BoxSelector.css similarity index 100% rename from app/portainer/components/BoxSelector/BoxSelector.css rename to app/react/components/BoxSelector/BoxSelector.css diff --git a/app/portainer/components/BoxSelector/BoxSelector.module.css b/app/react/components/BoxSelector/BoxSelector.module.css similarity index 100% rename from app/portainer/components/BoxSelector/BoxSelector.module.css rename to app/react/components/BoxSelector/BoxSelector.module.css diff --git a/app/portainer/components/BoxSelector/BoxSelector.stories.tsx b/app/react/components/BoxSelector/BoxSelector.stories.tsx similarity index 100% rename from app/portainer/components/BoxSelector/BoxSelector.stories.tsx rename to app/react/components/BoxSelector/BoxSelector.stories.tsx diff --git a/app/portainer/components/BoxSelector/BoxSelector.test.tsx b/app/react/components/BoxSelector/BoxSelector.test.tsx similarity index 100% rename from app/portainer/components/BoxSelector/BoxSelector.test.tsx rename to app/react/components/BoxSelector/BoxSelector.test.tsx diff --git a/app/portainer/components/BoxSelector/BoxSelector.tsx b/app/react/components/BoxSelector/BoxSelector.tsx similarity index 74% rename from app/portainer/components/BoxSelector/BoxSelector.tsx rename to app/react/components/BoxSelector/BoxSelector.tsx index fc2ac0444..19f8590d5 100644 --- a/app/portainer/components/BoxSelector/BoxSelector.tsx +++ b/app/react/components/BoxSelector/BoxSelector.tsx @@ -1,7 +1,5 @@ import clsx from 'clsx'; -import type { FeatureId } from '@/portainer/feature-flags/enums'; - import './BoxSelector.css'; import styles from './BoxSelector.module.css'; import { BoxSelectorItem } from './BoxSelectorItem'; @@ -36,14 +34,3 @@ export function BoxSelector({ ); } - -export function buildOption( - id: string, - icon: string, - label: string, - description: string, - value: T, - feature?: FeatureId -): BoxSelectorOption { - return { id, icon, label, description, value, feature }; -} diff --git a/app/portainer/components/BoxSelector/BoxSelectorItem.css b/app/react/components/BoxSelector/BoxSelectorItem.css similarity index 100% rename from app/portainer/components/BoxSelector/BoxSelectorItem.css rename to app/react/components/BoxSelector/BoxSelectorItem.css diff --git a/app/portainer/components/BoxSelector/BoxSelectorItem.stories.tsx b/app/react/components/BoxSelector/BoxSelectorItem.stories.tsx similarity index 100% rename from app/portainer/components/BoxSelector/BoxSelectorItem.stories.tsx rename to app/react/components/BoxSelector/BoxSelectorItem.stories.tsx diff --git a/app/portainer/components/BoxSelector/BoxSelectorItem.tsx b/app/react/components/BoxSelector/BoxSelectorItem.tsx similarity index 100% rename from app/portainer/components/BoxSelector/BoxSelectorItem.tsx rename to app/react/components/BoxSelector/BoxSelectorItem.tsx diff --git a/app/react/components/BoxSelector/index.ts b/app/react/components/BoxSelector/index.ts new file mode 100644 index 000000000..6563fb659 --- /dev/null +++ b/app/react/components/BoxSelector/index.ts @@ -0,0 +1,2 @@ +export { BoxSelector } from './BoxSelector'; +export type { BoxSelectorOption } from './types'; diff --git a/app/portainer/components/BoxSelector/types.ts b/app/react/components/BoxSelector/types.ts similarity index 100% rename from app/portainer/components/BoxSelector/types.ts rename to app/react/components/BoxSelector/types.ts diff --git a/app/portainer/components/Code/Code.module.css b/app/react/components/Code/Code.module.css similarity index 100% rename from app/portainer/components/Code/Code.module.css rename to app/react/components/Code/Code.module.css diff --git a/app/portainer/components/Code/Code.stories.tsx b/app/react/components/Code/Code.stories.tsx similarity index 100% rename from app/portainer/components/Code/Code.stories.tsx rename to app/react/components/Code/Code.stories.tsx diff --git a/app/portainer/components/Code/Code.test.tsx b/app/react/components/Code/Code.test.tsx similarity index 100% rename from app/portainer/components/Code/Code.test.tsx rename to app/react/components/Code/Code.test.tsx diff --git a/app/portainer/components/Code/Code.tsx b/app/react/components/Code/Code.tsx similarity index 88% rename from app/portainer/components/Code/Code.tsx rename to app/react/components/Code/Code.tsx index e27982349..7c5dd93bf 100644 --- a/app/portainer/components/Code/Code.tsx +++ b/app/react/components/Code/Code.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; -import { Button } from '../Button'; -import { useCopy } from '../Button/CopyButton/useCopy'; +import { Button } from '@@/buttons'; +import { useCopy } from '@@/buttons/CopyButton/useCopy'; import styles from './Code.module.css'; diff --git a/app/portainer/components/Code/index.ts b/app/react/components/Code/index.ts similarity index 100% rename from app/portainer/components/Code/index.ts rename to app/react/components/Code/index.ts diff --git a/app/portainer/components/Dashboard/DashboardItem.stories.tsx b/app/react/components/DashboardItem/DashboardItem.stories.tsx similarity index 93% rename from app/portainer/components/Dashboard/DashboardItem.stories.tsx rename to app/react/components/DashboardItem/DashboardItem.stories.tsx index 4a60a105c..805c86d1e 100644 --- a/app/portainer/components/Dashboard/DashboardItem.stories.tsx +++ b/app/react/components/DashboardItem/DashboardItem.stories.tsx @@ -1,6 +1,6 @@ import { Meta, Story } from '@storybook/react'; -import { Link } from '@/portainer/components/Link'; +import { Link } from '@@/Link'; import { DashboardItem } from './DashboardItem'; diff --git a/app/portainer/components/Dashboard/DashboardItem.test.tsx b/app/react/components/DashboardItem/DashboardItem.test.tsx similarity index 100% rename from app/portainer/components/Dashboard/DashboardItem.test.tsx rename to app/react/components/DashboardItem/DashboardItem.test.tsx diff --git a/app/portainer/components/Dashboard/DashboardItem.tsx b/app/react/components/DashboardItem/DashboardItem.tsx similarity index 90% rename from app/portainer/components/Dashboard/DashboardItem.tsx rename to app/react/components/DashboardItem/DashboardItem.tsx index 7541fdb09..f669a1ba5 100644 --- a/app/portainer/components/Dashboard/DashboardItem.tsx +++ b/app/react/components/DashboardItem/DashboardItem.tsx @@ -1,4 +1,4 @@ -import { Widget, WidgetBody } from '@/portainer/components/widget'; +import { Widget, WidgetBody } from '@@/Widget'; interface Props { value: number; diff --git a/app/react/components/DashboardItem/index.ts b/app/react/components/DashboardItem/index.ts new file mode 100644 index 000000000..57116e08e --- /dev/null +++ b/app/react/components/DashboardItem/index.ts @@ -0,0 +1 @@ +export { DashboardItem } from './DashboardItem'; diff --git a/app/portainer/components/DetailsTable/DetailsRow.tsx b/app/react/components/DetailsTable/DetailsRow.tsx similarity index 100% rename from app/portainer/components/DetailsTable/DetailsRow.tsx rename to app/react/components/DetailsTable/DetailsRow.tsx diff --git a/app/portainer/components/DetailsTable/DetailsTable.stories.tsx b/app/react/components/DetailsTable/DetailsTable.stories.tsx similarity index 100% rename from app/portainer/components/DetailsTable/DetailsTable.stories.tsx rename to app/react/components/DetailsTable/DetailsTable.stories.tsx diff --git a/app/portainer/components/DetailsTable/DetailsTable.test.tsx b/app/react/components/DetailsTable/DetailsTable.test.tsx similarity index 100% rename from app/portainer/components/DetailsTable/DetailsTable.test.tsx rename to app/react/components/DetailsTable/DetailsTable.test.tsx diff --git a/app/portainer/components/DetailsTable/DetailsTable.tsx b/app/react/components/DetailsTable/DetailsTable.tsx similarity index 100% rename from app/portainer/components/DetailsTable/DetailsTable.tsx rename to app/react/components/DetailsTable/DetailsTable.tsx diff --git a/app/portainer/components/DetailsTable/index.tsx b/app/react/components/DetailsTable/index.tsx similarity index 100% rename from app/portainer/components/DetailsTable/index.tsx rename to app/react/components/DetailsTable/index.tsx diff --git a/app/portainer/components/InformationPanel/InformationPanel.tsx b/app/react/components/InformationPanel.tsx similarity index 93% rename from app/portainer/components/InformationPanel/InformationPanel.tsx rename to app/react/components/InformationPanel.tsx index d38863cb4..6650020b5 100644 --- a/app/portainer/components/InformationPanel/InformationPanel.tsx +++ b/app/react/components/InformationPanel.tsx @@ -1,7 +1,7 @@ import { PropsWithChildren } from 'react'; -import { Button } from '../Button'; -import { Widget, WidgetBody } from '../widget'; +import { Widget, WidgetBody } from './Widget'; +import { Button } from './buttons'; interface Props { title: string; diff --git a/app/portainer/components/Link.tsx b/app/react/components/Link.tsx similarity index 100% rename from app/portainer/components/Link.tsx rename to app/react/components/Link.tsx diff --git a/app/portainer/components/NavTabs/NavTabs.module.css b/app/react/components/NavTabs/NavTabs.module.css similarity index 100% rename from app/portainer/components/NavTabs/NavTabs.module.css rename to app/react/components/NavTabs/NavTabs.module.css diff --git a/app/portainer/components/NavTabs/NavTabs.stories.tsx b/app/react/components/NavTabs/NavTabs.stories.tsx similarity index 100% rename from app/portainer/components/NavTabs/NavTabs.stories.tsx rename to app/react/components/NavTabs/NavTabs.stories.tsx diff --git a/app/portainer/components/NavTabs/NavTabs.test.tsx b/app/react/components/NavTabs/NavTabs.test.tsx similarity index 100% rename from app/portainer/components/NavTabs/NavTabs.test.tsx rename to app/react/components/NavTabs/NavTabs.test.tsx diff --git a/app/portainer/components/NavTabs/NavTabs.tsx b/app/react/components/NavTabs/NavTabs.tsx similarity index 100% rename from app/portainer/components/NavTabs/NavTabs.tsx rename to app/react/components/NavTabs/NavTabs.tsx diff --git a/app/react/components/NavTabs/index.ts b/app/react/components/NavTabs/index.ts new file mode 100644 index 000000000..20f2d03a6 --- /dev/null +++ b/app/react/components/NavTabs/index.ts @@ -0,0 +1 @@ +export { NavTabs } from './NavTabs'; diff --git a/app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.css b/app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.css similarity index 100% rename from app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.css rename to app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.css diff --git a/app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.stories.tsx b/app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.stories.tsx similarity index 100% rename from app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.stories.tsx rename to app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.stories.tsx diff --git a/app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.test.tsx b/app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.test.tsx similarity index 100% rename from app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.test.tsx rename to app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.test.tsx diff --git a/app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.tsx b/app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.tsx similarity index 93% rename from app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.tsx rename to app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.tsx index 197023a6b..dcffc6646 100644 --- a/app/portainer/components/PageHeader/Breadcrumbs/Breadcrumbs.tsx +++ b/app/react/components/PageHeader/Breadcrumbs/Breadcrumbs.tsx @@ -1,6 +1,6 @@ import { Fragment } from 'react'; -import { Link } from '@/portainer/components/Link'; +import { Link } from '@@/Link'; import './Breadcrumbs.css'; diff --git a/app/portainer/components/PageHeader/Breadcrumbs/index.tsx b/app/react/components/PageHeader/Breadcrumbs/index.ts similarity index 100% rename from app/portainer/components/PageHeader/Breadcrumbs/index.tsx rename to app/react/components/PageHeader/Breadcrumbs/index.ts diff --git a/app/portainer/components/PageHeader/HeaderContainer.css b/app/react/components/PageHeader/HeaderContainer.css similarity index 100% rename from app/portainer/components/PageHeader/HeaderContainer.css rename to app/react/components/PageHeader/HeaderContainer.css diff --git a/app/portainer/components/PageHeader/HeaderContainer.stories.tsx b/app/react/components/PageHeader/HeaderContainer.stories.tsx similarity index 100% rename from app/portainer/components/PageHeader/HeaderContainer.stories.tsx rename to app/react/components/PageHeader/HeaderContainer.stories.tsx diff --git a/app/portainer/components/PageHeader/HeaderContainer.tsx b/app/react/components/PageHeader/HeaderContainer.tsx similarity index 87% rename from app/portainer/components/PageHeader/HeaderContainer.tsx rename to app/react/components/PageHeader/HeaderContainer.tsx index 5cb7ae55b..12bb1595f 100644 --- a/app/portainer/components/PageHeader/HeaderContainer.tsx +++ b/app/react/components/PageHeader/HeaderContainer.tsx @@ -24,8 +24,3 @@ export function HeaderContainer({ children }: PropsWithChildren) { ); } - -export const HeaderAngular = { - transclude: true, - templateUrl: './HeaderContainer.html', -}; diff --git a/app/portainer/components/PageHeader/HeaderContent.module.css b/app/react/components/PageHeader/HeaderContent.module.css similarity index 100% rename from app/portainer/components/PageHeader/HeaderContent.module.css rename to app/react/components/PageHeader/HeaderContent.module.css diff --git a/app/portainer/components/PageHeader/HeaderContent.test.tsx b/app/react/components/PageHeader/HeaderContent.test.tsx similarity index 100% rename from app/portainer/components/PageHeader/HeaderContent.test.tsx rename to app/react/components/PageHeader/HeaderContent.test.tsx diff --git a/app/portainer/components/PageHeader/HeaderContent.tsx b/app/react/components/PageHeader/HeaderContent.tsx similarity index 84% rename from app/portainer/components/PageHeader/HeaderContent.tsx rename to app/react/components/PageHeader/HeaderContent.tsx index 5608afc4c..dbb97ddb6 100644 --- a/app/portainer/components/PageHeader/HeaderContent.tsx +++ b/app/react/components/PageHeader/HeaderContent.tsx @@ -1,10 +1,10 @@ import { PropsWithChildren } from 'react'; import clsx from 'clsx'; -import { Link } from '@/portainer/components/Link'; import { useUser } from '@/portainer/hooks/useUser'; -import controller from './HeaderContent.controller'; +import { Link } from '@@/Link'; + import styles from './HeaderContent.module.css'; import { useHeaderContext } from './HeaderContainer'; @@ -41,10 +41,3 @@ export function HeaderContent({ children }: PropsWithChildren) { ); } - -export const HeaderContentAngular = { - requires: '^rdHeader', - transclude: true, - templateUrl: './HeaderContent.html', - controller, -}; diff --git a/app/portainer/components/PageHeader/HeaderTitle.test.tsx b/app/react/components/PageHeader/HeaderTitle.test.tsx similarity index 100% rename from app/portainer/components/PageHeader/HeaderTitle.test.tsx rename to app/react/components/PageHeader/HeaderTitle.test.tsx diff --git a/app/portainer/components/PageHeader/HeaderTitle.tsx b/app/react/components/PageHeader/HeaderTitle.tsx similarity index 74% rename from app/portainer/components/PageHeader/HeaderTitle.tsx rename to app/react/components/PageHeader/HeaderTitle.tsx index 9d113886b..75fc6ee6c 100644 --- a/app/portainer/components/PageHeader/HeaderTitle.tsx +++ b/app/react/components/PageHeader/HeaderTitle.tsx @@ -3,7 +3,6 @@ import { PropsWithChildren } from 'react'; import { useUser } from '@/portainer/hooks/useUser'; import { useHeaderContext } from './HeaderContainer'; -import controller from './HeaderTitle.controller'; interface Props { title: string; @@ -26,13 +25,3 @@ export function HeaderTitle({ title, children }: PropsWithChildren) { ); } - -export const HeaderTitleAngular = { - requires: '^rdHeader', - bindings: { - titleText: '@', - }, - transclude: true, - templateUrl: './HeaderTitle.html', - controller, -}; diff --git a/app/portainer/components/PageHeader/PageHeader.module.css b/app/react/components/PageHeader/PageHeader.module.css similarity index 100% rename from app/portainer/components/PageHeader/PageHeader.module.css rename to app/react/components/PageHeader/PageHeader.module.css diff --git a/app/portainer/components/PageHeader/PageHeader.stories.tsx b/app/react/components/PageHeader/PageHeader.stories.tsx similarity index 100% rename from app/portainer/components/PageHeader/PageHeader.stories.tsx rename to app/react/components/PageHeader/PageHeader.stories.tsx diff --git a/app/portainer/components/PageHeader/PageHeader.test.tsx b/app/react/components/PageHeader/PageHeader.test.tsx similarity index 100% rename from app/portainer/components/PageHeader/PageHeader.test.tsx rename to app/react/components/PageHeader/PageHeader.test.tsx diff --git a/app/portainer/components/PageHeader/PageHeader.tsx b/app/react/components/PageHeader/PageHeader.tsx similarity index 96% rename from app/portainer/components/PageHeader/PageHeader.tsx rename to app/react/components/PageHeader/PageHeader.tsx index e42432d3a..a93111a26 100644 --- a/app/portainer/components/PageHeader/PageHeader.tsx +++ b/app/react/components/PageHeader/PageHeader.tsx @@ -1,6 +1,6 @@ import { useRouter } from '@uirouter/react'; -import { Button } from '../Button'; +import { Button } from '../buttons'; import { Breadcrumbs } from './Breadcrumbs'; import { Crumb } from './Breadcrumbs/Breadcrumbs'; diff --git a/app/portainer/components/PageHeader/__snapshots__/HeaderContent.test.tsx.snap b/app/react/components/PageHeader/__snapshots__/HeaderContent.test.tsx.snap similarity index 100% rename from app/portainer/components/PageHeader/__snapshots__/HeaderContent.test.tsx.snap rename to app/react/components/PageHeader/__snapshots__/HeaderContent.test.tsx.snap diff --git a/app/portainer/components/PageHeader/__snapshots__/HeaderTitle.test.tsx.snap b/app/react/components/PageHeader/__snapshots__/HeaderTitle.test.tsx.snap similarity index 100% rename from app/portainer/components/PageHeader/__snapshots__/HeaderTitle.test.tsx.snap rename to app/react/components/PageHeader/__snapshots__/HeaderTitle.test.tsx.snap diff --git a/app/react/components/PageHeader/index.ts b/app/react/components/PageHeader/index.ts new file mode 100644 index 000000000..888aa1b66 --- /dev/null +++ b/app/react/components/PageHeader/index.ts @@ -0,0 +1,7 @@ +import { Breadcrumbs } from './Breadcrumbs'; +import { PageHeader } from './PageHeader'; +import { HeaderContainer } from './HeaderContainer'; +import { HeaderContent } from './HeaderContent'; +import { HeaderTitle } from './HeaderTitle'; + +export { PageHeader, Breadcrumbs, HeaderContainer, HeaderContent, HeaderTitle }; diff --git a/app/portainer/components/pagination-controls/ItemsPerPageSelector.tsx b/app/react/components/PaginationControls/ItemsPerPageSelector.tsx similarity index 100% rename from app/portainer/components/pagination-controls/ItemsPerPageSelector.tsx rename to app/react/components/PaginationControls/ItemsPerPageSelector.tsx diff --git a/app/portainer/components/pagination-controls/PageButton.tsx b/app/react/components/PaginationControls/PageButton.tsx similarity index 100% rename from app/portainer/components/pagination-controls/PageButton.tsx rename to app/react/components/PaginationControls/PageButton.tsx diff --git a/app/portainer/components/pagination-controls/PageInput.tsx b/app/react/components/PaginationControls/PageInput.tsx similarity index 94% rename from app/portainer/components/pagination-controls/PageInput.tsx rename to app/react/components/PaginationControls/PageInput.tsx index d8b230dd9..82312c63e 100644 --- a/app/portainer/components/pagination-controls/PageInput.tsx +++ b/app/react/components/PaginationControls/PageInput.tsx @@ -2,8 +2,8 @@ import { useFormik } from 'formik'; import { ChangeEvent, KeyboardEvent } from 'react'; import { object, number } from 'yup'; -import { Button } from '../Button'; -import { Input } from '../form-components/Input'; +import { Button } from '@@/buttons'; +import { Input } from '@@/form-components/Input'; interface Values { page: number | ''; diff --git a/app/portainer/components/pagination-controls/PageSelector.tsx b/app/react/components/PaginationControls/PageSelector.tsx similarity index 100% rename from app/portainer/components/pagination-controls/PageSelector.tsx rename to app/react/components/PaginationControls/PageSelector.tsx diff --git a/app/portainer/components/pagination-controls/PaginationControls.tsx b/app/react/components/PaginationControls/PaginationControls.tsx similarity index 100% rename from app/portainer/components/pagination-controls/PaginationControls.tsx rename to app/react/components/PaginationControls/PaginationControls.tsx diff --git a/app/portainer/components/pagination-controls/calculatePageNumber.ts b/app/react/components/PaginationControls/calculatePageNumber.ts similarity index 100% rename from app/portainer/components/pagination-controls/calculatePageNumber.ts rename to app/react/components/PaginationControls/calculatePageNumber.ts diff --git a/app/portainer/components/pagination-controls/generatePagesArray.ts b/app/react/components/PaginationControls/generatePagesArray.ts similarity index 100% rename from app/portainer/components/pagination-controls/generatePagesArray.ts rename to app/react/components/PaginationControls/generatePagesArray.ts diff --git a/app/portainer/components/pagination-controls/index.ts b/app/react/components/PaginationControls/index.ts similarity index 100% rename from app/portainer/components/pagination-controls/index.ts rename to app/react/components/PaginationControls/index.ts diff --git a/app/portainer/components/pagination-controls/pagination-controls.css b/app/react/components/PaginationControls/pagination-controls.css similarity index 100% rename from app/portainer/components/pagination-controls/pagination-controls.css rename to app/react/components/PaginationControls/pagination-controls.css diff --git a/app/portainer/components/PasswordCheckHint.tsx b/app/react/components/PasswordCheckHint.tsx similarity index 82% rename from app/portainer/components/PasswordCheckHint.tsx rename to app/react/components/PasswordCheckHint.tsx index 6164d5755..cdaaec032 100644 --- a/app/portainer/components/PasswordCheckHint.tsx +++ b/app/react/components/PasswordCheckHint.tsx @@ -1,4 +1,3 @@ -import { react2angular } from '@/react-tools/react2angular'; import { usePublicSettings } from '@/portainer/settings/queries'; interface Props { @@ -30,8 +29,3 @@ export function PasswordCheckHint({ ); } - -export const PasswordCheckHintAngular = react2angular(PasswordCheckHint, [ - 'passwordValid', - 'forceChangePassword', -]); diff --git a/app/react/components/Stepper/Stepper.stories.tsx b/app/react/components/Stepper/Stepper.stories.tsx index 6b48273f6..f4d61e6f2 100644 --- a/app/react/components/Stepper/Stepper.stories.tsx +++ b/app/react/components/Stepper/Stepper.stories.tsx @@ -1,7 +1,7 @@ import { Meta } from '@storybook/react'; import { useState } from 'react'; -import { Button } from '@/portainer/components/Button'; +import { Button } from '@@/buttons'; import { Step, Stepper } from './Stepper'; diff --git a/app/react/components/TagSelector/TagSelector.tsx b/app/react/components/TagSelector/TagSelector.tsx index d268f2a0c..50b52e61a 100644 --- a/app/react/components/TagSelector/TagSelector.tsx +++ b/app/react/components/TagSelector/TagSelector.tsx @@ -2,13 +2,11 @@ import clsx from 'clsx'; import _ from 'lodash'; import { TagId } from '@/portainer/tags/types'; -import { - Creatable, - Select, -} from '@/portainer/components/form-components/ReactSelect'; import { useCreateTagMutation, useTags } from '@/portainer/tags/queries'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Link } from '@/portainer/components/Link'; + +import { Creatable, Select } from '@@/form-components/ReactSelect'; +import { FormControl } from '@@/form-components/FormControl'; +import { Link } from '@@/Link'; import styles from './TagSelector.module.css'; diff --git a/app/portainer/components/TeamsSelector/TeamsSelector.mocks.ts b/app/react/components/TeamsSelector/TeamsSelector.mocks.ts similarity index 100% rename from app/portainer/components/TeamsSelector/TeamsSelector.mocks.ts rename to app/react/components/TeamsSelector/TeamsSelector.mocks.ts diff --git a/app/portainer/components/TeamsSelector/TeamsSelector.stories.tsx b/app/react/components/TeamsSelector/TeamsSelector.stories.tsx similarity index 100% rename from app/portainer/components/TeamsSelector/TeamsSelector.stories.tsx rename to app/react/components/TeamsSelector/TeamsSelector.stories.tsx diff --git a/app/portainer/components/TeamsSelector/TeamsSelector.tsx b/app/react/components/TeamsSelector/TeamsSelector.tsx similarity index 91% rename from app/portainer/components/TeamsSelector/TeamsSelector.tsx rename to app/react/components/TeamsSelector/TeamsSelector.tsx index 3e798aff0..4bd71cdc9 100644 --- a/app/portainer/components/TeamsSelector/TeamsSelector.tsx +++ b/app/react/components/TeamsSelector/TeamsSelector.tsx @@ -1,6 +1,7 @@ -import { Select } from '@/portainer/components/form-components/ReactSelect'; import { Team, TeamId } from '@/portainer/teams/types'; +import { Select } from '@@/form-components/ReactSelect'; + interface Props { name?: string; value: TeamId[]; diff --git a/app/portainer/components/TeamsSelector/index.ts b/app/react/components/TeamsSelector/index.ts similarity index 100% rename from app/portainer/components/TeamsSelector/index.ts rename to app/react/components/TeamsSelector/index.ts diff --git a/app/portainer/components/Tip/TextTip/TextTip.stories.tsx b/app/react/components/Tip/TextTip/TextTip.stories.tsx similarity index 100% rename from app/portainer/components/Tip/TextTip/TextTip.stories.tsx rename to app/react/components/Tip/TextTip/TextTip.stories.tsx diff --git a/app/portainer/components/Tip/TextTip/TextTip.test.tsx b/app/react/components/Tip/TextTip/TextTip.test.tsx similarity index 100% rename from app/portainer/components/Tip/TextTip/TextTip.test.tsx rename to app/react/components/Tip/TextTip/TextTip.test.tsx diff --git a/app/portainer/components/Tip/TextTip/TextTip.tsx b/app/react/components/Tip/TextTip/TextTip.tsx similarity index 100% rename from app/portainer/components/Tip/TextTip/TextTip.tsx rename to app/react/components/Tip/TextTip/TextTip.tsx diff --git a/app/portainer/components/Tip/TextTip/index.ts b/app/react/components/Tip/TextTip/index.ts similarity index 100% rename from app/portainer/components/Tip/TextTip/index.ts rename to app/react/components/Tip/TextTip/index.ts diff --git a/app/portainer/components/Tip/Tooltip/Tooltip.module.css b/app/react/components/Tip/Tooltip/Tooltip.module.css similarity index 100% rename from app/portainer/components/Tip/Tooltip/Tooltip.module.css rename to app/react/components/Tip/Tooltip/Tooltip.module.css diff --git a/app/portainer/components/Tip/Tooltip/Tooltip.stories.tsx b/app/react/components/Tip/Tooltip/Tooltip.stories.tsx similarity index 100% rename from app/portainer/components/Tip/Tooltip/Tooltip.stories.tsx rename to app/react/components/Tip/Tooltip/Tooltip.stories.tsx diff --git a/app/portainer/components/Tip/Tooltip/Tooltip.tsx b/app/react/components/Tip/Tooltip/Tooltip.tsx similarity index 100% rename from app/portainer/components/Tip/Tooltip/Tooltip.tsx rename to app/react/components/Tip/Tooltip/Tooltip.tsx diff --git a/app/react/components/Tip/Tooltip/index.ts b/app/react/components/Tip/Tooltip/index.ts new file mode 100644 index 000000000..b44d466fa --- /dev/null +++ b/app/react/components/Tip/Tooltip/index.ts @@ -0,0 +1 @@ +export { Tooltip } from './Tooltip'; diff --git a/app/portainer/components/UsersSelector/UsersSelector.mocks.ts b/app/react/components/UsersSelector/UsersSelector.mocks.ts similarity index 100% rename from app/portainer/components/UsersSelector/UsersSelector.mocks.ts rename to app/react/components/UsersSelector/UsersSelector.mocks.ts diff --git a/app/portainer/components/UsersSelector/UsersSelector.stories.tsx b/app/react/components/UsersSelector/UsersSelector.stories.tsx similarity index 100% rename from app/portainer/components/UsersSelector/UsersSelector.stories.tsx rename to app/react/components/UsersSelector/UsersSelector.stories.tsx diff --git a/app/portainer/components/UsersSelector/UsersSelector.tsx b/app/react/components/UsersSelector/UsersSelector.tsx similarity index 91% rename from app/portainer/components/UsersSelector/UsersSelector.tsx rename to app/react/components/UsersSelector/UsersSelector.tsx index c2d631ac2..2963830e8 100644 --- a/app/portainer/components/UsersSelector/UsersSelector.tsx +++ b/app/react/components/UsersSelector/UsersSelector.tsx @@ -1,5 +1,6 @@ import { User, UserId } from '@/portainer/users/types'; -import { Select } from '@/portainer/components/form-components/ReactSelect'; + +import { Select } from '@@/form-components/ReactSelect'; interface Props { name?: string; diff --git a/app/portainer/components/UsersSelector/index.ts b/app/react/components/UsersSelector/index.ts similarity index 100% rename from app/portainer/components/UsersSelector/index.ts rename to app/react/components/UsersSelector/index.ts diff --git a/app/portainer/components/ViewLoading/ViewLoading.module.css b/app/react/components/ViewLoading/ViewLoading.module.css similarity index 100% rename from app/portainer/components/ViewLoading/ViewLoading.module.css rename to app/react/components/ViewLoading/ViewLoading.module.css diff --git a/app/portainer/components/ViewLoading/ViewLoading.stories.tsx b/app/react/components/ViewLoading/ViewLoading.stories.tsx similarity index 100% rename from app/portainer/components/ViewLoading/ViewLoading.stories.tsx rename to app/react/components/ViewLoading/ViewLoading.stories.tsx diff --git a/app/portainer/components/ViewLoading/ViewLoading.tsx b/app/react/components/ViewLoading/ViewLoading.tsx similarity index 83% rename from app/portainer/components/ViewLoading/ViewLoading.tsx rename to app/react/components/ViewLoading/ViewLoading.tsx index 42dd968bb..68103abd8 100644 --- a/app/portainer/components/ViewLoading/ViewLoading.tsx +++ b/app/react/components/ViewLoading/ViewLoading.tsx @@ -1,7 +1,5 @@ import clsx from 'clsx'; -import { r2a } from '@/react-tools/react2angular'; - import styles from './ViewLoading.module.css'; interface Props { @@ -26,5 +24,3 @@ export function ViewLoading({ message }: Props) { ); } - -export const ViewLoadingAngular = r2a(ViewLoading, ['message']); diff --git a/app/react/components/ViewLoading/index.ts b/app/react/components/ViewLoading/index.ts new file mode 100644 index 000000000..2658cdeca --- /dev/null +++ b/app/react/components/ViewLoading/index.ts @@ -0,0 +1 @@ +export { ViewLoading } from './ViewLoading'; diff --git a/app/portainer/components/widget/Loading.tsx b/app/react/components/Widget/Loading.tsx similarity index 58% rename from app/portainer/components/widget/Loading.tsx rename to app/react/components/Widget/Loading.tsx index d7f04d072..40b433c76 100644 --- a/app/portainer/components/widget/Loading.tsx +++ b/app/react/components/Widget/Loading.tsx @@ -1,5 +1,3 @@ -import { react2angular } from '@/react-tools/react2angular'; - export function Loading() { return (
@@ -8,5 +6,3 @@ export function Loading() {
); } - -export const LoadingAngular = react2angular(Loading, []); diff --git a/app/portainer/components/widget/Widget.stories.tsx b/app/react/components/Widget/Widget.stories.tsx similarity index 100% rename from app/portainer/components/widget/Widget.stories.tsx rename to app/react/components/Widget/Widget.stories.tsx diff --git a/app/portainer/components/widget/Widget.tsx b/app/react/components/Widget/Widget.tsx similarity index 81% rename from app/portainer/components/widget/Widget.tsx rename to app/react/components/Widget/Widget.tsx index ee069851f..33c6c34d6 100644 --- a/app/portainer/components/widget/Widget.tsx +++ b/app/react/components/Widget/Widget.tsx @@ -10,11 +10,6 @@ export function useWidgetContext() { } } -export const rdWidget = { - transclude: true, - template: `
`, -}; - export function Widget({ children }: PropsWithChildren) { return ( diff --git a/app/portainer/components/widget/WidgetBody.tsx b/app/react/components/Widget/WidgetBody.tsx similarity index 58% rename from app/portainer/components/widget/WidgetBody.tsx rename to app/react/components/Widget/WidgetBody.tsx index 4926ddf48..56d31949e 100644 --- a/app/portainer/components/widget/WidgetBody.tsx +++ b/app/react/components/Widget/WidgetBody.tsx @@ -4,21 +4,6 @@ import { PropsWithChildren } from 'react'; import { useWidgetContext } from './Widget'; import { Loading } from './Loading'; -export const rdWidgetBody = { - requires: '^rdWidget', - bindings: { - loading: '@?', - classes: '@?', - }, - transclude: true, - template: ` -
- -
-
- `, -}; - interface Props { loading?: boolean; className?: string; diff --git a/app/portainer/components/widget/WidgetFooter.tsx b/app/react/components/Widget/WidgetFooter.tsx similarity index 61% rename from app/portainer/components/widget/WidgetFooter.tsx rename to app/react/components/Widget/WidgetFooter.tsx index 8f4f2e71b..cf59c5b23 100644 --- a/app/portainer/components/widget/WidgetFooter.tsx +++ b/app/react/components/Widget/WidgetFooter.tsx @@ -2,14 +2,6 @@ import { PropsWithChildren } from 'react'; import { useWidgetContext } from './Widget'; -export const rdWidgetFooter = { - requires: '^rdWidget', - transclude: true, - template: ` - - `, -}; - export function WidgetFooter({ children }: PropsWithChildren) { useWidgetContext(); diff --git a/app/portainer/components/widget/WidgetTaskbar.tsx b/app/react/components/Widget/WidgetTaskbar.tsx similarity index 59% rename from app/portainer/components/widget/WidgetTaskbar.tsx rename to app/react/components/Widget/WidgetTaskbar.tsx index f24341acf..f718df6df 100644 --- a/app/portainer/components/widget/WidgetTaskbar.tsx +++ b/app/react/components/Widget/WidgetTaskbar.tsx @@ -2,21 +2,6 @@ import { PropsWithChildren } from 'react'; import { useWidgetContext } from './Widget'; -export const rdWidgetTaskbar = { - requires: '^rdWidget', - bindings: { - classes: '@?', - }, - transclude: true, - template: ` -
-
-
-
-
- `, -}; - interface Props { className?: string; } diff --git a/app/portainer/components/widget/WidgetTitle.tsx b/app/react/components/Widget/WidgetTitle.tsx similarity index 55% rename from app/portainer/components/widget/WidgetTitle.tsx rename to app/react/components/Widget/WidgetTitle.tsx index 419f67643..199658431 100644 --- a/app/portainer/components/widget/WidgetTitle.tsx +++ b/app/react/components/Widget/WidgetTitle.tsx @@ -3,29 +3,6 @@ import { PropsWithChildren, ReactNode } from 'react'; import { useWidgetContext } from './Widget'; -export const rdWidgetTitle = { - requires: '^rdWidget', - bindings: { - titleText: '@', - icon: '@', - classes: '@?', - }, - transclude: { - title: '?headerTitle', - }, - template: ` -
-
- - - {{ $ctrl.titleText }} - - -
-
-`, -}; - interface Props { title: ReactNode; icon: ReactNode; diff --git a/app/react/components/Widget/index.ts b/app/react/components/Widget/index.ts new file mode 100644 index 000000000..92164b168 --- /dev/null +++ b/app/react/components/Widget/index.ts @@ -0,0 +1,31 @@ +import { Widget as MainComponent } from './Widget'; +import { WidgetBody } from './WidgetBody'; +import { WidgetFooter } from './WidgetFooter'; +import { WidgetTitle } from './WidgetTitle'; +import { WidgetTaskbar } from './WidgetTaskbar'; +import { Loading } from './Loading'; + +interface WithSubcomponents { + Body: typeof WidgetBody; + Footer: typeof WidgetFooter; + Title: typeof WidgetTitle; + Taskbar: typeof WidgetTaskbar; + Loading: typeof Loading; +} + +const Widget = MainComponent as typeof MainComponent & WithSubcomponents; + +Widget.Body = WidgetBody; +Widget.Footer = WidgetFooter; +Widget.Title = WidgetTitle; +Widget.Taskbar = WidgetTaskbar; +Widget.Loading = Loading; + +export { + Widget, + WidgetBody, + WidgetFooter, + WidgetTitle, + WidgetTaskbar, + Loading, +}; diff --git a/app/portainer/components/Button/AddButton.module.css b/app/react/components/buttons/AddButton.module.css similarity index 100% rename from app/portainer/components/Button/AddButton.module.css rename to app/react/components/buttons/AddButton.module.css diff --git a/app/portainer/components/Button/AddButton.stories.tsx b/app/react/components/buttons/AddButton.stories.tsx similarity index 100% rename from app/portainer/components/Button/AddButton.stories.tsx rename to app/react/components/buttons/AddButton.stories.tsx diff --git a/app/portainer/components/Button/AddButton.test.tsx b/app/react/components/buttons/AddButton.test.tsx similarity index 100% rename from app/portainer/components/Button/AddButton.test.tsx rename to app/react/components/buttons/AddButton.test.tsx diff --git a/app/portainer/components/Button/AddButton.tsx b/app/react/components/buttons/AddButton.tsx similarity index 100% rename from app/portainer/components/Button/AddButton.tsx rename to app/react/components/buttons/AddButton.tsx diff --git a/app/portainer/components/Button/Button.stories.tsx b/app/react/components/buttons/Button.stories.tsx similarity index 100% rename from app/portainer/components/Button/Button.stories.tsx rename to app/react/components/buttons/Button.stories.tsx diff --git a/app/portainer/components/Button/Button.test.tsx b/app/react/components/buttons/Button.test.tsx similarity index 100% rename from app/portainer/components/Button/Button.test.tsx rename to app/react/components/buttons/Button.test.tsx diff --git a/app/portainer/components/Button/Button.tsx b/app/react/components/buttons/Button.tsx similarity index 100% rename from app/portainer/components/Button/Button.tsx rename to app/react/components/buttons/Button.tsx diff --git a/app/portainer/components/Button/ButtonGroup.stories.tsx b/app/react/components/buttons/ButtonGroup.stories.tsx similarity index 100% rename from app/portainer/components/Button/ButtonGroup.stories.tsx rename to app/react/components/buttons/ButtonGroup.stories.tsx diff --git a/app/portainer/components/Button/ButtonGroup.test.tsx b/app/react/components/buttons/ButtonGroup.test.tsx similarity index 100% rename from app/portainer/components/Button/ButtonGroup.test.tsx rename to app/react/components/buttons/ButtonGroup.test.tsx diff --git a/app/portainer/components/Button/ButtonGroup.tsx b/app/react/components/buttons/ButtonGroup.tsx similarity index 100% rename from app/portainer/components/Button/ButtonGroup.tsx rename to app/react/components/buttons/ButtonGroup.tsx diff --git a/app/portainer/components/Button/CopyButton/CopyButton.module.css b/app/react/components/buttons/CopyButton/CopyButton.module.css similarity index 100% rename from app/portainer/components/Button/CopyButton/CopyButton.module.css rename to app/react/components/buttons/CopyButton/CopyButton.module.css diff --git a/app/portainer/components/Button/CopyButton/CopyButton.stories.tsx b/app/react/components/buttons/CopyButton/CopyButton.stories.tsx similarity index 100% rename from app/portainer/components/Button/CopyButton/CopyButton.stories.tsx rename to app/react/components/buttons/CopyButton/CopyButton.stories.tsx diff --git a/app/portainer/components/Button/CopyButton/CopyButton.test.tsx b/app/react/components/buttons/CopyButton/CopyButton.test.tsx similarity index 100% rename from app/portainer/components/Button/CopyButton/CopyButton.test.tsx rename to app/react/components/buttons/CopyButton/CopyButton.test.tsx diff --git a/app/portainer/components/Button/CopyButton/CopyButton.tsx b/app/react/components/buttons/CopyButton/CopyButton.tsx similarity index 100% rename from app/portainer/components/Button/CopyButton/CopyButton.tsx rename to app/react/components/buttons/CopyButton/CopyButton.tsx diff --git a/app/portainer/components/Button/CopyButton/index.ts b/app/react/components/buttons/CopyButton/index.ts similarity index 100% rename from app/portainer/components/Button/CopyButton/index.ts rename to app/react/components/buttons/CopyButton/index.ts diff --git a/app/portainer/components/Button/CopyButton/useCopy.ts b/app/react/components/buttons/CopyButton/useCopy.ts similarity index 100% rename from app/portainer/components/Button/CopyButton/useCopy.ts rename to app/react/components/buttons/CopyButton/useCopy.ts diff --git a/app/portainer/components/Button/LoadingButton.stories.tsx b/app/react/components/buttons/LoadingButton.stories.tsx similarity index 100% rename from app/portainer/components/Button/LoadingButton.stories.tsx rename to app/react/components/buttons/LoadingButton.stories.tsx diff --git a/app/portainer/components/Button/LoadingButton.test.tsx b/app/react/components/buttons/LoadingButton.test.tsx similarity index 100% rename from app/portainer/components/Button/LoadingButton.test.tsx rename to app/react/components/buttons/LoadingButton.test.tsx diff --git a/app/portainer/components/Button/LoadingButton.tsx b/app/react/components/buttons/LoadingButton.tsx similarity index 100% rename from app/portainer/components/Button/LoadingButton.tsx rename to app/react/components/buttons/LoadingButton.tsx diff --git a/app/react/components/buttons/index.ts b/app/react/components/buttons/index.ts new file mode 100644 index 000000000..815e00fd8 --- /dev/null +++ b/app/react/components/buttons/index.ts @@ -0,0 +1,5 @@ +export { Button } from './Button'; +export { AddButton } from './AddButton'; +export { ButtonGroup } from './ButtonGroup'; +export { LoadingButton } from './LoadingButton'; +export { CopyButton } from './CopyButton'; diff --git a/app/portainer/components/datatables/components/ActionsMenu.module.css b/app/react/components/datatables/ActionsMenu.module.css similarity index 100% rename from app/portainer/components/datatables/components/ActionsMenu.module.css rename to app/react/components/datatables/ActionsMenu.module.css diff --git a/app/portainer/components/datatables/components/ActionsMenu.tsx b/app/react/components/datatables/ActionsMenu.tsx similarity index 100% rename from app/portainer/components/datatables/components/ActionsMenu.tsx rename to app/react/components/datatables/ActionsMenu.tsx diff --git a/app/portainer/components/datatables/components/ActionsMenuTitle.module.css b/app/react/components/datatables/ActionsMenuTitle.module.css similarity index 100% rename from app/portainer/components/datatables/components/ActionsMenuTitle.module.css rename to app/react/components/datatables/ActionsMenuTitle.module.css diff --git a/app/portainer/components/datatables/components/ActionsMenuTitle.tsx b/app/react/components/datatables/ActionsMenuTitle.tsx similarity index 100% rename from app/portainer/components/datatables/components/ActionsMenuTitle.tsx rename to app/react/components/datatables/ActionsMenuTitle.tsx diff --git a/app/portainer/components/datatables/components/ColumnVisibilityMenu.tsx b/app/react/components/datatables/ColumnVisibilityMenu.tsx similarity index 95% rename from app/portainer/components/datatables/components/ColumnVisibilityMenu.tsx rename to app/react/components/datatables/ColumnVisibilityMenu.tsx index e6392108b..192e12f5e 100644 --- a/app/portainer/components/datatables/components/ColumnVisibilityMenu.tsx +++ b/app/react/components/datatables/ColumnVisibilityMenu.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; import { Menu, MenuButton, MenuList } from '@reach/menu-button'; import { ColumnInstance } from 'react-table'; -import { Checkbox } from '@/portainer/components/form-components/Checkbox'; +import { Checkbox } from '@@/form-components/Checkbox'; import { useTableContext } from './TableContainer'; diff --git a/app/portainer/components/datatables/components/ExpandingCell.module.css b/app/react/components/datatables/ExpandingCell.module.css similarity index 100% rename from app/portainer/components/datatables/components/ExpandingCell.module.css rename to app/react/components/datatables/ExpandingCell.module.css diff --git a/app/portainer/components/datatables/components/ExpandingCell.tsx b/app/react/components/datatables/ExpandingCell.tsx similarity index 100% rename from app/portainer/components/datatables/components/ExpandingCell.tsx rename to app/react/components/datatables/ExpandingCell.tsx diff --git a/app/portainer/components/datatables/components/Filter.tsx b/app/react/components/datatables/Filter.tsx similarity index 100% rename from app/portainer/components/datatables/components/Filter.tsx rename to app/react/components/datatables/Filter.tsx diff --git a/app/portainer/components/datatables/components/FilterSearchBar.module.css b/app/react/components/datatables/FilterSearchBar.module.css similarity index 100% rename from app/portainer/components/datatables/components/FilterSearchBar.module.css rename to app/react/components/datatables/FilterSearchBar.module.css diff --git a/app/portainer/components/datatables/components/FilterSearchBar.tsx b/app/react/components/datatables/FilterSearchBar.tsx similarity index 100% rename from app/portainer/components/datatables/components/FilterSearchBar.tsx rename to app/react/components/datatables/FilterSearchBar.tsx diff --git a/app/portainer/components/datatables/components/InnerDatatable.module.css b/app/react/components/datatables/InnerDatatable.module.css similarity index 100% rename from app/portainer/components/datatables/components/InnerDatatable.module.css rename to app/react/components/datatables/InnerDatatable.module.css diff --git a/app/portainer/components/datatables/components/InnerDatatable.tsx b/app/react/components/datatables/InnerDatatable.tsx similarity index 100% rename from app/portainer/components/datatables/components/InnerDatatable.tsx rename to app/react/components/datatables/InnerDatatable.tsx diff --git a/app/portainer/components/datatables/components/QuickActionsSettings.tsx b/app/react/components/datatables/QuickActionsSettings.tsx similarity index 93% rename from app/portainer/components/datatables/components/QuickActionsSettings.tsx rename to app/react/components/datatables/QuickActionsSettings.tsx index 4afac83b3..e22be0c40 100644 --- a/app/portainer/components/datatables/components/QuickActionsSettings.tsx +++ b/app/react/components/datatables/QuickActionsSettings.tsx @@ -1,4 +1,4 @@ -import { Checkbox } from '@/portainer/components/form-components/Checkbox'; +import { Checkbox } from '@@/form-components/Checkbox'; import { useTableSettings } from './useTableSettings'; diff --git a/app/portainer/components/datatables/components/SearchBar.tsx b/app/react/components/datatables/SearchBar.tsx similarity index 100% rename from app/portainer/components/datatables/components/SearchBar.tsx rename to app/react/components/datatables/SearchBar.tsx diff --git a/app/portainer/components/datatables/components/SelectedRowsCount.tsx b/app/react/components/datatables/SelectedRowsCount.tsx similarity index 100% rename from app/portainer/components/datatables/components/SelectedRowsCount.tsx rename to app/react/components/datatables/SelectedRowsCount.tsx diff --git a/app/portainer/components/datatables/components/SortbySelector.module.css b/app/react/components/datatables/SortbySelector.module.css similarity index 100% rename from app/portainer/components/datatables/components/SortbySelector.module.css rename to app/react/components/datatables/SortbySelector.module.css diff --git a/app/portainer/components/datatables/components/SortbySelector.tsx b/app/react/components/datatables/SortbySelector.tsx similarity index 95% rename from app/portainer/components/datatables/components/SortbySelector.tsx rename to app/react/components/datatables/SortbySelector.tsx index 277bcb215..60848cbd2 100644 --- a/app/portainer/components/datatables/components/SortbySelector.tsx +++ b/app/react/components/datatables/SortbySelector.tsx @@ -1,8 +1,9 @@ import { useEffect, useState } from 'react'; -import { Select } from '@/portainer/components/form-components/ReactSelect'; import { Filter } from '@/portainer/home/types'; +import { Select } from '@@/form-components/ReactSelect'; + import styles from './SortbySelector.module.css'; interface Props { diff --git a/app/portainer/components/datatables/components/Table.tsx b/app/react/components/datatables/Table.tsx similarity index 100% rename from app/portainer/components/datatables/components/Table.tsx rename to app/react/components/datatables/Table.tsx diff --git a/app/portainer/components/datatables/components/TableActions.tsx b/app/react/components/datatables/TableActions.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableActions.tsx rename to app/react/components/datatables/TableActions.tsx diff --git a/app/portainer/components/datatables/components/TableContainer.tsx b/app/react/components/datatables/TableContainer.tsx similarity index 89% rename from app/portainer/components/datatables/components/TableContainer.tsx rename to app/react/components/datatables/TableContainer.tsx index b9aef245f..de7eea6b4 100644 --- a/app/portainer/components/datatables/components/TableContainer.tsx +++ b/app/react/components/datatables/TableContainer.tsx @@ -1,6 +1,6 @@ import { createContext, PropsWithChildren, useContext } from 'react'; -import { Widget, WidgetBody } from '@/portainer/components/widget'; +import { Widget, WidgetBody } from '@@/Widget'; const Context = createContext(null); diff --git a/app/portainer/components/datatables/components/TableContent.tsx b/app/react/components/datatables/TableContent.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableContent.tsx rename to app/react/components/datatables/TableContent.tsx diff --git a/app/portainer/components/datatables/components/TableFooter.tsx b/app/react/components/datatables/TableFooter.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableFooter.tsx rename to app/react/components/datatables/TableFooter.tsx diff --git a/app/portainer/components/datatables/components/TableHeaderCell.module.css b/app/react/components/datatables/TableHeaderCell.module.css similarity index 100% rename from app/portainer/components/datatables/components/TableHeaderCell.module.css rename to app/react/components/datatables/TableHeaderCell.module.css diff --git a/app/portainer/components/datatables/components/TableHeaderCell.tsx b/app/react/components/datatables/TableHeaderCell.tsx similarity index 97% rename from app/portainer/components/datatables/components/TableHeaderCell.tsx rename to app/react/components/datatables/TableHeaderCell.tsx index c9e35a090..919b9f076 100644 --- a/app/portainer/components/datatables/components/TableHeaderCell.tsx +++ b/app/react/components/datatables/TableHeaderCell.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; import { PropsWithChildren, ReactNode } from 'react'; import { TableHeaderProps } from 'react-table'; -import { Button } from '@/portainer/components/Button'; +import { Button } from '@@/buttons'; import { useTableContext } from './TableContainer'; import styles from './TableHeaderCell.module.css'; diff --git a/app/portainer/components/datatables/components/TableHeaderRow.tsx b/app/react/components/datatables/TableHeaderRow.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableHeaderRow.tsx rename to app/react/components/datatables/TableHeaderRow.tsx diff --git a/app/portainer/components/datatables/components/TableRow.tsx b/app/react/components/datatables/TableRow.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableRow.tsx rename to app/react/components/datatables/TableRow.tsx diff --git a/app/portainer/components/datatables/components/TableSettingsMenu.tsx b/app/react/components/datatables/TableSettingsMenu.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableSettingsMenu.tsx rename to app/react/components/datatables/TableSettingsMenu.tsx diff --git a/app/portainer/components/datatables/components/TableSettingsMenuAutoRefresh.module.css b/app/react/components/datatables/TableSettingsMenuAutoRefresh.module.css similarity index 100% rename from app/portainer/components/datatables/components/TableSettingsMenuAutoRefresh.module.css rename to app/react/components/datatables/TableSettingsMenuAutoRefresh.module.css diff --git a/app/portainer/components/datatables/components/TableSettingsMenuAutoRefresh.tsx b/app/react/components/datatables/TableSettingsMenuAutoRefresh.tsx similarity index 95% rename from app/portainer/components/datatables/components/TableSettingsMenuAutoRefresh.tsx rename to app/react/components/datatables/TableSettingsMenuAutoRefresh.tsx index e69276713..5f7a31864 100644 --- a/app/portainer/components/datatables/components/TableSettingsMenuAutoRefresh.tsx +++ b/app/react/components/datatables/TableSettingsMenuAutoRefresh.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import { useState } from 'react'; -import { Checkbox } from '@/portainer/components/form-components/Checkbox'; +import { Checkbox } from '@@/form-components/Checkbox'; import styles from './TableSettingsMenuAutoRefresh.module.css'; diff --git a/app/portainer/components/datatables/components/TableTitle.tsx b/app/react/components/datatables/TableTitle.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableTitle.tsx rename to app/react/components/datatables/TableTitle.tsx diff --git a/app/portainer/components/datatables/components/TableTitleActions.tsx b/app/react/components/datatables/TableTitleActions.tsx similarity index 100% rename from app/portainer/components/datatables/components/TableTitleActions.tsx rename to app/react/components/datatables/TableTitleActions.tsx diff --git a/app/portainer/components/datatables/components/filter-types.ts b/app/react/components/datatables/filter-types.ts similarity index 100% rename from app/portainer/components/datatables/components/filter-types.ts rename to app/react/components/datatables/filter-types.ts diff --git a/app/portainer/components/datatables/components/index.tsx b/app/react/components/datatables/index.tsx similarity index 100% rename from app/portainer/components/datatables/components/index.tsx rename to app/react/components/datatables/index.tsx diff --git a/app/portainer/components/datatables/types.ts b/app/react/components/datatables/types.ts similarity index 100% rename from app/portainer/components/datatables/types.ts rename to app/react/components/datatables/types.ts diff --git a/app/portainer/components/datatables/components/useRepeater.ts b/app/react/components/datatables/useRepeater.ts similarity index 100% rename from app/portainer/components/datatables/components/useRepeater.ts rename to app/react/components/datatables/useRepeater.ts diff --git a/app/portainer/components/datatables/components/useRowSelect.ts b/app/react/components/datatables/useRowSelect.ts similarity index 100% rename from app/portainer/components/datatables/components/useRowSelect.ts rename to app/react/components/datatables/useRowSelect.ts diff --git a/app/portainer/components/datatables/components/useTableSettings.tsx b/app/react/components/datatables/useTableSettings.tsx similarity index 100% rename from app/portainer/components/datatables/components/useTableSettings.tsx rename to app/react/components/datatables/useTableSettings.tsx diff --git a/app/portainer/components/form-components/ButtonSelector/ButtonSelector.module.css b/app/react/components/form-components/ButtonSelector/ButtonSelector.module.css similarity index 100% rename from app/portainer/components/form-components/ButtonSelector/ButtonSelector.module.css rename to app/react/components/form-components/ButtonSelector/ButtonSelector.module.css diff --git a/app/portainer/components/form-components/ButtonSelector/ButtonSelector.stories.tsx b/app/react/components/form-components/ButtonSelector/ButtonSelector.stories.tsx similarity index 100% rename from app/portainer/components/form-components/ButtonSelector/ButtonSelector.stories.tsx rename to app/react/components/form-components/ButtonSelector/ButtonSelector.stories.tsx diff --git a/app/portainer/components/form-components/ButtonSelector/ButtonSelector.tsx b/app/react/components/form-components/ButtonSelector/ButtonSelector.tsx similarity index 94% rename from app/portainer/components/form-components/ButtonSelector/ButtonSelector.tsx rename to app/react/components/form-components/ButtonSelector/ButtonSelector.tsx index 324f50f46..3f1586999 100644 --- a/app/portainer/components/form-components/ButtonSelector/ButtonSelector.tsx +++ b/app/react/components/form-components/ButtonSelector/ButtonSelector.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import { PropsWithChildren, ReactNode } from 'react'; -import { ButtonGroup, Size } from '../../Button/ButtonGroup'; +import { ButtonGroup, Size } from '@@/buttons/ButtonGroup'; import styles from './ButtonSelector.module.css'; diff --git a/app/portainer/components/form-components/Checkbox.tsx b/app/react/components/form-components/Checkbox.tsx similarity index 100% rename from app/portainer/components/form-components/Checkbox.tsx rename to app/react/components/form-components/Checkbox.tsx diff --git a/app/portainer/components/form-components/FileUpload/FileUploadField.module.css b/app/react/components/form-components/FileUpload/FileUploadField.module.css similarity index 100% rename from app/portainer/components/form-components/FileUpload/FileUploadField.module.css rename to app/react/components/form-components/FileUpload/FileUploadField.module.css diff --git a/app/portainer/components/form-components/FileUpload/FileUploadField.stories.tsx b/app/react/components/form-components/FileUpload/FileUploadField.stories.tsx similarity index 100% rename from app/portainer/components/form-components/FileUpload/FileUploadField.stories.tsx rename to app/react/components/form-components/FileUpload/FileUploadField.stories.tsx diff --git a/app/portainer/components/form-components/FileUpload/FileUploadField.test.tsx b/app/react/components/form-components/FileUpload/FileUploadField.test.tsx similarity index 100% rename from app/portainer/components/form-components/FileUpload/FileUploadField.test.tsx rename to app/react/components/form-components/FileUpload/FileUploadField.test.tsx diff --git a/app/portainer/components/form-components/FileUpload/FileUploadField.tsx b/app/react/components/form-components/FileUpload/FileUploadField.tsx similarity index 85% rename from app/portainer/components/form-components/FileUpload/FileUploadField.tsx rename to app/react/components/form-components/FileUpload/FileUploadField.tsx index 890d29912..34a83db18 100644 --- a/app/portainer/components/form-components/FileUpload/FileUploadField.tsx +++ b/app/react/components/form-components/FileUpload/FileUploadField.tsx @@ -1,7 +1,6 @@ import { ChangeEvent, createRef } from 'react'; -import { r2a } from '@/react-tools/react2angular'; -import { Button } from '@/portainer/components/Button'; +import { Button } from '@@/buttons'; import styles from './FileUploadField.module.css'; @@ -67,12 +66,3 @@ export function FileUploadField({ } } } - -export const FileUploadFieldAngular = r2a(FileUploadField, [ - 'onChange', - 'value', - 'title', - 'required', - 'accept', - 'inputId', -]); diff --git a/app/portainer/components/form-components/FileUpload/FileUploadForm.stories.tsx b/app/react/components/form-components/FileUpload/FileUploadForm.stories.tsx similarity index 100% rename from app/portainer/components/form-components/FileUpload/FileUploadForm.stories.tsx rename to app/react/components/form-components/FileUpload/FileUploadForm.stories.tsx diff --git a/app/portainer/components/form-components/FileUpload/FileUploadForm.test.tsx b/app/react/components/form-components/FileUpload/FileUploadForm.test.tsx similarity index 100% rename from app/portainer/components/form-components/FileUpload/FileUploadForm.test.tsx rename to app/react/components/form-components/FileUpload/FileUploadForm.test.tsx diff --git a/app/portainer/components/form-components/FileUpload/FileUploadForm.tsx b/app/react/components/form-components/FileUpload/FileUploadForm.tsx similarity index 82% rename from app/portainer/components/form-components/FileUpload/FileUploadForm.tsx rename to app/react/components/form-components/FileUpload/FileUploadForm.tsx index 78d19c847..ad9942e25 100644 --- a/app/portainer/components/form-components/FileUpload/FileUploadForm.tsx +++ b/app/react/components/form-components/FileUpload/FileUploadForm.tsx @@ -1,7 +1,7 @@ import { PropsWithChildren, ReactNode } from 'react'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { FileUploadField } from '@/portainer/components/form-components/FileUpload/FileUploadField'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { FileUploadField } from '@@/form-components/FileUpload/FileUploadField'; export interface Props { onChange(value: unknown): void; diff --git a/app/react/components/form-components/FileUpload/index.ts b/app/react/components/form-components/FileUpload/index.ts new file mode 100644 index 000000000..6ca730f5e --- /dev/null +++ b/app/react/components/form-components/FileUpload/index.ts @@ -0,0 +1,2 @@ +export { FileUploadField } from './FileUploadField'; +export { FileUploadForm } from './FileUploadForm'; diff --git a/app/portainer/components/form-components/FormControl/FormControl.module.css b/app/react/components/form-components/FormControl/FormControl.module.css similarity index 100% rename from app/portainer/components/form-components/FormControl/FormControl.module.css rename to app/react/components/form-components/FormControl/FormControl.module.css diff --git a/app/portainer/components/form-components/FormControl/FormControl.stories.tsx b/app/react/components/form-components/FormControl/FormControl.stories.tsx similarity index 100% rename from app/portainer/components/form-components/FormControl/FormControl.stories.tsx rename to app/react/components/form-components/FormControl/FormControl.stories.tsx diff --git a/app/portainer/components/form-components/FormControl/FormControl.test.tsx b/app/react/components/form-components/FormControl/FormControl.test.tsx similarity index 100% rename from app/portainer/components/form-components/FormControl/FormControl.test.tsx rename to app/react/components/form-components/FormControl/FormControl.test.tsx diff --git a/app/portainer/components/form-components/FormControl/FormControl.tsx b/app/react/components/form-components/FormControl/FormControl.tsx similarity index 96% rename from app/portainer/components/form-components/FormControl/FormControl.tsx rename to app/react/components/form-components/FormControl/FormControl.tsx index ca46ec3f4..1717621b9 100644 --- a/app/portainer/components/form-components/FormControl/FormControl.tsx +++ b/app/react/components/form-components/FormControl/FormControl.tsx @@ -1,7 +1,7 @@ import { PropsWithChildren, ReactNode } from 'react'; import clsx from 'clsx'; -import { Tooltip } from '@/portainer/components/Tip/Tooltip'; +import { Tooltip } from '@@/Tip/Tooltip'; import { FormError } from '../FormError'; diff --git a/app/portainer/components/form-components/FormControl/index.ts b/app/react/components/form-components/FormControl/index.ts similarity index 100% rename from app/portainer/components/form-components/FormControl/index.ts rename to app/react/components/form-components/FormControl/index.ts diff --git a/app/portainer/components/form-components/FormError.tsx b/app/react/components/form-components/FormError.tsx similarity index 100% rename from app/portainer/components/form-components/FormError.tsx rename to app/react/components/form-components/FormError.tsx diff --git a/app/portainer/components/form-components/FormSection/FormSection.stories.tsx b/app/react/components/form-components/FormSection/FormSection.stories.tsx similarity index 100% rename from app/portainer/components/form-components/FormSection/FormSection.stories.tsx rename to app/react/components/form-components/FormSection/FormSection.stories.tsx diff --git a/app/portainer/components/form-components/FormSection/FormSection.tsx b/app/react/components/form-components/FormSection/FormSection.tsx similarity index 100% rename from app/portainer/components/form-components/FormSection/FormSection.tsx rename to app/react/components/form-components/FormSection/FormSection.tsx diff --git a/app/portainer/components/form-components/FormSection/index.ts b/app/react/components/form-components/FormSection/index.ts similarity index 100% rename from app/portainer/components/form-components/FormSection/index.ts rename to app/react/components/form-components/FormSection/index.ts diff --git a/app/portainer/components/form-components/FormSectionTitle/FormSectionTitle.stories.tsx b/app/react/components/form-components/FormSectionTitle/FormSectionTitle.stories.tsx similarity index 100% rename from app/portainer/components/form-components/FormSectionTitle/FormSectionTitle.stories.tsx rename to app/react/components/form-components/FormSectionTitle/FormSectionTitle.stories.tsx diff --git a/app/portainer/components/form-components/FormSectionTitle/FormSectionTitle.test.tsx b/app/react/components/form-components/FormSectionTitle/FormSectionTitle.test.tsx similarity index 100% rename from app/portainer/components/form-components/FormSectionTitle/FormSectionTitle.test.tsx rename to app/react/components/form-components/FormSectionTitle/FormSectionTitle.test.tsx diff --git a/app/portainer/components/form-components/FormSectionTitle/FormSectionTitle.tsx b/app/react/components/form-components/FormSectionTitle/FormSectionTitle.tsx similarity index 100% rename from app/portainer/components/form-components/FormSectionTitle/FormSectionTitle.tsx rename to app/react/components/form-components/FormSectionTitle/FormSectionTitle.tsx diff --git a/app/portainer/components/form-components/FormSectionTitle/index.ts b/app/react/components/form-components/FormSectionTitle/index.ts similarity index 100% rename from app/portainer/components/form-components/FormSectionTitle/index.ts rename to app/react/components/form-components/FormSectionTitle/index.ts diff --git a/app/portainer/components/form-components/Input/Input.stories.tsx b/app/react/components/form-components/Input/Input.stories.tsx similarity index 100% rename from app/portainer/components/form-components/Input/Input.stories.tsx rename to app/react/components/form-components/Input/Input.stories.tsx diff --git a/app/portainer/components/form-components/Input/Input.tsx b/app/react/components/form-components/Input/Input.tsx similarity index 100% rename from app/portainer/components/form-components/Input/Input.tsx rename to app/react/components/form-components/Input/Input.tsx diff --git a/app/portainer/components/form-components/Input/Select.stories.tsx b/app/react/components/form-components/Input/Select.stories.tsx similarity index 100% rename from app/portainer/components/form-components/Input/Select.stories.tsx rename to app/react/components/form-components/Input/Select.stories.tsx diff --git a/app/portainer/components/form-components/Input/Select.tsx b/app/react/components/form-components/Input/Select.tsx similarity index 100% rename from app/portainer/components/form-components/Input/Select.tsx rename to app/react/components/form-components/Input/Select.tsx diff --git a/app/portainer/components/form-components/Input/Textarea.tsx b/app/react/components/form-components/Input/Textarea.tsx similarity index 100% rename from app/portainer/components/form-components/Input/Textarea.tsx rename to app/react/components/form-components/Input/Textarea.tsx diff --git a/app/portainer/components/form-components/Input/index.ts b/app/react/components/form-components/Input/index.ts similarity index 100% rename from app/portainer/components/form-components/Input/index.ts rename to app/react/components/form-components/Input/index.ts diff --git a/app/portainer/components/form-components/InputGroup/InputGroup.stories.tsx b/app/react/components/form-components/InputGroup/InputGroup.stories.tsx similarity index 100% rename from app/portainer/components/form-components/InputGroup/InputGroup.stories.tsx rename to app/react/components/form-components/InputGroup/InputGroup.stories.tsx diff --git a/app/portainer/components/form-components/InputGroup/InputGroup.tsx b/app/react/components/form-components/InputGroup/InputGroup.tsx similarity index 100% rename from app/portainer/components/form-components/InputGroup/InputGroup.tsx rename to app/react/components/form-components/InputGroup/InputGroup.tsx diff --git a/app/portainer/components/form-components/InputGroup/InputGroupAddon.tsx b/app/react/components/form-components/InputGroup/InputGroupAddon.tsx similarity index 100% rename from app/portainer/components/form-components/InputGroup/InputGroupAddon.tsx rename to app/react/components/form-components/InputGroup/InputGroupAddon.tsx diff --git a/app/portainer/components/form-components/InputGroup/InputGroupButtonWrapper.tsx b/app/react/components/form-components/InputGroup/InputGroupButtonWrapper.tsx similarity index 100% rename from app/portainer/components/form-components/InputGroup/InputGroupButtonWrapper.tsx rename to app/react/components/form-components/InputGroup/InputGroupButtonWrapper.tsx diff --git a/app/portainer/components/form-components/InputGroup/index.ts b/app/react/components/form-components/InputGroup/index.ts similarity index 100% rename from app/portainer/components/form-components/InputGroup/index.ts rename to app/react/components/form-components/InputGroup/index.ts diff --git a/app/portainer/components/form-components/InputList/InputList.module.css b/app/react/components/form-components/InputList/InputList.module.css similarity index 100% rename from app/portainer/components/form-components/InputList/InputList.module.css rename to app/react/components/form-components/InputList/InputList.module.css diff --git a/app/portainer/components/form-components/InputList/InputList.stories.tsx b/app/react/components/form-components/InputList/InputList.stories.tsx similarity index 100% rename from app/portainer/components/form-components/InputList/InputList.stories.tsx rename to app/react/components/form-components/InputList/InputList.stories.tsx diff --git a/app/portainer/components/form-components/InputList/InputList.tsx b/app/react/components/form-components/InputList/InputList.tsx similarity index 96% rename from app/portainer/components/form-components/InputList/InputList.tsx rename to app/react/components/form-components/InputList/InputList.tsx index 70042310f..7d555c207 100644 --- a/app/portainer/components/form-components/InputList/InputList.tsx +++ b/app/react/components/form-components/InputList/InputList.tsx @@ -1,9 +1,9 @@ import { ComponentType } from 'react'; import clsx from 'clsx'; -import { AddButton, Button } from '@/portainer/components/Button'; -import { Tooltip } from '@/portainer/components/Tip/Tooltip'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; +import { AddButton, Button } from '@@/buttons'; +import { Tooltip } from '@@/Tip/Tooltip'; +import { TextTip } from '@@/Tip/TextTip'; import { Input } from '../Input'; import { FormError } from '../FormError'; diff --git a/app/portainer/components/form-components/InputList/index.ts b/app/react/components/form-components/InputList/index.ts similarity index 100% rename from app/portainer/components/form-components/InputList/index.ts rename to app/react/components/form-components/InputList/index.ts diff --git a/app/portainer/components/form-components/InputList/utils.test.ts b/app/react/components/form-components/InputList/utils.test.ts similarity index 100% rename from app/portainer/components/form-components/InputList/utils.test.ts rename to app/react/components/form-components/InputList/utils.test.ts diff --git a/app/portainer/components/form-components/InputList/utils.ts b/app/react/components/form-components/InputList/utils.ts similarity index 100% rename from app/portainer/components/form-components/InputList/utils.ts rename to app/react/components/form-components/InputList/utils.ts diff --git a/app/portainer/components/form-components/ReactSelect.module.css b/app/react/components/form-components/ReactSelect.module.css similarity index 100% rename from app/portainer/components/form-components/ReactSelect.module.css rename to app/react/components/form-components/ReactSelect.module.css diff --git a/app/portainer/components/form-components/ReactSelect.tsx b/app/react/components/form-components/ReactSelect.tsx similarity index 100% rename from app/portainer/components/form-components/ReactSelect.tsx rename to app/react/components/form-components/ReactSelect.tsx diff --git a/app/portainer/components/form-components/Slider/Slider.module.css b/app/react/components/form-components/Slider/Slider.module.css similarity index 100% rename from app/portainer/components/form-components/Slider/Slider.module.css rename to app/react/components/form-components/Slider/Slider.module.css diff --git a/app/portainer/components/form-components/Slider/Slider.stories.tsx b/app/react/components/form-components/Slider/Slider.stories.tsx similarity index 100% rename from app/portainer/components/form-components/Slider/Slider.stories.tsx rename to app/react/components/form-components/Slider/Slider.stories.tsx diff --git a/app/portainer/components/form-components/Slider/Slider.test.tsx b/app/react/components/form-components/Slider/Slider.test.tsx similarity index 100% rename from app/portainer/components/form-components/Slider/Slider.test.tsx rename to app/react/components/form-components/Slider/Slider.test.tsx diff --git a/app/portainer/components/form-components/Slider/Slider.tsx b/app/react/components/form-components/Slider/Slider.tsx similarity index 100% rename from app/portainer/components/form-components/Slider/Slider.tsx rename to app/react/components/form-components/Slider/Slider.tsx diff --git a/app/portainer/components/form-components/SwitchField/Switch.css b/app/react/components/form-components/SwitchField/Switch.css similarity index 100% rename from app/portainer/components/form-components/SwitchField/Switch.css rename to app/react/components/form-components/SwitchField/Switch.css diff --git a/app/portainer/components/form-components/SwitchField/Switch.module.css b/app/react/components/form-components/SwitchField/Switch.module.css similarity index 100% rename from app/portainer/components/form-components/SwitchField/Switch.module.css rename to app/react/components/form-components/SwitchField/Switch.module.css diff --git a/app/portainer/components/form-components/SwitchField/Switch.stories.tsx b/app/react/components/form-components/SwitchField/Switch.stories.tsx similarity index 100% rename from app/portainer/components/form-components/SwitchField/Switch.stories.tsx rename to app/react/components/form-components/SwitchField/Switch.stories.tsx diff --git a/app/portainer/components/form-components/SwitchField/Switch.test.tsx b/app/react/components/form-components/SwitchField/Switch.test.tsx similarity index 100% rename from app/portainer/components/form-components/SwitchField/Switch.test.tsx rename to app/react/components/form-components/SwitchField/Switch.test.tsx diff --git a/app/portainer/components/form-components/SwitchField/Switch.tsx b/app/react/components/form-components/SwitchField/Switch.tsx similarity index 93% rename from app/portainer/components/form-components/SwitchField/Switch.tsx rename to app/react/components/form-components/SwitchField/Switch.tsx index 840c7cccb..9e2a8e497 100644 --- a/app/portainer/components/form-components/SwitchField/Switch.tsx +++ b/app/react/components/form-components/SwitchField/Switch.tsx @@ -1,9 +1,10 @@ import clsx from 'clsx'; import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; -import { BEFeatureIndicator } from '@/portainer/components/BEFeatureIndicator'; import { FeatureId } from '@/portainer/feature-flags/enums'; +import { BEFeatureIndicator } from '@@/BEFeatureIndicator'; + import './Switch.css'; import styles from './Switch.module.css'; diff --git a/app/portainer/components/form-components/SwitchField/SwitchField.module.css b/app/react/components/form-components/SwitchField/SwitchField.module.css similarity index 100% rename from app/portainer/components/form-components/SwitchField/SwitchField.module.css rename to app/react/components/form-components/SwitchField/SwitchField.module.css diff --git a/app/portainer/components/form-components/SwitchField/SwitchField.stories.tsx b/app/react/components/form-components/SwitchField/SwitchField.stories.tsx similarity index 100% rename from app/portainer/components/form-components/SwitchField/SwitchField.stories.tsx rename to app/react/components/form-components/SwitchField/SwitchField.stories.tsx diff --git a/app/portainer/components/form-components/SwitchField/SwitchField.test.tsx b/app/react/components/form-components/SwitchField/SwitchField.test.tsx similarity index 100% rename from app/portainer/components/form-components/SwitchField/SwitchField.test.tsx rename to app/react/components/form-components/SwitchField/SwitchField.test.tsx diff --git a/app/portainer/components/form-components/SwitchField/SwitchField.tsx b/app/react/components/form-components/SwitchField/SwitchField.tsx similarity index 79% rename from app/portainer/components/form-components/SwitchField/SwitchField.tsx rename to app/react/components/form-components/SwitchField/SwitchField.tsx index ab6bfd2a7..09ced61aa 100644 --- a/app/portainer/components/form-components/SwitchField/SwitchField.tsx +++ b/app/react/components/form-components/SwitchField/SwitchField.tsx @@ -1,8 +1,8 @@ import clsx from 'clsx'; import { FeatureId } from '@/portainer/feature-flags/enums'; -import { Tooltip } from '@/portainer/components/Tip/Tooltip'; -import { r2a } from '@/react-tools/react2angular'; + +import { Tooltip } from '@@/Tip/Tooltip'; import styles from './SwitchField.module.css'; import { Switch } from './Switch'; @@ -58,15 +58,3 @@ export function SwitchField({ ); } - -export const SwitchFieldAngular = r2a(SwitchField, [ - 'tooltip', - 'checked', - 'label', - 'name', - 'labelClass', - 'dataCy', - 'disabled', - 'onChange', - 'featureId', -]); diff --git a/app/react/components/form-components/SwitchField/index.ts b/app/react/components/form-components/SwitchField/index.ts new file mode 100644 index 000000000..b8ccca237 --- /dev/null +++ b/app/react/components/form-components/SwitchField/index.ts @@ -0,0 +1 @@ +export { SwitchField } from './SwitchField'; diff --git a/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx b/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx index 31ead6309..5f75de94a 100644 --- a/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx +++ b/app/react/edge/components/EdgeScriptForm/EdgeScriptSettingsFieldset.tsx @@ -1,9 +1,9 @@ -import { useFormikContext, Field } from 'formik'; +import { Field, useFormikContext } from 'formik'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input } from '@/portainer/components/form-components/Input'; -import { SwitchField } from '@/portainer/components/form-components/SwitchField'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; +import { FormControl } from '@@/form-components/FormControl'; +import { Input } from '@@/form-components/Input'; +import { SwitchField } from '@@/form-components/SwitchField'; +import { TextTip } from '@@/Tip/TextTip'; import { NomadTokenField } from './NomadTokenField'; import { ScriptFormValues } from './types'; diff --git a/app/react/edge/components/EdgeScriptForm/NomadTokenField.tsx b/app/react/edge/components/EdgeScriptForm/NomadTokenField.tsx index cdf61d0f4..8b7058457 100644 --- a/app/react/edge/components/EdgeScriptForm/NomadTokenField.tsx +++ b/app/react/edge/components/EdgeScriptForm/NomadTokenField.tsx @@ -1,9 +1,9 @@ import { Field, useFormikContext } from 'formik'; import { string, boolean } from 'yup'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { SwitchField } from '@/portainer/components/form-components/SwitchField'; -import { Input } from '@/portainer/components/form-components/Input'; +import { FormControl } from '@@/form-components/FormControl'; +import { SwitchField } from '@@/form-components/SwitchField'; +import { Input } from '@@/form-components/Input'; import { ScriptFormValues } from './types'; diff --git a/app/react/edge/components/EdgeScriptForm/OsSelector.tsx b/app/react/edge/components/EdgeScriptForm/OsSelector.tsx index 8682414b5..d90f0e0c7 100644 --- a/app/react/edge/components/EdgeScriptForm/OsSelector.tsx +++ b/app/react/edge/components/EdgeScriptForm/OsSelector.tsx @@ -1,4 +1,4 @@ -import { ButtonSelector } from '@/portainer/components/form-components/ButtonSelector/ButtonSelector'; +import { ButtonSelector } from '@@/form-components/ButtonSelector/ButtonSelector'; import { OS } from './types'; diff --git a/app/react/edge/components/EdgeScriptForm/ScriptTabs.tsx b/app/react/edge/components/EdgeScriptForm/ScriptTabs.tsx index ec19f3d90..d1a864acd 100644 --- a/app/react/edge/components/EdgeScriptForm/ScriptTabs.tsx +++ b/app/react/edge/components/EdgeScriptForm/ScriptTabs.tsx @@ -1,10 +1,11 @@ import { useEffect } from 'react'; -import { Code } from '@/portainer/components/Code'; -import { CopyButton } from '@/portainer/components/Button/CopyButton'; -import { NavTabs } from '@/portainer/components/NavTabs/NavTabs'; import { useAgentDetails } from '@/portainer/environments/queries/useAgentDetails'; +import { Code } from '@@/Code'; +import { CopyButton } from '@@/buttons/CopyButton'; +import { NavTabs } from '@@/NavTabs'; + import { ScriptFormValues, Platform } from './types'; import { CommandTab } from './scripts'; diff --git a/app/portainer/views/account/CreateAccessToken/CreateAccessToken.test.tsx b/app/react/portainer/account/CreateAccessTokenView/CreateAccessToken.test.tsx similarity index 100% rename from app/portainer/views/account/CreateAccessToken/CreateAccessToken.test.tsx rename to app/react/portainer/account/CreateAccessTokenView/CreateAccessToken.test.tsx diff --git a/app/portainer/views/account/CreateAccessToken/CreateAccessToken.tsx b/app/react/portainer/account/CreateAccessTokenView/CreateAccessToken.tsx similarity index 84% rename from app/portainer/views/account/CreateAccessToken/CreateAccessToken.tsx rename to app/react/portainer/account/CreateAccessTokenView/CreateAccessToken.tsx index 0d84153c6..48341348f 100644 --- a/app/portainer/views/account/CreateAccessToken/CreateAccessToken.tsx +++ b/app/react/portainer/account/CreateAccessTokenView/CreateAccessToken.tsx @@ -2,14 +2,14 @@ import { PropsWithChildren, useEffect, useState } from 'react'; import { useRouter } from '@uirouter/react'; import { Trans, useTranslation } from 'react-i18next'; -import { Widget, WidgetBody } from '@/portainer/components/widget'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Button } from '@/portainer/components/Button'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { TextTip } from '@/portainer/components/Tip/TextTip'; -import { Code } from '@/portainer/components/Code'; -import { CopyButton } from '@/portainer/components/Button/CopyButton'; -import { Input } from '@/portainer/components/form-components/Input'; +import { Widget, WidgetBody } from '@@/Widget'; +import { FormControl } from '@@/form-components/FormControl'; +import { Button } from '@@/buttons'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { TextTip } from '@@/Tip/TextTip'; +import { Code } from '@@/Code'; +import { CopyButton } from '@@/buttons/CopyButton'; +import { Input } from '@@/form-components/Input'; interface AccessTokenResponse { rawAPIKey: string; diff --git a/app/react/portainer/account/CreateAccessTokenView/index.ts b/app/react/portainer/account/CreateAccessTokenView/index.ts new file mode 100644 index 000000000..015b67a86 --- /dev/null +++ b/app/react/portainer/account/CreateAccessTokenView/index.ts @@ -0,0 +1 @@ +export { CreateAccessToken } from './CreateAccessToken'; diff --git a/app/react/portainer/custom-templates/components/CustomTemplatesVariablesDefinitionField/CustomTemplatesVariablesDefinitionField.tsx b/app/react/portainer/custom-templates/components/CustomTemplatesVariablesDefinitionField/CustomTemplatesVariablesDefinitionField.tsx index 4e1f1acc8..fdc4a8d6a 100644 --- a/app/react/portainer/custom-templates/components/CustomTemplatesVariablesDefinitionField/CustomTemplatesVariablesDefinitionField.tsx +++ b/app/react/portainer/custom-templates/components/CustomTemplatesVariablesDefinitionField/CustomTemplatesVariablesDefinitionField.tsx @@ -1,10 +1,10 @@ -import { FormError } from '@/portainer/components/form-components/FormError'; -import { Input } from '@/portainer/components/form-components/Input'; -import { InputList } from '@/portainer/components/form-components/InputList'; +import { FormError } from '@@/form-components/FormError'; +import { Input } from '@@/form-components/Input'; +import { InputList } from '@@/form-components/InputList'; import { InputListError, ItemProps, -} from '@/portainer/components/form-components/InputList/InputList'; +} from '@@/form-components/InputList/InputList'; export interface VariableDefinition { name: string; diff --git a/app/react/portainer/custom-templates/components/CustomTemplatesVariablesField/CustomTemplatesVariablesField.tsx b/app/react/portainer/custom-templates/components/CustomTemplatesVariablesField/CustomTemplatesVariablesField.tsx index 558d19aac..70fe54477 100644 --- a/app/react/portainer/custom-templates/components/CustomTemplatesVariablesField/CustomTemplatesVariablesField.tsx +++ b/app/react/portainer/custom-templates/components/CustomTemplatesVariablesField/CustomTemplatesVariablesField.tsx @@ -1,6 +1,6 @@ -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { FormSection } from '@/portainer/components/form-components/FormSection/FormSection'; -import { Input } from '@/portainer/components/form-components/Input'; +import { FormControl } from '@@/form-components/FormControl'; +import { FormSection } from '@@/form-components/FormSection/FormSection'; +import { Input } from '@@/form-components/Input'; import { VariableDefinition } from '../CustomTemplatesVariablesDefinitionField/CustomTemplatesVariablesDefinitionField'; diff --git a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx index 5700f0399..bc1e30f3e 100644 --- a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EndpointTypeView.tsx @@ -2,11 +2,12 @@ import { useState } from 'react'; import { useRouter } from '@uirouter/react'; import _ from 'lodash'; -import { Button } from '@/portainer/components/Button'; -import { PageHeader } from '@/portainer/components/PageHeader'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; import { useAnalytics } from '@/angulartics.matomo/analytics-services'; +import { Button } from '@@/buttons'; +import { PageHeader } from '@@/PageHeader'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; + import { EnvironmentSelector, EnvironmentSelectorValue, diff --git a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EnvironmentSelector.tsx b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EnvironmentSelector.tsx index 504b8ad86..e1aa30a82 100644 --- a/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EnvironmentSelector.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentTypeSelectView/EnvironmentSelector.tsx @@ -1,4 +1,4 @@ -import { FormSection } from '@/portainer/components/form-components/FormSection'; +import { FormSection } from '@@/form-components/FormSection'; import { Option } from '../components/Option'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/EnvironmentsCreationView.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/EnvironmentsCreationView.tsx index b13b50bba..38376e6ad 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/EnvironmentsCreationView.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/EnvironmentsCreationView.tsx @@ -3,14 +3,15 @@ import { useState } from 'react'; import _ from 'lodash'; import clsx from 'clsx'; -import { Stepper } from '@/react/components/Stepper'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; import { notifyError } from '@/portainer/services/notifications'; -import { PageHeader } from '@/portainer/components/PageHeader'; -import { Button } from '@/portainer/components/Button'; import { Environment, EnvironmentId } from '@/portainer/environments/types'; import { useAnalytics } from '@/angulartics.matomo/analytics-services'; -import { FormSection } from '@/portainer/components/form-components/FormSection'; + +import { Stepper } from '@@/Stepper'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { PageHeader } from '@@/PageHeader'; +import { Button } from '@@/buttons'; +import { FormSection } from '@@/form-components/FormSection'; import { environmentTypes } from '../EnvironmentTypeSelectView/environment-types'; import { EnvironmentSelectorValue } from '../EnvironmentTypeSelectView/EnvironmentSelector'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx index 04b89059a..641aac38e 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardAzure/WizardAzure.tsx @@ -2,15 +2,17 @@ import { Field, Form, Formik } from 'formik'; import { useReducer, useState } from 'react'; import { object, SchemaOf, string } from 'yup'; -import { BoxSelector, buildOption } from '@/portainer/components/BoxSelector'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input } from '@/portainer/components/form-components/Input'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; +import { buildOption } from '@/portainer/components/BoxSelector'; import { useCreateAzureEnvironmentMutation } from '@/portainer/environments/queries/useCreateEnvironmentMutation'; import { notifySuccess } from '@/portainer/services/notifications'; import { Environment } from '@/portainer/environments/types'; import { EnvironmentMetadata } from '@/portainer/environments/environment.service/create'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { Input } from '@@/form-components/Input'; +import { FormControl } from '@@/form-components/FormControl'; +import { BoxSelector } from '@@/BoxSelector'; + import { NameField, nameValidation } from '../shared/NameField'; import { AnalyticsStateKey } from '../types'; import { metadataValidation } from '../shared/MetadataFieldset/validation'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/APIForm.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/APIForm.tsx index 8c025b82e..6865da6d3 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/APIForm.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/APIForm.tsx @@ -1,16 +1,17 @@ import { Field, Form, Formik } from 'formik'; import { useReducer } from 'react'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; import { useCreateRemoteEnvironmentMutation } from '@/portainer/environments/queries/useCreateEnvironmentMutation'; import { notifySuccess } from '@/portainer/services/notifications'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input } from '@/portainer/components/form-components/Input'; import { Environment, EnvironmentCreationTypes, } from '@/portainer/environments/types'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { FormControl } from '@@/form-components/FormControl'; +import { Input } from '@@/form-components/Input'; + import { NameField } from '../../shared/NameField'; import { MoreSettingsSection } from '../../shared/MoreSettingsSection'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/DeploymentScripts.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/DeploymentScripts.tsx index 8d95eab4d..39976ecbc 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/DeploymentScripts.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/DeploymentScripts.tsx @@ -1,10 +1,11 @@ import { useState } from 'react'; -import { CopyButton } from '@/portainer/components/Button/CopyButton'; -import { Code } from '@/portainer/components/Code'; -import { NavTabs } from '@/portainer/components/NavTabs/NavTabs'; import { useAgentDetails } from '@/portainer/environments/queries/useAgentDetails'; +import { CopyButton } from '@@/buttons/CopyButton'; +import { Code } from '@@/Code'; +import { NavTabs } from '@@/NavTabs'; + const deployments = [ { id: 'linux', 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 f14d369d9..990e4d849 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/TLSFieldset.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/APITab/TLSFieldset.tsx @@ -1,14 +1,15 @@ import { useFormikContext } from 'formik'; -import { FileUploadField } from '@/portainer/components/form-components/FileUpload'; -import { SwitchField } from '@/portainer/components/form-components/SwitchField'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; import { file, withFileSize, withFileType, } from '@/portainer/helpers/yup-file-validation'; +import { FileUploadField } from '@@/form-components/FileUpload'; +import { SwitchField } from '@@/form-components/SwitchField'; +import { FormControl } from '@@/form-components/FormControl'; + import { FormValues } from './types'; export function TLSFieldset() { diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/AgentTab/DeploymentScripts.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/AgentTab/DeploymentScripts.tsx index c60ae5d54..ec4954600 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/AgentTab/DeploymentScripts.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/AgentTab/DeploymentScripts.tsx @@ -1,11 +1,12 @@ import { useState } from 'react'; -import { CopyButton } from '@/portainer/components/Button/CopyButton'; -import { Code } from '@/portainer/components/Code'; -import { NavTabs } from '@/portainer/components/NavTabs/NavTabs'; import { getAgentShortVersion } from '@/portainer/views/endpoints/helpers'; import { useAgentDetails } from '@/portainer/environments/queries/useAgentDetails'; +import { CopyButton } from '@@/buttons/CopyButton'; +import { Code } from '@@/Code'; +import { NavTabs } from '@@/NavTabs'; + const deployments = [ { id: 'linux', diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/SocketTab/SocketForm.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/SocketTab/SocketForm.tsx index cb7013b46..1d970dbd9 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/SocketTab/SocketForm.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/SocketTab/SocketForm.tsx @@ -1,14 +1,15 @@ import { Field, Form, Formik, useFormikContext } from 'formik'; import { useReducer } from 'react'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; import { useCreateLocalDockerEnvironmentMutation } from '@/portainer/environments/queries/useCreateEnvironmentMutation'; import { notifySuccess } from '@/portainer/services/notifications'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input } from '@/portainer/components/form-components/Input'; -import { SwitchField } from '@/portainer/components/form-components/SwitchField'; import { Environment } from '@/portainer/environments/types'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { FormControl } from '@@/form-components/FormControl'; +import { Input } from '@@/form-components/Input'; +import { SwitchField } from '@@/form-components/SwitchField'; + import { NameField } from '../../shared/NameField'; import { MoreSettingsSection } from '../../shared/MoreSettingsSection'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx index 862ca604a..a07340c2c 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardDocker/WizardDocker.tsx @@ -1,12 +1,10 @@ import { useState } from 'react'; -import { - BoxSelector, - BoxSelectorOption, -} from '@/portainer/components/BoxSelector'; import { Environment } from '@/portainer/environments/types'; import { commandsTabs } from '@/react/edge/components/EdgeScriptForm/scripts'; +import { BoxSelector, type BoxSelectorOption } from '@@/BoxSelector'; + import { AnalyticsStateKey } from '../types'; import { EdgeAgentTab } from '../shared/EdgeAgentTab'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx index 731e91527..2008c6831 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardEndpointsList/WizardEndpointsList.tsx @@ -1,6 +1,5 @@ import clsx from 'clsx'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; import { environmentTypeIcon, endpointTypeName, @@ -17,6 +16,8 @@ import { useEnvironmentList, } from '@/portainer/environments/queries/useEnvironmentList'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; + import styles from './WizardEndpointsList.module.css'; interface Props { diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/DeploymentScripts.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/DeploymentScripts.tsx index d2b1c745b..abf7fba91 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/DeploymentScripts.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/DeploymentScripts.tsx @@ -1,12 +1,13 @@ import { useState } from 'react'; -import { CopyButton } from '@/portainer/components/Button/CopyButton'; -import { Code } from '@/portainer/components/Code'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { NavTabs } from '@/portainer/components/NavTabs/NavTabs'; import { getAgentShortVersion } from '@/portainer/views/endpoints/helpers'; import { useAgentDetails } from '@/portainer/environments/queries/useAgentDetails'; +import { CopyButton } from '@@/buttons/CopyButton'; +import { Code } from '@@/Code'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { NavTabs } from '@@/NavTabs'; + const deployments = [ { id: 'k8sLoadBalancer', diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/KubeConfigTeaserForm.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/KubeConfigTeaserForm.tsx index 5023be795..6fa4e4477 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/KubeConfigTeaserForm.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/KubeConfigTeaserForm.tsx @@ -1,10 +1,10 @@ import { Field, Form, Formik } from 'formik'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { FormSectionTitle } from '@/portainer/components/form-components/FormSectionTitle'; -import { Input } from '@/portainer/components/form-components/Input'; -import { Button } from '@/portainer/components/Button'; +import { LoadingButton } from '@@/buttons/LoadingButton'; +import { FormControl } from '@@/form-components/FormControl'; +import { FormSectionTitle } from '@@/form-components/FormSectionTitle'; +import { Input } from '@@/form-components/Input'; +import { Button } from '@@/buttons'; const initialValues = { kubeConfig: '', diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx index edc606c13..c69aa4331 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/WizardKubernetes/WizardKubernetes.tsx @@ -1,14 +1,15 @@ import { useState } from 'react'; -import { BoxSelector } from '@/portainer/components/BoxSelector'; import { Environment, EnvironmentCreationTypes, } from '@/portainer/environments/types'; -import { BoxSelectorOption } from '@/portainer/components/BoxSelector/types'; import { commandsTabs } from '@/react/edge/components/EdgeScriptForm/scripts'; import { FeatureId } from '@/portainer/feature-flags/enums'; -import { BEFeatureIndicator } from '@/portainer/components/BEFeatureIndicator'; + +import { BoxSelectorOption } from '@@/BoxSelector/types'; +import { BoxSelector } from '@@/BoxSelector'; +import { BEFeatureIndicator } from '@@/BEFeatureIndicator'; import { AnalyticsStateKey } from '../types'; import { EdgeAgentTab } from '../shared/EdgeAgentTab'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/AgentForm.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/AgentForm.tsx index 252a679f5..412308e8c 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/AgentForm.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/AgentForm.tsx @@ -1,12 +1,13 @@ import { Form, Formik } from 'formik'; import { useReducer } from 'react'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; import { useCreateAgentEnvironmentMutation } from '@/portainer/environments/queries/useCreateEnvironmentMutation'; import { notifySuccess } from '@/portainer/services/notifications'; import { Environment } from '@/portainer/environments/types'; import { CreateAgentEnvironmentValues } from '@/portainer/environments/environment.service/create'; +import { LoadingButton } from '@@/buttons/LoadingButton'; + import { NameField } from '../NameField'; import { MoreSettingsSection } from '../MoreSettingsSection'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/EnvironmentUrlField.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/EnvironmentUrlField.tsx index f06125325..d28a0c584 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/EnvironmentUrlField.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/AgentForm/EnvironmentUrlField.tsx @@ -1,7 +1,7 @@ import { Field, useField } from 'formik'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input } from '@/portainer/components/form-components/Input'; +import { FormControl } from '@@/form-components/FormControl'; +import { Input } from '@@/form-components/Input'; export function EnvironmentUrlField() { const [, meta] = useField('environmentUrl'); diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx index 9eeb46b95..8c2cbd08d 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx @@ -1,12 +1,13 @@ import { Formik, Form } from 'formik'; -import { LoadingButton } from '@/portainer/components/Button/LoadingButton'; import { Environment } from '@/portainer/environments/types'; import { useCreateEdgeAgentEnvironmentMutation } from '@/portainer/environments/queries/useCreateEnvironmentMutation'; import { baseHref } from '@/portainer/helpers/pathHelper'; -import { FormSection } from '@/portainer/components/form-components/FormSection'; import { EdgeCheckinIntervalField } from '@/edge/components/EdgeCheckInIntervalField'; +import { FormSection } from '@@/form-components/FormSection'; +import { LoadingButton } from '@@/buttons/LoadingButton'; + import { MoreSettingsSection } from '../../MoreSettingsSection'; import { EdgeAgentFieldset } from './EdgeAgentFieldset'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/PortainerUrlField.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/PortainerUrlField.tsx index ce72ee93d..13795f13a 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/PortainerUrlField.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/PortainerUrlField.tsx @@ -1,8 +1,8 @@ import { Field, useField } from 'formik'; import { string } from 'yup'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input } from '@/portainer/components/form-components/Input'; +import { FormControl } from '@@/form-components/FormControl'; +import { Input } from '@@/form-components/Input'; interface Props { fieldName: string; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx index 7f00a8c15..8ee11bb04 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentTab.tsx @@ -1,12 +1,13 @@ import { v4 as uuid } from 'uuid'; import { useReducer, useState } from 'react'; -import { Button } from '@/portainer/components/Button'; import { Environment } from '@/portainer/environments/types'; import { EdgeScriptForm } from '@/react/edge/components/EdgeScriptForm'; import { CommandTab } from '@/react/edge/components/EdgeScriptForm/scripts'; import { OS, EdgeInfo } from '@/react/edge/components/EdgeScriptForm/types'; +import { Button } from '@@/buttons'; + import { EdgeAgentForm } from './EdgeAgentForm'; interface Props { 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 3a076a484..5d8d5d826 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/GroupsField.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/GroupsField.tsx @@ -1,10 +1,11 @@ import { useField } from 'formik'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Select } from '@/portainer/components/form-components/Input'; import { useGroups } from '@/portainer/environment-groups/queries'; import { EnvironmentGroupId } from '@/portainer/environment-groups/types'; +import { FormControl } from '@@/form-components/FormControl'; +import { Select } from '@@/form-components/Input'; + export function GroupField() { const [fieldProps, metaProps, helpers] = useField('meta.groupId'); 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 148247d3c..cef7e2b3e 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/MetadataFieldset.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MetadataFieldset/MetadataFieldset.tsx @@ -1,8 +1,9 @@ import { useField } from 'formik'; -import { TagSelector } from '@/react/components/TagSelector'; import { useUser } from '@/portainer/hooks/useUser'; -import { FormSection } from '@/portainer/components/form-components/FormSection'; + +import { TagSelector } from '@@/TagSelector'; +import { FormSection } from '@@/form-components/FormSection'; import { GroupField } from './GroupsField'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MoreSettingsSection.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MoreSettingsSection.tsx index f516027ef..1e1427c7e 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MoreSettingsSection.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/MoreSettingsSection.tsx @@ -1,6 +1,6 @@ import { PropsWithChildren } from 'react'; -import { FormSection } from '@/portainer/components/form-components/FormSection'; +import { FormSection } from '@@/form-components/FormSection'; import { MetadataFieldset } from './MetadataFieldset'; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/NameField.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/NameField.tsx index f850cb4b0..e02ed78c4 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/NameField.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/NameField.tsx @@ -2,10 +2,11 @@ import { Field, useField } from 'formik'; import { string } from 'yup'; import { debounce } from 'lodash'; -import { FormControl } from '@/portainer/components/form-components/FormControl'; -import { Input } from '@/portainer/components/form-components/Input'; import { getEndpoints } from '@/portainer/environments/environment.service'; +import { FormControl } from '@@/form-components/FormControl'; +import { Input } from '@@/form-components/Input'; + interface Props { readonly?: boolean; } diff --git a/app/react/portainer/environments/wizard/HomeView/HomeView.tsx b/app/react/portainer/environments/wizard/HomeView/HomeView.tsx index 1858e0c2a..f271c015f 100644 --- a/app/react/portainer/environments/wizard/HomeView/HomeView.tsx +++ b/app/react/portainer/environments/wizard/HomeView/HomeView.tsx @@ -1,8 +1,9 @@ -import { PageHeader } from '@/portainer/components/PageHeader'; -import { Widget, WidgetBody, WidgetTitle } from '@/portainer/components/widget'; import { EnvironmentType } from '@/portainer/environments/types'; import { useAnalytics } from '@/angulartics.matomo/analytics-services'; -import { Link } from '@/portainer/components/Link'; + +import { PageHeader } from '@@/PageHeader'; +import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; +import { Link } from '@@/Link'; import { Option } from '../components/Option'; diff --git a/app/react/portainer/environments/wizard/components/Option/Option.tsx b/app/react/portainer/environments/wizard/components/Option/Option.tsx index 22e0e45cb..1af0a72ce 100644 --- a/app/react/portainer/environments/wizard/components/Option/Option.tsx +++ b/app/react/portainer/environments/wizard/components/Option/Option.tsx @@ -1,10 +1,11 @@ import clsx from 'clsx'; import { ComponentType } from 'react'; -import { BEFeatureIndicator } from '@/portainer/components/BEFeatureIndicator'; import { FeatureId } from '@/portainer/feature-flags/enums'; import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; +import { BEFeatureIndicator } from '@@/BEFeatureIndicator'; + import styles from './Option.module.css'; export interface SelectorItemType { diff --git a/jest.config.js b/jest.config.js index e581ffbea..f60575be1 100644 --- a/jest.config.js +++ b/jest.config.js @@ -84,12 +84,13 @@ module.exports = { moduleNameMapper: { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/app/__mocks__/fileMock.js', '\\.(css|less)$': '/app/__mocks__/styleMock.js', + '^@@/(.*)$': '/app/react/components/$1', + '^@/(.*)$': '/app/$1', '^Agent/(.*)?': '/app/agent/$1', '^Azure/(.*)$': '/app/azure/$1', '^Docker/(.*)$': '/app/docker/$1', '^Kubernetes/(.*)$': '/app/kubernetes/$1', '^Portainer/(.*)$': '/app/portainer/$1', - '^@/(.*)$': '/app/$1', }, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader diff --git a/tsconfig.json b/tsconfig.json index 339d07d91..476f76334 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,6 +29,7 @@ "lib": ["dom", "dom.iterable", "esnext"], "paths": { // paths relative to the baseUrl + "@@/*": ["react/components/*"], "@/*": ["./*", "../app/*"], "Agent/*": ["agent/*"], "Azure/*": ["azure/*"], diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 9104b315b..b4181031e 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -172,12 +172,13 @@ module.exports = { }, resolve: { alias: { + '@@': path.resolve(projectRoot, 'app/react/components'), + '@': path.resolve(projectRoot, 'app'), Agent: path.resolve(projectRoot, 'app/agent'), Azure: path.resolve(projectRoot, 'app/azure'), Docker: path.resolve(projectRoot, 'app/docker'), Kubernetes: path.resolve(projectRoot, 'app/kubernetes'), Portainer: path.resolve(projectRoot, 'app/portainer'), - '@': path.resolve(projectRoot, 'app'), 'lodash-es': 'lodash', }, extensions: ['.js', '.ts', '.tsx'],