From 09dff759462d296644d965a2ffe594fa1b0b72c7 Mon Sep 17 00:00:00 2001 From: Ryan Clark Date: Thu, 2 Jan 2025 15:14:36 +0100 Subject: [PATCH] Move import sorting over to prettier --- .prettierrc | 9 -- .prettierrc.js | 39 ++++++ package.json | 2 +- pnpm-lock.yaml | 111 +++++++++++++++++- tsconfig.json | 4 +- web/.storybook/preview.js | 20 ++-- web/@types/styled-components.d.ts | 1 + web/packages/build/.eslintrc.js | 20 ---- .../jest/jest-environment-patched-jsdom.js | 2 +- web/packages/build/package.json | 2 +- web/packages/build/vite/config.ts | 6 +- web/packages/build/vite/html.ts | 3 +- web/packages/design/src/Alert/Alert.story.js | 1 - web/packages/design/src/Alert/Alert.test.jsx | 2 +- web/packages/design/src/Alert/index.jsx | 3 +- web/packages/design/src/Box/Box.story.tsx | 1 - web/packages/design/src/Button/Button.jsx | 4 +- web/packages/design/src/Button/index.js | 5 +- .../design/src/ButtonIcon/ButtonIcon.jsx | 2 +- web/packages/design/src/ButtonIcon/index.js | 1 + web/packages/design/src/ButtonLink/index.js | 1 + .../ButtonWithMenu/ButtonWithMenu.test.tsx | 2 +- web/packages/design/src/Card/Card.story.tsx | 3 +- web/packages/design/src/Card/index.js | 1 + .../design/src/CardError/CardError.jsx | 4 +- web/packages/design/src/CardError/index.js | 6 +- web/packages/design/src/CardIcon/index.js | 1 + web/packages/design/src/CardSuccess/index.js | 1 + .../src/CardTerminal/CardTerminal.story.jsx | 3 +- web/packages/design/src/CardTerminal/index.js | 1 + .../design/src/Checkbox/Checkbox.story.tsx | 2 - web/packages/design/src/Checkbox/Checkbox.tsx | 5 +- web/packages/design/src/DataTable/Cells.tsx | 7 +- .../design/src/DataTable/DataTable.story.tsx | 5 +- .../src/DataTable/InputSearch/InputSearch.tsx | 6 +- .../Pager/ClientSidePager/ClientSidePager.tsx | 3 +- .../design/src/DataTable/Table.test.tsx | 6 +- web/packages/design/src/DataTable/Table.tsx | 8 +- web/packages/design/src/DataTable/index.ts | 6 +- web/packages/design/src/DataTable/useTable.ts | 2 +- web/packages/design/src/Dialog/Dialog.jsx | 2 +- .../design/src/Dialog/Dialog.story.jsx | 3 +- .../design/src/Dialog/Dialog.test.tsx | 2 +- .../design/src/Dialog/DialogHeader.jsx | 1 - web/packages/design/src/Dialog/index.js | 4 +- .../DialogConfirmation.story.tsx | 3 +- .../DialogConfirmation.test.tsx | 2 +- .../design/src/DialogConfirmation/index.ts | 4 +- .../design/src/DocumentTitle/index.js | 1 + web/packages/design/src/Flex/Flex.story.js | 2 +- web/packages/design/src/Flex/Flex.tsx | 8 +- web/packages/design/src/Flex/index.js | 1 + web/packages/design/src/Icon/Icon.tsx | 2 +- web/packages/design/src/Icon/IconCircle.tsx | 1 - web/packages/design/src/Icon/Icons.story.tsx | 4 +- web/packages/design/src/Image/Image.jsx | 10 +- web/packages/design/src/Image/Image.story.js | 1 - web/packages/design/src/Image/index.js | 1 + .../design/src/Indicator/Indicator.test.tsx | 2 +- web/packages/design/src/Indicator/index.js | 1 + web/packages/design/src/Input/Input.tsx | 10 +- web/packages/design/src/Input/index.js | 1 + web/packages/design/src/Label/Label.test.jsx | 2 +- web/packages/design/src/Label/index.js | 3 +- .../src/LabelInput/LabelInput.story.jsx | 2 +- .../design/src/LabelInput/LabelInput.tsx | 2 +- web/packages/design/src/LabelInput/index.js | 1 + .../design/src/LabelState/LabelState.test.jsx | 2 +- .../design/src/LabelState/LabelState.tsx | 10 +- web/packages/design/src/LabelState/index.js | 3 +- web/packages/design/src/Link/Link.jsx | 2 +- web/packages/design/src/Link/index.js | 1 + web/packages/design/src/Menu/Menu.jsx | 3 +- web/packages/design/src/Menu/Menu.story.js | 7 +- .../design/src/Menu/Menu.story.test.tsx | 2 +- web/packages/design/src/Menu/MenuItem.tsx | 6 +- web/packages/design/src/Menu/MenuList.jsx | 2 +- web/packages/design/src/Menu/index.js | 1 + web/packages/design/src/Modal/Modal.jsx | 2 +- web/packages/design/src/Modal/Modal.test.tsx | 4 +- web/packages/design/src/Modal/Portal.jsx | 2 +- web/packages/design/src/Modal/Portal.test.tsx | 2 +- web/packages/design/src/Modal/RootRef.jsx | 2 +- web/packages/design/src/Modal/index.js | 1 + .../design/src/MultiRowBox/MultiRowBox.tsx | 1 - .../design/src/Onboard/OnboardFooter.test.tsx | 2 +- .../design/src/Onboard/OnboardFooter.tsx | 1 - .../src/Onboard/WelcomeWrapper.story.tsx | 4 +- .../design/src/Onboard/WelcomeWrapper.tsx | 5 +- web/packages/design/src/Pill/Pill.test.tsx | 4 +- web/packages/design/src/Popover/Popover.jsx | 7 +- .../design/src/Popover/Popover.story.js | 3 +- .../design/src/Popover/Popover.story.test.tsx | 4 +- .../src/ResourceIcon/ResourceIcon.story.tsx | 2 +- web/packages/design/src/ResourceIcon/icons.ts | 8 +- .../design/src/ResourceIcon/index.tsx | 2 +- web/packages/design/src/SVGIcon/AWS.tsx | 3 +- web/packages/design/src/SVGIcon/Ansible.tsx | 3 +- web/packages/design/src/SVGIcon/Azure.tsx | 3 +- web/packages/design/src/SVGIcon/Bug.tsx | 3 +- .../design/src/SVGIcon/ChevronRight.tsx | 3 +- web/packages/design/src/SVGIcon/CircleCI.tsx | 3 +- .../design/src/SVGIcon/ExternalLink.tsx | 3 +- web/packages/design/src/SVGIcon/GCP.tsx | 3 +- web/packages/design/src/SVGIcon/GitHub.tsx | 3 +- web/packages/design/src/SVGIcon/GitLab.tsx | 3 +- web/packages/design/src/SVGIcon/Jenkins.tsx | 3 +- .../design/src/SVGIcon/Kubernetes.tsx | 3 +- web/packages/design/src/SVGIcon/Lock.tsx | 3 +- web/packages/design/src/SVGIcon/Okta.tsx | 3 +- web/packages/design/src/SVGIcon/SVGIcon.tsx | 1 - .../design/src/SVGIcon/ServerIcon.tsx | 3 +- web/packages/design/src/SVGIcon/Servers.tsx | 3 +- web/packages/design/src/SVGIcon/Spacelift.tsx | 3 +- .../design/src/SVGIcon/SvgIcon.story.tsx | 4 +- .../design/src/SVGIcon/TeleportGearIcon.tsx | 4 +- .../design/src/SideNav/SideNav.test.tsx | 3 +- .../design/src/SideNav/SideNavItem.jsx | 2 +- .../design/src/SideNav/Sidenav.story.js | 1 - web/packages/design/src/SideNav/index.js | 1 + .../design/src/SlidePanel/SlidePanel.test.tsx | 3 +- .../design/src/SlidePanel/SlidePanel.tsx | 3 +- .../design/src/SlideTabs/SlideTabs.test.tsx | 2 +- .../src/StepSlider/StepSlider.story.tsx | 3 +- .../design/src/StepSlider/StepSlider.test.tsx | 4 +- web/packages/design/src/Text/Text.tsx | 14 +-- web/packages/design/src/Text/index.js | 1 + web/packages/design/src/TextArea/TextArea.tsx | 8 +- .../design/src/ThemeProvider/globals.js | 1 + .../design/src/ThemeProvider/index.tsx | 10 +- .../design/src/Toggle/Toggle.story.tsx | 3 +- web/packages/design/src/TopNav/TopNavItem.jsx | 2 +- web/packages/design/src/TopNav/index.js | 1 + web/packages/design/src/buttons.story.tsx | 12 +- web/packages/design/src/index.ts | 22 ++-- web/packages/design/src/labels.story.jsx | 2 +- .../design/src/system/borderRadius.ts | 8 +- web/packages/design/src/system/index.ts | 17 ++- web/packages/design/src/system/typography.ts | 1 - web/packages/design/src/theme/index.ts | 2 +- .../design/src/theme/palette.story.js | 3 +- .../design/src/theme/themeColors.story.tsx | 2 +- .../design/src/theme/themes/bblpTheme.ts | 1 - .../design/src/theme/themes/darkTheme.ts | 1 - .../design/src/theme/themes/lightTheme.ts | 3 +- .../design/src/theme/themes/sharedStyles.ts | 7 +- .../design/src/theme/typography.story.js | 2 +- .../design/src/utils/match/matchers.test.ts | 2 +- web/packages/design/src/utils/renderHook.tsx | 2 +- web/packages/design/src/utils/testing.tsx | 13 +- .../AccessDuration/AccessDurationRequest.tsx | 2 +- .../AccessDuration/AccessDurationReview.tsx | 3 +- .../AccessDuration/durationOptions.test.ts | 4 +- .../AccessDuration/durationOptions.ts | 5 +- .../getDurationOptionsFromStartTime.test.ts | 1 - .../AssumeStartTime/AssumeStartTime.story.tsx | 6 +- .../AssumeStartTime/AssumeStartTime.test.tsx | 6 +- .../AssumeStartTime/AssumeStartTime.tsx | 18 +-- .../AssumeStartTime/timeOptions.tsx | 3 +- .../NewRequest/CheckableOption.tsx | 2 +- .../RequestCheckout/AdditionalOptions.tsx | 5 +- .../NewRequest/RequestCheckout/CrossIcon.tsx | 1 - .../RequestCheckout/KubeNamespaceSelector.tsx | 11 +- .../RequestCheckout.story.test.tsx | 3 +- .../RequestCheckout/RequestCheckout.story.tsx | 4 +- .../RequestCheckout/RequestCheckout.test.tsx | 4 +- .../RequestCheckout/RequestCheckout.tsx | 38 +++--- .../RequestCheckout/SelectReviewers.tsx | 5 +- .../NewRequest/RequestCheckout/utils.ts | 2 +- .../NewRequest/ResourceList/Apps.tsx | 13 +- .../NewRequest/ResourceList/Databases.tsx | 4 +- .../NewRequest/ResourceList/Desktops.tsx | 4 +- .../NewRequest/ResourceList/Kubes.tsx | 4 +- .../NewRequest/ResourceList/Nodes.tsx | 4 +- .../ResourceList/ResourceList.story.test.tsx | 1 + .../ResourceList/ResourceList.story.tsx | 5 +- .../NewRequest/ResourceList/ResourceList.tsx | 18 +-- .../NewRequest/ResourceList/Roles.tsx | 2 +- .../NewRequest/ResourceList/UserGroups.tsx | 4 +- .../NewRequest/useSpecifiableFields.ts | 2 +- .../RequestList/RequestList.tsx | 3 +- .../RequestDelete.story.test.tsx | 2 +- .../RequestDelete/RequestDelete.story.tsx | 2 +- .../RequestDelete/RequestDelete.tsx | 13 +- .../RequestReview.story.test.tsx | 2 +- .../RequestReview/RequestReview.story.tsx | 5 +- .../RequestReview/RequestReview.tsx | 18 ++- .../RequestView/RequestView.story.test.tsx | 4 +- .../RequestView/RequestView.story.tsx | 11 +- .../RequestView/RequestView.test.tsx | 2 - .../RequestView/RequestView.tsx | 35 +++--- .../RequestView/RolesRequested.tsx | 1 + .../ReviewRequests/RequestView/types.ts | 4 +- .../AccessRequests/Shared/Shared.tsx | 7 +- .../AdvancedSearchToggle.tsx | 3 +- .../AnimatedTerminal/AnimatedTerminal.tsx | 1 - .../AuthorizeDeviceWeb.story.tsx | 4 +- .../AuthorizeDeviceWeb/AuthorizeDeviceWeb.tsx | 16 +-- .../AwsLaunchButton/AwsLaunchButton.tsx | 8 +- .../shared/components/BpfViewer/BpfViewer.jsx | 5 +- .../components/BpfViewer/fixtures/npm.js | 1 + .../components/BpfViewer/fixtures/vim.js | 1 + .../components/BpfViewer/flatFormatter.js | 2 +- .../shared/components/BpfViewer/index.js | 1 + .../components/BpfViewer/treeFormatter.js | 2 +- .../components/ButtonSso/ButtonSso.test.tsx | 2 +- .../shared/components/ButtonSso/ButtonSso.tsx | 4 +- .../shared/components/ButtonSso/index.ts | 1 + .../ButtonTextWithAddIcon.test.tsx | 2 +- .../ButtonTextWithAddIcon.tsx | 1 + .../ClusterDropdown/ClusterDropdown.story.tsx | 7 +- .../ClusterDropdown/ClusterDropdown.tsx | 9 +- .../DownloadConnect/DownloadConnect.story.tsx | 1 + .../DownloadConnect/DownloadConnect.tsx | 1 - .../shared/components/Editor/Editor.tsx | 13 +- .../components/EmptyState/EmptyState.tsx | 3 +- .../FieldInput/FieldInput.story.tsx | 1 - .../components/FieldInput/FieldInput.test.tsx | 6 +- .../components/FieldInput/FieldInput.tsx | 2 +- .../shared/components/FieldInput/index.ts | 1 + .../FieldMultiInput/FieldMultiInput.tsx | 5 +- .../FieldSelect/FieldSelect.story.tsx | 6 +- .../FieldSelect/FieldSelect.test.tsx | 6 +- .../components/FieldSelect/FieldSelect.tsx | 8 +- .../FieldSelectCreatable.story.tsx | 6 +- .../FieldSelect/FieldSelectCreatable.tsx | 6 +- .../shared/components/FieldSelect/index.ts | 1 + .../FieldTextArea/FieldTextArea.story.tsx | 1 - .../FieldTextArea/FieldTextArea.tsx | 2 +- .../FileTransfer/FileTransfer.test.tsx | 3 +- .../components/FileTransfer/FileTransfer.tsx | 2 +- .../FileTransfer/FileTransferActionBar.tsx | 4 +- .../FileTransferContextProvider.tsx | 6 +- .../FileTransfer/FileTransferRequests.tsx | 6 +- .../FileTransferStateless/CommonElements.tsx | 2 +- .../DownloadForm/DownloadForm.test.tsx | 1 + .../DownloadForm/DownloadForm.tsx | 1 + .../FileList/FileList.test.tsx | 2 +- .../FileList/FileList.tsx | 1 - .../FileList/FileListItem.tsx | 1 + .../FileTransferStateless.story.tsx | 1 - .../FileTransferStateless.tsx | 5 +- .../UploadForm/UploadForm.test.tsx | 1 + .../UploadForm/UploadForm.tsx | 3 +- .../FormPassword/FormPassword.test.tsx | 2 +- .../components/FormPassword/FormPassword.tsx | 13 +- .../shared/components/FormPassword/index.ts | 1 + .../components/Highlight/Highlight.story.tsx | 1 + .../shared/components/Highlight/Highlight.tsx | 2 +- .../LatencyDiagnostic.test.tsx | 2 +- .../LatencyDiagnostic/LatencyDiagnostic.tsx | 7 +- .../MenuAction/MenuAction.story.tsx | 3 +- .../components/MenuAction/MenuAction.test.tsx | 4 +- .../MenuAction/MenuActionButton.tsx | 5 +- .../components/MenuAction/MenuActionIcon.tsx | 5 +- .../shared/components/MenuAction/index.ts | 2 +- .../components/MenuLogin/MenuLogin.story.tsx | 3 +- .../components/MenuLogin/MenuLogin.test.tsx | 3 +- .../shared/components/MenuLogin/MenuLogin.tsx | 11 +- .../MissingPermissionsTooltip.tsx | 2 +- .../Notification/Notification.story.tsx | 3 +- .../components/Notification/Notification.tsx | 1 + .../components/Search/SearchPagination.tsx | 3 +- .../shared/components/Search/SearchPanel.tsx | 5 +- .../shared/components/Select/Select.story.tsx | 1 + .../shared/components/Select/Select.tsx | 7 +- .../Select/SelectCreatable.story.tsx | 5 +- .../shared/components/Select/types.ts | 1 - .../shared/components/SplitPane/SplitPane.jsx | 2 +- .../components/SplitPane/SplitPane.story.js | 3 +- .../shared/components/SplitPane/index.js | 3 +- .../TerminalSearch/TerminalSearch.test.tsx | 3 +- .../TerminalSearch/TerminalSearch.tsx | 7 +- .../TextEditor/StyledTextEditor.jsx | 1 + .../components/TextEditor/TextEditor.jsx | 4 +- .../components/TextEditor/TextEditor.test.tsx | 4 +- .../shared/components/TextEditor/index.js | 1 + .../TextSelectCopy/TextSelectCopy.tsx | 3 +- .../TextSelectCopy/TextSelectCopyMulti.tsx | 5 +- .../components/ToolTip/HoverTooltip.tsx | 5 +- .../components/ToolTip/ToolTip.story.tsx | 3 +- .../UnifiedResources/CardsView/CardsView.tsx | 8 +- .../CardsView/LoadingCard.tsx | 3 +- .../CardsView/ResourceCard.story.tsx | 13 +- .../CardsView/ResourceCard.tsx | 10 +- .../UnifiedResources/FilterPanel.tsx | 19 ++- .../UnifiedResources/ListView/ListView.tsx | 6 +- .../ListView/ResourceListItem.story.tsx | 10 +- .../ListView/ResourceListItem.tsx | 7 +- .../UnifiedResources/ResourceTab.tsx | 2 +- .../UnifiedResources.story.tsx | 23 ++-- .../UnifiedResources/UnifiedResources.tsx | 46 ++++---- .../UnifiedResources/shared/CopyButton.tsx | 3 +- .../shared/LoadingSkeleton.tsx | 2 +- .../UnifiedResources/shared/PinButton.tsx | 4 +- .../UnifiedResources/shared/guessAppIcon.ts | 2 +- .../shared/viewItemsFactory.ts | 14 +-- .../components/UnifiedResources/types.ts | 9 +- .../components/Validation/Validation.test.tsx | 5 +- .../shared/components/Validation/index.ts | 2 +- .../components/Validation/rules.test.ts | 8 +- .../shared/components/Validation/useRule.js | 1 - .../components/Validation/useRule.test.js | 2 +- .../shared/components/Window/Window.tsx | 2 +- web/packages/shared/hooks/index.ts | 10 +- web/packages/shared/hooks/useAsync.test.ts | 6 +- web/packages/shared/hooks/useAsync.ts | 2 +- web/packages/shared/hooks/useAttempt.ts | 1 + web/packages/shared/hooks/useAttemptNext.ts | 1 + web/packages/shared/hooks/useDraggable.js | 2 +- .../useInfiniteScroll.test.tsx | 4 +- .../useInfiniteScroll/useInfiniteScroll.ts | 2 +- .../useKeyBasedPagination.test.ts | 7 +- .../useKeyBasedPagination.ts | 12 +- .../useRefClickOutside.test.tsx | 2 +- .../useRefClickOutside/useRefClickOutside.ts | 2 +- web/packages/shared/libs/mergeRefs.test.tsx | 2 +- .../shared/libs/stores/useStore.test.tsx | 2 +- web/packages/shared/services/loc/index.ts | 3 +- web/packages/shared/services/loc/loc.test.ts | 2 +- web/packages/shared/services/loc/loc.ts | 2 +- web/packages/shared/utils/base64/index.ts | 1 + web/packages/shared/utils/text.test.ts | 2 +- web/packages/shared/utils/wait.ts | 2 +- .../AccessRequests.story.test.tsx | 3 +- .../AccessRequests/AccessRequests.story.tsx | 2 +- .../LockedAccessRequests.tsx | 4 +- .../teleport/src/AccessRequests/service.ts | 4 +- .../teleport/src/AccessRequests/types.ts | 1 - .../teleport/src/Account/Account.story.tsx | 3 +- .../teleport/src/Account/Account.test.tsx | 9 +- web/packages/teleport/src/Account/Account.tsx | 15 +-- .../teleport/src/Account/AccountNew.ts | 1 + .../ChangePasswordWizard.story.tsx | 5 +- .../ChangePasswordWizard.test.tsx | 9 +- .../ChangePasswordWizard.tsx | 8 +- web/packages/teleport/src/Account/Header.tsx | 5 +- .../AuthDeviceList/AuthDeviceList.story.tsx | 1 - .../AuthDeviceList/AuthDeviceList.test.tsx | 3 +- .../AuthDeviceList/AuthDeviceList.tsx | 10 +- .../Account/ManageDevices/useManageDevices.ts | 5 +- .../wizards/AddAuthDeviceWizard.story.tsx | 16 +-- .../wizards/AddAuthDeviceWizard.test.tsx | 14 +-- .../wizards/AddAuthDeviceWizard.tsx | 16 +-- .../wizards/DeleteAuthDeviceWizard.story.tsx | 6 +- .../wizards/DeleteAuthDeviceWizard.test.tsx | 16 ++- .../wizards/DeleteAuthDeviceWizard.tsx | 13 +- .../wizards/ReauthenticateStep.test.tsx | 2 +- .../wizards/ReauthenticateStep.tsx | 11 +- .../teleport/src/Account/PasswordBox.tsx | 10 +- .../src/AppLauncher/AppLauncher.test.tsx | 7 +- .../teleport/src/AppLauncher/AppLauncher.tsx | 3 - .../teleport/src/Apps/AddApp/AddApp.tsx | 8 +- .../src/Apps/AddApp/Automatically.test.tsx | 4 +- .../src/Apps/AddApp/Automatically.tsx | 13 +- .../src/Apps/AddApp/Manually.test.tsx | 1 + .../teleport/src/Apps/AddApp/Manually.tsx | 9 +- .../teleport/src/Apps/AddApp/useAddApp.ts | 4 +- .../teleport/src/Audit/Audit.story.test.tsx | 3 +- .../teleport/src/Audit/Audit.story.tsx | 4 +- web/packages/teleport/src/Audit/Audit.tsx | 8 +- .../src/Audit/EventDialog/EventDialog.tsx | 10 +- .../teleport/src/Audit/EventDialog/index.ts | 1 + .../src/Audit/EventList/EventList.tsx | 4 +- .../src/Audit/EventList/EventListCells.tsx | 3 +- .../src/Audit/EventList/EventTypeCell.tsx | 3 +- .../teleport/src/Audit/EventList/index.ts | 1 + .../teleport/src/Audit/useAuditEvents.ts | 7 +- .../src/AuthConnectors/AuthConnectors.tsx | 12 +- .../ConnectorList/ConnectorList.tsx | 4 +- .../src/AuthConnectors/ConnectorList/index.ts | 1 + .../DeleteConnectorDialog.tsx | 5 +- .../DeleteConnectorDialog/index.ts | 1 + .../AuthConnectors/EmptyList/EmptyList.tsx | 5 +- .../src/AuthConnectors/EmptyList/index.ts | 1 + .../AuthConnectors/ssoIcons/getSsoIcon.tsx | 3 +- .../styles/AuthConnectors.styles.ts | 1 + .../styles/ConnectorBox.styles.ts | 3 +- .../src/AuthConnectors/useAuthConnectors.tsx | 1 + .../teleport/src/Bots/Add/AddBots.tsx | 8 +- .../src/Bots/Add/AddBotsPicker.story.tsx | 1 - .../teleport/src/Bots/Add/AddBotsPicker.tsx | 11 +- .../GitHubActions/AddBotToWorkflow.story.tsx | 2 - .../GitHubActions/AddBotToWorkflow.test.tsx | 7 +- .../Add/GitHubActions/AddBotToWorkflow.tsx | 4 +- .../Add/GitHubActions/ConfigureBot.story.tsx | 2 - .../Add/GitHubActions/ConfigureBot.test.tsx | 8 +- .../Bots/Add/GitHubActions/ConfigureBot.tsx | 16 +-- .../Add/GitHubActions/ConnectGitHub.story.tsx | 2 - .../Add/GitHubActions/ConnectGitHub.test.tsx | 5 +- .../Bots/Add/GitHubActions/ConnectGitHub.tsx | 26 ++-- .../Bots/Add/GitHubActions/Finish.test.tsx | 5 +- .../src/Bots/Add/GitHubActions/Finish.tsx | 5 +- .../Add/GitHubActions/GitHubActions.test.tsx | 6 +- .../Bots/Add/GitHubActions/GitHubActions.tsx | 6 +- .../Bots/Add/GitHubActions/useGitHubFlow.tsx | 7 +- .../src/Bots/Add/Shared/FlowButtons.test.tsx | 5 +- web/packages/teleport/src/Bots/DeleteBot.tsx | 1 + .../teleport/src/Bots/EditBot.test.tsx | 4 +- web/packages/teleport/src/Bots/EditBot.tsx | 6 +- .../teleport/src/Bots/List/ActionCell.tsx | 1 + .../teleport/src/Bots/List/BotList.test.tsx | 2 +- .../teleport/src/Bots/List/BotList.tsx | 7 +- .../teleport/src/Bots/List/Bots.test.tsx | 5 +- web/packages/teleport/src/Bots/List/Bots.tsx | 10 +- .../src/Bots/List/EmptyState/EmptyState.tsx | 19 ++- .../teleport/src/Bots/ViewBot.story.tsx | 5 +- web/packages/teleport/src/Bots/ViewBot.tsx | 3 +- web/packages/teleport/src/Bots/types.ts | 1 + .../src/Clusters/ClusterList/ClusterList.tsx | 6 +- .../src/Clusters/ClusterList/index.ts | 1 + .../src/Clusters/Clusters.story.test.tsx | 2 +- .../teleport/src/Clusters/Clusters.story.tsx | 6 +- .../teleport/src/Clusters/Clusters.tsx | 9 +- .../ManageCluster/ManageCluster.story.tsx | 5 +- .../ManageCluster/ManageCluster.test.tsx | 11 +- .../Clusters/ManageCluster/ManageCluster.tsx | 18 ++- web/packages/teleport/src/Clusters/utils.ts | 1 - .../src/Console/ActionBar/ActionBar.tsx | 3 +- .../teleport/src/Console/ActionBar/index.ts | 1 + .../teleport/src/Console/Console.story.tsx | 7 +- web/packages/teleport/src/Console/Console.tsx | 16 +-- .../src/Console/Document/Document.tsx | 1 + .../teleport/src/Console/Document/index.ts | 1 + .../DocumentBlank.story.test.tsx | 2 + .../DocumentBlank/DocumentBlank.story.tsx | 2 +- .../Console/DocumentBlank/DocumentBlank.tsx | 3 +- .../src/Console/DocumentBlank/index.ts | 1 + .../DocumentKubeExec.story.tsx | 10 +- .../DocumentKubeExec.test.tsx | 14 +-- .../DocumentKubeExec/DocumentKubeExec.tsx | 13 +- .../DocumentKubeExec/KubeExecDataDialog.tsx | 18 +-- .../src/Console/DocumentKubeExec/index.ts | 1 + .../DocumentKubeExec/useKubeExecSession.tsx | 8 +- .../ClusterSelector/ClusterSelector.tsx | 1 + .../DocumentNodes/ClusterSelector/index.ts | 1 + .../DocumentNodes.story.test.tsx | 6 +- .../DocumentNodes/DocumentNodes.story.tsx | 4 +- .../Console/DocumentNodes/DocumentNodes.tsx | 7 +- .../src/Console/DocumentNodes/consoleTheme.ts | 8 +- .../src/Console/DocumentNodes/index.ts | 1 + .../src/Console/DocumentNodes/useNodes.ts | 7 +- .../Console/DocumentSsh/DocumentSsh.story.tsx | 11 +- .../Console/DocumentSsh/DocumentSsh.test.tsx | 7 +- .../src/Console/DocumentSsh/DocumentSsh.tsx | 18 ++- .../DocumentSsh/ShareSession/ShareSession.tsx | 7 +- .../Console/DocumentSsh/Terminal/Terminal.tsx | 8 +- .../DocumentSsh/httpFileTransferHandlers.ts | 2 +- .../teleport/src/Console/DocumentSsh/index.ts | 1 + .../Console/DocumentSsh/useFileTransfer.ts | 8 +- .../src/Console/DocumentSsh/useGetScpUrl.ts | 1 + .../src/Console/DocumentSsh/useSshSession.ts | 8 +- .../src/Console/StyledXterm/StyledXterm.tsx | 1 + .../teleport/src/Console/StyledXterm/index.ts | 1 + .../Console/Tabs/JoinedUsers/JoinedUsers.jsx | 3 +- .../src/Console/Tabs/JoinedUsers/index.js | 1 + .../teleport/src/Console/Tabs/TabItem.tsx | 3 +- .../src/Console/Tabs/Tabs.story.test.tsx | 2 + .../teleport/src/Console/Tabs/Tabs.story.tsx | 2 +- .../teleport/src/Console/Tabs/Tabs.tsx | 10 +- .../teleport/src/Console/consoleContext.tsx | 26 ++-- .../src/Console/consoleContextProvider.tsx | 1 + .../teleport/src/Console/stores/index.ts | 1 + .../src/Console/useTabRouting.test.tsx | 5 +- .../teleport/src/Console/useTabRouting.ts | 2 +- .../ConnectDialog/ConnectDialog.test.tsx | 1 + .../Databases/ConnectDialog/ConnectDialog.tsx | 9 +- .../src/Databases/ConnectDialog/index.ts | 1 + .../src/DesktopSession/ActionMenu.tsx | 5 +- .../DesktopSession.story.test.tsx | 8 +- .../DesktopSession/DesktopSession.story.tsx | 3 +- .../src/DesktopSession/DesktopSession.tsx | 19 +-- .../src/DesktopSession/KeyboardHandler.tsx | 4 +- .../teleport/src/DesktopSession/TopBar.tsx | 7 +- .../src/DesktopSession/WarningDropdown.tsx | 12 +- .../src/DesktopSession/useDesktopSession.tsx | 7 +- .../src/DesktopSession/useTdpClientCanvas.tsx | 22 ++-- .../src/DeviceTrust/DeviceTrustLocked.tsx | 20 ++-- .../CreateAppAccess/AppCreatedDialog.tsx | 5 +- .../CreateAppAccess/CreateAppAccess.story.tsx | 11 +- .../CreateAppAccess/CreateAppAccess.test.tsx | 20 ++-- .../CreateAppAccess/CreateAppAccess.tsx | 10 +- .../SetupAccess/SetupAccess.story.tsx | 12 +- .../SetupAccess/SetupAccess.tsx | 14 +-- .../TestConnection/TestConnection.story.tsx | 5 +- .../TestConnection/TestConnection.tsx | 15 ++- .../Discover/AwsMangementConsole/index.tsx | 3 +- .../SetupConnect/SetupConnect.story.tsx | 6 +- .../SetupConnect/SetupConnect.test.ts | 5 +- .../SetupConnect/SetupConnect.tsx | 18 ++- .../TestConnection/TestConnection.story.tsx | 10 +- .../TestConnection/TestConnection.tsx | 36 +++--- .../src/Discover/ConnectMyComputer/index.ts | 1 - .../CreateDatabase/CreateDatabase.story.tsx | 2 - .../CreateDatabase/CreateDatabase.tsx | 25 ++-- .../CreateDatabaseDialog.story.tsx | 3 +- .../CreateDatabase/CreateDatabaseDialog.tsx | 12 +- .../CreateDatabase/useCreateDatabase.test.tsx | 22 ++-- .../CreateDatabase/useCreateDatabase.ts | 25 ++-- .../src/Discover/Database/DatabaseWrapper.tsx | 3 +- .../AutoDeploy/AutoDeploy.story.tsx | 9 +- .../AutoDeploy/AutoDeploy.test.tsx | 34 +++--- .../DeployService/AutoDeploy/AutoDeploy.tsx | 34 +++--- .../AutoDeploy/SelectSecurityGroups.tsx | 12 +- .../AutoDeploy/SelectSubnetIds.tsx | 16 +-- .../Database/DeployService/DeployService.tsx | 3 +- .../ManualDeploy/ManualDeploy.story.tsx | 12 +- .../ManualDeploy/ManualDeploy.tsx | 30 +++-- .../DeployService/ManualDeploy/index.ts | 1 + .../EnrollRdsDatabase/AutoDiscoverToggle.tsx | 2 +- .../EnrollRdsDatabase/AutoEnrollment.tsx | 24 ++-- .../EnrollRdsDatabase.story.tsx | 17 +-- .../EnrollRdsDatabase.test.tsx | 13 +- .../EnrollRdsDatabase/EnrollRdsDatabase.tsx | 14 +-- .../EnrollRdsDatabase/RdsDatabaseList.tsx | 7 +- .../EnrollRdsDatabase/SingleEnrollment.tsx | 13 +- .../EnrollRdsDatabase/VpcSelector.tsx | 5 +- .../Database/IamPolicy/IamPolicy.story.tsx | 1 - .../Discover/Database/IamPolicy/IamPolicy.tsx | 13 +- .../Database/IamPolicy/useIamPolicy.ts | 4 +- .../Database/MutualTls/MutualTls.story.tsx | 2 - .../Discover/Database/MutualTls/MutualTls.tsx | 17 ++- .../Database/MutualTls/useMutualTls.ts | 9 +- .../SetupAccess/SetupAccess.story.tsx | 11 +- .../Database/SetupAccess/SetupAccess.tsx | 18 +-- .../Discover/Database/SetupAccess/index.ts | 1 + .../TestConnection/TestConnection.story.tsx | 5 +- .../TestConnection/TestConnection.test.tsx | 5 +- .../TestConnection/TestConnection.tsx | 19 ++- .../teleport/src/Discover/Database/common.tsx | 5 +- .../teleport/src/Discover/Database/index.tsx | 21 ++-- .../teleport/src/Discover/Discover.test.tsx | 33 +++--- .../teleport/src/Discover/Discover.tsx | 12 +- .../src/Discover/Fixtures/databases.tsx | 5 +- .../src/Discover/Fixtures/fixtures.tsx | 14 +-- .../src/Discover/Fixtures/kubernetes.tsx | 4 +- .../EnrollEKSCluster/AgentWaitingDialog.tsx | 12 +- .../EnrollEKSCluster/Dialogs.story.tsx | 22 ++-- .../EnrollEKSCluster/EksClustersList.tsx | 10 +- .../EnrollEKSCluster.test.tsx | 19 +-- .../EnrollEksCluster.story.tsx | 24 ++-- .../EnrollEKSCluster/EnrollEksCluster.tsx | 56 ++++----- .../EnrollEKSCluster/EnrollmentDialog.tsx | 8 +- .../EnrollEKSCluster/ManualHelmDialog.tsx | 19 ++- .../Kubernetes/HelmChart/HelmChart.story.tsx | 4 +- .../Kubernetes/HelmChart/HelmChart.tsx | 30 +++-- .../src/Discover/Kubernetes/KubeWrapper.tsx | 1 - .../SetupAccess/SetupAccess.story.tsx | 7 +- .../Kubernetes/SetupAccess/SetupAccess.tsx | 10 +- .../Discover/Kubernetes/SetupAccess/index.ts | 1 + .../TestConnection/TestConnection.story.tsx | 1 - .../TestConnection/TestConnection.tsx | 20 ++-- .../Kubernetes/TestConnection/index.ts | 1 + .../TestConnection/useTestConnection.ts | 7 +- .../src/Discover/Kubernetes/index.tsx | 8 +- .../PermissionsErrorMessage.tsx | 4 +- .../SelectResource.story.test.tsx | 7 +- .../SelectResource/SelectResource.story.tsx | 10 +- .../SelectResource/SelectResource.test.tsx | 5 +- .../SelectResource/SelectResource.tsx | 38 +++--- .../src/Discover/SelectResource/databases.tsx | 6 +- .../src/Discover/SelectResource/resources.tsx | 2 - .../Discover/SelectResource/resourcesE.tsx | 3 +- .../src/Discover/SelectResource/types.ts | 11 +- .../CreateEc2Ice/CreateEc2Ice.story.tsx | 9 +- .../Server/CreateEc2Ice/CreateEc2Ice.tsx | 26 ++-- .../CreateEc2Ice/CreateEc2IceDialog.tsx | 24 ++-- .../DiscoveryConfigCreatedDialog.tsx | 5 +- .../DiscoveryConfigSsm.story.tsx | 13 +- .../DiscoveryConfigSsm/DiscoveryConfigSsm.tsx | 28 ++--- .../DownloadScript/DownloadScript.story.tsx | 7 +- .../Server/DownloadScript/DownloadScript.tsx | 27 ++--- .../EnrollEc2Instance/Ec2InstanceList.tsx | 5 +- .../EnrollEc2Instance.story.tsx | 8 +- .../EnrollEc2Instance.test.tsx | 26 ++-- .../EnrollEc2Instance/EnrollEc2Instance.tsx | 43 ++++--- .../NoEc2IceRequiredDialog.tsx | 5 +- .../src/Discover/Server/ServerWrapper.tsx | 1 - .../Server/SetupAccess/SetupAccess.story.tsx | 7 +- .../Server/SetupAccess/SetupAccess.tsx | 10 +- .../src/Discover/Server/SetupAccess/index.ts | 1 + .../teleport/src/Discover/Server/Shared.tsx | 3 +- .../TestConnection/TestConnection.story.tsx | 6 +- .../Server/TestConnection/TestConnection.tsx | 24 ++-- .../teleport/src/Discover/Server/index.tsx | 10 +- .../src/Discover/Shared/ActionButtons.tsx | 1 + .../Discover/Shared/Aws/ConfigureIamPerms.tsx | 9 +- .../Discover/Shared/Aws/DisableableCell.tsx | 1 + .../src/Discover/Shared/Aws/StatusCell.tsx | 5 +- .../Shared/AwsAccount/AwsAccount.story.tsx | 9 +- .../Shared/AwsAccount/AwsAccount.test.tsx | 25 ++-- .../Discover/Shared/AwsAccount/AwsAccount.tsx | 34 +++--- .../AwsRegionSelector.story.tsx | 1 + .../AwsRegionSelector/AwsRegionSelector.tsx | 5 +- .../ConfigureDiscoveryService.story.tsx | 11 +- .../ConfigureDiscoveryService.tsx | 13 +- .../ConfigureDiscoveryServiceDirections.tsx | 7 +- .../CreatedDiscoveryConfigDialog.tsx | 8 +- .../ConnectionDiagnosticResult.story.tsx | 8 +- .../ConnectionDiagnosticResult.tsx | 8 +- .../useConnectionDiagnostic.ts | 22 ++-- .../Shared/CustomInputFieldForAsterisks.tsx | 3 +- .../Shared/Finished/Finished.story.tsx | 3 +- .../src/Discover/Shared/Finished/Finished.tsx | 6 +- .../teleport/src/Discover/Shared/Header.tsx | 2 +- .../teleport/src/Discover/Shared/HintBox.tsx | 1 - .../teleport/src/Discover/Shared/InfoIcon.tsx | 1 + .../LabelsCreater/LabelsCreater.story.tsx | 2 +- .../Shared/LabelsCreater/LabelsCreater.tsx | 5 +- .../Discover/Shared/PingTeleportContext.tsx | 2 +- .../SecurityGroupPicker.tsx | 9 +- .../SelectCreatable/SelectCreatable.tsx | 3 +- .../Shared/SetupAccess/AccessInfo.tsx | 13 +- .../SetupAccess/SetupAccessWrapper.story.tsx | 4 +- .../Shared/SetupAccess/SetupAccessWrapper.tsx | 11 +- .../Shared/SetupAccess/useUserTraits.test.tsx | 31 +++-- .../Shared/SetupAccess/useUserTraits.ts | 22 ++-- .../src/Discover/Shared/StatusLight.tsx | 3 +- .../teleport/src/Discover/Shared/StepBox.tsx | 1 + .../teleport/src/Discover/Shared/StyledBox.ts | 1 + .../Shared/SubnetIdPicker/SubnetIdPicker.tsx | 5 +- .../teleport/src/Discover/Shared/Text.tsx | 4 +- .../Discover/Shared/useJoinTokenSuspender.ts | 6 +- web/packages/teleport/src/Discover/flow.tsx | 2 +- .../src/Discover/resourceViewConfigs.ts | 4 +- web/packages/teleport/src/Discover/types.ts | 2 +- .../src/Discover/useDiscover.test.tsx | 12 +- .../teleport/src/Discover/useDiscover.tsx | 48 ++++---- .../src/Discover/yamlTemplates/index.ts | 16 +-- .../teleport/src/HeadlessRequest/Cards.tsx | 3 +- .../HeadlessRequest/HeadlessRequest.test.tsx | 7 +- .../src/HeadlessRequest/HeadlessRequest.tsx | 6 +- .../EditAwsOidcIntegrationDialog.test.tsx | 7 +- .../EditAwsOidcIntegrationDialog.tsx | 24 ++-- .../Enroll/AwsOidc/AwsOidc.test.tsx | 8 +- .../Integrations/Enroll/AwsOidc/AwsOidc.tsx | 30 ++--- .../AwsOidc/ConfigureAwsOidcSummary.tsx | 3 +- .../Enroll/AwsOidc/FinishDialog.tsx | 11 +- .../Enroll/AwsOidc/S3BucketConfiguration.tsx | 3 +- .../Enroll/IntegrationEnroll.story.tsx | 4 +- .../Integrations/Enroll/IntegrationEnroll.tsx | 7 +- .../Integrations/Enroll/IntegrationRoute.tsx | 2 +- .../Enroll/IntegrationTiles.test.tsx | 1 + .../Integrations/Enroll/IntegrationTiles.tsx | 8 +- .../src/Integrations/Enroll/common.tsx | 3 +- .../src/Integrations/IntegrationList.tsx | 10 +- .../src/Integrations/Integrations.story.tsx | 4 +- .../src/Integrations/Integrations.tsx | 16 +-- .../IntegrationsAddButton.test.tsx | 1 + .../Integrations/IntegrationsAddButton.tsx | 3 +- .../Operations/IntegrationOperations.tsx | 5 +- .../Operations/useIntegrationOperation.ts | 4 +- .../Integrations/RemoveIntegrationDialog.tsx | 7 +- .../teleport/src/Integrations/fixtures.ts | 9 +- .../src/JoinTokens/JoinTokenForms.tsx | 5 +- .../src/JoinTokens/JoinTokens.story.tsx | 6 +- .../src/JoinTokens/JoinTokens.test.tsx | 7 +- .../teleport/src/JoinTokens/JoinTokens.tsx | 26 ++-- .../src/JoinTokens/UpsertJoinTokenDialog.tsx | 16 +-- .../ConnectDialog.story.test.tsx | 3 +- .../src/Kubes/ConnectDialog/ConnectDialog.tsx | 9 +- .../teleport/src/Kubes/ConnectDialog/index.ts | 1 + .../src/LocksV2/Locks/DeleteLockDialogue.tsx | 9 +- .../teleport/src/LocksV2/Locks/Locks.test.tsx | 9 +- .../teleport/src/LocksV2/Locks/Locks.tsx | 14 +-- .../NewLock/LockCheckout/LockCheckout.tsx | 20 ++-- .../teleport/src/LocksV2/NewLock/NewLock.tsx | 33 +++--- .../ResourceList/HybridList/HybridList.tsx | 5 +- .../LocksV2/NewLock/ResourceList/Logins.tsx | 5 +- .../ServerSideSupportedList/Desktops.tsx | 3 +- .../ServerSideSupportedList/Nodes.tsx | 3 +- .../ServerSideSupportedList/Roles.tsx | 1 + .../ServerSideSupportedList.tsx | 35 +++--- .../ResourceList/SimpleList/MfaDevices.tsx | 1 + .../ResourceList/SimpleList/SimpleList.tsx | 11 +- .../NewLock/ResourceList/SimpleList/Users.tsx | 1 + .../LocksV2/NewLock/ResourceList/common.tsx | 3 +- web/packages/teleport/src/LocksV2/common.tsx | 1 + .../teleport/src/Login/Login.story.tsx | 6 +- .../teleport/src/Login/Login.test.tsx | 7 +- web/packages/teleport/src/Login/Login.tsx | 4 +- .../teleport/src/Login/LoginClose.tsx | 1 + .../teleport/src/Login/LoginFailed.test.tsx | 3 +- .../teleport/src/Login/LoginFailed.tsx | 3 +- .../teleport/src/Login/LoginSuccess.test.tsx | 1 + .../teleport/src/Login/LoginSuccess.tsx | 1 + .../src/Login/LoginTerminalRedirect.test.tsx | 1 + .../src/Login/LoginTerminalRedirect.tsx | 1 + web/packages/teleport/src/Login/Motd/Motd.tsx | 2 +- web/packages/teleport/src/Login/useLogin.ts | 9 +- .../teleport/src/Main/LayoutContext.tsx | 2 +- web/packages/teleport/src/Main/Main.story.tsx | 19 ++- web/packages/teleport/src/Main/Main.test.tsx | 15 +-- web/packages/teleport/src/Main/Main.tsx | 29 ++--- .../Main/OnboardDiscover/OnboardDiscover.tsx | 3 +- .../teleport/src/Navigation/Navigation.tsx | 11 +- .../NavigationCategoryContainer.tsx | 4 +- .../src/Navigation/NavigationDropdown.tsx | 15 +-- .../src/Navigation/NavigationItem.test.tsx | 23 ++-- .../src/Navigation/NavigationItem.tsx | 24 ++-- .../src/Navigation/NavigationSection.tsx | 3 +- .../teleport/src/Navigation/utils.tsx | 1 - .../src/Notifications/Notification.story.tsx | 13 +- .../src/Notifications/Notification.tsx | 19 ++- .../src/Notifications/Notifications.test.tsx | 14 +-- .../src/Notifications/Notifications.tsx | 21 ++-- .../teleport/src/Notifications/fixtures.ts | 8 +- .../notificationContentFactory.tsx | 5 +- .../src/Player/ActionBar/ActionBar.tsx | 5 +- .../teleport/src/Player/ActionBar/index.ts | 1 + .../teleport/src/Player/DesktopPlayer.tsx | 14 +-- .../teleport/src/Player/Player.story.tsx | 5 +- web/packages/teleport/src/Player/Player.tsx | 11 +- .../src/Player/PlayerTabs/PlayerTabs.tsx | 3 +- .../teleport/src/Player/PlayerTabs/index.ts | 1 + .../src/Player/ProgressBar/Slider/Slider.jsx | 4 +- .../src/Player/ProgressBar/Slider/index.js | 1 + .../teleport/src/Player/SshPlayer.tsx | 5 +- .../teleport/src/Player/Xterm/Xterm.tsx | 8 +- .../src/Recordings/Recordings.story.tsx | 3 +- .../teleport/src/Recordings/Recordings.tsx | 6 +- .../src/Recordings/RecordingsList.tsx | 4 +- .../teleport/src/Recordings/useRecordings.ts | 9 +- .../src/Roles/DeleteRole/DeleteRole.tsx | 7 +- .../teleport/src/Roles/DeleteRole/index.ts | 1 + .../teleport/src/Roles/RoleList/RoleList.tsx | 2 +- .../teleport/src/Roles/Roles.test.tsx | 3 +- web/packages/teleport/src/Roles/Roles.tsx | 12 +- web/packages/teleport/src/Roles/useRoles.ts | 3 +- .../SamlApplications/useSamlAppActions.tsx | 4 +- .../SessionList/SessionJoinBtn.test.tsx | 2 +- .../Sessions/SessionList/SessionJoinBtn.tsx | 2 +- .../src/Sessions/SessionList/SessionList.tsx | 5 +- .../src/Sessions/SessionList/index.ts | 1 + .../src/Sessions/Sessions.story.test.tsx | 2 +- .../teleport/src/Sessions/Sessions.story.tsx | 3 +- .../teleport/src/Sessions/Sessions.tsx | 7 +- .../teleport/src/Sessions/useSessions.ts | 7 +- .../SingleLogoutFailed.story.tsx | 2 +- .../SingleLogoutFailed/SingleLogoutFailed.tsx | 1 + .../src/Support/Support.story.test.tsx | 4 +- .../teleport/src/Support/Support.story.tsx | 3 +- web/packages/teleport/src/Support/Support.tsx | 10 +- web/packages/teleport/src/Teleport.tsx | 35 +++--- .../ClusterSelector/ClusterSelector.story.tsx | 1 + .../ClusterSelector/ClusterSelector.tsx | 1 + .../src/TopBar/ClusterSelector/index.ts | 1 + .../teleport/src/TopBar/DeviceTrustIcon.tsx | 1 + .../teleport/src/TopBar/DeviceTrustStatus.tsx | 1 + .../teleport/src/TopBar/TopBar.story.tsx | 10 +- .../teleport/src/TopBar/TopBar.test.tsx | 27 ++--- web/packages/teleport/src/TopBar/TopBar.tsx | 25 ++-- .../DeleteTrust/DeleteTrust.tsx | 7 +- .../src/TrustedClusters/DeleteTrust/index.ts | 1 + .../src/TrustedClusters/TrustedClusters.tsx | 6 +- .../TrustedList/TrustedList.tsx | 1 + .../TrustedList/TrustedListItem.tsx | 3 +- .../src/TrustedClusters/TrustedList/index.ts | 1 + .../teleport/src/TrustedClusters/assets.js | 1 + .../teleport/src/TrustedClusters/index.ts | 1 + .../UnifiedResources/ResourceActionButton.tsx | 26 ++-- .../src/UnifiedResources/UnifiedResources.tsx | 39 +++--- .../teleport/src/User/UserContext.test.tsx | 12 +- .../teleport/src/User/UserContext.tsx | 14 +-- .../Users/UserAddEdit/TraitsEditor.test.tsx | 7 +- .../src/Users/UserAddEdit/TraitsEditor.tsx | 5 +- .../Users/UserAddEdit/UserAddEdit.story.tsx | 3 +- .../src/Users/UserAddEdit/UserAddEdit.tsx | 12 +- .../src/Users/UserAddEdit/useDialog.tsx | 5 +- .../src/Users/UserDelete/UserDelete.tsx | 7 +- .../teleport/src/Users/UserDelete/index.ts | 1 + .../teleport/src/Users/UserList/UserList.tsx | 3 +- .../Users/UserReset/UserReset.story.test.tsx | 2 +- .../src/Users/UserReset/UserReset.tsx | 7 +- .../src/Users/UserTokenLink/UserTokenLink.tsx | 8 +- .../teleport/src/Users/Users.test.tsx | 3 +- web/packages/teleport/src/Users/Users.tsx | 13 +- web/packages/teleport/src/Users/useUsers.ts | 7 +- .../teleport/src/Welcome/CardWelcome.tsx | 2 +- .../src/Welcome/NewCredentials/Expired.tsx | 2 +- .../NewCredentials.story.test.tsx | 1 + .../NewCredentials/NewCredentials.test.tsx | 10 +- .../Welcome/NewCredentials/NewCredentials.tsx | 9 +- .../Welcome/NewCredentials/NewPassword.tsx | 4 +- .../NewCredentials/NewPasswordlessDevice.tsx | 6 +- .../src/Welcome/NewCredentials/Success.tsx | 4 +- .../src/Welcome/NewCredentials/constants.ts | 2 +- .../src/Welcome/NewCredentials/types.ts | 10 +- .../teleport/src/Welcome/Welcome.story.tsx | 2 +- .../teleport/src/Welcome/Welcome.test.tsx | 12 +- web/packages/teleport/src/Welcome/Welcome.tsx | 6 +- web/packages/teleport/src/Welcome/useToken.ts | 3 +- web/packages/teleport/src/boot.tsx | 3 +- .../AgentButtonAdd.story.test.tsx | 1 + .../AgentErrorMessage/AgentErrorMessage.tsx | 1 + .../src/components/AjaxPoller/index.js | 1 + .../Authenticated/Authenticated.test.tsx | 4 +- .../Authenticated/Authenticated.tsx | 15 +-- .../Authenticated/ErrorDialogue.tsx | 7 +- .../src/components/Authenticated/index.ts | 1 + .../components/AuthnDialog/AuthnDialog.tsx | 7 +- .../src/components/AuthnDialog/index.ts | 1 + .../src/components/BannerList/Banner.test.tsx | 1 + .../src/components/BannerList/Banner.tsx | 2 +- .../components/BannerList/BannerList.test.tsx | 5 +- .../src/components/BannerList/BannerList.tsx | 7 +- .../components/BannerList/useAlerts.test.tsx | 1 - .../src/components/BannerList/useAlerts.tsx | 14 ++- .../ButtonLockedFeature.test.tsx | 5 +- .../ButtonLockedFeature.tsx | 4 +- .../src/components/CardEmpty/CardEmpty.jsx | 3 +- .../src/components/CardEmpty/index.js | 1 + .../src/components/CatchError/CatchError.tsx | 1 + ...tSearcheableTableWithQueryParamSupport.tsx | 2 +- .../src/components/DayPicker/Shared.tsx | 1 + .../DownloadLinks/DownloadLinks.tsx | 1 + .../src/components/DownloadLinks/index.ts | 1 + .../src/components/Empty/Empty.test.tsx | 3 +- .../teleport/src/components/Empty/Empty.tsx | 6 +- .../EventRangePicker/Custom/Custom.tsx | 7 +- .../EventRangePicker.story.tsx | 3 +- .../EventRangePicker/EventRangePicker.tsx | 9 +- .../src/components/EventRangePicker/utils.ts | 2 +- .../ExternalAuditStorageCta.test.tsx | 9 +- .../ExternalAuditStorageCta.tsx | 12 +- .../components/FormLogin/FormLogin.test.tsx | 2 +- .../src/components/FormLogin/FormLogin.tsx | 36 +++--- .../src/components/FormLogin/SsoButtons.tsx | 1 + .../src/components/FormLogin/index.ts | 1 + .../HeadlessRequestDialog.tsx | 5 +- .../components/InputSearch/InputSearch.jsx | 5 +- .../src/components/InputSearch/index.js | 1 + .../LabelSelector/LabelSelector.test.tsx | 2 +- .../LabelSelector/LabelSelector.tsx | 3 +- .../LabelsInput/LabelsInput.story.tsx | 5 +- .../LabelsInput/LabelsInput.test.tsx | 6 +- .../components/LabelsInput/LabelsInput.tsx | 7 +- .../teleport/src/components/Layout/Layout.jsx | 1 + .../src/components/LogoHero/LogoHero.tsx | 9 +- .../MfaDeviceList/MfaDeviceList.tsx | 1 + .../RemoveDialog/RemoveDialog.tsx | 1 + .../MfaDeviceList/RemoveDialog/index.ts | 1 + .../NewMfaDeviceForm/NewMfaDeviceForm.tsx | 11 +- .../src/components/NodeList/NodeList.tsx | 8 +- .../teleport/src/components/NodeList/index.ts | 1 + .../src/components/Passkeys/PasskeyBlurb.tsx | 3 +- .../src/components/Passkeys/PasskeyIcons.tsx | 1 + .../ReAuthenticate.story.test.tsx | 3 +- .../ReAuthenticate/ReAuthenticate.story.tsx | 2 +- .../ReAuthenticate/ReAuthenticate.tsx | 15 +-- .../ReAuthenticate/useReAuthenticate.ts | 1 - .../RecoveryCodes.story.test.tsx | 1 + .../RecoveryCodes/RecoveryCodes.tsx | 1 + .../ResourceEditor/ResourceEditor.jsx | 7 +- .../ResourceEditor/ResourceEditor.story.js | 2 +- .../teleport/src/components/Router/Router.jsx | 7 +- .../teleport/src/components/Router/index.js | 12 +- .../src/components/SelectFilters/Pager.tsx | 3 +- .../SelectFilters/SelectFilters.tsx | 13 +- .../src/components/SelectFilters/index.ts | 1 + .../ServersideSearchPanel/SearchInput.tsx | 4 +- .../ServersideSearchPanel.tsx | 4 +- ...ServersideSearchPanelWithPageIndicator.tsx | 3 +- .../useServerSideSearchPanel.ts | 3 +- .../src/components/TabIcon/TabIcon.tsx | 1 + .../teleport/src/components/TabIcon/index.ts | 1 + .../src/components/Tabs/Tabs.story.tsx | 1 - .../src/components/Tabs/Tabs.test.tsx | 2 +- .../teleport/src/components/Tabs/Tabs.tsx | 1 + .../teleport/src/components/Tabs/index.ts | 1 + .../TdpClientCanvas/TdpClientCanvas.tsx | 9 +- .../src/components/TextSelectCopy/index.ts | 1 + .../ToolTipBadge/ToolTipBadge.story.tsx | 1 + .../components/ToolTipBadge/ToolTipBadge.tsx | 3 +- .../ToolTipNoPermBadge.story.tsx | 3 +- .../ToolTipNoPermBadge.test.tsx | 1 + .../UserMenuNav/UserMenuNav.story.tsx | 9 +- .../UserMenuNav/UserMenuNav.test.tsx | 22 ++-- .../components/UserMenuNav/UserMenuNav.tsx | 24 ++-- .../components/Wizard/Navigation/Bullet.tsx | 3 +- .../Wizard/Navigation/Navigation.story.tsx | 2 +- .../Wizard/Navigation/Navigation.test.tsx | 1 + .../Wizard/Navigation/Navigation.tsx | 3 +- .../components/Wizard/Navigation/StepItem.tsx | 3 +- .../components/Wizard/Navigation/StepList.tsx | 1 - .../src/components/Wizard/flow.test.tsx | 3 +- .../hooks/useServersidePagination.ts | 5 +- .../useUrlFiltering/useUrlFiltering.test.tsx | 5 +- .../hooks/useUrlFiltering/useUrlFiltering.ts | 4 +- .../teleport/src/components/useResources.ts | 2 +- web/packages/teleport/src/config.test.ts | 4 +- web/packages/teleport/src/config.ts | 15 +-- web/packages/teleport/src/features.tsx | 36 +++--- web/packages/teleport/src/lib/global.d.ts | 4 +- web/packages/teleport/src/lib/tdp/client.ts | 50 ++++---- .../teleport/src/lib/tdp/codec.test.ts | 2 +- web/packages/teleport/src/lib/tdp/index.ts | 2 +- .../teleport/src/lib/tdp/playerClient.ts | 2 +- .../teleport/src/lib/term/terminal.ts | 14 +-- web/packages/teleport/src/lib/term/tty.ts | 4 +- .../teleport/src/lib/term/ttyPlayer.js | 4 +- .../teleport/src/lib/term/ttyPlayer.test.js | 2 +- web/packages/teleport/src/lib/useWebAuthn.ts | 2 +- web/packages/teleport/src/lib/util.test.ts | 2 +- web/packages/teleport/src/mocks/contexts.ts | 3 +- .../src/services/agents/agents.test.ts | 3 +- .../teleport/src/services/agents/agents.ts | 3 +- .../teleport/src/services/agents/types.ts | 9 +- .../teleport/src/services/alerts/alerts.tsx | 2 +- .../teleport/src/services/api/api.test.ts | 2 +- web/packages/teleport/src/services/api/api.ts | 4 +- .../teleport/src/services/api/index.js | 5 +- .../teleport/src/services/apps/apps.ts | 3 +- .../teleport/src/services/apps/types.ts | 1 - .../teleport/src/services/audit/audit.ts | 2 +- .../teleport/src/services/audit/makeEvent.ts | 3 +- .../teleport/src/services/auth/auth.test.ts | 2 +- .../teleport/src/services/auth/auth.ts | 13 +- web/packages/teleport/src/services/bot/bot.ts | 9 +- .../src/services/clusters/clusters.ts | 5 +- .../src/services/databases/databases.ts | 5 +- .../src/services/desktops/desktops.ts | 3 +- .../src/services/discovery/discovery.ts | 2 +- .../teleport/src/services/history/history.ts | 5 +- .../teleport/src/services/history/index.ts | 1 + .../integrations/integrations.test.ts | 2 +- .../src/services/integrations/integrations.ts | 57 +++++---- .../src/services/joinToken/joinToken.test.ts | 3 +- .../src/services/joinToken/joinToken.ts | 5 +- .../src/services/joinToken/makeJoinToken.ts | 2 +- .../teleport/src/services/kube/kube.ts | 4 +- .../teleport/src/services/kube/types.ts | 1 + .../teleport/src/services/locks/locks.ts | 2 +- web/packages/teleport/src/services/mfa/mfa.ts | 6 +- .../teleport/src/services/nodes/makeNode.ts | 2 +- .../teleport/src/services/nodes/nodes.ts | 4 +- .../src/services/recordings/makeRecording.ts | 3 +- .../src/services/recordings/recordings.ts | 2 +- .../src/services/resources/makeResource.ts | 2 +- .../src/services/resources/resource.ts | 8 +- .../src/services/session/makeSession.ts | 2 +- .../teleport/src/services/session/session.ts | 2 +- .../services/storageService/storageService.ts | 15 +-- .../teleport/src/services/user/index.ts | 2 +- .../src/services/user/makeUserContext.ts | 3 +- .../teleport/src/services/user/user.test.ts | 4 +- .../teleport/src/services/user/user.ts | 9 +- .../src/services/userEvent/userEvent.ts | 12 +- .../src/services/userGroups/usergroups.ts | 3 +- .../userPreferences/userPreferences.ts | 15 +-- .../src/services/websession/websession.ts | 2 +- .../teleport/src/services/yaml/yaml.ts | 2 +- web/packages/teleport/src/stores/index.ts | 2 +- .../teleport/src/stores/storeUserContext.ts | 1 - web/packages/teleport/src/telemetry-boot.ts | 26 ++-- web/packages/teleport/src/teleportContext.tsx | 30 ++--- .../teleport/src/useStickyClusterId.ts | 4 +- .../teleterm/electron.vite.config.mts | 3 +- .../agentCleanupDaemon.test.ts | 4 +- web/packages/teleterm/src/deepLinks.ts | 7 +- web/packages/teleterm/src/helpers.ts | 15 ++- web/packages/teleterm/src/logger.ts | 2 +- web/packages/teleterm/src/main.ts | 16 +-- .../agentDownloader/agentDownloader.test.ts | 4 +- .../agentDownloader/agentDownloader.ts | 7 +- .../agentDownloader/fileDownloader.test.ts | 4 +- .../agentRunner/agentRunner.test.ts | 3 +- .../mainProcess/agentRunner/agentRunner.ts | 8 +- .../contextMenus/tabContextMenu.ts | 6 +- .../mainProcess/createAgentConfigFile.test.ts | 2 +- .../src/mainProcess/createAgentConfigFile.ts | 4 +- .../src/mainProcess/fixtures/mocks.ts | 6 +- .../teleterm/src/mainProcess/index.ts | 1 + .../loadInstallationId.test.ts | 2 +- .../loadInstallationId/loadInstallationId.ts | 2 +- .../teleterm/src/mainProcess/mainProcess.ts | 54 ++++----- .../src/mainProcess/mainProcessClient.ts | 10 +- .../src/mainProcess/protocolHandler.ts | 4 +- .../rootClusterProxyHostAllowList.ts | 8 +- .../src/mainProcess/runtimeSettings.ts | 2 +- .../teleterm/src/mainProcess/types.ts | 8 +- .../src/mainProcess/windowsManager.ts | 8 +- web/packages/teleterm/src/preload.ts | 18 +-- .../src/services/config/configService.test.ts | 2 +- .../src/services/config/configService.ts | 6 +- .../config/keyboardShortcutSchema.test.ts | 4 +- .../teleterm/src/services/config/migration.ts | 2 +- .../src/services/fileStorage/fileStorage.ts | 2 +- .../services/fileStorage/fileStorageClient.ts | 1 - .../src/services/grpcCredentials/files.ts | 4 +- .../grpcCredentials/makeCert/makeCert.ts | 2 +- .../src/services/logger/loggerService.ts | 12 +- .../teleterm/src/services/logger/types.ts | 4 +- .../src/services/pty/fixtures/mocks.ts | 2 +- .../pty/ptyHost/buildPtyOptions.test.ts | 10 +- .../services/pty/ptyHost/buildPtyOptions.ts | 13 +- .../pty/ptyHost/ptyEventsStreamHandler.ts | 11 +- .../src/services/pty/ptyHost/ptyHostClient.ts | 4 +- .../teleterm/src/services/pty/ptyService.ts | 2 +- .../teleterm/src/services/pty/types.ts | 2 +- .../src/services/tshd/cloneableClient.test.ts | 10 +- .../src/services/tshd/cloneableClient.ts | 10 +- .../src/services/tshd/createClient.ts | 1 + .../src/services/tshd/fixtures/mocks.ts | 4 +- .../teleterm/src/services/tshd/gateway.ts | 2 +- .../src/services/tshd/interceptors.test.ts | 2 +- .../teleterm/src/services/tshd/testHelpers.ts | 4 +- .../teleterm/src/services/tshdEvents/index.ts | 5 +- .../ptyHost/ptyEventsStreamHandler.ts | 4 +- .../sharedProcess/ptyHost/ptyHostService.ts | 8 +- .../src/sharedProcess/ptyHost/ptyProcess.ts | 6 +- .../src/sharedProcess/sharedProcess.ts | 8 +- web/packages/teleterm/src/types.ts | 10 +- .../AccessRequestCheckout.tsx | 11 +- .../AccessRequestCheckout/AssumedRolesBar.tsx | 1 + .../useAccessRequestCheckout.test.tsx | 7 +- .../useAccessRequestCheckout.ts | 30 ++--- .../useAssumedRolesBar.test.tsx | 6 +- .../useAssumedRolesBar.ts | 13 +- web/packages/teleterm/src/ui/App.tsx | 10 +- .../src/ui/AppInitializer/AppInitializer.tsx | 5 +- .../showStartupModalsAndNotifications.test.ts | 2 +- .../showStartupModalsAndNotifications.ts | 6 +- .../ClusterAdd/ClusterAdd.story.tsx | 5 +- .../ClusterConnect/ClusterAdd/ClusterAdd.tsx | 5 +- .../ClusterLogin/ClusterLogin.story.tsx | 2 +- .../ClusterLogin/ClusterLogin.tsx | 9 +- .../FormLogin/FormLocal/FormLocal.tsx | 8 +- .../ClusterLogin/FormLogin/FormLogin.tsx | 17 ++- .../FormPasswordless/FormPasswordless.tsx | 5 +- .../FormLogin/FormSso/FormSso.tsx | 4 +- .../FormLogin/FormSso/SsoButtons.tsx | 1 + .../PromptSsoStatus/PromptSsoStatus.tsx | 2 +- .../FormLogin/PromptSsoStatus/index.ts | 1 + .../PromptWebauthn/PromptWebauthn.tsx | 9 +- .../ClusterLogin/FormLogin/index.ts | 1 + .../ClusterLogin/useClusterLogin.ts | 10 +- .../src/ui/ClusterLogout/ClusterLogout.tsx | 6 +- .../CompatibilityPromise.test.tsx | 7 +- .../CompatibilityPromise.tsx | 5 +- .../DocumentConnectMyComputer.tsx | 5 +- .../DocumentConnectMyComputer/ProgressBar.tsx | 3 +- .../DocumentConnectMyComputer/Setup.story.tsx | 11 +- .../DocumentConnectMyComputer/Setup.test.tsx | 11 +- .../DocumentConnectMyComputer/Setup.tsx | 20 ++-- .../Status.story.tsx | 14 +-- .../DocumentConnectMyComputer/Status.tsx | 27 ++--- .../src/ui/ConnectMyComputer/Logs.tsx | 3 +- .../NavigationMenu.story.tsx | 12 +- .../ui/ConnectMyComputer/NavigationMenu.tsx | 4 +- .../UpgradeAgentSuggestion.test.tsx | 5 +- .../UpgradeAgentSuggestion.tsx | 2 +- .../connectMyComputerContext.test.tsx | 18 +-- .../connectMyComputerContext.tsx | 21 ++-- .../ConnectMyComputer/useAgentProperties.ts | 2 +- .../teleterm/src/ui/Document/Document.tsx | 1 + .../teleterm/src/ui/Document/index.ts | 1 + .../DocumentAccessRequests.tsx | 10 +- .../NewRequest/NewRequest.tsx | 17 ++- .../NewRequest/useNewRequest.ts | 46 ++++---- .../RequestList/RequestList.test.tsx | 4 +- .../RequestList/RequestList.tsx | 13 +- .../ReviewAccessRequest.tsx | 6 +- .../useReviewAccessRequest.ts | 13 +- .../useAccessRequests.test.tsx | 3 +- .../useAccessRequests.tsx | 20 ++-- .../DocumentAccessRequests/useAssumeAccess.ts | 4 +- .../DocumentAuthorizeWebSession.story.tsx | 6 +- .../DocumentAuthorizeWebSession.test.tsx | 11 +- .../DocumentAuthorizeWebSession.tsx | 16 +-- .../DocumentCluster/ActionButtons.story.tsx | 12 +- .../src/ui/DocumentCluster/ActionButtons.tsx | 44 +++---- .../DocumentCluster/DocumentCluster.story.tsx | 37 +++--- .../DocumentCluster/DocumentCluster.test.tsx | 20 ++-- .../ui/DocumentCluster/DocumentCluster.tsx | 14 +-- .../DocumentCluster/UnifiedResources.test.tsx | 32 ++--- .../ui/DocumentCluster/UnifiedResources.tsx | 64 +++++----- .../teleterm/src/ui/DocumentCluster/index.ts | 1 + .../DocumentCluster/resourcesContext.test.tsx | 2 +- .../useUserPreferences.test.tsx | 11 +- .../ui/DocumentCluster/useUserPreferences.ts | 33 +++--- .../src/ui/DocumentGateway/CliCommand.tsx | 3 +- .../DocumentGateway/DocumentGateway.story.tsx | 2 +- .../ui/DocumentGateway/DocumentGateway.tsx | 3 +- .../DocumentGateway/OnlineDocumentGateway.tsx | 6 +- .../teleterm/src/ui/DocumentGateway/index.ts | 1 + .../useDocumentGateway.test.tsx | 5 +- .../ui/DocumentGateway/useDocumentGateway.ts | 8 +- .../src/ui/DocumentGatewayApp/AppGateway.tsx | 14 +-- .../DocumentGatewayApp.story.tsx | 8 +- .../DocumentGatewayApp/DocumentGatewayApp.tsx | 6 +- .../DocumentGatewayCliClient.tsx | 11 +- .../DocumentGatewayKube.story.tsx | 3 +- .../DocumentGatewayKube.tsx | 6 +- .../ui/DocumentTerminal/DocumentTerminal.tsx | 10 +- .../src/ui/DocumentTerminal/Reconnect.tsx | 6 +- .../Terminal/Terminal.test.tsx | 6 +- .../ui/DocumentTerminal/Terminal/Terminal.tsx | 9 +- .../src/ui/DocumentTerminal/Terminal/ctrl.ts | 8 +- .../useDocumentTerminal.test.tsx | 33 +++--- .../DocumentTerminal/useDocumentTerminal.ts | 34 +++--- .../useTshFileTransferHandlers.ts | 8 +- .../src/ui/Documents/DocumentsRenderer.tsx | 34 +++--- .../ui/Documents/KeyboardShortcutsPanel.tsx | 8 +- .../src/ui/Documents/workspaceContext.tsx | 2 +- .../ui/DocumentsReopen/DocumentsReopen.tsx | 5 +- .../HeadlessAuthn/HeadlessAuthentication.tsx | 8 +- .../HeadlessPrompt/HeadlessPrompt.tsx | 12 +- .../teleterm/src/ui/LayoutManager.tsx | 5 +- .../src/ui/ModalsHost/ModalsHost.story.tsx | 4 +- .../src/ui/ModalsHost/ModalsHost.test.tsx | 7 +- .../teleterm/src/ui/ModalsHost/ModalsHost.tsx | 10 +- .../teleterm/src/ui/ModalsHost/index.ts | 1 + .../ChangeAccessRequestKind.tsx | 2 +- .../ModalsHost/modals/HardwareKeys/AskPin.tsx | 5 +- .../modals/HardwareKeys/ChangePin.tsx | 9 +- .../modals/HardwareKeys/CommonHeader.tsx | 4 +- .../modals/HardwareKeys/OverwriteSlot.tsx | 2 +- .../ModalsHost/modals/HardwareKeys/Touch.tsx | 3 +- .../modals/HardwareKeys/index.story.tsx | 6 +- .../ReAuthenticate/ReAuthenticate.story.tsx | 2 +- .../modals/ReAuthenticate/ReAuthenticate.tsx | 27 ++--- .../ModalsHost/modals/UsageData/UsageData.tsx | 3 +- .../modals/UserJobRole/UserJobRole.tsx | 1 + .../ui/Search/ResourceSearchErrors.story.tsx | 2 +- .../src/ui/Search/ResourceSearchErrors.tsx | 4 +- .../teleterm/src/ui/Search/SearchBar.test.tsx | 23 ++-- .../teleterm/src/ui/Search/SearchBar.tsx | 5 +- .../src/ui/Search/SearchContext.test.tsx | 15 ++- .../teleterm/src/ui/Search/SearchContext.tsx | 13 +- .../teleterm/src/ui/Search/actions.tsx | 10 +- .../ui/Search/pickers/ActionPicker.test.ts | 2 +- .../src/ui/Search/pickers/ActionPicker.tsx | 26 ++-- .../src/ui/Search/pickers/ParameterPicker.tsx | 14 +-- .../src/ui/Search/pickers/ResultList.tsx | 5 +- .../src/ui/Search/pickers/pickers.tsx | 1 - .../src/ui/Search/pickers/results.story.tsx | 21 ++-- .../ui/Search/pickers/useActionAttempts.ts | 11 +- .../Search/pickers/useDisplayResults.test.tsx | 4 +- .../ui/Search/pickers/useDisplayResults.ts | 4 +- .../teleterm/src/ui/Search/searchResult.ts | 3 +- .../teleterm/src/ui/Search/useSearch.test.tsx | 13 +- .../teleterm/src/ui/Search/useSearch.ts | 13 +- .../ShareFeedback/ShareFeedback.test.tsx | 5 +- .../StatusBar/ShareFeedback/ShareFeedback.tsx | 5 +- .../ShareFeedback/ShareFeedbackForm.tsx | 8 +- .../ShareFeedback/ShareFeedbackFormFields.tsx | 5 +- .../ShareFeedback/useShareFeedback.ts | 1 - .../teleterm/src/ui/StatusBar/StatusBar.tsx | 5 +- .../ClusterConnectPanel.tsx | 3 +- .../ClusterConnectPanel/RecentClusters.tsx | 6 +- .../teleterm/src/ui/TabHost/TabHost.test.tsx | 12 +- .../teleterm/src/ui/TabHost/TabHost.tsx | 11 +- .../src/ui/TabHost/useTabShortcuts.test.tsx | 9 +- web/packages/teleterm/src/ui/Tabs/TabItem.tsx | 3 +- web/packages/teleterm/src/ui/Tabs/Tabs.tsx | 6 +- .../teleterm/src/ui/ThemeProvider/globals.ts | 1 + .../teleterm/src/ui/ThemeProvider/theme.ts | 2 +- .../src/ui/TopBar/AdditionalActions.story.tsx | 1 + .../src/ui/TopBar/AdditionalActions.tsx | 15 ++- .../ClusterSelector/ClusterSelector.tsx | 3 +- .../src/ui/TopBar/Clusters/Clusters.tsx | 7 +- .../ClustersFilterableList/ClusterItem.tsx | 10 +- .../ClustersFilterableList.tsx | 2 +- .../TopBar/Connections/Connections.story.tsx | 5 +- .../TopBar/Connections/Connections.test.tsx | 5 +- .../src/ui/TopBar/Connections/Connections.tsx | 9 +- .../ConnectionItem.tsx | 9 +- .../ConnectionStatusIndicator.story.tsx | 3 +- .../ConnectionStatusIndicator.tsx | 3 +- .../ConnectionsFilterableList.tsx | 6 +- .../ConnectionsIcon/ConnectionsIcon.tsx | 3 +- .../ConnectionsIconStatusIndicator.tsx | 1 + .../Connections/ConnectionsSliderStep.tsx | 3 +- .../TopBar/Connections/connectionsContext.tsx | 2 +- .../EmptyIdentityList/EmptyIdentityList.tsx | 1 + .../src/ui/TopBar/Identity/Identity.story.tsx | 3 +- .../src/ui/TopBar/Identity/Identity.test.tsx | 9 +- .../src/ui/TopBar/Identity/Identity.tsx | 12 +- .../IdentityList/AddNewClusterItem.tsx | 3 +- .../Identity/IdentityList/IdentityList.tsx | 8 +- .../IdentityList/IdentityListItem.tsx | 5 +- .../IdentitySelector/IdentitySelector.tsx | 10 +- .../Identity/IdentitySelector/PamIcon.tsx | 1 + .../src/ui/TopBar/Identity/useIdentity.ts | 2 +- .../teleterm/src/ui/TopBar/TopBar.tsx | 6 +- .../src/ui/Vnet/VnetConnectionItem.test.tsx | 4 +- .../src/ui/Vnet/VnetConnectionItem.tsx | 9 +- .../src/ui/Vnet/VnetSliderStep.story.tsx | 4 +- .../teleterm/src/ui/Vnet/VnetSliderStep.tsx | 7 +- .../teleterm/src/ui/Vnet/vnetContext.test.tsx | 8 +- .../teleterm/src/ui/Vnet/vnetContext.tsx | 13 +- web/packages/teleterm/src/ui/appContext.ts | 28 ++--- web/packages/teleterm/src/ui/boot.tsx | 5 +- .../teleterm/src/ui/components/App.test.tsx | 3 +- .../teleterm/src/ui/components/App.tsx | 1 + .../ui/components/CatchError/CatchError.jsx | 2 +- .../components/CatchError/CatchError.test.tsx | 3 +- .../src/ui/components/FieldInputs.tsx | 6 +- .../FilterableList/FilterableList.test.tsx | 3 +- .../FilterableList/FilterableList.tsx | 3 +- .../KeyboardArrowsNavigation.test.tsx | 1 + .../src/ui/components/LinearProgress/index.ts | 1 + .../Notifcations/Notifications.story.tsx | 4 +- .../components/Notifcations/Notifications.tsx | 8 +- .../src/ui/components/OfflineGateway.tsx | 2 +- .../src/ui/components/ProfileStatusError.tsx | 2 +- .../VirtualScroll/VirtualScroll.tsx | 4 +- .../VirtualScroll/useVirtualScrollNodes.tsx | 3 +- .../ui/fixtures/MockAppContextProvider.tsx | 4 +- .../fixtures/MockWorkspaceContextProvider.tsx | 2 +- .../teleterm/src/ui/fixtures/mocks.ts | 4 +- .../teleterm/src/ui/hooks/useLoggedInUser.ts | 2 +- .../src/ui/hooks/usePersistedState.test.tsx | 2 +- .../teleterm/src/ui/hooks/useStoreSelector.ts | 4 +- .../services/clusters/clustersService.test.ts | 13 +- .../ui/services/clusters/clustersService.ts | 32 +++-- .../connectMyComputerService.ts | 3 +- .../connectionTrackerService.test.ts | 6 +- .../connectionTrackerService.ts | 7 +- .../trackedConnectionOperationsFactory.ts | 4 +- .../ui/services/connectionTracker/types.ts | 2 +- .../deepLinks/deepLinksService.test.ts | 2 +- .../ui/services/deepLinks/deepLinksService.ts | 6 +- .../fileTransferClient/fileTransferService.ts | 7 +- .../headlessAuthn/headlessAuthnService.ts | 7 +- .../services/immutableStore/immutableStore.ts | 3 +- .../keyboardShortcutsService.ts | 2 +- .../useKeyboardShortcutFormatters.ts | 2 +- .../useKeyboardShortcuts.test.tsx | 8 +- .../src/ui/services/modals/modalsService.ts | 7 +- .../notifications/notificationsService.ts | 9 +- .../src/ui/services/relogin/reloginService.ts | 14 +-- .../resources/resourcesService.test.ts | 9 +- .../ui/services/resources/resourcesService.ts | 20 ++-- .../tshdNotificationService.ts | 8 +- .../usage/askAboutUserJobRoleIfNeeded.ts | 4 +- .../ui/services/usage/setUpUsageReporting.ts | 4 +- .../src/ui/services/usage/usageService.ts | 8 +- .../accessRequestsService.test.ts | 8 +- .../accessRequestsService.ts | 12 +- .../documentsService/connectToApp.test.ts | 4 +- .../documentsService/connectToApp.ts | 9 +- .../documentsService/connectToDatabase.ts | 2 +- .../documentsService/connectToKube.ts | 2 +- .../documentsService/connectToServer.ts | 2 +- .../documentsService/documentsService.ts | 21 ++-- .../documentsService/types.test.ts | 6 +- .../documentsService/types.ts | 3 +- .../workspacesService.test.ts | 16 ++- .../workspacesService/workspacesService.ts | 17 ++- web/packages/teleterm/src/ui/tshdEvents.ts | 2 +- web/packages/teleterm/src/ui/types.ts | 24 ++-- web/packages/teleterm/src/ui/uri.ts | 4 +- .../src/ui/utils/retryWithRelogin.test.ts | 4 +- .../teleterm/src/ui/utils/retryWithRelogin.ts | 4 +- 1256 files changed, 4326 insertions(+), 4450 deletions(-) delete mode 100644 .prettierrc create mode 100644 .prettierrc.js diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 6589f7c77bbdb..0000000000000 --- a/.prettierrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "arrowParens": "avoid", - "printWidth": 80, - "bracketSpacing": true, - "semi": true, - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "es5" -} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000000000..02b8b0ba9a1a4 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,39 @@ +const tsConfigBase = require('./tsconfig.json'); + +const ourPackages = new Set( + Object.keys(tsConfigBase.compilerOptions.paths).map( + // Remove extra '/*' if present in the package name. + packageName => packageName.split('/')[0] + ) +); +const appPackages = ['teleport', 'e-teleport', 'teleterm'].flatMap(pkg => [ + pkg, + `@gravitational/${pkg}`, +]); +const libraryPackages = [...ourPackages] + .filter(pkg => !appPackages.includes(pkg)) + .flatMap(pkg => [pkg, `@gravitational/${pkg}`]); + +module.exports = { + arrowParens: 'avoid', + printWidth: 80, + bracketSpacing: true, + plugins: [require('@ianvs/prettier-plugin-sort-imports')], + importOrder: [ + '', + '', + '', + '', + `^(${libraryPackages.join('|')})`, + '', + `^(${appPackages.join('|')})`, + '', + '^[./]', + ], + importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'], + importOrderTypeScriptVersion: '5.0.0', + semi: true, + singleQuote: true, + tabWidth: 2, + trailingComma: 'es5', +}; diff --git a/package.json b/package.json index 0c0423cf73532..eae573de5d3d9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "eslint": "eslint --quiet '+(e|web)/**/*.{ts,tsx,js,jsx,mts}'", "type-check": "NODE_OPTIONS='--max-old-space-size=4096' tsc", "prettier-check": "prettier --check '+(e|web)/**/*.{ts,tsx,js,jsx,mts}'", - "prettier-write": "prettier --write --loglevel silent '+(e|web)/**/*.{ts,tsx,js,jsx,mts}'", + "prettier-write": "prettier --write --log-level silent '+(e|web)/**/*.{ts,tsx,js,jsx,mts}'", "process-icons": "node web/packages/design/src/Icon/script/script.js & pnpm prettier --loglevel silent --write 'web/packages/design/src/Icon/Icons/*.tsx'", "nop": "exit 0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0370c12c796b..504ddd9b26e87 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -199,6 +199,9 @@ importers: '@babel/preset-typescript': specifier: ^7.24.7 version: 7.24.7(@babel/core@7.24.7) + '@ianvs/prettier-plugin-sort-imports': + specifier: ^4.4.0 + version: 4.4.0(prettier@3.3.2) '@storybook/addon-toolbars': specifier: ^6.5.16 version: 6.5.16(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -229,9 +232,6 @@ importers: eslint-plugin-babel: specifier: ^5.3.1 version: 5.3.1(eslint@8.57.0) - eslint-plugin-import: - specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.14.1(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jest: specifier: ^27.9.0 version: 27.9.0(@typescript-eslint/eslint-plugin@7.14.1(@typescript-eslint/parser@7.14.1(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0))(typescript@5.5.3) @@ -524,6 +524,10 @@ packages: resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} + '@babel/code-frame@7.26.2': + resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} + engines: {node: '>=6.9.0'} + '@babel/compat-data@7.24.7': resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} engines: {node: '>=6.9.0'} @@ -540,6 +544,10 @@ packages: resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} engines: {node: '>=6.9.0'} + '@babel/generator@7.26.3': + resolution: {integrity: sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==} + engines: {node: '>=6.9.0'} + '@babel/helper-annotate-as-pure@7.24.7': resolution: {integrity: sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==} engines: {node: '>=6.9.0'} @@ -639,10 +647,18 @@ packages: resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.25.9': + resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.24.7': resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.24.7': resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} engines: {node: '>=6.9.0'} @@ -664,6 +680,11 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@7.26.3': + resolution: {integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==} + engines: {node: '>=6.0.0'} + hasBin: true + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.7': resolution: {integrity: sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ==} engines: {node: '>=6.9.0'} @@ -1260,14 +1281,26 @@ packages: resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} engines: {node: '>=6.9.0'} + '@babel/template@7.25.9': + resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} + engines: {node: '>=6.9.0'} + '@babel/traverse@7.24.7': resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} engines: {node: '>=6.9.0'} + '@babel/traverse@7.26.4': + resolution: {integrity: sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==} + engines: {node: '>=6.9.0'} + '@babel/types@7.24.7': resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} engines: {node: '>=6.9.0'} + '@babel/types@7.26.3': + resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==} + engines: {node: '>=6.9.0'} + '@base2/pretty-print-object@1.0.1': resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==} @@ -1578,6 +1611,15 @@ packages: resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} deprecated: Use @eslint/object-schema instead + '@ianvs/prettier-plugin-sort-imports@4.4.0': + resolution: {integrity: sha512-f4/e+/ANGk3tHuwRW0uh2YuBR50I4h1ZjGQ+5uD8sWfinHTivQsnieR5cz24t8M6Vx4rYvZ5v/IEKZhYpzQm9Q==} + peerDependencies: + '@vue/compiler-sfc': 2.7.x || 3.x + prettier: 2 || 3 + peerDependenciesMeta: + '@vue/compiler-sfc': + optional: true + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -5781,6 +5823,11 @@ packages: engines: {node: '>=4'} hasBin: true + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -8406,6 +8453,12 @@ snapshots: '@babel/highlight': 7.24.7 picocolors: 1.0.1 + '@babel/code-frame@7.26.2': + dependencies: + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 + picocolors: 1.0.1 + '@babel/compat-data@7.24.7': {} '@babel/core@7.12.9': @@ -8456,6 +8509,14 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 + '@babel/generator@7.26.3': + dependencies: + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 3.1.0 + '@babel/helper-annotate-as-pure@7.24.7': dependencies: '@babel/types': 7.24.7 @@ -8617,8 +8678,12 @@ snapshots: '@babel/helper-string-parser@7.24.7': {} + '@babel/helper-string-parser@7.25.9': {} + '@babel/helper-validator-identifier@7.24.7': {} + '@babel/helper-validator-identifier@7.25.9': {} + '@babel/helper-validator-option@7.24.7': {} '@babel/helper-wrap-function@7.24.7': @@ -8646,6 +8711,10 @@ snapshots: dependencies: '@babel/types': 7.24.7 + '@babel/parser@7.26.3': + dependencies: + '@babel/types': 7.26.3 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -9397,6 +9466,12 @@ snapshots: '@babel/parser': 7.24.7 '@babel/types': 7.24.7 + '@babel/template@7.25.9': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + '@babel/traverse@7.24.7(supports-color@5.5.0)': dependencies: '@babel/code-frame': 7.24.7 @@ -9412,12 +9487,29 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/traverse@7.26.4': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 + debug: 4.3.4(supports-color@5.5.0) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + '@babel/types@7.24.7': dependencies: '@babel/helper-string-parser': 7.24.7 '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + '@babel/types@7.26.3': + dependencies: + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@base2/pretty-print-object@1.0.1': {} '@bcoe/v8-coverage@0.2.3': {} @@ -9753,6 +9845,17 @@ snapshots: '@humanwhocodes/object-schema@2.0.2': {} + '@ianvs/prettier-plugin-sort-imports@4.4.0(prettier@3.3.2)': + dependencies: + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 + prettier: 3.3.2 + semver: 7.6.2 + transitivePeerDependencies: + - supports-color + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -15646,6 +15749,8 @@ snapshots: jsesc@2.5.2: {} + jsesc@3.1.0: {} + json-buffer@3.0.1: {} json-parse-even-better-errors@2.3.1: {} diff --git a/tsconfig.json b/tsconfig.json index 06e6400494378..27c6eb1626baf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,8 @@ "target": "esnext", "types": ["node", "@emotion/core", "@types/wicg-file-system-access"], "paths": { + "build/*": ["web/packages/build/src/*"], + "build": ["web/packages/build/src/"], "shared/*": ["web/packages/shared/*"], "design/*": ["web/packages/design/src/*"], "design": ["web/packages/design/src/"], @@ -29,7 +31,7 @@ "teleterm/*": ["web/packages/teleterm/src/*"], "e-teleport/*": ["e/web/teleport/src/*"], "gen-proto-js/*": ["gen/proto/js/*"], - "gen-proto-ts/*": ["gen/proto/ts/*"], + "gen-proto-ts/*": ["gen/proto/ts/*"] } }, "include": [ diff --git a/web/.storybook/preview.js b/web/.storybook/preview.js index 8e67701399c39..299e5fc33207e 100644 --- a/web/.storybook/preview.js +++ b/web/.storybook/preview.js @@ -16,25 +16,29 @@ * along with this program. If not, see . */ -import React from 'react'; -import { rest, setupWorker } from 'msw'; import { addParameters } from '@storybook/react'; +import { rest, setupWorker } from 'msw'; +import React from 'react'; + +import DefaultThemeProvider from '../packages/design/src/ThemeProvider'; +import Box from './../packages/design/src/Box'; import { + bblpTheme, darkTheme, lightTheme, - bblpTheme, } from './../packages/design/src/theme'; -import DefaultThemeProvider from '../packages/design/src/ThemeProvider'; -import Box from './../packages/design/src/Box'; + import '../packages/teleport/src/lib/polyfillRandomUuid'; + +import { UserContextProvider } from 'teleport/User'; + +import { handlersTeleport } from './../packages/teleport/src/mocks/handlers'; +import history from './../packages/teleport/src/services/history/history'; import { StaticThemeProvider as TeletermThemeProvider } from './../packages/teleterm/src/ui/ThemeProvider'; import { darkTheme as teletermDarkTheme, lightTheme as teletermLightTheme, } from './../packages/teleterm/src/ui/ThemeProvider/theme'; -import { handlersTeleport } from './../packages/teleport/src/mocks/handlers'; -import history from './../packages/teleport/src/services/history/history'; -import { UserContextProvider } from 'teleport/User'; // Checks we are running non-node environment (browser) if (typeof global.process === 'undefined') { diff --git a/web/@types/styled-components.d.ts b/web/@types/styled-components.d.ts index f75f89f0be506..cb921a459f7c5 100644 --- a/web/@types/styled-components.d.ts +++ b/web/@types/styled-components.d.ts @@ -17,6 +17,7 @@ */ import 'styled-components'; + import { Theme } from 'design/theme/themes/types'; declare module 'styled-components' { diff --git a/web/packages/build/.eslintrc.js b/web/packages/build/.eslintrc.js index 4d12c50d92111..5e19e02f5c428 100644 --- a/web/packages/build/.eslintrc.js +++ b/web/packages/build/.eslintrc.js @@ -67,22 +67,6 @@ module.exports = { }, ], rules: { - 'import/order': [ - 'error', - { - groups: [ - 'builtin', - 'external', - 'internal', - 'parent', - 'sibling', - 'index', - 'object', - 'type', - ], - 'newlines-between': 'always-and-inside-groups', - }, - ], 'no-unused-vars': 'off', // disabled to allow the typescript one to take over and avoid errors in reporting '@typescript-eslint/no-unused-vars': ['error'], @@ -109,10 +93,6 @@ module.exports = { 'comma-dangle': 0, 'no-mixed-spaces-and-tabs': 0, 'no-alert': 0, - 'import/no-named-as-default': 0, - 'import/default': 2, - // XXX Change to a 2 once e pkg imports are removed from teleterm. - 'import/no-unresolved': 1, 'no-underscore-dangle': 0, 'no-case-declarations': 0, 'prefer-const': 0, diff --git a/web/packages/build/jest/jest-environment-patched-jsdom.js b/web/packages/build/jest/jest-environment-patched-jsdom.js index 642a360b9e395..cbc704768bfb8 100644 --- a/web/packages/build/jest/jest-environment-patched-jsdom.js +++ b/web/packages/build/jest/jest-environment-patched-jsdom.js @@ -1,4 +1,4 @@ -import { TextEncoder, TextDecoder } from 'node:util'; +import { TextDecoder, TextEncoder } from 'node:util'; import { TestEnvironment as JSDOMEnvironment } from 'jest-environment-jsdom'; diff --git a/web/packages/build/package.json b/web/packages/build/package.json index cca092c66324b..c603d0c6394ac 100644 --- a/web/packages/build/package.json +++ b/web/packages/build/package.json @@ -18,6 +18,7 @@ "@babel/preset-env": "^7.24.7", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", + "@ianvs/prettier-plugin-sort-imports": "^4.4.0", "@storybook/addon-toolbars": "^6.5.16", "@storybook/builder-webpack5": "^6.5.16", "@storybook/manager-webpack5": "^6.5.16", @@ -28,7 +29,6 @@ "eslint": "^8.56.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-babel": "^5.3.1", - "eslint-plugin-import": "2.29.1", "eslint-plugin-jest": "^27.9.0", "eslint-plugin-jest-dom": "^5.4.0", "eslint-plugin-react": "^7.34.3", diff --git a/web/packages/build/vite/config.ts b/web/packages/build/vite/config.ts index 96881e38ce22e..50a318d870c72 100644 --- a/web/packages/build/vite/config.ts +++ b/web/packages/build/vite/config.ts @@ -19,17 +19,15 @@ import { existsSync, readFileSync } from 'fs'; import { resolve } from 'path'; -import { defineConfig } from 'vite'; import { visualizer } from 'rollup-plugin-visualizer'; +import { defineConfig, type UserConfig } from 'vite'; import wasm from 'vite-plugin-wasm'; -import { htmlPlugin, transformPlugin } from './html'; import { generateAppHashFile } from './apphash'; +import { htmlPlugin, transformPlugin } from './html'; import { reactPlugin } from './react.mjs'; import { tsconfigPathsPlugin } from './tsconfigPaths.mjs'; -import type { UserConfig } from 'vite'; - const DEFAULT_PROXY_TARGET = '127.0.0.1:3080'; const ENTRY_FILE_NAME = 'app/app.js'; diff --git a/web/packages/build/vite/html.ts b/web/packages/build/vite/html.ts index eaf802aa34f56..34bfdfe124d68 100644 --- a/web/packages/build/vite/html.ts +++ b/web/packages/build/vite/html.ts @@ -17,13 +17,12 @@ */ import { readFileSync } from 'fs'; +import type { IncomingHttpHeaders } from 'http'; import { get } from 'https'; import { resolve } from 'path'; import { JSDOM } from 'jsdom'; - import type { Plugin } from 'vite'; -import type { IncomingHttpHeaders } from 'http'; function getHTML(target: string, headers: IncomingHttpHeaders) { return new Promise<{ data: string; headers: IncomingHttpHeaders }>( diff --git a/web/packages/design/src/Alert/Alert.story.js b/web/packages/design/src/Alert/Alert.story.js index 6818f0c0bfc9f..b52f6ed4434f4 100644 --- a/web/packages/design/src/Alert/Alert.story.js +++ b/web/packages/design/src/Alert/Alert.story.js @@ -19,7 +19,6 @@ import React from 'react'; import { Box } from './../'; - import Alert from './index'; export default { diff --git a/web/packages/design/src/Alert/Alert.test.jsx b/web/packages/design/src/Alert/Alert.test.jsx index 6d358cd5d1f2f..4f704a7c208a5 100644 --- a/web/packages/design/src/Alert/Alert.test.jsx +++ b/web/packages/design/src/Alert/Alert.test.jsx @@ -20,7 +20,7 @@ import React from 'react'; import { render, theme } from 'design/utils/testing'; -import Alert, { Danger, Info, Warning, Success } from './index'; +import Alert, { Danger, Info, Success, Warning } from './index'; describe('design/Alert', () => { it('respects default "kind" prop == danger', () => { diff --git a/web/packages/design/src/Alert/index.jsx b/web/packages/design/src/Alert/index.jsx index 565208b8b7a91..7a1c0c03914aa 100644 --- a/web/packages/design/src/Alert/index.jsx +++ b/web/packages/design/src/Alert/index.jsx @@ -16,6 +16,7 @@ * along with this program. If not, see . */ -import Alert, { Danger, Info, Warning, Success } from './Alert'; +import Alert, { Danger, Info, Success, Warning } from './Alert'; + export default Alert; export { Danger, Info, Warning, Success }; diff --git a/web/packages/design/src/Box/Box.story.tsx b/web/packages/design/src/Box/Box.story.tsx index 947f24c8042ac..ee692968e98f8 100644 --- a/web/packages/design/src/Box/Box.story.tsx +++ b/web/packages/design/src/Box/Box.story.tsx @@ -17,7 +17,6 @@ */ import React from 'react'; - import styled from 'styled-components'; import Box from './Box'; diff --git a/web/packages/design/src/Button/Button.jsx b/web/packages/design/src/Button/Button.jsx index b1de8086d2911..2226f13b49bcc 100644 --- a/web/packages/design/src/Button/Button.jsx +++ b/web/packages/design/src/Button/Button.jsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ +import { bool, string } from 'prop-types'; import React from 'react'; import styled from 'styled-components'; -import { bool, string } from 'prop-types'; -import { space, width, height, alignSelf, gap } from 'design/system'; +import { alignSelf, gap, height, space, width } from 'design/system'; const Button = ({ children, setRef = undefined, ...props }) => { return ( diff --git a/web/packages/design/src/Button/index.js b/web/packages/design/src/Button/index.js index a4f9b62951670..3aee841ffc452 100644 --- a/web/packages/design/src/Button/index.js +++ b/web/packages/design/src/Button/index.js @@ -17,12 +17,13 @@ */ import Button, { + ButtonBorder, ButtonPrimary, - ButtonWarning, ButtonSecondary, - ButtonBorder, ButtonText, + ButtonWarning, } from './Button'; + export default Button; export { ButtonPrimary, diff --git a/web/packages/design/src/ButtonIcon/ButtonIcon.jsx b/web/packages/design/src/ButtonIcon/ButtonIcon.jsx index 96fa44907e0e5..015d65b93057f 100644 --- a/web/packages/design/src/ButtonIcon/ButtonIcon.jsx +++ b/web/packages/design/src/ButtonIcon/ButtonIcon.jsx @@ -19,7 +19,7 @@ import React from 'react'; import styled from 'styled-components'; -import { space, color, alignSelf } from 'design/system'; +import { alignSelf, color, space } from 'design/system'; const sizeMap = { 0: { diff --git a/web/packages/design/src/ButtonIcon/index.js b/web/packages/design/src/ButtonIcon/index.js index 45a5cceadbd6b..d15f77cbf5be3 100644 --- a/web/packages/design/src/ButtonIcon/index.js +++ b/web/packages/design/src/ButtonIcon/index.js @@ -17,4 +17,5 @@ */ import ButtonIcon from './ButtonIcon'; + export default ButtonIcon; diff --git a/web/packages/design/src/ButtonLink/index.js b/web/packages/design/src/ButtonLink/index.js index f439d750b20d5..df0ab3c0ab209 100644 --- a/web/packages/design/src/ButtonLink/index.js +++ b/web/packages/design/src/ButtonLink/index.js @@ -17,4 +17,5 @@ */ import ButtonLink from './ButtonLink'; + export default ButtonLink; diff --git a/web/packages/design/src/ButtonWithMenu/ButtonWithMenu.test.tsx b/web/packages/design/src/ButtonWithMenu/ButtonWithMenu.test.tsx index 899a69ca1f9f9..76f50094345a3 100644 --- a/web/packages/design/src/ButtonWithMenu/ButtonWithMenu.test.tsx +++ b/web/packages/design/src/ButtonWithMenu/ButtonWithMenu.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { render, screen, userEvent } from 'design/utils/testing'; import { MenuItem } from 'design'; +import { render, screen, userEvent } from 'design/utils/testing'; import { ButtonWithMenu } from './ButtonWithMenu'; diff --git a/web/packages/design/src/Card/Card.story.tsx b/web/packages/design/src/Card/Card.story.tsx index c3f97c4984b67..a725a0ee3ff53 100644 --- a/web/packages/design/src/Card/Card.story.tsx +++ b/web/packages/design/src/Card/Card.story.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { Flex, Text } from '..'; - import Card from '.'; +import { Flex, Text } from '..'; export default { title: 'Design/Card', diff --git a/web/packages/design/src/Card/index.js b/web/packages/design/src/Card/index.js index f938a77ff67a4..40dd07877ddba 100644 --- a/web/packages/design/src/Card/index.js +++ b/web/packages/design/src/Card/index.js @@ -17,4 +17,5 @@ */ import Card from './Card'; + export default Card; diff --git a/web/packages/design/src/CardError/CardError.jsx b/web/packages/design/src/CardError/CardError.jsx index 77bad2ecba168..1d846fda529dd 100644 --- a/web/packages/design/src/CardError/CardError.jsx +++ b/web/packages/design/src/CardError/CardError.jsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'styled-components'; -import { Text, Alert, Card } from 'design'; +import { Alert, Card, Text } from 'design'; export default function CardError(props) { return ( diff --git a/web/packages/design/src/CardError/index.js b/web/packages/design/src/CardError/index.js index dfb3d91963b94..c35217bd9a008 100644 --- a/web/packages/design/src/CardError/index.js +++ b/web/packages/design/src/CardError/index.js @@ -17,12 +17,12 @@ */ import CardError, { + AccessDenied, Failed, - Offline, LoginFailed, - AccessDenied, - NotFound, LogoutFailed, + NotFound, + Offline, } from './CardError'; export default CardError; diff --git a/web/packages/design/src/CardIcon/index.js b/web/packages/design/src/CardIcon/index.js index 0bb5aeb6b3cfb..257a21c1d8824 100644 --- a/web/packages/design/src/CardIcon/index.js +++ b/web/packages/design/src/CardIcon/index.js @@ -17,4 +17,5 @@ */ import CardIcon from './CardIcon'; + export default CardIcon; diff --git a/web/packages/design/src/CardSuccess/index.js b/web/packages/design/src/CardSuccess/index.js index 114f6d82c7256..169391cc16b68 100644 --- a/web/packages/design/src/CardSuccess/index.js +++ b/web/packages/design/src/CardSuccess/index.js @@ -17,5 +17,6 @@ */ import CardSuccess, { CardSuccessLogin } from './CardSuccess'; + export default CardSuccess; export { CardSuccessLogin }; diff --git a/web/packages/design/src/CardTerminal/CardTerminal.story.jsx b/web/packages/design/src/CardTerminal/CardTerminal.story.jsx index 27e10fb19c092..9721b20f09435 100644 --- a/web/packages/design/src/CardTerminal/CardTerminal.story.jsx +++ b/web/packages/design/src/CardTerminal/CardTerminal.story.jsx @@ -17,10 +17,9 @@ */ import React from 'react'; - import { MemoryRouter } from 'react-router'; -import { Route } from 'teleport/components/Router'; +import { Route } from 'teleport/components/Router'; import cfg from 'teleport/config'; import CardTerminal, { CardTerminalLogin } from './index'; diff --git a/web/packages/design/src/CardTerminal/index.js b/web/packages/design/src/CardTerminal/index.js index eb87c82d7acbe..b834a5ee6f91b 100644 --- a/web/packages/design/src/CardTerminal/index.js +++ b/web/packages/design/src/CardTerminal/index.js @@ -17,5 +17,6 @@ */ import CardTerminal, { CardTerminalLogin } from './CardTerminal'; + export default CardTerminal; export { CardTerminalLogin }; diff --git a/web/packages/design/src/Checkbox/Checkbox.story.tsx b/web/packages/design/src/Checkbox/Checkbox.story.tsx index 047ab380f39c3..90dce0734e9c7 100644 --- a/web/packages/design/src/Checkbox/Checkbox.story.tsx +++ b/web/packages/design/src/Checkbox/Checkbox.story.tsx @@ -17,11 +17,9 @@ */ import React from 'react'; - import styled from 'styled-components'; import { Flex } from '..'; - import { StyledCheckbox } from './Checkbox'; export default { diff --git a/web/packages/design/src/Checkbox/Checkbox.tsx b/web/packages/design/src/Checkbox/Checkbox.tsx index fb6b5f458a3f7..3a74172a267f4 100644 --- a/web/packages/design/src/Checkbox/Checkbox.tsx +++ b/web/packages/design/src/Checkbox/Checkbox.tsx @@ -16,13 +16,12 @@ * along with this program. If not, see . */ -import styled from 'styled-components'; - import React from 'react'; +import styled from 'styled-components'; import { Flex } from 'design'; -import { space } from 'design/system'; import * as Icon from 'design/Icon'; +import { space } from 'design/system'; export const CheckboxWrapper = styled(Flex)` padding: 8px; diff --git a/web/packages/design/src/DataTable/Cells.tsx b/web/packages/design/src/DataTable/Cells.tsx index 78059a36efd5f..d08302c31ce3d 100644 --- a/web/packages/design/src/DataTable/Cells.tsx +++ b/web/packages/design/src/DataTable/Cells.tsx @@ -18,16 +18,15 @@ import React from 'react'; -import { displayDate } from 'shared/services/loc'; - -import { Label, Flex } from 'design'; +import { Flex, Label } from 'design'; import * as Icons from 'design/Icon'; +import { displayDate } from 'shared/services/loc'; import { + LabelDescription, ServersideProps, SortDir, TableColumn, - LabelDescription, } from './types'; export const Cell = props => ; diff --git a/web/packages/design/src/DataTable/DataTable.story.tsx b/web/packages/design/src/DataTable/DataTable.story.tsx index 710ef3cff9f4d..6226f93feeb24 100644 --- a/web/packages/design/src/DataTable/DataTable.story.tsx +++ b/web/packages/design/src/DataTable/DataTable.story.tsx @@ -17,12 +17,13 @@ */ import React, { useState } from 'react'; -import { ServersideSearchPanelWithPageIndicator } from 'teleport/components/ServersideSearchPanel'; import { SortType, TableProps } from 'design/DataTable/types'; -import Table from './Table'; +import { ServersideSearchPanelWithPageIndicator } from 'teleport/components/ServersideSearchPanel'; + import { ClickableLabelCell, DateCell, LabelCell } from './Cells'; +import Table from './Table'; export default { title: 'Design/DataTable', diff --git a/web/packages/design/src/DataTable/InputSearch/InputSearch.tsx b/web/packages/design/src/DataTable/InputSearch/InputSearch.tsx index 511dd20c5dc7f..fe7f15a072d82 100644 --- a/web/packages/design/src/DataTable/InputSearch/InputSearch.tsx +++ b/web/packages/design/src/DataTable/InputSearch/InputSearch.tsx @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -import React, { JSX, SetStateAction, FormEvent } from 'react'; +import React, { FormEvent, JSX, SetStateAction } from 'react'; import styled from 'styled-components'; import { + color, + ColorProps, height, HeightProps, space, SpaceProps, - color, - ColorProps, } from 'design/system'; const searchInputName = 'searchValue'; diff --git a/web/packages/design/src/DataTable/Pager/ClientSidePager/ClientSidePager.tsx b/web/packages/design/src/DataTable/Pager/ClientSidePager/ClientSidePager.tsx index b75a0032fc96d..4e37be3aed629 100644 --- a/web/packages/design/src/DataTable/Pager/ClientSidePager/ClientSidePager.tsx +++ b/web/packages/design/src/DataTable/Pager/ClientSidePager/ClientSidePager.tsx @@ -19,11 +19,10 @@ import React from 'react'; import { Flex } from 'design'; -import { CircleArrowLeft, CircleArrowRight } from 'design/Icon'; import { PageIndicatorText } from 'design/DataTable/Pager/PageIndicatorText'; +import { CircleArrowLeft, CircleArrowRight } from 'design/Icon'; import { StyledArrowBtn, StyledFetchMoreBtn } from '../StyledPager'; - import { Props, useClientSidePager } from './useClientSidePager'; export function ClientSidePager(props: Props) { diff --git a/web/packages/design/src/DataTable/Table.test.tsx b/web/packages/design/src/DataTable/Table.test.tsx index f53522f924c57..0962ad7699535 100644 --- a/web/packages/design/src/DataTable/Table.test.tsx +++ b/web/packages/design/src/DataTable/Table.test.tsx @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -import React from 'react'; import { within } from '@testing-library/react'; +import React from 'react'; -import { render, fireEvent, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; -import Table from './Table'; import { SortIndicator } from './Cells'; +import Table from './Table'; const data = [ { diff --git a/web/packages/design/src/DataTable/Table.tsx b/web/packages/design/src/DataTable/Table.tsx index fd4b76ca2378a..0e62df725146c 100644 --- a/web/packages/design/src/DataTable/Table.tsx +++ b/web/packages/design/src/DataTable/Table.tsx @@ -21,7 +21,10 @@ import React, { PropsWithChildren } from 'react'; import { Box, Flex, Indicator, Text } from 'design'; import * as Icons from 'design/Icon'; -import { StyledTable, StyledPanel } from './StyledTable'; +import { SortHeaderCell, TextCell } from './Cells'; +import InputSearch from './InputSearch'; +import { ClientSidePager, ServerSidePager } from './Pager'; +import { StyledPanel, StyledTable } from './StyledTable'; import { BasicTableProps, PagedTableProps, @@ -30,9 +33,6 @@ import { ServersideTableProps, TableProps, } from './types'; -import { SortHeaderCell, TextCell } from './Cells'; -import { ClientSidePager, ServerSidePager } from './Pager'; -import InputSearch from './InputSearch'; import useTable, { State } from './useTable'; export default function Container(props: TableProps) { diff --git a/web/packages/design/src/DataTable/index.ts b/web/packages/design/src/DataTable/index.ts index 1cefb036ed1fd..8086b17c85600 100644 --- a/web/packages/design/src/DataTable/index.ts +++ b/web/packages/design/src/DataTable/index.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import Table from './Table'; import { Cell, - TextCell, + ClickableLabelCell, DateCell, LabelCell, - ClickableLabelCell, + TextCell, } from './Cells'; import { StyledPanel } from './StyledTable'; +import Table from './Table'; export { Cell, TextCell, DateCell, LabelCell, ClickableLabelCell, StyledPanel }; export default Table; diff --git a/web/packages/design/src/DataTable/useTable.ts b/web/packages/design/src/DataTable/useTable.ts index 509227ab73398..b1c708486fa1a 100644 --- a/web/packages/design/src/DataTable/useTable.ts +++ b/web/packages/design/src/DataTable/useTable.ts @@ -21,7 +21,7 @@ import { useEffect, useState } from 'react'; import isMatch, { MatchCallback } from 'design/utils/match'; import paginateData from './Pager/paginateData'; -import { TableProps, TableColumn } from './types'; +import { TableColumn, TableProps } from './types'; export default function useTable({ data, diff --git a/web/packages/design/src/Dialog/Dialog.jsx b/web/packages/design/src/Dialog/Dialog.jsx index d4c3830114c1e..006ed76a10a81 100644 --- a/web/packages/design/src/Dialog/Dialog.jsx +++ b/web/packages/design/src/Dialog/Dialog.jsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'styled-components'; import Modal from './../Modal'; diff --git a/web/packages/design/src/Dialog/Dialog.story.jsx b/web/packages/design/src/Dialog/Dialog.story.jsx index 812401753150b..a6df53f6c2bea 100644 --- a/web/packages/design/src/Dialog/Dialog.story.jsx +++ b/web/packages/design/src/Dialog/Dialog.story.jsx @@ -19,11 +19,10 @@ import React from 'react'; import { ButtonPrimary, Input, LabelInput } from './..'; - import Dialog, { - DialogHeader, DialogContent, DialogFooter, + DialogHeader, DialogTitle, } from './index'; diff --git a/web/packages/design/src/Dialog/Dialog.test.tsx b/web/packages/design/src/Dialog/Dialog.test.tsx index f88835ef13a10..1802e2359a826 100644 --- a/web/packages/design/src/Dialog/Dialog.test.tsx +++ b/web/packages/design/src/Dialog/Dialog.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/design/src/Dialog/DialogHeader.jsx b/web/packages/design/src/Dialog/DialogHeader.jsx index ff30b39d7e65f..c63cc9283f722 100644 --- a/web/packages/design/src/Dialog/DialogHeader.jsx +++ b/web/packages/design/src/Dialog/DialogHeader.jsx @@ -17,7 +17,6 @@ */ import React from 'react'; - import styled from 'styled-components'; import { typography } from 'design/system'; diff --git a/web/packages/design/src/Dialog/index.js b/web/packages/design/src/Dialog/index.js index 0be584d831eaa..81af1d873e8c1 100644 --- a/web/packages/design/src/Dialog/index.js +++ b/web/packages/design/src/Dialog/index.js @@ -17,10 +17,10 @@ */ import Dialog from './Dialog'; -import DialogTitle from './DialogTitle'; -import DialogHeader from './DialogHeader'; import DialogContent from './DialogContent'; import DialogFooter from './DialogFooter'; +import DialogHeader from './DialogHeader'; +import DialogTitle from './DialogTitle'; export default Dialog; export { DialogTitle, DialogContent, DialogFooter, DialogHeader }; diff --git a/web/packages/design/src/DialogConfirmation/DialogConfirmation.story.tsx b/web/packages/design/src/DialogConfirmation/DialogConfirmation.story.tsx index 51e5e25ed7b8a..b5e8ccdfc7f4a 100644 --- a/web/packages/design/src/DialogConfirmation/DialogConfirmation.story.tsx +++ b/web/packages/design/src/DialogConfirmation/DialogConfirmation.story.tsx @@ -17,11 +17,10 @@ */ import { ButtonPrimary } from '../Button'; - import DialogConfirmation, { - DialogHeader, DialogContent, DialogFooter, + DialogHeader, DialogTitle, } from './index'; diff --git a/web/packages/design/src/DialogConfirmation/DialogConfirmation.test.tsx b/web/packages/design/src/DialogConfirmation/DialogConfirmation.test.tsx index 4887037fd3974..c2812d05a075e 100644 --- a/web/packages/design/src/DialogConfirmation/DialogConfirmation.test.tsx +++ b/web/packages/design/src/DialogConfirmation/DialogConfirmation.test.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { render, fireEvent } from 'design/utils/testing'; +import { fireEvent, render } from 'design/utils/testing'; import { DialogConfirmation } from './DialogConfirmation'; diff --git a/web/packages/design/src/DialogConfirmation/index.ts b/web/packages/design/src/DialogConfirmation/index.ts index 62a4d56409401..5a2f348157b78 100644 --- a/web/packages/design/src/DialogConfirmation/index.ts +++ b/web/packages/design/src/DialogConfirmation/index.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -import { DialogConfirmation } from './DialogConfirmation'; import { - DialogTitle, DialogContent, DialogFooter, DialogHeader, + DialogTitle, } from './../Dialog'; +import { DialogConfirmation } from './DialogConfirmation'; export default DialogConfirmation; export { DialogTitle, DialogContent, DialogFooter, DialogHeader }; diff --git a/web/packages/design/src/DocumentTitle/index.js b/web/packages/design/src/DocumentTitle/index.js index d5cff1fdd5f23..94b7d5824dfe9 100644 --- a/web/packages/design/src/DocumentTitle/index.js +++ b/web/packages/design/src/DocumentTitle/index.js @@ -17,4 +17,5 @@ */ import DocumentTitle from './DocumentTitle'; + export default DocumentTitle; diff --git a/web/packages/design/src/Flex/Flex.story.js b/web/packages/design/src/Flex/Flex.story.js index 1ffe5a60f0a19..6bb64389eb6f8 100644 --- a/web/packages/design/src/Flex/Flex.story.js +++ b/web/packages/design/src/Flex/Flex.story.js @@ -18,8 +18,8 @@ import React from 'react'; -import Flex from './Flex'; import Box from './../Box'; +import Flex from './Flex'; export default { title: 'Design/Flex', diff --git a/web/packages/design/src/Flex/Flex.tsx b/web/packages/design/src/Flex/Flex.tsx index f52b4da35afe1..70c2c0340c805 100644 --- a/web/packages/design/src/Flex/Flex.tsx +++ b/web/packages/design/src/Flex/Flex.tsx @@ -21,16 +21,16 @@ import styled from 'styled-components'; import { alignItems, AlignItemsProps, - justifyContent, - JustifyContentProps, flexBasis, FlexBasisProps, - flexWrap, - FlexWrapProps, flexDirection, FlexDirectionProps, + flexWrap, + FlexWrapProps, gap, GapProps, + justifyContent, + JustifyContentProps, } from 'design/system'; import Box, { BoxProps } from '../Box'; diff --git a/web/packages/design/src/Flex/index.js b/web/packages/design/src/Flex/index.js index 723555b905c59..3b766e2707f32 100644 --- a/web/packages/design/src/Flex/index.js +++ b/web/packages/design/src/Flex/index.js @@ -17,4 +17,5 @@ */ import Flex from './Flex'; + export default Flex; diff --git a/web/packages/design/src/Icon/Icon.tsx b/web/packages/design/src/Icon/Icon.tsx index 24f60236713f3..e9e5a73b87f20 100644 --- a/web/packages/design/src/Icon/Icon.tsx +++ b/web/packages/design/src/Icon/Icon.tsx @@ -19,7 +19,7 @@ import React, { PropsWithChildren } from 'react'; import styled from 'styled-components'; -import { space, color, borderRadius } from 'design/system'; +import { borderRadius, color, space } from 'design/system'; export function Icon({ size = 'medium', diff --git a/web/packages/design/src/Icon/IconCircle.tsx b/web/packages/design/src/Icon/IconCircle.tsx index 55e94a58355f2..b4c0e917a576a 100644 --- a/web/packages/design/src/Icon/IconCircle.tsx +++ b/web/packages/design/src/Icon/IconCircle.tsx @@ -17,7 +17,6 @@ */ import React from 'react'; - import { useTheme } from 'styled-components'; import { Box } from 'design'; diff --git a/web/packages/design/src/Icon/Icons.story.tsx b/web/packages/design/src/Icon/Icons.story.tsx index 1abe023ff0313..f64c7310be607 100644 --- a/web/packages/design/src/Icon/Icons.story.tsx +++ b/web/packages/design/src/Icon/Icons.story.tsx @@ -18,12 +18,10 @@ import React from 'react'; +import * as Icon from '.'; import { Text } from '..'; - import Flex from './../Flex'; -import * as Icon from '.'; - export default { title: 'Design/Icon', }; diff --git a/web/packages/design/src/Image/Image.jsx b/web/packages/design/src/Image/Image.jsx index 23602330fa5a8..06baee66ca17f 100644 --- a/web/packages/design/src/Image/Image.jsx +++ b/web/packages/design/src/Image/Image.jsx @@ -16,18 +16,18 @@ * along with this program. If not, see . */ +import PropTypes from 'prop-types'; import React from 'react'; import styled from 'styled-components'; -import PropTypes from 'prop-types'; import { - space, + alignSelf, color, - width, height, - maxWidth, maxHeight, - alignSelf, + maxWidth, + space, + width, } from 'design/system'; const Image = props => { diff --git a/web/packages/design/src/Image/Image.story.js b/web/packages/design/src/Image/Image.story.js index bd9bd97910e9c..52619dbf67113 100644 --- a/web/packages/design/src/Image/Image.story.js +++ b/web/packages/design/src/Image/Image.story.js @@ -19,7 +19,6 @@ import React from 'react'; import Image from '../Image'; - import teleportSvg from './../assets/images/enterprise-dark.svg'; export default { diff --git a/web/packages/design/src/Image/index.js b/web/packages/design/src/Image/index.js index 7332e029d75d1..2ac7853fa5017 100644 --- a/web/packages/design/src/Image/index.js +++ b/web/packages/design/src/Image/index.js @@ -17,4 +17,5 @@ */ import Image from './Image'; + export default Image; diff --git a/web/packages/design/src/Indicator/Indicator.test.tsx b/web/packages/design/src/Indicator/Indicator.test.tsx index ccf39a13fd475..cdebc716344ba 100644 --- a/web/packages/design/src/Indicator/Indicator.test.tsx +++ b/web/packages/design/src/Indicator/Indicator.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/design/src/Indicator/index.js b/web/packages/design/src/Indicator/index.js index 7bac49ad88462..10d5ff662273c 100644 --- a/web/packages/design/src/Indicator/index.js +++ b/web/packages/design/src/Indicator/index.js @@ -17,4 +17,5 @@ */ import Indicator from './Indicator'; + export default Indicator; diff --git a/web/packages/design/src/Input/Input.tsx b/web/packages/design/src/Input/Input.tsx index 59726300324d5..3946000f37210 100644 --- a/web/packages/design/src/Input/Input.tsx +++ b/web/packages/design/src/Input/Input.tsx @@ -16,17 +16,17 @@ * along with this program. If not, see . */ -import styled from 'styled-components'; import PropTypes from 'prop-types'; +import styled from 'styled-components'; import { - space, - width, color, - height, ColorProps, + height, + HeightProps, + space, SpaceProps, + width, WidthProps, - HeightProps, } from 'styled-system'; function error({ hasError, theme }) { diff --git a/web/packages/design/src/Input/index.js b/web/packages/design/src/Input/index.js index 97c71f0a0d65b..39cc5355a4f79 100644 --- a/web/packages/design/src/Input/index.js +++ b/web/packages/design/src/Input/index.js @@ -17,4 +17,5 @@ */ import Input from './Input'; + export default Input; diff --git a/web/packages/design/src/Label/Label.test.jsx b/web/packages/design/src/Label/Label.test.jsx index d112e0633d480..30f1da53d97e9 100644 --- a/web/packages/design/src/Label/Label.test.jsx +++ b/web/packages/design/src/Label/Label.test.jsx @@ -20,7 +20,7 @@ import React from 'react'; import { render, theme } from 'design/utils/testing'; -import Label, { Primary, Secondary, Warning, Danger } from './Label'; +import Label, { Danger, Primary, Secondary, Warning } from './Label'; describe('design/Label', () => { const colors = [ diff --git a/web/packages/design/src/Label/index.js b/web/packages/design/src/Label/index.js index e7c934c6f4029..2ccfbce116f92 100644 --- a/web/packages/design/src/Label/index.js +++ b/web/packages/design/src/Label/index.js @@ -16,6 +16,7 @@ * along with this program. If not, see . */ -import Label, { Primary, Secondary, Warning, Danger } from './Label'; +import Label, { Danger, Primary, Secondary, Warning } from './Label'; + export default Label; export { Primary, Secondary, Warning, Danger }; diff --git a/web/packages/design/src/LabelInput/LabelInput.story.jsx b/web/packages/design/src/LabelInput/LabelInput.story.jsx index c496b21b22745..2c3f2aed6ba0a 100644 --- a/web/packages/design/src/LabelInput/LabelInput.story.jsx +++ b/web/packages/design/src/LabelInput/LabelInput.story.jsx @@ -18,8 +18,8 @@ import React from 'react'; -import LabelInput from './LabelInput'; import InputComp from './../Input'; +import LabelInput from './LabelInput'; export default { title: 'Design/LabelInput', diff --git a/web/packages/design/src/LabelInput/LabelInput.tsx b/web/packages/design/src/LabelInput/LabelInput.tsx index 6f2d13013bf06..f729b74f3c3b7 100644 --- a/web/packages/design/src/LabelInput/LabelInput.tsx +++ b/web/packages/design/src/LabelInput/LabelInput.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import styled from 'styled-components'; import PropTypes from 'prop-types'; +import styled from 'styled-components'; import { space, SpaceProps } from 'design/system'; diff --git a/web/packages/design/src/LabelInput/index.js b/web/packages/design/src/LabelInput/index.js index 42c2d5f17b130..161668d4d5a27 100644 --- a/web/packages/design/src/LabelInput/index.js +++ b/web/packages/design/src/LabelInput/index.js @@ -17,4 +17,5 @@ */ import LabelInput from './LabelInput'; + export default LabelInput; diff --git a/web/packages/design/src/LabelState/LabelState.test.jsx b/web/packages/design/src/LabelState/LabelState.test.jsx index 9939fd81b28d6..45bc2fe8cfab1 100644 --- a/web/packages/design/src/LabelState/LabelState.test.jsx +++ b/web/packages/design/src/LabelState/LabelState.test.jsx @@ -23,8 +23,8 @@ import { render, theme } from 'design/utils/testing'; import LabelState, { StateDanger, StateInfo, - StateWarning, StateSuccess, + StateWarning, } from './LabelState'; const colors = { diff --git a/web/packages/design/src/LabelState/LabelState.tsx b/web/packages/design/src/LabelState/LabelState.tsx index 14c3b67dfcfad..5df00f7637735 100644 --- a/web/packages/design/src/LabelState/LabelState.tsx +++ b/web/packages/design/src/LabelState/LabelState.tsx @@ -20,17 +20,17 @@ import React from 'react'; import styled from 'styled-components'; import { - fontSize, - FontSizeProps, color, ColorProps, - width, - WidthProps, + fontSize, + FontSizeProps, space, SpaceProps, + width, + WidthProps, } from 'design/system'; -import { fade } from 'design/theme/utils/colorManipulator'; import { Theme } from 'design/theme/themes/types'; +import { fade } from 'design/theme/utils/colorManipulator'; export type LabelKind = | 'primary' diff --git a/web/packages/design/src/LabelState/index.js b/web/packages/design/src/LabelState/index.js index 7cebf1608815c..c2bfd9fadb581 100644 --- a/web/packages/design/src/LabelState/index.js +++ b/web/packages/design/src/LabelState/index.js @@ -19,9 +19,10 @@ import LabelState, { StateDanger, StateInfo, - StateWarning, StateSuccess, + StateWarning, } from './LabelState'; + export default LabelState; export { StateDanger, StateInfo, StateWarning, StateSuccess }; diff --git a/web/packages/design/src/Link/Link.jsx b/web/packages/design/src/Link/Link.jsx index 260c31f85094b..d35b49f900278 100644 --- a/web/packages/design/src/Link/Link.jsx +++ b/web/packages/design/src/Link/Link.jsx @@ -19,7 +19,7 @@ import React from 'react'; import styled from 'styled-components'; -import { space, color } from 'design/system'; +import { color, space } from 'design/system'; function Link({ ...props }) { return ; diff --git a/web/packages/design/src/Link/index.js b/web/packages/design/src/Link/index.js index 050436180418d..bdccb35999514 100644 --- a/web/packages/design/src/Link/index.js +++ b/web/packages/design/src/Link/index.js @@ -17,4 +17,5 @@ */ import Link from './Link'; + export default Link; diff --git a/web/packages/design/src/Menu/Menu.jsx b/web/packages/design/src/Menu/Menu.jsx index 5b664fa3a3049..30d2740be00ed 100644 --- a/web/packages/design/src/Menu/Menu.jsx +++ b/web/packages/design/src/Menu/Menu.jsx @@ -16,12 +16,11 @@ * along with this program. If not, see . */ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import ReactDOM from 'react-dom'; import Popover from '../Popover'; - import getScrollbarSize from './../utils/scrollbarSize'; import MenuList from './MenuList'; diff --git a/web/packages/design/src/Menu/Menu.story.js b/web/packages/design/src/Menu/Menu.story.js index e7163eae7f11e..485d4acd2469a 100644 --- a/web/packages/design/src/Menu/Menu.story.js +++ b/web/packages/design/src/Menu/Menu.story.js @@ -18,14 +18,13 @@ import React from 'react'; -import { ButtonPrimary } from '../Button'; import Box from '../Box'; +import { ButtonPrimary } from '../Button'; import Flex from '../Flex'; import * as Icons from '../Icon'; - -import MenuItemIcon from './MenuItemIcon'; -import MenuItem from './MenuItem'; import Menu from './Menu'; +import MenuItem from './MenuItem'; +import MenuItemIcon from './MenuItemIcon'; export default { title: 'Design/Menu', diff --git a/web/packages/design/src/Menu/Menu.story.test.tsx b/web/packages/design/src/Menu/Menu.story.test.tsx index 5f4f768207d1c..bd189666be132 100644 --- a/web/packages/design/src/Menu/Menu.story.test.tsx +++ b/web/packages/design/src/Menu/Menu.story.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/design/src/Menu/MenuItem.tsx b/web/packages/design/src/Menu/MenuItem.tsx index a13f852f5b934..77359e5740ea6 100644 --- a/web/packages/design/src/Menu/MenuItem.tsx +++ b/web/packages/design/src/Menu/MenuItem.tsx @@ -18,12 +18,12 @@ import styled from 'styled-components'; import { - fontSize, color, - space, + ColorProps, + fontSize, FontSizeProps, + space, SpaceProps, - ColorProps, } from 'styled-system'; import { Theme } from 'design/theme/themes/types'; diff --git a/web/packages/design/src/Menu/MenuList.jsx b/web/packages/design/src/Menu/MenuList.jsx index df6b36e1302e3..23ea39ebf30ae 100644 --- a/web/packages/design/src/Menu/MenuList.jsx +++ b/web/packages/design/src/Menu/MenuList.jsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'styled-components'; class MenuList extends React.Component { diff --git a/web/packages/design/src/Menu/index.js b/web/packages/design/src/Menu/index.js index 6a606c399365c..a780f468affe3 100644 --- a/web/packages/design/src/Menu/index.js +++ b/web/packages/design/src/Menu/index.js @@ -19,5 +19,6 @@ import Menu from './Menu'; import MenuItem from './MenuItem'; import MenuItemIcon from './MenuItemIcon'; + export default Menu; export { MenuItem, MenuItemIcon }; diff --git a/web/packages/design/src/Modal/Modal.jsx b/web/packages/design/src/Modal/Modal.jsx index 0599b73a56fb2..35dee65b362e8 100644 --- a/web/packages/design/src/Modal/Modal.jsx +++ b/web/packages/design/src/Modal/Modal.jsx @@ -16,9 +16,9 @@ * along with this program. If not, see . */ +import PropTypes from 'prop-types'; import React from 'react'; import styled from 'styled-components'; -import PropTypes from 'prop-types'; import { ownerDocument } from './../utils'; import Portal from './Portal'; diff --git a/web/packages/design/src/Modal/Modal.test.tsx b/web/packages/design/src/Modal/Modal.test.tsx index 041786aa61037..5d4e64bec3929 100644 --- a/web/packages/design/src/Modal/Modal.test.tsx +++ b/web/packages/design/src/Modal/Modal.test.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; -import { render, fireEvent } from 'design/utils/testing'; +import { fireEvent, render } from 'design/utils/testing'; import Modal from './Modal'; diff --git a/web/packages/design/src/Modal/Portal.jsx b/web/packages/design/src/Modal/Portal.jsx index 1e11f0a295309..11f98030e461a 100644 --- a/web/packages/design/src/Modal/Portal.jsx +++ b/web/packages/design/src/Modal/Portal.jsx @@ -16,9 +16,9 @@ * along with this program. If not, see . */ +import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; -import PropTypes from 'prop-types'; import { ownerDocument } from './../utils'; diff --git a/web/packages/design/src/Modal/Portal.test.tsx b/web/packages/design/src/Modal/Portal.test.tsx index 5c2a0b0129185..be85b2067d3e6 100644 --- a/web/packages/design/src/Modal/Portal.test.tsx +++ b/web/packages/design/src/Modal/Portal.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/design/src/Modal/RootRef.jsx b/web/packages/design/src/Modal/RootRef.jsx index b4f49a6e280dd..06746a1eef398 100644 --- a/web/packages/design/src/Modal/RootRef.jsx +++ b/web/packages/design/src/Modal/RootRef.jsx @@ -16,9 +16,9 @@ * along with this program. If not, see . */ +import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; -import PropTypes from 'prop-types'; class RootRef extends React.Component { componentDidMount() { diff --git a/web/packages/design/src/Modal/index.js b/web/packages/design/src/Modal/index.js index adfe116bb3d83..7853a26f6c29e 100644 --- a/web/packages/design/src/Modal/index.js +++ b/web/packages/design/src/Modal/index.js @@ -17,4 +17,5 @@ */ import Modal from './Modal'; + export default Modal; diff --git a/web/packages/design/src/MultiRowBox/MultiRowBox.tsx b/web/packages/design/src/MultiRowBox/MultiRowBox.tsx index 2ab551cdfde7b..f22c37d13dc56 100644 --- a/web/packages/design/src/MultiRowBox/MultiRowBox.tsx +++ b/web/packages/design/src/MultiRowBox/MultiRowBox.tsx @@ -17,7 +17,6 @@ */ import React, { ReactNode } from 'react'; - import styled from 'styled-components'; import { Box } from 'design'; diff --git a/web/packages/design/src/Onboard/OnboardFooter.test.tsx b/web/packages/design/src/Onboard/OnboardFooter.test.tsx index 0f44cc0547a0c..abe0be78185c0 100644 --- a/web/packages/design/src/Onboard/OnboardFooter.test.tsx +++ b/web/packages/design/src/Onboard/OnboardFooter.test.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import { render, screen } from 'design/utils/testing'; import { OnboardFooter } from 'design/Onboard/OnboardFooter'; +import { render, screen } from 'design/utils/testing'; test('renders RR, TOS, and PP', () => { render(); diff --git a/web/packages/design/src/Onboard/OnboardFooter.tsx b/web/packages/design/src/Onboard/OnboardFooter.tsx index 1719d9fcd06b0..2e14e9e4dd72b 100644 --- a/web/packages/design/src/Onboard/OnboardFooter.tsx +++ b/web/packages/design/src/Onboard/OnboardFooter.tsx @@ -17,7 +17,6 @@ */ import React from 'react'; - import styled from 'styled-components'; import { Flex, Link, Text } from 'design'; diff --git a/web/packages/design/src/Onboard/WelcomeWrapper.story.tsx b/web/packages/design/src/Onboard/WelcomeWrapper.story.tsx index ec586dbc53d43..895760102d454 100644 --- a/web/packages/design/src/Onboard/WelcomeWrapper.story.tsx +++ b/web/packages/design/src/Onboard/WelcomeWrapper.story.tsx @@ -18,9 +18,9 @@ import React from 'react'; -import { WelcomeWrapper } from 'design/Onboard/WelcomeWrapper'; -import { OnboardCard } from 'design/Onboard/OnboardCard'; import { Text } from 'design'; +import { OnboardCard } from 'design/Onboard/OnboardCard'; +import { WelcomeWrapper } from 'design/Onboard/WelcomeWrapper'; export default { title: 'Design/Onboard', diff --git a/web/packages/design/src/Onboard/WelcomeWrapper.tsx b/web/packages/design/src/Onboard/WelcomeWrapper.tsx index 4a6bf8e00980a..e876cc09ce22b 100644 --- a/web/packages/design/src/Onboard/WelcomeWrapper.tsx +++ b/web/packages/design/src/Onboard/WelcomeWrapper.tsx @@ -17,14 +17,13 @@ */ import React from 'react'; - import styled from 'styled-components'; -import { LogoHero } from 'teleport/components/LogoHero'; - import { Box, Flex } from 'design'; import cloudCity from 'design/assets/images/backgrounds/cloud-city.png'; +import { LogoHero } from 'teleport/components/LogoHero'; + import { OnboardFooter } from './OnboardFooter'; export const WelcomeWrapper = ({ children }) => { diff --git a/web/packages/design/src/Pill/Pill.test.tsx b/web/packages/design/src/Pill/Pill.test.tsx index 5f36a507b4b59..4181bb3dfd5fd 100644 --- a/web/packages/design/src/Pill/Pill.test.tsx +++ b/web/packages/design/src/Pill/Pill.test.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; -import { render, fireEvent } from 'design/utils/testing'; +import { fireEvent, render } from 'design/utils/testing'; import { Pill } from './Pill'; diff --git a/web/packages/design/src/Popover/Popover.jsx b/web/packages/design/src/Popover/Popover.jsx index 00d2857593178..154ba6d29653f 100644 --- a/web/packages/design/src/Popover/Popover.jsx +++ b/web/packages/design/src/Popover/Popover.jsx @@ -40,14 +40,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import React from 'react'; -import styled from 'styled-components'; import PropTypes from 'prop-types'; +import React from 'react'; import ReactDOM from 'react-dom'; +import styled from 'styled-components'; -import { ownerWindow, ownerDocument } from '../utils'; import Modal from '../Modal'; - +import { ownerDocument, ownerWindow } from '../utils'; import Transition from './Transition'; function getOffsetTop(rect, vertical) { diff --git a/web/packages/design/src/Popover/Popover.story.js b/web/packages/design/src/Popover/Popover.story.js index 06303d149c8e8..9e431dd531cfc 100644 --- a/web/packages/design/src/Popover/Popover.story.js +++ b/web/packages/design/src/Popover/Popover.story.js @@ -19,8 +19,7 @@ import React from 'react'; import styled from 'styled-components'; -import { ButtonPrimary, Box, Flex, Text } from '../'; - +import { Box, ButtonPrimary, Flex, Text } from '../'; import Popover from './../Popover'; export default { diff --git a/web/packages/design/src/Popover/Popover.story.test.tsx b/web/packages/design/src/Popover/Popover.story.test.tsx index b35cb266e03c8..0349a5771454f 100644 --- a/web/packages/design/src/Popover/Popover.story.test.tsx +++ b/web/packages/design/src/Popover/Popover.story.test.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; -import { render, fireEvent } from 'design/utils/testing'; +import { fireEvent, render } from 'design/utils/testing'; import { Sample, Tooltip } from './Popover.story'; diff --git a/web/packages/design/src/ResourceIcon/ResourceIcon.story.tsx b/web/packages/design/src/ResourceIcon/ResourceIcon.story.tsx index e7435b87001a7..6b52251a5af5d 100644 --- a/web/packages/design/src/ResourceIcon/ResourceIcon.story.tsx +++ b/web/packages/design/src/ResourceIcon/ResourceIcon.story.tsx @@ -19,8 +19,8 @@ import React, { PropsWithChildren } from 'react'; import { useTheme } from 'styled-components'; -import { ResourceIcon } from 'design/ResourceIcon'; import { Flex, Text } from 'design'; +import { ResourceIcon } from 'design/ResourceIcon'; import { iconNames } from './resourceIconSpecs'; diff --git a/web/packages/design/src/ResourceIcon/icons.ts b/web/packages/design/src/ResourceIcon/icons.ts index ac0dab5304745..0880dfae0e23f 100644 --- a/web/packages/design/src/ResourceIcon/icons.ts +++ b/web/packages/design/src/ResourceIcon/icons.ts @@ -17,10 +17,10 @@ */ import activemq from './assets/activemq.svg'; +import adobe from './assets/adobe.svg'; import adobecreativecloudDark from './assets/adobecreativecloud-dark.svg'; import adobecreativecloudLight from './assets/adobecreativecloud-light.svg'; import adobemarketo from './assets/adobemarketo.svg'; -import adobe from './assets/adobe.svg'; import airbase from './assets/airbase.svg'; import airtable from './assets/airtable.svg'; import algoliaDark from './assets/algolia-dark.svg'; @@ -39,10 +39,10 @@ import argocd from './assets/argocd.svg'; import asana from './assets/asana.svg'; import assembleDark from './assets/assemble-dark.svg'; import assembleLight from './assets/assemble-light.svg'; +import atlassian from './assets/atlassian.svg'; import atlassianbitbucket from './assets/atlassianbitbucket.svg'; import atlassianjiraservicemanagement from './assets/atlassianjiraservicemanagement.svg'; import atlassianstatuspage from './assets/atlassianstatuspage.svg'; -import atlassian from './assets/atlassian.svg'; import auth0Dark from './assets/auth0-dark.svg'; import auth0Light from './assets/auth0-light.svg'; import avalara from './assets/avalara.svg'; @@ -63,6 +63,8 @@ import cartaDark from './assets/carta-dark.svg'; import cartaLight from './assets/carta-light.svg'; import checkly from './assets/checkly.svg'; import checkr from './assets/checkr.svg'; +import ciliumDark from './assets/cilium-dark.svg'; +import ciliumLight from './assets/cilium-light.svg'; import circleciDark from './assets/circleci-dark.svg'; import circleciLight from './assets/circleci-light.svg'; import clari from './assets/clari.svg'; @@ -146,8 +148,6 @@ import hackeroneDark from './assets/hackerone-dark.svg'; import hackeroneLight from './assets/hackerone-light.svg'; import headliner from './assets/headliner.svg'; import hootsuite from './assets/hootsuite.svg'; -import ciliumDark from './assets/cilium-dark.svg'; -import ciliumLight from './assets/cilium-light.svg'; import ibmDark from './assets/ibm-dark.svg'; import ibmLight from './assets/ibm-light.svg'; import inkeep from './assets/inkeep.svg'; diff --git a/web/packages/design/src/ResourceIcon/index.tsx b/web/packages/design/src/ResourceIcon/index.tsx index 209b1c7f641d2..13c756c820d16 100644 --- a/web/packages/design/src/ResourceIcon/index.tsx +++ b/web/packages/design/src/ResourceIcon/index.tsx @@ -22,9 +22,9 @@ import { useTheme } from 'styled-components'; import { Image } from 'design'; import { + iconNames, ResourceIconName, resourceIconSpecs, - iconNames, } from './resourceIconSpecs'; interface ResourceIconProps extends ComponentProps { diff --git a/web/packages/design/src/SVGIcon/AWS.tsx b/web/packages/design/src/SVGIcon/AWS.tsx index 10299e2221092..e6b80784031fd 100644 --- a/web/packages/design/src/SVGIcon/AWS.tsx +++ b/web/packages/design/src/SVGIcon/AWS.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function AWSIcon({ size = 24, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Ansible.tsx b/web/packages/design/src/SVGIcon/Ansible.tsx index 5f5f2c3982184..ebc4963c0cd30 100644 --- a/web/packages/design/src/SVGIcon/Ansible.tsx +++ b/web/packages/design/src/SVGIcon/Ansible.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function AnsibleIcon({ size = 100, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Azure.tsx b/web/packages/design/src/SVGIcon/Azure.tsx index 6ef707b86dc66..2942df77e67a2 100644 --- a/web/packages/design/src/SVGIcon/Azure.tsx +++ b/web/packages/design/src/SVGIcon/Azure.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function AzureIcon({ size = 80, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Bug.tsx b/web/packages/design/src/SVGIcon/Bug.tsx index ca27faed1fc3a..67ba3d0d777bb 100644 --- a/web/packages/design/src/SVGIcon/Bug.tsx +++ b/web/packages/design/src/SVGIcon/Bug.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function BugIcon({ size = 32, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/ChevronRight.tsx b/web/packages/design/src/SVGIcon/ChevronRight.tsx index c0c8eeb52ea06..7cd5b05880ccf 100644 --- a/web/packages/design/src/SVGIcon/ChevronRight.tsx +++ b/web/packages/design/src/SVGIcon/ChevronRight.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function ChevronRightIcon({ size = 14, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/CircleCI.tsx b/web/packages/design/src/SVGIcon/CircleCI.tsx index 36a6d56e04d3b..3645738cd3dc7 100644 --- a/web/packages/design/src/SVGIcon/CircleCI.tsx +++ b/web/packages/design/src/SVGIcon/CircleCI.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function CircleCIIcon({ size = 104, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/ExternalLink.tsx b/web/packages/design/src/SVGIcon/ExternalLink.tsx index 42d87c2849e31..206f4e6749f27 100644 --- a/web/packages/design/src/SVGIcon/ExternalLink.tsx +++ b/web/packages/design/src/SVGIcon/ExternalLink.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function ExternalLinkIcon({ size = 22, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/GCP.tsx b/web/packages/design/src/SVGIcon/GCP.tsx index a85103bb23e04..885a628edf746 100644 --- a/web/packages/design/src/SVGIcon/GCP.tsx +++ b/web/packages/design/src/SVGIcon/GCP.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function GCPIcon({ size = 80, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/GitHub.tsx b/web/packages/design/src/SVGIcon/GitHub.tsx index f1b786ec9cf98..123e948d3cd14 100644 --- a/web/packages/design/src/SVGIcon/GitHub.tsx +++ b/web/packages/design/src/SVGIcon/GitHub.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function GitHubIcon({ size = 98, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/GitLab.tsx b/web/packages/design/src/SVGIcon/GitLab.tsx index f94c459a2c681..3be559146b9a4 100644 --- a/web/packages/design/src/SVGIcon/GitLab.tsx +++ b/web/packages/design/src/SVGIcon/GitLab.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function GitLabIcon({ size = 80, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Jenkins.tsx b/web/packages/design/src/SVGIcon/Jenkins.tsx index b77ffc9b794e7..42aa1a5420b10 100644 --- a/web/packages/design/src/SVGIcon/Jenkins.tsx +++ b/web/packages/design/src/SVGIcon/Jenkins.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function JenkinsIcon({ size = 64, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Kubernetes.tsx b/web/packages/design/src/SVGIcon/Kubernetes.tsx index a054283dfa956..0d597016920d4 100644 --- a/web/packages/design/src/SVGIcon/Kubernetes.tsx +++ b/web/packages/design/src/SVGIcon/Kubernetes.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function KubernetesIcon({ size = 20, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Lock.tsx b/web/packages/design/src/SVGIcon/Lock.tsx index a4ff4f045e755..30b7f7e9b4a7f 100644 --- a/web/packages/design/src/SVGIcon/Lock.tsx +++ b/web/packages/design/src/SVGIcon/Lock.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function LockIcon({ size = 13, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Okta.tsx b/web/packages/design/src/SVGIcon/Okta.tsx index 3482b359e88a5..bb1ba1408c810 100644 --- a/web/packages/design/src/SVGIcon/Okta.tsx +++ b/web/packages/design/src/SVGIcon/Okta.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function OktaIcon({ size = 16, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/SVGIcon.tsx b/web/packages/design/src/SVGIcon/SVGIcon.tsx index c2cdb0ad00337..1260bcb4fa42f 100644 --- a/web/packages/design/src/SVGIcon/SVGIcon.tsx +++ b/web/packages/design/src/SVGIcon/SVGIcon.tsx @@ -17,7 +17,6 @@ */ import React from 'react'; - import { useTheme } from 'styled-components'; export function SVGIcon({ diff --git a/web/packages/design/src/SVGIcon/ServerIcon.tsx b/web/packages/design/src/SVGIcon/ServerIcon.tsx index 310682bda1003..3c797066b64e9 100644 --- a/web/packages/design/src/SVGIcon/ServerIcon.tsx +++ b/web/packages/design/src/SVGIcon/ServerIcon.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function ServerIcon({ size = 48, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Servers.tsx b/web/packages/design/src/SVGIcon/Servers.tsx index 2095c6aa38bd1..e21a24ab3a1a2 100644 --- a/web/packages/design/src/SVGIcon/Servers.tsx +++ b/web/packages/design/src/SVGIcon/Servers.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function ServersIcon({ size = 20, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/Spacelift.tsx b/web/packages/design/src/SVGIcon/Spacelift.tsx index 0132c844cbef9..3abdfb0332618 100644 --- a/web/packages/design/src/SVGIcon/Spacelift.tsx +++ b/web/packages/design/src/SVGIcon/Spacelift.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function SpaceliftIcon({ size = 80, fill }: SVGIconProps) { return ( diff --git a/web/packages/design/src/SVGIcon/SvgIcon.story.tsx b/web/packages/design/src/SVGIcon/SvgIcon.story.tsx index 9fac1ffcab654..03e42b780333b 100644 --- a/web/packages/design/src/SVGIcon/SvgIcon.story.tsx +++ b/web/packages/design/src/SVGIcon/SvgIcon.story.tsx @@ -17,16 +17,14 @@ */ import React from 'react'; - import { useTheme } from 'styled-components'; import { IconCircle } from 'design/Icon/IconCircle'; +import * as SvgIcons from '.'; import Flex from '../Flex'; import Text from '../Text'; -import * as SvgIcons from '.'; - export default { title: 'Design/Icon', }; diff --git a/web/packages/design/src/SVGIcon/TeleportGearIcon.tsx b/web/packages/design/src/SVGIcon/TeleportGearIcon.tsx index 3d1dd7904855f..a242d6dd17274 100644 --- a/web/packages/design/src/SVGIcon/TeleportGearIcon.tsx +++ b/web/packages/design/src/SVGIcon/TeleportGearIcon.tsx @@ -17,12 +17,10 @@ */ import React from 'react'; - import { useTheme } from 'styled-components'; -import { SVGIcon } from './SVGIcon'; - import type { SVGIconProps } from './common'; +import { SVGIcon } from './SVGIcon'; export function TeleportGearIcon({ size = 16 }: Omit) { const theme = useTheme(); diff --git a/web/packages/design/src/SideNav/SideNav.test.tsx b/web/packages/design/src/SideNav/SideNav.test.tsx index 1761099cf3cdc..75a52dd094964 100644 --- a/web/packages/design/src/SideNav/SideNav.test.tsx +++ b/web/packages/design/src/SideNav/SideNav.test.tsx @@ -16,13 +16,12 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; import { render } from 'design/utils/testing'; import * as Icons from '../Icon'; - import SideNav, { SideNavItem, SideNavItemIcon } from './index'; test('renders: SideNav, SideNavItem, SideNavItemIcon', () => { diff --git a/web/packages/design/src/SideNav/SideNavItem.jsx b/web/packages/design/src/SideNav/SideNavItem.jsx index 999b63e6fbadc..b6aad4abe7888 100644 --- a/web/packages/design/src/SideNav/SideNavItem.jsx +++ b/web/packages/design/src/SideNav/SideNavItem.jsx @@ -18,8 +18,8 @@ import styled from 'styled-components'; -import { borderColor } from './../system'; import Flex from './../Flex'; +import { borderColor } from './../system'; const fromTheme = ({ theme }) => { return { diff --git a/web/packages/design/src/SideNav/Sidenav.story.js b/web/packages/design/src/SideNav/Sidenav.story.js index c285beca7b677..6205a689c12fb 100644 --- a/web/packages/design/src/SideNav/Sidenav.story.js +++ b/web/packages/design/src/SideNav/Sidenav.story.js @@ -19,7 +19,6 @@ import React from 'react'; import * as Icons from '../Icon'; - import SideNav, { SideNavItem, SideNavItemIcon } from './index'; export default { diff --git a/web/packages/design/src/SideNav/index.js b/web/packages/design/src/SideNav/index.js index 08fe4ac1f8f52..7c34271562566 100644 --- a/web/packages/design/src/SideNav/index.js +++ b/web/packages/design/src/SideNav/index.js @@ -19,6 +19,7 @@ import SideNav from './SideNav'; import SideNavItem from './SideNavItem'; import SideNavItemIcon from './SideNavItemIcon'; + export default SideNav; export { SideNavItem, SideNavItemIcon }; diff --git a/web/packages/design/src/SlidePanel/SlidePanel.test.tsx b/web/packages/design/src/SlidePanel/SlidePanel.test.tsx index 0d7e95a131c7a..938218061841e 100644 --- a/web/packages/design/src/SlidePanel/SlidePanel.test.tsx +++ b/web/packages/design/src/SlidePanel/SlidePanel.test.tsx @@ -16,10 +16,11 @@ * along with this program. If not, see . */ -import React from 'react'; import userEvent from '@testing-library/user-event'; +import React from 'react'; import { render, screen } from 'design/utils/testing'; + import '@testing-library/jest-dom'; import { SlidePanel } from './SlidePanel'; diff --git a/web/packages/design/src/SlidePanel/SlidePanel.tsx b/web/packages/design/src/SlidePanel/SlidePanel.tsx index 882c8e5d6fd68..852bd771d62f6 100644 --- a/web/packages/design/src/SlidePanel/SlidePanel.tsx +++ b/web/packages/design/src/SlidePanel/SlidePanel.tsx @@ -19,9 +19,8 @@ import React, { PropsWithChildren } from 'react'; import styled from 'styled-components'; -import { useEscape } from 'shared/hooks/useEscape'; - import { Box } from 'design'; +import { useEscape } from 'shared/hooks/useEscape'; export type Positions = 'open' | 'closed'; diff --git a/web/packages/design/src/SlideTabs/SlideTabs.test.tsx b/web/packages/design/src/SlideTabs/SlideTabs.test.tsx index 12034f7b5f8aa..0fd74d27c33b2 100644 --- a/web/packages/design/src/SlideTabs/SlideTabs.test.tsx +++ b/web/packages/design/src/SlideTabs/SlideTabs.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; import { screen } from '@testing-library/react'; +import React, { useState } from 'react'; import { render, userEvent } from 'design/utils/testing'; diff --git a/web/packages/design/src/StepSlider/StepSlider.story.tsx b/web/packages/design/src/StepSlider/StepSlider.story.tsx index 13ca83a12a76c..c2d65d699cd35 100644 --- a/web/packages/design/src/StepSlider/StepSlider.story.tsx +++ b/web/packages/design/src/StepSlider/StepSlider.story.tsx @@ -18,8 +18,7 @@ import React, { useState } from 'react'; -import { Box, ButtonLink, ButtonPrimary, Text, Card } from 'design'; - +import { Box, ButtonLink, ButtonPrimary, Card, Text } from 'design'; import { OnboardCard } from 'design/Onboard/OnboardCard'; import { NewFlow, StepComponentProps, StepSlider } from './StepSlider'; diff --git a/web/packages/design/src/StepSlider/StepSlider.test.tsx b/web/packages/design/src/StepSlider/StepSlider.test.tsx index aec7a11831649..bdcb99ddaa9d7 100644 --- a/web/packages/design/src/StepSlider/StepSlider.test.tsx +++ b/web/packages/design/src/StepSlider/StepSlider.test.tsx @@ -18,11 +18,11 @@ import React from 'react'; -import { render, fireEvent, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { - SingleFlowInPlaceSlider, MultiFlowWheelSlider, + SingleFlowInPlaceSlider, } from './StepSlider.story'; test('single flow', () => { diff --git a/web/packages/design/src/Text/Text.tsx b/web/packages/design/src/Text/Text.tsx index a2637e9a676f5..b0ed6780f4a75 100644 --- a/web/packages/design/src/Text/Text.tsx +++ b/web/packages/design/src/Text/Text.tsx @@ -16,24 +16,22 @@ * along with this program. If not, see . */ +import { Property } from 'csstype'; import styled from 'styled-components'; - import { ResponsiveValue } from 'styled-system'; -import { Property } from 'csstype'; - import { - typography, - TypographyProps, + color, + ColorProps, fontSize, FontSizeProps, + fontWeight, space, SpaceProps, - color, - ColorProps, textAlign, TextAlignProps, - fontWeight, + typography, + TypographyProps, } from 'design/system'; import { fontWeights } from 'design/theme/typography'; diff --git a/web/packages/design/src/Text/index.js b/web/packages/design/src/Text/index.js index d4c1d1a1bbaf6..47a9a5cf65e25 100644 --- a/web/packages/design/src/Text/index.js +++ b/web/packages/design/src/Text/index.js @@ -17,6 +17,7 @@ */ import Text from './Text'; + export { H1, H2, diff --git a/web/packages/design/src/TextArea/TextArea.tsx b/web/packages/design/src/TextArea/TextArea.tsx index b32f74d88b375..f354c0b7379da 100644 --- a/web/packages/design/src/TextArea/TextArea.tsx +++ b/web/packages/design/src/TextArea/TextArea.tsx @@ -18,14 +18,14 @@ import styled, { CSSObject } from 'styled-components'; import { - space, - width, color, - height, ColorProps, + height, + HeightProps, + space, SpaceProps, + width, WidthProps, - HeightProps, } from 'styled-system'; export interface TextAreaProps diff --git a/web/packages/design/src/ThemeProvider/globals.js b/web/packages/design/src/ThemeProvider/globals.js index 7f3de31e2065c..3e9c2bf7219a1 100644 --- a/web/packages/design/src/ThemeProvider/globals.js +++ b/web/packages/design/src/ThemeProvider/globals.js @@ -17,6 +17,7 @@ */ import { createGlobalStyle } from 'styled-components'; + import './../assets/ubuntu/style.css'; const GlobalStyle = createGlobalStyle` diff --git a/web/packages/design/src/ThemeProvider/index.tsx b/web/packages/design/src/ThemeProvider/index.tsx index b3b8b45a8c2b1..ae15948b17e87 100644 --- a/web/packages/design/src/ThemeProvider/index.tsx +++ b/web/packages/design/src/ThemeProvider/index.tsx @@ -18,18 +18,16 @@ import React, { useEffect, useState } from 'react'; import { - StyleSheetManager, ThemeProvider as StyledThemeProvider, + StyleSheetManager, } from 'styled-components'; -import { KeysEnum, storageService } from 'teleport/services/storageService'; - -import cfg from 'teleport/config'; - import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; -import { darkTheme, lightTheme, bblpTheme } from '../theme'; +import cfg from 'teleport/config'; +import { KeysEnum, storageService } from 'teleport/services/storageService'; +import { bblpTheme, darkTheme, lightTheme } from '../theme'; import { GlobalStyle } from './globals'; function themePreferenceToTheme(themePreference: Theme) { diff --git a/web/packages/design/src/Toggle/Toggle.story.tsx b/web/packages/design/src/Toggle/Toggle.story.tsx index ec23c98ed69a0..0a24d2b238b03 100644 --- a/web/packages/design/src/Toggle/Toggle.story.tsx +++ b/web/packages/design/src/Toggle/Toggle.story.tsx @@ -18,9 +18,8 @@ import React, { useState } from 'react'; -import Text from '../Text'; import Flex from '../Flex'; - +import Text from '../Text'; import { Toggle } from './Toggle'; export default { diff --git a/web/packages/design/src/TopNav/TopNavItem.jsx b/web/packages/design/src/TopNav/TopNavItem.jsx index b0ec6134bf1ea..c3d5fad7fcbc9 100644 --- a/web/packages/design/src/TopNav/TopNavItem.jsx +++ b/web/packages/design/src/TopNav/TopNavItem.jsx @@ -18,7 +18,7 @@ import styled from 'styled-components'; -import { space, width, maxWidth, height, maxHeight } from 'design/system'; +import { height, maxHeight, maxWidth, space, width } from 'design/system'; /** * TopNavItem diff --git a/web/packages/design/src/TopNav/index.js b/web/packages/design/src/TopNav/index.js index 79f60b7a6b13a..565035b27d344 100644 --- a/web/packages/design/src/TopNav/index.js +++ b/web/packages/design/src/TopNav/index.js @@ -17,4 +17,5 @@ */ import TopNav from './TopNav'; + export default TopNav; diff --git a/web/packages/design/src/buttons.story.tsx b/web/packages/design/src/buttons.story.tsx index d7c7302e22d3a..097a90f4d3d23 100644 --- a/web/packages/design/src/buttons.story.tsx +++ b/web/packages/design/src/buttons.story.tsx @@ -20,18 +20,18 @@ import React from 'react'; import { MenuItem } from 'design'; -import ButtonLink from './ButtonLink'; -import ButtonIcon from './ButtonIcon'; -import * as icons from './Icon'; -import Flex from './Flex'; import Button, { + ButtonBorder, ButtonPrimary, ButtonSecondary, - ButtonWarning, - ButtonBorder, ButtonText, + ButtonWarning, } from './Button'; +import ButtonIcon from './ButtonIcon'; +import ButtonLink from './ButtonLink'; import { ButtonWithMenu } from './ButtonWithMenu'; +import Flex from './Flex'; +import * as icons from './Icon'; export default { title: 'Design/Button', diff --git a/web/packages/design/src/index.ts b/web/packages/design/src/index.ts index c9cd66f1222ad..9ec0715d67b9d 100644 --- a/web/packages/design/src/index.ts +++ b/web/packages/design/src/index.ts @@ -19,11 +19,11 @@ import Alert from './Alert'; import Box from './Box'; import Button, { + ButtonBorder, ButtonPrimary, - ButtonWarning, ButtonSecondary, - ButtonBorder, ButtonText, + ButtonWarning, } from './Button'; import ButtonIcon from './ButtonIcon'; import ButtonLink from './ButtonLink'; @@ -31,6 +31,8 @@ import { ButtonWithMenu } from './ButtonWithMenu'; import Card from './Card'; import CardSuccess, { CardSuccessLogin } from './CardSuccess'; import DocumentTitle from './DocumentTitle'; +import Flex from './Flex'; +import Image from './Image'; import Indicator from './Indicator'; import Input from './Input'; import Label from './Label'; @@ -38,7 +40,12 @@ import LabelInput from './LabelInput'; import LabelState from './LabelState'; import Link from './Link'; import { Mark } from './Mark'; -import Image from './Image'; +import Menu, { MenuItem, MenuItemIcon } from './Menu'; +import { Pill } from './Pill'; +import Popover from './Popover'; +import { ResourceIcon } from './ResourceIcon'; +import SideNav, { SideNavItem } from './SideNav'; +import { StepSlider } from './StepSlider'; import Text, { H1, H2, @@ -51,16 +58,9 @@ import Text, { Subtitle2, Subtitle3, } from './Text'; -import SideNav, { SideNavItem } from './SideNav'; -import { StepSlider } from './StepSlider'; -import TopNav from './TopNav'; -import Flex from './Flex'; -import Menu, { MenuItem, MenuItemIcon } from './Menu'; -import { Pill } from './Pill'; -import Popover from './Popover'; import { TextArea } from './TextArea'; -import { ResourceIcon } from './ResourceIcon'; import { Toggle } from './Toggle'; +import TopNav from './TopNav'; export { AnimatedProgressBar } from './AnimatedProgressBar'; export { diff --git a/web/packages/design/src/labels.story.jsx b/web/packages/design/src/labels.story.jsx index 7907e70cd46dd..f9aa6b5165fc1 100644 --- a/web/packages/design/src/labels.story.jsx +++ b/web/packages/design/src/labels.story.jsx @@ -18,9 +18,9 @@ import React from 'react'; +import Flex from './Flex'; import Label from './Label'; import LabelState from './LabelState'; -import Flex from './Flex'; export default { title: 'Design/Label', diff --git a/web/packages/design/src/system/borderRadius.ts b/web/packages/design/src/system/borderRadius.ts index d7429ec3ba575..f464dba2a83b4 100644 --- a/web/packages/design/src/system/borderRadius.ts +++ b/web/packages/design/src/system/borderRadius.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ +import { Property } from 'csstype'; import { - style, - px, compose, - BorderRadiusProps as StyledSystemBorderRadiusProps, + px, ResponsiveValue, + style, + BorderRadiusProps as StyledSystemBorderRadiusProps, TLengthStyledSystem, } from 'styled-system'; -import { Property } from 'csstype'; export interface BorderRadiusProps extends StyledSystemBorderRadiusProps { diff --git a/web/packages/design/src/system/index.ts b/web/packages/design/src/system/index.ts index b4225cee1513b..8be9418439992 100644 --- a/web/packages/design/src/system/index.ts +++ b/web/packages/design/src/system/index.ts @@ -16,25 +16,25 @@ * along with this program. If not, see . */ +import { Property } from 'csstype'; import { alignItems, AlignItemsProps, alignSelf, AlignSelfProps, border, - BorderProps, borderColor, BorderColorProps, + BorderProps, borders, BordersProps, color, ColorProps, flex, - FlexProps, flexBasis, - type FlexBasisProps, flexDirection, FlexDirectionProps, + FlexProps, flexWrap, FlexWrapProps, fontSize, @@ -59,23 +59,22 @@ import { MinWidthProps, overflow, OverflowProps, + ResponsiveValue, size, SizeProps, space, SpaceProps, + style, textAlign, TextAlignProps, + TLengthStyledSystem, width, WidthProps, - style, - ResponsiveValue, - TLengthStyledSystem, + type FlexBasisProps, } from 'styled-system'; -import { Property } from 'csstype'; - -import typography, { TypographyProps } from './typography'; import borderRadius, { BorderRadiusProps } from './borderRadius'; +import typography, { TypographyProps } from './typography'; const gap = style({ prop: 'gap', diff --git a/web/packages/design/src/system/typography.ts b/web/packages/design/src/system/typography.ts index c2adcd8382bd1..592b17eb1a3df 100644 --- a/web/packages/design/src/system/typography.ts +++ b/web/packages/design/src/system/typography.ts @@ -17,7 +17,6 @@ */ import PropTypes from 'prop-types'; - import { ResponsiveValue } from 'styled-system'; import { SharedStyles, Theme } from 'design/theme/themes/types'; diff --git a/web/packages/design/src/theme/index.ts b/web/packages/design/src/theme/index.ts index b39a28034caf0..ca62f87dc63f7 100644 --- a/web/packages/design/src/theme/index.ts +++ b/web/packages/design/src/theme/index.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ +import bblpTheme from './themes/bblpTheme'; import darkTheme from './themes/darkTheme'; import lightTheme from './themes/lightTheme'; -import bblpTheme from './themes/bblpTheme'; export { darkTheme, lightTheme, bblpTheme }; diff --git a/web/packages/design/src/theme/palette.story.js b/web/packages/design/src/theme/palette.story.js index 8d45d73478aa3..7cd4d46c6b135 100644 --- a/web/packages/design/src/theme/palette.story.js +++ b/web/packages/design/src/theme/palette.story.js @@ -20,8 +20,7 @@ import React from 'react'; -import { Flex, Box } from '..'; - +import { Box, Flex } from '..'; import * as colors from './palette'; import { getContrastText } from './themes/sharedStyles'; diff --git a/web/packages/design/src/theme/themeColors.story.tsx b/web/packages/design/src/theme/themeColors.story.tsx index ac67fe4ce9258..b0cdc83054202 100644 --- a/web/packages/design/src/theme/themeColors.story.tsx +++ b/web/packages/design/src/theme/themeColors.story.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { useTheme } from 'styled-components'; -import { Flex, Box, Text, Link } from '..'; +import { Box, Flex, Link, Text } from '..'; export default { title: 'Design/Theme/Colors', diff --git a/web/packages/design/src/theme/themes/bblpTheme.ts b/web/packages/design/src/theme/themes/bblpTheme.ts index 169ed595cdfe3..b637410803ce0 100644 --- a/web/packages/design/src/theme/themes/bblpTheme.ts +++ b/web/packages/design/src/theme/themes/bblpTheme.ts @@ -29,7 +29,6 @@ import { } from 'design/theme/palette'; import { lighten } from '../utils/colorManipulator'; - import { sharedColors, sharedStyles } from './sharedStyles'; import { DataVisualisationColors, Theme, ThemeColors } from './types'; diff --git a/web/packages/design/src/theme/themes/darkTheme.ts b/web/packages/design/src/theme/themes/darkTheme.ts index b03e28e6ea29a..2976d94f60e17 100644 --- a/web/packages/design/src/theme/themes/darkTheme.ts +++ b/web/packages/design/src/theme/themes/darkTheme.ts @@ -29,7 +29,6 @@ import { } from 'design/theme/palette'; import { lighten } from '../utils/colorManipulator'; - import { sharedColors, sharedStyles } from './sharedStyles'; import { DataVisualisationColors, Theme, ThemeColors } from './types'; diff --git a/web/packages/design/src/theme/themes/lightTheme.ts b/web/packages/design/src/theme/themes/lightTheme.ts index 822391669b214..c579a04296f9e 100644 --- a/web/packages/design/src/theme/themes/lightTheme.ts +++ b/web/packages/design/src/theme/themes/lightTheme.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import { darken, lighten } from '../utils/colorManipulator'; import { blue, green, @@ -28,7 +27,7 @@ import { red, yellow, } from '../palette'; - +import { darken, lighten } from '../utils/colorManipulator'; import { sharedColors, sharedStyles } from './sharedStyles'; import { DataVisualisationColors, Theme, ThemeColors } from './types'; diff --git a/web/packages/design/src/theme/themes/sharedStyles.ts b/web/packages/design/src/theme/themes/sharedStyles.ts index 1e5b96c01c5ed..490c313daef7e 100644 --- a/web/packages/design/src/theme/themes/sharedStyles.ts +++ b/web/packages/design/src/theme/themes/sharedStyles.ts @@ -16,11 +16,10 @@ * along with this program. If not, see . */ -import { getContrastRatio } from '../utils/colorManipulator'; -import { lightBlue, blueGrey, yellow } from '../palette'; -import typography, { fontSizes, fontWeights } from '../typography'; import { fonts } from '../fonts'; - +import { blueGrey, lightBlue, yellow } from '../palette'; +import typography, { fontSizes, fontWeights } from '../typography'; +import { getContrastRatio } from '../utils/colorManipulator'; import { SharedColors, SharedStyles } from './types'; // TODO(bl-nero): use a CSS var for sidebar width and make the breakpoints work diff --git a/web/packages/design/src/theme/typography.story.js b/web/packages/design/src/theme/typography.story.js index f1e5147f6f574..fed32fba7fb8e 100644 --- a/web/packages/design/src/theme/typography.story.js +++ b/web/packages/design/src/theme/typography.story.js @@ -18,8 +18,8 @@ import React from 'react'; +import { Box, Text } from './../'; import typography from './typography'; -import { Text, Box } from './../'; export default { title: 'Design/Theme/Typography', diff --git a/web/packages/design/src/utils/match/matchers.test.ts b/web/packages/design/src/utils/match/matchers.test.ts index 72de61034f72f..1deb2e371ab55 100644 --- a/web/packages/design/src/utils/match/matchers.test.ts +++ b/web/packages/design/src/utils/match/matchers.test.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { dateTimeMatcher, dateMatcher } from './matchers'; +import { dateMatcher, dateTimeMatcher } from './matchers'; test('dateTimeMatcher should match date times correctly', () => { const searchValue = '23:13'; diff --git a/web/packages/design/src/utils/renderHook.tsx b/web/packages/design/src/utils/renderHook.tsx index 223d819d742fe..08edc9a3cea74 100644 --- a/web/packages/design/src/utils/renderHook.tsx +++ b/web/packages/design/src/utils/renderHook.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { act, render } from '@testing-library/react'; +import React from 'react'; /** * @deprecated Use renderHook provided by @testing-library/react-hooks instead. diff --git a/web/packages/design/src/utils/testing.tsx b/web/packages/design/src/utils/testing.tsx index 20dcc5d0f64e7..cbc8a4f5fa1dd 100644 --- a/web/packages/design/src/utils/testing.tsx +++ b/web/packages/design/src/utils/testing.tsx @@ -16,22 +16,23 @@ * along with this program. If not, see . */ -import React from 'react'; import { - render as testingRender, act, fireEvent, - waitFor, - screen, - prettyDOM, getByTestId, + prettyDOM, + screen, + render as testingRender, + waitFor, waitForElementToBeRemoved, } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import React from 'react'; import { MemoryRouter as Router } from 'react-router-dom'; -import ThemeProvider from 'design/ThemeProvider'; import { darkTheme } from 'design/theme'; +import ThemeProvider from 'design/ThemeProvider'; + import '@testing-library/jest-dom'; import 'jest-styled-components'; diff --git a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx index 998245bbc58da..0fdef515ad0ed 100644 --- a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx +++ b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx @@ -17,8 +17,8 @@ */ import React from 'react'; -import { Flex, LabelInput, Text } from 'design'; +import { Flex, LabelInput, Text } from 'design'; import Select, { Option } from 'shared/components/Select'; import { ToolTipInfo } from 'shared/components/ToolTip'; diff --git a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx index 6779c54528111..bc3253ca0f819 100644 --- a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx +++ b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx @@ -17,10 +17,9 @@ */ import React from 'react'; -import { Flex, Text } from 'design'; +import { Flex, Text } from 'design'; import { ToolTipInfo } from 'shared/components/ToolTip'; - import { AccessRequest } from 'shared/services/accessRequests'; import { getFormattedDurationTxt } from '../Shared/utils'; diff --git a/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.test.ts b/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.test.ts index d0d3645a76a20..3f246bc32bbb2 100644 --- a/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.test.ts +++ b/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.test.ts @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { addHours, addWeeks, addDays } from 'date-fns'; +import { addDays, addHours, addWeeks } from 'date-fns'; import { - getDurationOptionIndexClosestToOneWeek, DurationOption, + getDurationOptionIndexClosestToOneWeek, } from './durationOptions'; describe('getDurationOptionIndexClosestToOneWeek', () => { diff --git a/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.ts b/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.ts index f3460b06c0d37..94acd0fc8c3a8 100644 --- a/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.ts +++ b/web/packages/shared/components/AccessRequests/AccessDuration/durationOptions.ts @@ -17,15 +17,14 @@ */ import { - addHours, addDays, - isAfter, + addHours, addWeeks, differenceInHours, + isAfter, } from 'date-fns'; import { Option } from 'shared/components/Select'; - import { AccessRequest } from 'shared/services/accessRequests'; import { getFormattedDurationTxt } from '../Shared/utils'; diff --git a/web/packages/shared/components/AccessRequests/AccessDuration/getDurationOptionsFromStartTime.test.ts b/web/packages/shared/components/AccessRequests/AccessDuration/getDurationOptionsFromStartTime.test.ts index 34dada01f42a7..47250ea38706e 100644 --- a/web/packages/shared/components/AccessRequests/AccessDuration/getDurationOptionsFromStartTime.test.ts +++ b/web/packages/shared/components/AccessRequests/AccessDuration/getDurationOptionsFromStartTime.test.ts @@ -19,7 +19,6 @@ import { addDays } from 'date-fns'; import { Option } from 'shared/components/Select'; - import { AccessRequest } from 'shared/services/accessRequests'; import { diff --git a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx index 473e297cbae70..9c29800f0c56c 100644 --- a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx +++ b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx @@ -16,17 +16,15 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; import { format } from 'date-fns'; +import React, { useState } from 'react'; import { Box, Text } from 'design'; - import { Option } from 'shared/components/Select'; import cfg from 'shared/config'; -import { dryRunResponse } from '../fixtures'; import { AccessDurationRequest, AccessDurationReview } from '../AccessDuration'; - +import { dryRunResponse } from '../fixtures'; import { AssumeStartTime } from './AssumeStartTime'; export default { diff --git a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.test.tsx b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.test.tsx index 9c7e709fce807..5de9221d12960 100644 --- a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.test.tsx +++ b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.test.tsx @@ -16,14 +16,12 @@ * along with this program. If not, see . */ -import { render, screen, fireEvent } from 'design/utils/testing'; - +import { fireEvent, render, screen } from 'design/utils/testing'; import { AccessRequest } from 'shared/services/accessRequests'; -import { dryRunResponse } from '../fixtures'; import { AccessDurationRequest, AccessDurationReview } from '../AccessDuration'; +import { dryRunResponse } from '../fixtures'; import { useSpecifiableFields } from '../NewRequest/useSpecifiableFields'; - import { AssumeStartTime } from './AssumeStartTime'; test('assume start time, creating mode', () => { diff --git a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.tsx b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.tsx index 6191524008cc0..e5fa02db1efe0 100644 --- a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.tsx +++ b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.tsx @@ -17,25 +17,25 @@ */ import { useState } from 'react'; -import styled from 'styled-components'; import { DayPicker } from 'react-day-picker'; +import styled from 'styled-components'; + import 'react-day-picker/dist/style.css'; + import { addMonths, format } from 'date-fns'; -import { Flex, Box, LabelInput, ButtonIcon } from 'design'; -import { Calendar as CalendarIcon, Refresh as RefreshIcon } from 'design/Icon'; -import { StyledDateRange } from 'teleport/components/DayPicker/Shared'; +import { Box, ButtonIcon, Flex, LabelInput } from 'design'; import { ButtonSecondary } from 'design/Button'; - -import Validation from 'shared/components/Validation'; +import { Calendar as CalendarIcon, Refresh as RefreshIcon } from 'design/Icon'; import FieldSelect from 'shared/components/FieldSelect'; -import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; +import Validation from 'shared/components/Validation'; import cfg from 'shared/config'; - +import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; import { AccessRequest } from 'shared/services/accessRequests'; -import { TimeOption } from '../Shared/types'; +import { StyledDateRange } from 'teleport/components/DayPicker/Shared'; +import { TimeOption } from '../Shared/types'; import { convertStartToTimeOption, getMaxAssumableDate, diff --git a/web/packages/shared/components/AccessRequests/AssumeStartTime/timeOptions.tsx b/web/packages/shared/components/AccessRequests/AssumeStartTime/timeOptions.tsx index 82a46d49c1372..eb0299712e4a3 100644 --- a/web/packages/shared/components/AccessRequests/AssumeStartTime/timeOptions.tsx +++ b/web/packages/shared/components/AccessRequests/AssumeStartTime/timeOptions.tsx @@ -18,9 +18,8 @@ import { addDays, isSameDay } from 'date-fns'; -import { dateTimeShortFormat } from 'shared/services/loc/loc'; - import { AccessRequest } from 'shared/services/accessRequests'; +import { dateTimeShortFormat } from 'shared/services/loc/loc'; import { TimeOption } from '../Shared/types'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx b/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx index f10b940050628..0bb65dd4bf933 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx @@ -17,9 +17,9 @@ */ import React from 'react'; -import { Flex, Text } from 'design'; import { components, OptionProps } from 'react-select'; +import { Flex, Text } from 'design'; import { Option as BaseOption } from 'shared/components/Select'; export type Option = BaseOption & { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx index 849eafa289424..ec4b766d0e7f5 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx @@ -17,12 +17,11 @@ */ import React, { useState } from 'react'; -import { Flex, Text, ButtonIcon, Box, LabelInput } from 'design'; -import * as Icon from 'design/Icon'; +import { Box, ButtonIcon, Flex, LabelInput, Text } from 'design'; +import * as Icon from 'design/Icon'; import Select, { Option } from 'shared/components/Select'; import { ToolTipInfo } from 'shared/components/ToolTip'; - import { AccessRequest } from 'shared/services/accessRequests'; import { getFormattedDurationTxt } from '../../Shared/utils'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/CrossIcon.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/CrossIcon.tsx index c65c54bf5d2d9..21ddb3da3bbbc 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/CrossIcon.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/CrossIcon.tsx @@ -17,7 +17,6 @@ */ import { Cross } from 'design/Icon'; - import { Attempt } from 'shared/hooks/useAttemptNext'; export function CrossIcon({ diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx index ecef0bdd79d0e..ccd9f9a0737ca 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx @@ -16,18 +16,17 @@ * along with this program. If not, see . */ -import { useState, useEffect } from 'react'; -import styled from 'styled-components'; -import { Box } from 'design'; +import { useEffect, useState } from 'react'; import { ActionMeta } from 'react-select'; +import styled from 'styled-components'; -import { Option } from 'shared/components/Select'; +import { Box } from 'design'; import { FieldSelectAsync } from 'shared/components/FieldSelect'; +import { Option } from 'shared/components/Select'; import { useAsync } from 'shared/hooks/useAsync'; import { CheckableOptionComponent } from '../CheckableOption'; - -import { PendingListItem, PendingKubeResourceItem } from './RequestCheckout'; +import { PendingKubeResourceItem, PendingListItem } from './RequestCheckout'; export function KubeNamespaceSelector({ kubeClusterItem, diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.test.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.test.tsx index 0dfe9b5ef2dac..4b1fdc6adbe62 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.test.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.test.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; -import { Loaded, Failed, Success } from './RequestCheckout.story'; +import { Failed, Loaded, Success } from './RequestCheckout.story'; test('loaded state', async () => { const { container } = render(); diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx index 37a9c76795329..3fb8b4d17a7a9 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx @@ -17,15 +17,13 @@ */ import React, { useState } from 'react'; -import { MemoryRouter, Link } from 'react-router-dom'; +import { Link, MemoryRouter } from 'react-router-dom'; import { Box, ButtonPrimary, ButtonText } from 'design'; - import { Option } from 'shared/components/Select'; import { dryRunResponse } from '../../fixtures'; import { useSpecifiableFields } from '../useSpecifiableFields'; - import { RequestCheckoutWithSlider, RequestCheckoutWithSliderProps, diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.test.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.test.tsx index 23599a83f6964..da3b4e2467785 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.test.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.test.tsx @@ -16,13 +16,11 @@ * along with this program. If not, see . */ -import { render, screen, userEvent, fireEvent } from 'design/utils/testing'; - +import { fireEvent, render, screen, userEvent } from 'design/utils/testing'; import { RequestState } from 'shared/services/accessRequests'; import { dryRunResponse } from '../../fixtures'; import { useSpecifiableFields } from '../useSpecifiableFields'; - import { RequestCheckoutWithSlider as RequestCheckoutComp, RequestCheckoutWithSliderProps, diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx index 980b936a3d5ca..112d9e78d42d9 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx @@ -17,7 +17,9 @@ */ import React, { useRef, useState } from 'react'; +import type { TransitionStatus } from 'react-transition-group'; import styled from 'styled-components'; + import { Alert, Box, @@ -25,47 +27,41 @@ import { ButtonIcon, ButtonPrimary, ButtonSecondary, + Link as ExternalLink, Flex, H2, Image, Indicator, LabelInput, - Link as ExternalLink, Subtitle2, Text, } from 'design'; -import { ArrowBack, ChevronDown, ChevronRight, Warning } from 'design/Icon'; -import Table, { Cell } from 'design/DataTable'; -import { CheckboxInput, CheckboxWrapper } from 'design/Checkbox'; import { Danger } from 'design/Alert'; - -import Validation, { useRule, Validator } from 'shared/components/Validation'; -import { Attempt } from 'shared/hooks/useAttemptNext'; -import { pluralize } from 'shared/utils/text'; +import { CheckboxInput, CheckboxWrapper } from 'design/Checkbox'; +import Table, { Cell } from 'design/DataTable'; +import { ArrowBack, ChevronDown, ChevronRight, Warning } from 'design/Icon'; +import { RequestableResourceKind } from 'shared/components/AccessRequests/NewRequest/resource'; import { Option } from 'shared/components/Select'; import { TextSelectCopyMulti } from 'shared/components/TextSelectCopy'; -import { RequestableResourceKind } from 'shared/components/AccessRequests/NewRequest/resource'; import { HoverTooltip } from 'shared/components/ToolTip'; +import Validation, { useRule, Validator } from 'shared/components/Validation'; +import { Attempt } from 'shared/hooks/useAttemptNext'; +import type { AccessRequest } from 'shared/services/accessRequests'; +import { pluralize } from 'shared/utils/text'; -import { CreateRequest } from '../../Shared/types'; -import { AssumeStartTime } from '../../AssumeStartTime/AssumeStartTime'; import { AccessDurationRequest } from '../../AccessDuration'; +import { AssumeStartTime } from '../../AssumeStartTime/AssumeStartTime'; +import { CreateRequest } from '../../Shared/types'; import { checkSupportForKubeResources, isKubeClusterWithNamespaces, } from '../kube'; - -import { ReviewerOption } from './types'; - -import shieldCheck from './shield-check.png'; -import { SelectReviewers } from './SelectReviewers'; import { AdditionalOptions } from './AdditionalOptions'; -import { KubeNamespaceSelector } from './KubeNamespaceSelector'; import { CrossIcon } from './CrossIcon'; - -import type { TransitionStatus } from 'react-transition-group'; - -import type { AccessRequest } from 'shared/services/accessRequests'; +import { KubeNamespaceSelector } from './KubeNamespaceSelector'; +import { SelectReviewers } from './SelectReviewers'; +import shieldCheck from './shield-check.png'; +import { ReviewerOption } from './types'; export function RequestCheckoutWithSlider< T extends PendingListItem = PendingListItem, diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx index 8cbf89ca00748..e2796e8cbe3e7 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx @@ -16,11 +16,12 @@ * along with this program. If not, see . */ -import React, { useState, useRef } from 'react'; +import React, { useRef, useState } from 'react'; import { components } from 'react-select'; import ReactSelectCreatable from 'react-select/creatable'; import styled from 'styled-components'; -import { ButtonBorder, Box, Text, Flex, ButtonIcon } from 'design'; + +import { Box, ButtonBorder, ButtonIcon, Flex, Text } from 'design'; import * as Icon from 'design/Icon'; import { ReviewerOption } from './types'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/utils.ts b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/utils.ts index 9fe62cdcabd70..a4ed5abcc7ecf 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/utils.ts +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/utils.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { addHours, addDays, isAfter } from 'date-fns'; +import { addDays, addHours, isAfter } from 'date-fns'; import { Option } from 'shared/components/Select'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Apps.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Apps.tsx index 067eeb1bbe1b5..cfc96e375ff51 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Apps.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Apps.tsx @@ -16,14 +16,12 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import styled from 'styled-components'; +import React, { useEffect, useState } from 'react'; import { components } from 'react-select'; -import { Flex, Text, ButtonBorder, ButtonPrimary } from 'design'; -import { ClickableLabelCell, Cell } from 'design/DataTable'; - -import { App } from 'teleport/services/apps'; +import styled from 'styled-components'; +import { ButtonBorder, ButtonPrimary, Flex, Text } from 'design'; +import { Cell, ClickableLabelCell } from 'design/DataTable'; import Select, { Option as BaseOption, CustomSelectComponentProps, @@ -31,8 +29,9 @@ import Select, { import { StyledSelect as BaseStyledSelect } from 'shared/components/Select/Select'; import { ToolTipInfo } from 'shared/components/ToolTip'; -import { ResourceMap, RequestableResourceKind } from '../resource'; +import { App } from 'teleport/services/apps'; +import { RequestableResourceKind, ResourceMap } from '../resource'; import { ListProps, StyledTable } from './ResourceList'; type Option = BaseOption & { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Databases.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Databases.tsx index 3f6f1e69da38c..3aa793c678a8c 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Databases.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Databases.tsx @@ -17,10 +17,12 @@ */ import React from 'react'; + import { ClickableLabelCell } from 'design/DataTable'; + import { Database } from 'teleport/services/databases'; -import { ListProps, StyledTable, renderActionCell } from './ResourceList'; +import { ListProps, renderActionCell, StyledTable } from './ResourceList'; export function Databases(props: ListProps & { databases: Database[] }) { const { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Desktops.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Desktops.tsx index 7dcde05b2b33d..c86d2dec2505a 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Desktops.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Desktops.tsx @@ -17,10 +17,12 @@ */ import React from 'react'; + import { ClickableLabelCell } from 'design/DataTable'; + import { Desktop } from 'teleport/services/desktops'; -import { ListProps, StyledTable, renderActionCell } from './ResourceList'; +import { ListProps, renderActionCell, StyledTable } from './ResourceList'; export function Desktops(props: ListProps & { desktops: Desktop[] }) { const { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Kubes.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Kubes.tsx index b6e79ed45329a..37e7ff169dc84 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Kubes.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Kubes.tsx @@ -17,10 +17,12 @@ */ import React from 'react'; + import { ClickableLabelCell } from 'design/DataTable'; + import { Kube } from 'teleport/services/kube'; -import { ListProps, StyledTable, renderActionCell } from './ResourceList'; +import { ListProps, renderActionCell, StyledTable } from './ResourceList'; export function Kubes(props: ListProps & { kubes: Kube[] }) { const { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Nodes.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Nodes.tsx index dfcb2021445ab..0e8bd90e219ae 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Nodes.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Nodes.tsx @@ -17,10 +17,12 @@ */ import React from 'react'; + import { Cell, ClickableLabelCell } from 'design/DataTable'; + import { Node } from 'teleport/services/nodes'; -import { ListProps, StyledTable, renderActionCell } from './ResourceList'; +import { ListProps, renderActionCell, StyledTable } from './ResourceList'; export function Nodes(props: ListProps & { nodes: Node[] }) { const { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.test.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.test.tsx index d61c443008096..cc4ae458d1e91 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.test.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; import { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.tsx index 90a3fd3d202dd..6643d5caa70db 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.story.tsx @@ -18,15 +18,14 @@ import React from 'react'; -import { Desktop } from 'teleport/services/desktops'; -import { Database } from 'teleport/services/databases'; import { App } from 'teleport/services/apps'; +import { Database } from 'teleport/services/databases'; +import { Desktop } from 'teleport/services/desktops'; import { Kube } from 'teleport/services/kube'; import { Node } from 'teleport/services/nodes'; import { UserGroup } from 'teleport/services/userGroups'; import { getEmptyResourceState } from '../resource'; - import { ResourceList, ResourceListProps } from './ResourceList'; export default { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.tsx index 2981f1175ebd3..7b6a153c9242c 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/ResourceList.tsx @@ -18,25 +18,25 @@ import React from 'react'; import styled from 'styled-components'; -import { ButtonBorder, ButtonPrimary, Box } from 'design'; + +import { Box, ButtonBorder, ButtonPrimary } from 'design'; import Table, { Cell } from 'design/DataTable'; -import { Desktop } from 'teleport/services/desktops'; -import { Database } from 'teleport/services/databases'; +import { CustomSort } from 'design/DataTable/types'; + +import { ResourceLabel, UnifiedResource } from 'teleport/services/agents'; import { App } from 'teleport/services/apps'; +import { Database } from 'teleport/services/databases'; +import { Desktop } from 'teleport/services/desktops'; import { Kube } from 'teleport/services/kube'; import { Node } from 'teleport/services/nodes'; import { UserGroup } from 'teleport/services/userGroups'; -import { CustomSort } from 'design/DataTable/types'; - -import { ResourceLabel, UnifiedResource } from 'teleport/services/agents'; - -import { ResourceMap, RequestableResourceKind } from '../resource'; +import { RequestableResourceKind, ResourceMap } from '../resource'; import { Apps } from './Apps'; import { Databases } from './Databases'; -import { Nodes } from './Nodes'; import { Desktops } from './Desktops'; import { Kubes } from './Kubes'; +import { Nodes } from './Nodes'; import { Roles } from './Roles'; import { UserGroups } from './UserGroups'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Roles.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Roles.tsx index 5ec6e78f95ff1..b473ce14234a4 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Roles.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/Roles.tsx @@ -18,7 +18,7 @@ import React from 'react'; -import { ListProps, StyledTable, renderActionCell } from './ResourceList'; +import { ListProps, renderActionCell, StyledTable } from './ResourceList'; export function Roles(props: ListProps & { roles: string[] }) { const { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/UserGroups.tsx b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/UserGroups.tsx index e96e396127543..d924d7b5bde14 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/UserGroups.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/ResourceList/UserGroups.tsx @@ -17,10 +17,12 @@ */ import React from 'react'; + import { ClickableLabelCell } from 'design/DataTable'; + import { UserGroup } from 'teleport/services/userGroups'; -import { ListProps, StyledTable, renderActionCell } from './ResourceList'; +import { ListProps, renderActionCell, StyledTable } from './ResourceList'; export function UserGroups(props: ListProps & { userGroups: UserGroup[] }) { const { diff --git a/web/packages/shared/components/AccessRequests/NewRequest/useSpecifiableFields.ts b/web/packages/shared/components/AccessRequests/NewRequest/useSpecifiableFields.ts index 3f7f7d6edd826..3be43d7f8b949 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/useSpecifiableFields.ts +++ b/web/packages/shared/components/AccessRequests/NewRequest/useSpecifiableFields.ts @@ -18,11 +18,11 @@ import { useState } from 'react'; -import { Option } from 'shared/components/Select'; import { getPendingRequestDurationOptions, ReviewerOption, } from 'shared/components/AccessRequests/NewRequest'; +import { Option } from 'shared/components/Select'; import { AccessRequest } from 'shared/services/accessRequests'; import { diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestList/RequestList.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestList/RequestList.tsx index 0921c346d052c..bf627a11da91e 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestList/RequestList.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestList/RequestList.tsx @@ -16,11 +16,10 @@ * along with this program. If not, see . */ -import { Text, LabelState, Flex } from 'design'; +import { Flex, LabelState, Text } from 'design'; import { Cell } from 'design/DataTable'; import { ArrowFatLinesUp } from 'design/Icon'; import { LabelKind } from 'design/LabelState/LabelState'; - import { AccessRequest } from 'shared/services/accessRequests'; export const renderUserCell = ({ user }: AccessRequest) => { diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.test.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.test.tsx index 0756b20b3b68b..13861136e8b4a 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.test.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.test.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { render, screen } from 'design/utils/testing'; -import { Loaded, Failed, Processing, Approved } from './RequestDelete.story'; +import { Approved, Failed, Loaded, Processing } from './RequestDelete.story'; test('loaded state', () => { render(); diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx index 52482cc5f1274..be1a5e312d3da 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx @@ -20,8 +20,8 @@ import React from 'react'; import { makeEmptyAttempt, - makeProcessingAttempt, makeErrorAttempt, + makeProcessingAttempt, } from 'shared/hooks/useAsync'; import { RequestDelete } from './RequestDelete'; diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx index 534ad150994a8..da3ccd0b38043 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx @@ -17,21 +17,20 @@ */ import React from 'react'; -import { ButtonWarning, ButtonSecondary, Flex, Text, Alert } from 'design'; -import TextSelectCopy from 'teleport/components/TextSelectCopy'; +import { Alert, ButtonSecondary, ButtonWarning, Flex, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; - import { Attempt } from 'shared/hooks/useAsync'; +import type { RequestState } from 'shared/services/accessRequests'; -import RolesRequested from '../RolesRequested'; +import TextSelectCopy from 'teleport/components/TextSelectCopy'; -import type { RequestState } from 'shared/services/accessRequests'; +import RolesRequested from '../RolesRequested'; export interface RequestDeleteProps { requestId: string; diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.test.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.test.tsx index 7bacd20ee8bff..544292f6d572b 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.test.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.test.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { render } from 'design/utils/testing'; -import { Loaded, Failed } from './RequestReview.story'; +import { Failed, Loaded } from './RequestReview.story'; test('loaded state', () => { const { container } = render(); diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx index 7348178391c47..3ed13f5dade03 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx @@ -19,14 +19,13 @@ import React from 'react'; import { - makeSuccessAttempt, makeEmptyAttempt, - makeProcessingAttempt, makeErrorAttempt, + makeProcessingAttempt, + makeSuccessAttempt, } from 'shared/hooks/useAsync'; import { requestRolePending } from '../../../fixtures'; - import RequestReview, { RequestReviewProps } from './RequestReview'; export default { diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.tsx index 8128a849715b3..f868586680cbb 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.tsx @@ -18,24 +18,22 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { ButtonPrimary, Text, Box, Alert, Flex, Label } from 'design'; + +import { Alert, Box, ButtonPrimary, Flex, Label, Text } from 'design'; import { Warning } from 'design/Icon'; import { Radio } from 'design/RadioGroup'; - -import Validation, { Validator } from 'shared/components/Validation'; import FieldSelect from 'shared/components/FieldSelect'; +import { FieldTextArea } from 'shared/components/FieldTextArea'; import { Option } from 'shared/components/Select'; -import { Attempt } from 'shared/hooks/useAsync'; -import { requiredField } from 'shared/components/Validation/rules'; import { HoverTooltip } from 'shared/components/ToolTip'; -import { FieldTextArea } from 'shared/components/FieldTextArea'; - +import Validation, { Validator } from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; +import { Attempt } from 'shared/hooks/useAsync'; import { AccessRequest, RequestState } from 'shared/services/accessRequests'; -import { AssumeStartTime } from '../../../AssumeStartTime/AssumeStartTime'; import { AccessDurationReview } from '../../../AccessDuration'; - -import { SuggestedAccessList, SubmitReview } from '../types'; +import { AssumeStartTime } from '../../../AssumeStartTime/AssumeStartTime'; +import { SubmitReview, SuggestedAccessList } from '../types'; type ReviewStateOption = Option & { disabled?: boolean; diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.test.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.test.tsx index 5aa8fea812794..f478cb5a9adec 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.test.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.test.tsx @@ -21,10 +21,10 @@ import React from 'react'; import { render } from 'design/utils/testing'; import { - LoadedSearchPending, - LoadedRolePending, LoadedRoleApproved, LoadedRoleDenied, + LoadedRolePending, + LoadedSearchPending, } from './RequestView.story'; test('loaded pending role based request state', () => { diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx index 5880a1f5c94ee..0c72d5fbc7d94 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx @@ -19,22 +19,21 @@ import React from 'react'; import { - makeSuccessAttempt, makeEmptyAttempt, - makeProcessingAttempt, makeErrorAttempt, + makeProcessingAttempt, + makeSuccessAttempt, } from 'shared/hooks/useAsync'; import { requestRoleApproved, + requestRoleApprovedWithStartTime, requestRoleDenied, - requestRolePending, - requestSearchPending, requestRoleEmpty, + requestRolePending, requestRolePromoted, - requestRoleApprovedWithStartTime, + requestSearchPending, } from '../../fixtures'; - import { RequestView, RequestViewProps } from './RequestView'; import { RequestFlags, SuggestedAccessList } from './types'; diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.test.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.test.tsx index 1ee774c4d75ae..ce950454b44c9 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.test.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.test.tsx @@ -17,11 +17,9 @@ */ import { render, screen } from 'design/utils/testing'; - import { makeEmptyAttempt, makeSuccessAttempt } from 'shared/hooks/useAsync'; import { requestRolePending } from '../../fixtures'; - import { RequestView, RequestViewProps } from './RequestView'; import { RequestFlags } from './types'; diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx index 34a8e4f7fd5ba..dd133c51c95b6 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see . */ +import { format } from 'date-fns'; import React from 'react'; import styled from 'styled-components'; -import { format } from 'date-fns'; + import { Alert, Box, @@ -26,51 +27,45 @@ import { ButtonPrimary, Flex, Indicator, + Label, LabelState, Text, - Label, } from 'design'; +import Table from 'design/DataTable'; import { + ArrowFatLinesUp, ChevronCircleDown, CircleCheck, CircleCross, - ArrowFatLinesUp, } from 'design/Icon'; -import { TeleportGearIcon } from 'design/SVGIcon'; -import Table from 'design/DataTable'; - import { LabelKind } from 'design/LabelState/LabelState'; - +import { TeleportGearIcon } from 'design/SVGIcon'; import { HoverTooltip } from 'shared/components/ToolTip'; -import { hasFinished, Attempt } from 'shared/hooks/useAsync'; import cfg from 'shared/config'; - +import { Attempt, hasFinished } from 'shared/hooks/useAsync'; import { - canAssumeNow, + AccessRequest, AccessRequestReview, AccessRequestReviewer, + canAssumeNow, RequestState, Resource, - AccessRequest, } from 'shared/services/accessRequests'; +import type { + RequestFlags, + SubmitReview, +} from '../../ReviewRequests/RequestView/types'; import { - PromotedMessage, getAssumeStartTimeTooltipText, + PromotedMessage, } from '../../Shared/Shared'; import { getFormattedDurationTxt } from '../../Shared/utils'; - import { formattedName } from '../formattedName'; - +import { RequestDelete } from './RequestDelete'; import RequestReview from './RequestReview'; import RolesRequested from './RolesRequested'; import { SuggestedAccessList } from './types'; -import { RequestDelete } from './RequestDelete'; - -import type { - RequestFlags, - SubmitReview, -} from '../../ReviewRequests/RequestView/types'; export interface RequestViewProps { user: string; diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx index 40716141f6339..c4bf35e610673 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Box, Label } from 'design'; export default function RolesRequested({ roles }: { roles: string[] }) { diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/types.ts b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/types.ts index 5a016cec9a723..2fc16e1b307c8 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/types.ts +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/types.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { AllUserTraits } from 'teleport/services/user'; - import { RequestState } from 'shared/services/accessRequests'; +import { AllUserTraits } from 'teleport/services/user'; + export type RequestFlags = { /** Describes request is own request and request is approved */ canAssume: boolean; diff --git a/web/packages/shared/components/AccessRequests/Shared/Shared.tsx b/web/packages/shared/components/AccessRequests/Shared/Shared.tsx index b0100ad749ae7..aff253177059d 100644 --- a/web/packages/shared/components/AccessRequests/Shared/Shared.tsx +++ b/web/packages/shared/components/AccessRequests/Shared/Shared.tsx @@ -16,14 +16,13 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; -import { ButtonPrimary, Text, Box, ButtonIcon, Menu } from 'design'; -import { Info } from 'design/Icon'; import { format } from 'date-fns'; +import React, { useState } from 'react'; +import { Box, ButtonIcon, ButtonPrimary, Menu, Text } from 'design'; +import { Info } from 'design/Icon'; import { HoverTooltip } from 'shared/components/ToolTip'; import cfg from 'shared/config'; - import { AccessRequest } from 'shared/services/accessRequests'; export function PromotedMessage({ diff --git a/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx b/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx index a637ab065b48d..eef5b1e57993c 100644 --- a/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx +++ b/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx @@ -18,8 +18,7 @@ import React from 'react'; -import { Text, Toggle, Link, Flex } from 'design'; - +import { Flex, Link, Text, Toggle } from 'design'; import { ToolTipInfo } from 'shared/components/ToolTip'; const GUIDE_URL = diff --git a/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx b/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx index d2923a8ae5029..c6f5d96f76e5b 100644 --- a/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx +++ b/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx @@ -23,7 +23,6 @@ import { SelectedLines, TerminalContent, } from 'shared/components/AnimatedTerminal/TerminalContent'; - import { Window } from 'shared/components/Window'; import { BufferEntry, createTerminalContent, TerminalLine } from './content'; diff --git a/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.story.tsx b/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.story.tsx index e66eeddd95c77..25d825a56f205 100644 --- a/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.story.tsx +++ b/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.story.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { getPlatform } from 'design/platform'; import { MemoryRouter } from 'react-router'; -import { getConnectDownloadLinks } from '../DownloadConnect/DownloadConnect'; +import { getPlatform } from 'design/platform'; +import { getConnectDownloadLinks } from '../DownloadConnect/DownloadConnect'; import { DeviceTrustConnectPassthrough } from './AuthorizeDeviceWeb'; export default { diff --git a/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.tsx b/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.tsx index 3a17a0141392b..753f8d8f34bcf 100644 --- a/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.tsx +++ b/web/packages/shared/components/AuthorizeDeviceWeb/AuthorizeDeviceWeb.tsx @@ -17,23 +17,23 @@ */ import { useEffect } from 'react'; -import styled from 'styled-components'; -import { Box, Flex, ButtonPrimary, Text, ButtonLink } from 'design'; +import { useLocation, useParams } from 'react-router'; import { Link } from 'react-router-dom'; -import { useParams, useLocation } from 'react-router'; +import styled from 'styled-components'; -import cfg from 'teleport/config'; -import useTeleport from 'teleport/useTeleport'; +import { Box, ButtonLink, ButtonPrimary, Flex, Text } from 'design'; import { getPlatform } from 'design/platform'; -import history from 'teleport/services/history/history'; - import { DownloadConnect, DownloadLink, getConnectDownloadLinks, } from 'shared/components/DownloadConnect/DownloadConnect'; -import { processRedirectUri } from 'shared/redirects'; import { makeDeepLinkWithSafeInput } from 'shared/deepLinks'; +import { processRedirectUri } from 'shared/redirects'; + +import cfg from 'teleport/config'; +import history from 'teleport/services/history/history'; +import useTeleport from 'teleport/useTeleport'; export const PassthroughPage = () => { const ctx = useTeleport(); diff --git a/web/packages/shared/components/AwsLaunchButton/AwsLaunchButton.tsx b/web/packages/shared/components/AwsLaunchButton/AwsLaunchButton.tsx index 18a2f4db743a6..248d465646442 100644 --- a/web/packages/shared/components/AwsLaunchButton/AwsLaunchButton.tsx +++ b/web/packages/shared/components/AwsLaunchButton/AwsLaunchButton.tsx @@ -18,11 +18,11 @@ import React from 'react'; import styled from 'styled-components'; -import { space, SpaceProps } from 'design/system'; -import { ButtonBorder, Flex, Text, Box } from 'design'; -import Menu, { MenuItem } from 'design/Menu'; -import { ChevronDown } from 'design/Icon'; +import { Box, ButtonBorder, Flex, Text } from 'design'; +import { ChevronDown } from 'design/Icon'; +import Menu, { MenuItem } from 'design/Menu'; +import { space, SpaceProps } from 'design/system'; import { AwsRole } from 'shared/services/apps'; export class AwsLaunchButton extends React.Component { diff --git a/web/packages/shared/components/BpfViewer/BpfViewer.jsx b/web/packages/shared/components/BpfViewer/BpfViewer.jsx index dc19f3a92d407..df9fb7861679c 100644 --- a/web/packages/shared/components/BpfViewer/BpfViewer.jsx +++ b/web/packages/shared/components/BpfViewer/BpfViewer.jsx @@ -16,16 +16,17 @@ * along with this program. If not, see . */ +import ace from 'ace-builds/src-min-noconflict/ace'; import React from 'react'; import styled from 'styled-components'; -import ace from 'ace-builds/src-min-noconflict/ace'; import 'ace-builds/src-noconflict/theme-monokai'; import 'ace-builds/src-noconflict/ext-searchbox'; import './ace-mode-bpf'; + +import flatFormatter from './flatFormatter'; import treeBuilder from './treeBuilder'; import treeFormatter from './treeFormatter'; -import flatFormatter from './flatFormatter'; export default class BpfViewer extends React.Component { componentDidMount() { diff --git a/web/packages/shared/components/BpfViewer/fixtures/npm.js b/web/packages/shared/components/BpfViewer/fixtures/npm.js index 59b21b934ef55..5820c2bf217d9 100644 --- a/web/packages/shared/components/BpfViewer/fixtures/npm.js +++ b/web/packages/shared/components/BpfViewer/fixtures/npm.js @@ -1,2 +1,3 @@ import events from './bpf.npm.json'; + export default events; diff --git a/web/packages/shared/components/BpfViewer/fixtures/vim.js b/web/packages/shared/components/BpfViewer/fixtures/vim.js index ccf1991452c1c..b22d14af47c1f 100644 --- a/web/packages/shared/components/BpfViewer/fixtures/vim.js +++ b/web/packages/shared/components/BpfViewer/fixtures/vim.js @@ -1,2 +1,3 @@ import events from './bpf.vim.json'; + export default events; diff --git a/web/packages/shared/components/BpfViewer/flatFormatter.js b/web/packages/shared/components/BpfViewer/flatFormatter.js index 904e9499a2700..324b32ee630de 100644 --- a/web/packages/shared/components/BpfViewer/flatFormatter.js +++ b/web/packages/shared/components/BpfViewer/flatFormatter.js @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { formatCmd, formatNetwork, formatFile } from './formatters'; +import { formatCmd, formatFile, formatNetwork } from './formatters'; export default function flatFormatter(events, buffer) { for (var i = 0; i < events.length; i++) { diff --git a/web/packages/shared/components/BpfViewer/index.js b/web/packages/shared/components/BpfViewer/index.js index c95d1544b089f..d8c08abf7079d 100644 --- a/web/packages/shared/components/BpfViewer/index.js +++ b/web/packages/shared/components/BpfViewer/index.js @@ -17,5 +17,6 @@ */ import BpfViewer, { formatEvents } from './BpfViewer'; + export default BpfViewer; export { formatEvents }; diff --git a/web/packages/shared/components/BpfViewer/treeFormatter.js b/web/packages/shared/components/BpfViewer/treeFormatter.js index bdafb084532b2..c394a69b31c98 100644 --- a/web/packages/shared/components/BpfViewer/treeFormatter.js +++ b/web/packages/shared/components/BpfViewer/treeFormatter.js @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { formatTabs, formatCmd, formatNetwork, formatFile } from './formatters'; +import { formatCmd, formatFile, formatNetwork, formatTabs } from './formatters'; export default function formatTree(tree, events, buffer) { if (!tree) { diff --git a/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx b/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx index 7beef5afe9f48..73ba14c5ad4fa 100644 --- a/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx +++ b/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/shared/components/ButtonSso/ButtonSso.tsx b/web/packages/shared/components/ButtonSso/ButtonSso.tsx index c2e772a8cbb26..ce6acc04a57bb 100644 --- a/web/packages/shared/components/ButtonSso/ButtonSso.tsx +++ b/web/packages/shared/components/ButtonSso/ButtonSso.tsx @@ -18,10 +18,10 @@ import React, { forwardRef } from 'react'; import styled from 'styled-components'; + import Button from 'design/Button'; -import { darken, lighten } from 'design/theme/utils/colorManipulator'; import * as Icons from 'design/Icon'; - +import { darken, lighten } from 'design/theme/utils/colorManipulator'; import { AuthProviderType } from 'shared/services'; const ButtonSso = forwardRef((props: Props, ref) => { diff --git a/web/packages/shared/components/ButtonSso/index.ts b/web/packages/shared/components/ButtonSso/index.ts index 87363a3dc5d6e..1f2c073bf5da8 100644 --- a/web/packages/shared/components/ButtonSso/index.ts +++ b/web/packages/shared/components/ButtonSso/index.ts @@ -17,5 +17,6 @@ */ import ButtonSso, { guessProviderType } from './ButtonSso'; + export default ButtonSso; export { guessProviderType }; diff --git a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx index 6d88f3c1d26b5..f2a84ada4631c 100644 --- a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx +++ b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx @@ -18,7 +18,7 @@ import React from 'react'; -import { render, fireEvent, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { ButtonTextWithAddIcon } from './ButtonTextWithAddIcon'; diff --git a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx index b8e0ac49c0143..1cab647477ba6 100644 --- a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx +++ b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { ButtonText } from 'design'; import { Add as AddIcon } from 'design/Icon'; diff --git a/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx b/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx index 1a26d46287c49..a1a21431ed06f 100644 --- a/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx +++ b/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx @@ -19,10 +19,11 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { Cluster } from 'teleport/services/clusters'; -import { createTeleportContext } from 'teleport/mocks/contexts'; +import { Box, Text } from 'design'; + import { ContextProvider } from 'teleport/index'; -import { Text, Box } from 'design'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import { Cluster } from 'teleport/services/clusters'; import { ClusterDropdown } from './ClusterDropdown'; diff --git a/web/packages/shared/components/ClusterDropdown/ClusterDropdown.tsx b/web/packages/shared/components/ClusterDropdown/ClusterDropdown.tsx index fdccb6ae9045b..8ff27ac18365c 100644 --- a/web/packages/shared/components/ClusterDropdown/ClusterDropdown.tsx +++ b/web/packages/shared/components/ClusterDropdown/ClusterDropdown.tsx @@ -16,16 +16,17 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import styled from 'styled-components'; +import React, { useEffect, useState } from 'react'; import { useHistory } from 'react-router'; +import styled from 'styled-components'; + import { Box, ButtonSecondary, Flex, Menu, MenuItem, Text } from 'design'; import { ChevronDown } from 'design/Icon'; +import { HoverTooltip } from 'shared/components/ToolTip'; + import cfg from 'teleport/config'; import { Cluster } from 'teleport/services/clusters'; -import { HoverTooltip } from 'shared/components/ToolTip'; - export interface ClusterDropdownProps { clusterLoader: ClusterLoader; clusterId: string; diff --git a/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx b/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx index 9758176f55156..ecc2190e0b5b5 100644 --- a/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx +++ b/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Box, Text } from 'design'; import { Platform } from 'design/platform'; diff --git a/web/packages/shared/components/DownloadConnect/DownloadConnect.tsx b/web/packages/shared/components/DownloadConnect/DownloadConnect.tsx index bb32350f19b08..92b195e858a21 100644 --- a/web/packages/shared/components/DownloadConnect/DownloadConnect.tsx +++ b/web/packages/shared/components/DownloadConnect/DownloadConnect.tsx @@ -18,7 +18,6 @@ import { ButtonSecondary } from 'design/Button'; import { Platform } from 'design/platform'; - import { MenuButton, MenuItem } from 'shared/components/MenuAction'; export type DownloadLink = { text: string; url: string }; diff --git a/web/packages/shared/components/Editor/Editor.tsx b/web/packages/shared/components/Editor/Editor.tsx index 455728dfd6b95..486940173cbb7 100644 --- a/web/packages/shared/components/Editor/Editor.tsx +++ b/web/packages/shared/components/Editor/Editor.tsx @@ -19,19 +19,18 @@ import React, { useState } from 'react'; import styled, { keyframes } from 'styled-components'; +import { + KeywordHighlight, + TerminalColor, +} from 'shared/components/AnimatedTerminal/TerminalContent'; +import { Language } from 'shared/components/Editor/Language'; +import { Tabs } from 'shared/components/Editor/Tabs'; import { WindowCode, WindowContainer, WindowContentContainer, WindowTitleBar, } from 'shared/components/Window'; -import { Tabs } from 'shared/components/Editor/Tabs'; -import { Language } from 'shared/components/Editor/Language'; - -import { - KeywordHighlight, - TerminalColor, -} from 'shared/components/AnimatedTerminal/TerminalContent'; import { File, FileProps } from './File'; diff --git a/web/packages/shared/components/EmptyState/EmptyState.tsx b/web/packages/shared/components/EmptyState/EmptyState.tsx index 802e81b23c25f..b95bd8819eab8 100644 --- a/web/packages/shared/components/EmptyState/EmptyState.tsx +++ b/web/packages/shared/components/EmptyState/EmptyState.tsx @@ -17,7 +17,8 @@ */ import styled from 'styled-components'; -import { Flex, Text, Box } from 'design'; + +import { Box, Flex, Text } from 'design'; export const FeatureContainer = styled(Flex)` @media (min-width: 1662px) { diff --git a/web/packages/shared/components/FieldInput/FieldInput.story.tsx b/web/packages/shared/components/FieldInput/FieldInput.story.tsx index 01e67dd94a729..d6fbaa28ed2bd 100644 --- a/web/packages/shared/components/FieldInput/FieldInput.story.tsx +++ b/web/packages/shared/components/FieldInput/FieldInput.story.tsx @@ -21,7 +21,6 @@ import React from 'react'; import { Text } from 'design'; import Validation from '../../components/Validation'; - import FieldInput from './FieldInput'; export default { diff --git a/web/packages/shared/components/FieldInput/FieldInput.test.tsx b/web/packages/shared/components/FieldInput/FieldInput.test.tsx index a4a6bd0b74f56..91b3bb7e80fc6 100644 --- a/web/packages/shared/components/FieldInput/FieldInput.test.tsx +++ b/web/packages/shared/components/FieldInput/FieldInput.test.tsx @@ -16,15 +16,13 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; - -import { render, fireEvent } from 'design/utils/testing'; +import React from 'react'; import { darkTheme } from 'design/theme'; +import { fireEvent, render } from 'design/utils/testing'; import * as useRule from '../Validation/useRule'; - import FieldInput from './FieldInput'; import { Fields } from './FieldInput.story'; diff --git a/web/packages/shared/components/FieldInput/FieldInput.tsx b/web/packages/shared/components/FieldInput/FieldInput.tsx index 0e4942045fae3..5850cfc3deeff 100644 --- a/web/packages/shared/components/FieldInput/FieldInput.tsx +++ b/web/packages/shared/components/FieldInput/FieldInput.tsx @@ -17,8 +17,8 @@ */ import React, { forwardRef } from 'react'; -import { Box, Input, LabelInput, Text } from 'design'; +import { Box, Input, LabelInput, Text } from 'design'; import { ToolTipInfo } from 'shared/components/ToolTip'; import { useRule } from 'shared/components/Validation'; diff --git a/web/packages/shared/components/FieldInput/index.ts b/web/packages/shared/components/FieldInput/index.ts index c5b9e121d8882..9f0c8b4533f26 100644 --- a/web/packages/shared/components/FieldInput/index.ts +++ b/web/packages/shared/components/FieldInput/index.ts @@ -17,5 +17,6 @@ */ import FieldInput from './FieldInput'; + export default FieldInput; export type { FieldInputProps } from './FieldInput'; diff --git a/web/packages/shared/components/FieldMultiInput/FieldMultiInput.tsx b/web/packages/shared/components/FieldMultiInput/FieldMultiInput.tsx index eaa98ef0a6511..e39b8da757507 100644 --- a/web/packages/shared/components/FieldMultiInput/FieldMultiInput.tsx +++ b/web/packages/shared/components/FieldMultiInput/FieldMultiInput.tsx @@ -16,14 +16,15 @@ * along with this program. If not, see . */ +import { useRef } from 'react'; +import styled, { useTheme } from 'styled-components'; + import Box from 'design/Box'; import { ButtonSecondary } from 'design/Button'; import ButtonIcon from 'design/ButtonIcon'; import Flex from 'design/Flex'; import * as Icon from 'design/Icon'; import Input from 'design/Input'; -import { useRef } from 'react'; -import styled, { useTheme } from 'styled-components'; export type FieldMultiInputProps = { label?: string; diff --git a/web/packages/shared/components/FieldSelect/FieldSelect.story.tsx b/web/packages/shared/components/FieldSelect/FieldSelect.story.tsx index 6126e036bd385..3773a0cf2d82a 100644 --- a/web/packages/shared/components/FieldSelect/FieldSelect.story.tsx +++ b/web/packages/shared/components/FieldSelect/FieldSelect.story.tsx @@ -17,11 +17,11 @@ */ import { useState } from 'react'; -import { Flex } from 'design'; -import { wait } from 'shared/utils/wait'; -import Validation from 'shared/components/Validation'; +import { Flex } from 'design'; import { Option } from 'shared/components/Select'; +import Validation from 'shared/components/Validation'; +import { wait } from 'shared/utils/wait'; import { FieldSelect, FieldSelectAsync } from './FieldSelect'; diff --git a/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx b/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx index 445c68b34f47c..c7e57a2484cc7 100644 --- a/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx +++ b/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx @@ -16,15 +16,13 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; - -import { render, fireEvent } from 'design/utils/testing'; +import React from 'react'; import { darkTheme } from 'design/theme'; +import { fireEvent, render } from 'design/utils/testing'; import * as useRule from '../Validation/useRule'; - import FieldSelect from './FieldSelect'; test('valid values and onChange prop', () => { diff --git a/web/packages/shared/components/FieldSelect/FieldSelect.tsx b/web/packages/shared/components/FieldSelect/FieldSelect.tsx index 7e8a20b53ab7b..865d7dc703359 100644 --- a/web/packages/shared/components/FieldSelect/FieldSelect.tsx +++ b/web/packages/shared/components/FieldSelect/FieldSelect.tsx @@ -17,17 +17,15 @@ */ import { Box, LabelInput } from 'design'; - import { useRule } from 'shared/components/Validation'; import { useAsync } from 'shared/hooks/useAsync'; import Select, { - Props as SelectProps, - SelectAsync, AsyncProps as AsyncSelectProps, + SelectAsync, + Props as SelectProps, } from '../Select'; - -import { LabelTip, defaultRule } from './shared'; +import { defaultRule, LabelTip } from './shared'; export function FieldSelect({ components, diff --git a/web/packages/shared/components/FieldSelect/FieldSelectCreatable.story.tsx b/web/packages/shared/components/FieldSelect/FieldSelectCreatable.story.tsx index a83d4203b9fcc..9f1924341545f 100644 --- a/web/packages/shared/components/FieldSelect/FieldSelectCreatable.story.tsx +++ b/web/packages/shared/components/FieldSelect/FieldSelectCreatable.story.tsx @@ -17,11 +17,11 @@ */ import { useState } from 'react'; -import { Flex } from 'design'; -import { wait } from 'shared/utils/wait'; -import Validation from 'shared/components/Validation'; +import { Flex } from 'design'; import { Option } from 'shared/components/Select'; +import Validation from 'shared/components/Validation'; +import { wait } from 'shared/utils/wait'; import { FieldSelectCreatable, diff --git a/web/packages/shared/components/FieldSelect/FieldSelectCreatable.tsx b/web/packages/shared/components/FieldSelect/FieldSelectCreatable.tsx index 841929522bbf7..bd325cb431f72 100644 --- a/web/packages/shared/components/FieldSelect/FieldSelectCreatable.tsx +++ b/web/packages/shared/components/FieldSelect/FieldSelectCreatable.tsx @@ -19,10 +19,9 @@ import React from 'react'; import { Box, Flex, LabelInput } from 'design'; - -import { useAsync } from 'shared/hooks/useAsync'; import { ToolTipInfo } from 'shared/components/ToolTip'; import { useRule } from 'shared/components/Validation'; +import { useAsync } from 'shared/hooks/useAsync'; import { AsyncProps, @@ -30,8 +29,7 @@ import { CreatableProps as SelectCreatableProps, } from '../Select'; import { SelectCreatableAsync } from '../Select/Select'; - -import { LabelTip, defaultRule } from './shared'; +import { defaultRule, LabelTip } from './shared'; /** * Returns a styled SelectCreatable with label, input validation rule and error handling. diff --git a/web/packages/shared/components/FieldSelect/index.ts b/web/packages/shared/components/FieldSelect/index.ts index 7c8a50a36d62b..f989f7b562e3d 100644 --- a/web/packages/shared/components/FieldSelect/index.ts +++ b/web/packages/shared/components/FieldSelect/index.ts @@ -17,6 +17,7 @@ */ import FieldSelect from './FieldSelect'; + export default FieldSelect; export * from './FieldSelect'; diff --git a/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx b/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx index 2846f880ee6bb..312de8a34cc0a 100644 --- a/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx +++ b/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx @@ -19,7 +19,6 @@ import React from 'react'; import Validation from '../../components/Validation'; - import { FieldTextArea } from './FieldTextArea'; export default { diff --git a/web/packages/shared/components/FieldTextArea/FieldTextArea.tsx b/web/packages/shared/components/FieldTextArea/FieldTextArea.tsx index a1d492ad2c9fa..9c3653a51eaed 100644 --- a/web/packages/shared/components/FieldTextArea/FieldTextArea.tsx +++ b/web/packages/shared/components/FieldTextArea/FieldTextArea.tsx @@ -17,8 +17,8 @@ */ import React from 'react'; -import { Box, LabelInput, Text, TextArea } from 'design'; +import { Box, LabelInput, Text, TextArea } from 'design'; import { useRule } from 'shared/components/Validation'; export interface FieldTextAreaProps diff --git a/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx b/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx index 11de431965aad..e9599382c2aee 100644 --- a/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { act, fireEvent, @@ -25,10 +26,10 @@ import { waitForElementToBeRemoved, } from 'design/utils/testing'; +import { createFileTransferEventsEmitter } from './createFileTransferEventsEmitter'; import { FileTransfer, TransferHandlers } from './FileTransfer'; import { FileTransferContextProvider } from './FileTransferContextProvider'; import { FileTransferDialogDirection } from './FileTransferStateless'; -import { createFileTransferEventsEmitter } from './createFileTransferEventsEmitter'; function FileTransferTestWrapper(props: { beforeClose?: () => boolean | Promise; diff --git a/web/packages/shared/components/FileTransfer/FileTransfer.tsx b/web/packages/shared/components/FileTransfer/FileTransfer.tsx index a192461b61447..d5f70db4edc0a 100644 --- a/web/packages/shared/components/FileTransfer/FileTransfer.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransfer.tsx @@ -18,13 +18,13 @@ import React from 'react'; +import { FileTransferContainer } from './FileTransferContainer'; import { useFileTransferContext } from './FileTransferContextProvider'; import { FileTransferDialogDirection, FileTransferListeners, FileTransferStateless, } from './FileTransferStateless'; -import { FileTransferContainer } from './FileTransferContainer'; interface FileTransferProps { transferHandlers: TransferHandlers; diff --git a/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx b/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx index 720f42b226f0a..15f70c14341ec 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx @@ -17,11 +17,11 @@ */ import React from 'react'; -import { Flex, ButtonIcon, Text } from 'design'; + +import { ButtonIcon, Flex, Text } from 'design'; import * as Icons from 'design/Icon'; import { HoverTooltip } from '../ToolTip'; - import { useFileTransferContext } from './FileTransferContextProvider'; type FileTransferActionBarProps = { diff --git a/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx b/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx index 031d4bbb0608c..23754212df01f 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx @@ -17,11 +17,11 @@ */ import React, { - useContext, - useState, - FC, createContext, + FC, PropsWithChildren, + useContext, + useState, } from 'react'; import { FileTransferDialogDirection } from './FileTransferStateless'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx b/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx index 1e066f45f2519..7c508db09d078 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx @@ -18,13 +18,15 @@ import React from 'react'; import styled from 'styled-components'; -import { ButtonBorder, Box, Flex, Text } from 'design'; + +import { Box, ButtonBorder, Flex, Text } from 'design'; import * as Icons from 'design/Icon'; + +import { useConsoleContext } from 'teleport/Console/consoleContextProvider'; import { FileTransferRequest, isOwnRequest, } from 'teleport/Console/DocumentSsh/useFileTransfer'; -import { useConsoleContext } from 'teleport/Console/consoleContextProvider'; import { UserContext } from 'teleport/services/user'; type FileTransferRequestsProps = { diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx index b3ed7919609de..970a5f58f4d96 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx @@ -20,8 +20,8 @@ import React, { forwardRef } from 'react'; import styled from 'styled-components'; import FieldInput, { FieldInputProps } from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import Validation from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; export const Form = styled.form.attrs(() => ({ 'aria-label': 'form', diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx index be91459bbd712..ea4de9f749e2f 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { fireEvent, render, screen } from 'design/utils/testing'; import { DownloadForm } from './DownloadForm'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx index 460c66affdf0f..76ad877748717 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx @@ -17,6 +17,7 @@ */ import React, { useState } from 'react'; + import { Flex } from 'design'; import { ButtonPrimary } from 'design/Button'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx index 9e1c64d6e8b73..d81a35a1c16a7 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx @@ -17,10 +17,10 @@ */ import React from 'react'; + import { fireEvent, render, screen } from 'design/utils/testing'; import { TransferredFile } from '../types'; - import { FileList } from './FileList'; const files: TransferredFile[] = [ diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx index 052e9e100a86e..8c1ee36b1b843 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx @@ -20,7 +20,6 @@ import React from 'react'; import styled from 'styled-components'; import { TransferredFile } from '../types'; - import { FileListItem } from './FileListItem'; interface FileListProps { diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx index a53a42a884e3f..bec510d9d2561 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx @@ -18,6 +18,7 @@ import React, { FC, PropsWithChildren, useEffect } from 'react'; import styled from 'styled-components'; + import { ButtonIcon, Flex, Text } from 'design'; import { CircleCheck, Cross, Warning } from 'design/Icon'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx index c2a212ea68b4d..a0b8e3a33d614 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx @@ -19,7 +19,6 @@ import React from 'react'; import { FileTransferContainer } from '../FileTransferContainer'; - import { FileTransferStateless, FileTransferStatelessProps, diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx index f0ebfd507e2e0..7b9de0d591c70 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx @@ -18,13 +18,14 @@ import React from 'react'; import styled from 'styled-components'; + import { ButtonIcon, Flex, Text } from 'design'; import { Cross as CloseIcon } from 'design/Icon'; -import { FileTransferDialogDirection, TransferredFile } from './types'; import { DownloadForm } from './DownloadForm'; -import { UploadForm } from './UploadForm'; import { FileList } from './FileList'; +import { FileTransferDialogDirection, TransferredFile } from './types'; +import { UploadForm } from './UploadForm'; export interface FileTransferStatelessProps { openedDialog: FileTransferDialogDirection; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx index 465387081d940..565f476317c9e 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { fireEvent, render, screen } from 'design/utils/testing'; import { UploadForm } from './UploadForm'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.tsx index d05d6f0130ece..5c07601635d91 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.tsx @@ -18,10 +18,11 @@ import React, { useRef, useState } from 'react'; import styled from 'styled-components'; + import { Text } from 'design'; import { NoteAdded } from 'design/Icon'; -import { PathInput, Form } from '../CommonElements'; +import { Form, PathInput } from '../CommonElements'; interface UploadFormProps { onAddUpload(destinationPath: string, file: File): void; diff --git a/web/packages/shared/components/FormPassword/FormPassword.test.tsx b/web/packages/shared/components/FormPassword/FormPassword.test.tsx index cba542342151d..22fbbbf988330 100644 --- a/web/packages/shared/components/FormPassword/FormPassword.test.tsx +++ b/web/packages/shared/components/FormPassword/FormPassword.test.tsx @@ -18,7 +18,7 @@ import React from 'react'; -import { render, fireEvent, waitFor, screen } from 'design/utils/testing'; +import { fireEvent, render, screen, waitFor } from 'design/utils/testing'; import FormPassword from './FormPassword'; import { On, Optional } from './FormPassword.story'; diff --git a/web/packages/shared/components/FormPassword/FormPassword.tsx b/web/packages/shared/components/FormPassword/FormPassword.tsx index a31a3ef171af2..e6d14c887adf8 100644 --- a/web/packages/shared/components/FormPassword/FormPassword.tsx +++ b/web/packages/shared/components/FormPassword/FormPassword.tsx @@ -17,22 +17,21 @@ */ import React from 'react'; -import { ButtonPrimary, Flex, Box, ButtonSecondary } from 'design'; -import * as Alerts from 'design/Alert'; +import { Box, ButtonPrimary, ButtonSecondary, Flex } from 'design'; +import * as Alerts from 'design/Alert'; import useAttempt from 'shared/hooks/useAttempt'; -import createMfaOptions, { MfaOption } from 'shared/utils/createMfaOptions'; - import { Auth2faType, PreferredMfaType } from 'shared/services'; +import createMfaOptions, { MfaOption } from 'shared/utils/createMfaOptions'; import FieldInput from '../FieldInput'; import FieldSelect from '../FieldSelect'; import Validation, { Validator } from '../Validation'; import { - requiredToken, - requiredPassword, - requiredField, requiredConfirmedPassword, + requiredField, + requiredPassword, + requiredToken, } from '../Validation/rules'; function FormPassword(props: Props) { diff --git a/web/packages/shared/components/FormPassword/index.ts b/web/packages/shared/components/FormPassword/index.ts index ec96921b630e7..bd85980299597 100644 --- a/web/packages/shared/components/FormPassword/index.ts +++ b/web/packages/shared/components/FormPassword/index.ts @@ -17,4 +17,5 @@ */ import FormPassword from './FormPassword'; + export default FormPassword; diff --git a/web/packages/shared/components/Highlight/Highlight.story.tsx b/web/packages/shared/components/Highlight/Highlight.story.tsx index 946dc1f512ddf..d446a330224d1 100644 --- a/web/packages/shared/components/Highlight/Highlight.story.tsx +++ b/web/packages/shared/components/Highlight/Highlight.story.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Flex, Text } from 'design'; import { Highlight } from './Highlight'; diff --git a/web/packages/shared/components/Highlight/Highlight.tsx b/web/packages/shared/components/Highlight/Highlight.tsx index 017c1903729c4..e296b74e507d3 100644 --- a/web/packages/shared/components/Highlight/Highlight.tsx +++ b/web/packages/shared/components/Highlight/Highlight.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { findAll } from 'highlight-words-core'; +import React from 'react'; /** * Highlight wraps the keywords found in the text in tags. diff --git a/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.test.tsx b/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.test.tsx index 426e45c61650d..d6aad4529441f 100644 --- a/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.test.tsx +++ b/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.test.tsx @@ -17,9 +17,9 @@ */ import { - latencyColors, ERROR_THRESHOLD, LatencyColor, + latencyColors, WARN_THRESHOLD, } from 'shared/components/LatencyDiagnostic/LatencyDiagnostic'; diff --git a/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.tsx b/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.tsx index cd30ba6d90f75..acdf875ef3df3 100644 --- a/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.tsx +++ b/web/packages/shared/components/LatencyDiagnostic/LatencyDiagnostic.tsx @@ -16,17 +16,16 @@ * along with this program. If not, see . */ -import styled from 'styled-components'; import React from 'react'; +import styled from 'styled-components'; -import * as Icons from 'design/Icon'; import { Flex, Text } from 'design'; +import * as Icons from 'design/Icon'; import { TeleportGearIcon } from 'design/SVGIcon'; +import { MenuIcon } from 'shared/components/MenuAction'; import { DocumentSsh } from 'teleport/Console/stores'; -import { MenuIcon } from 'shared/components/MenuAction'; - export const WARN_THRESHOLD = 150; export const ERROR_THRESHOLD = 400; diff --git a/web/packages/shared/components/MenuAction/MenuAction.story.tsx b/web/packages/shared/components/MenuAction/MenuAction.story.tsx index 156193ea6aeac..7f59c94184c52 100644 --- a/web/packages/shared/components/MenuAction/MenuAction.story.tsx +++ b/web/packages/shared/components/MenuAction/MenuAction.story.tsx @@ -17,10 +17,11 @@ */ import React from 'react'; + import { Flex } from 'design'; import { Cog } from 'design/Icon'; -import { MenuIcon, MenuButton, MenuItem } from '.'; +import { MenuButton, MenuIcon, MenuItem } from '.'; export default { title: 'Shared/MenuAction', diff --git a/web/packages/shared/components/MenuAction/MenuAction.test.tsx b/web/packages/shared/components/MenuAction/MenuAction.test.tsx index 184bb434e495a..fbf5907bce9a8 100644 --- a/web/packages/shared/components/MenuAction/MenuAction.test.tsx +++ b/web/packages/shared/components/MenuAction/MenuAction.test.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; -import { render, fireEvent } from 'design/utils/testing'; +import { fireEvent, render } from 'design/utils/testing'; import { MenuIcon, MenuItem } from '.'; diff --git a/web/packages/shared/components/MenuAction/MenuActionButton.tsx b/web/packages/shared/components/MenuAction/MenuActionButton.tsx index 758f6c8452f66..8ba5c2d2cd8a7 100644 --- a/web/packages/shared/components/MenuAction/MenuActionButton.tsx +++ b/web/packages/shared/components/MenuAction/MenuActionButton.tsx @@ -17,11 +17,12 @@ */ import React, { PropsWithChildren } from 'react'; -import Menu from 'design/Menu'; + import { ButtonBorder } from 'design'; import { ChevronDown } from 'design/Icon'; +import Menu from 'design/Menu'; -import { MenuProps, AnchorProps } from './types'; +import { AnchorProps, MenuProps } from './types'; type Props = MenuProps & { defaultOpen?: boolean; diff --git a/web/packages/shared/components/MenuAction/MenuActionIcon.tsx b/web/packages/shared/components/MenuAction/MenuActionIcon.tsx index d8cbb17841414..679d09e05b287 100644 --- a/web/packages/shared/components/MenuAction/MenuActionIcon.tsx +++ b/web/packages/shared/components/MenuAction/MenuActionIcon.tsx @@ -17,12 +17,13 @@ */ import React, { PropsWithChildren } from 'react'; -import Menu from 'design/Menu'; + import { ButtonIcon } from 'design'; import { MoreHoriz } from 'design/Icon'; import { IconProps } from 'design/Icon/Icon'; +import Menu from 'design/Menu'; -import { MenuProps, AnchorProps } from './types'; +import { AnchorProps, MenuProps } from './types'; export default class MenuActionIcon extends React.Component< PropsWithChildren diff --git a/web/packages/shared/components/MenuAction/index.ts b/web/packages/shared/components/MenuAction/index.ts index 34b1b64e880fe..24b94a7278a9f 100644 --- a/web/packages/shared/components/MenuAction/index.ts +++ b/web/packages/shared/components/MenuAction/index.ts @@ -18,7 +18,7 @@ import { MenuItem, MenuItemIcon } from 'design/Menu'; -import MenuIcon from './MenuActionIcon'; import MenuButton from './MenuActionButton'; +import MenuIcon from './MenuActionIcon'; export { MenuIcon, MenuButton, MenuItem, MenuItemIcon }; diff --git a/web/packages/shared/components/MenuLogin/MenuLogin.story.tsx b/web/packages/shared/components/MenuLogin/MenuLogin.story.tsx index 347ae0e5a2c35..5533d995facdb 100644 --- a/web/packages/shared/components/MenuLogin/MenuLogin.story.tsx +++ b/web/packages/shared/components/MenuLogin/MenuLogin.story.tsx @@ -16,8 +16,9 @@ * along with this program. If not, see . */ -import React from 'react'; import { storiesOf } from '@storybook/react'; +import React from 'react'; + import { Flex } from 'design'; import { MenuLogin } from './MenuLogin'; diff --git a/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx b/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx index 56d9d4be7c5b4..c0bbee5d126d8 100644 --- a/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx +++ b/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx @@ -17,7 +17,8 @@ */ import React from 'react'; -import { render, fireEvent, screen, waitFor } from 'design/utils/testing'; + +import { fireEvent, render, screen, waitFor } from 'design/utils/testing'; import { MenuLogin } from './MenuLogin'; diff --git a/web/packages/shared/components/MenuLogin/MenuLogin.tsx b/web/packages/shared/components/MenuLogin/MenuLogin.tsx index 68f13121361ae..ceef6934a4d8b 100644 --- a/web/packages/shared/components/MenuLogin/MenuLogin.tsx +++ b/web/packages/shared/components/MenuLogin/MenuLogin.tsx @@ -17,17 +17,16 @@ */ import React, { useImperativeHandle, useRef, useState } from 'react'; -import styled from 'styled-components'; import { NavLink } from 'react-router-dom'; -import Menu, { MenuItem } from 'design/Menu'; -import { space, SpaceProps } from 'design/system'; +import styled from 'styled-components'; import { ButtonBorder, Flex, Indicator } from 'design'; import { ChevronDown } from 'design/Icon'; +import Menu, { MenuItem } from 'design/Menu'; +import { space, SpaceProps } from 'design/system'; +import { Attempt, useAsync } from 'shared/hooks/useAsync'; -import { useAsync, Attempt } from 'shared/hooks/useAsync'; - -import { MenuLoginProps, LoginItem, MenuLoginHandle } from './types'; +import { LoginItem, MenuLoginHandle, MenuLoginProps } from './types'; export const MenuLogin = React.forwardRef( (props, ref) => { diff --git a/web/packages/shared/components/MissingPermissionsTooltip/MissingPermissionsTooltip.tsx b/web/packages/shared/components/MissingPermissionsTooltip/MissingPermissionsTooltip.tsx index f414c2526318f..b0e4fd5f943fd 100644 --- a/web/packages/shared/components/MissingPermissionsTooltip/MissingPermissionsTooltip.tsx +++ b/web/packages/shared/components/MissingPermissionsTooltip/MissingPermissionsTooltip.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { Box, Text, Flex } from 'design'; +import { Box, Flex, Text } from 'design'; export const MissingPermissionsTooltip = ({ missingPermissions, diff --git a/web/packages/shared/components/Notification/Notification.story.tsx b/web/packages/shared/components/Notification/Notification.story.tsx index f02da7cffcae5..88615c03bff6b 100644 --- a/web/packages/shared/components/Notification/Notification.story.tsx +++ b/web/packages/shared/components/Notification/Notification.story.tsx @@ -17,8 +17,9 @@ */ import React, { useState } from 'react'; -import { Info, Warning } from 'design/Icon'; + import Flex from 'design/Flex'; +import { Info, Warning } from 'design/Icon'; import { Notification } from './Notification'; diff --git a/web/packages/shared/components/Notification/Notification.tsx b/web/packages/shared/components/Notification/Notification.tsx index fe0da9e53eac5..5b84c9abfa824 100644 --- a/web/packages/shared/components/Notification/Notification.tsx +++ b/web/packages/shared/components/Notification/Notification.tsx @@ -18,6 +18,7 @@ import React, { useEffect, useRef, useState } from 'react'; import styled, { useTheme } from 'styled-components'; + import { ButtonIcon, Flex, Link, Text } from 'design'; import { Cross } from 'design/Icon'; diff --git a/web/packages/shared/components/Search/SearchPagination.tsx b/web/packages/shared/components/Search/SearchPagination.tsx index d4d31851abf7d..b82f749a268cb 100644 --- a/web/packages/shared/components/Search/SearchPagination.tsx +++ b/web/packages/shared/components/Search/SearchPagination.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; + import { Flex } from 'design'; -import { StyledPanel } from 'design/DataTable/StyledTable'; import { StyledArrowBtn } from 'design/DataTable/Pager/StyledPager'; +import { StyledPanel } from 'design/DataTable/StyledTable'; import { CircleArrowLeft, CircleArrowRight } from 'design/Icon'; export function SearchPagination({ prevPage, nextPage }: Props) { diff --git a/web/packages/shared/components/Search/SearchPanel.tsx b/web/packages/shared/components/Search/SearchPanel.tsx index e4dec55a30776..d85a8c14f9ced 100644 --- a/web/packages/shared/components/Search/SearchPanel.tsx +++ b/web/packages/shared/components/Search/SearchPanel.tsx @@ -18,13 +18,14 @@ import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + import { Flex } from 'design'; import InputSearch from 'design/DataTable/InputSearch'; import { PageIndicatorText } from 'design/DataTable/Pager/PageIndicatorText'; -import { ResourceFilter } from 'teleport/services/agents'; - import { AdvancedSearchToggle } from 'shared/components/AdvancedSearchToggle'; +import { ResourceFilter } from 'teleport/services/agents'; + export function SearchPanel({ updateQuery, updateSearch, diff --git a/web/packages/shared/components/Select/Select.story.tsx b/web/packages/shared/components/Select/Select.story.tsx index f453f625c25a7..f80828be1b32c 100644 --- a/web/packages/shared/components/Select/Select.story.tsx +++ b/web/packages/shared/components/Select/Select.story.tsx @@ -17,6 +17,7 @@ */ import { useState } from 'react'; + import { Flex } from 'design'; import Select, { Option } from '../Select'; diff --git a/web/packages/shared/components/Select/Select.tsx b/web/packages/shared/components/Select/Select.tsx index e15f698caa618..50bb4f8d5e496 100644 --- a/web/packages/shared/components/Select/Select.tsx +++ b/web/packages/shared/components/Select/Select.tsx @@ -19,12 +19,13 @@ import React from 'react'; import ReactSelect from 'react-select'; import ReactSelectAsync from 'react-select/async'; -import CreatableSelect from 'react-select/creatable'; import ReactSelectCreatableAsync from 'react-select/async-creatable'; +import CreatableSelect from 'react-select/creatable'; import styled from 'styled-components'; -import { width, WidthProps, space, SpaceProps } from 'design/system'; -import { Props, AsyncProps, CreatableProps } from './types'; +import { space, SpaceProps, width, WidthProps } from 'design/system'; + +import { AsyncProps, CreatableProps, Props } from './types'; export default function Select(props: Props) { const { diff --git a/web/packages/shared/components/Select/SelectCreatable.story.tsx b/web/packages/shared/components/Select/SelectCreatable.story.tsx index d3feb33cd8c48..6412b1fe8c6d8 100644 --- a/web/packages/shared/components/Select/SelectCreatable.story.tsx +++ b/web/packages/shared/components/Select/SelectCreatable.story.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { Flex, Box } from 'design'; -import { SelectCreatable, Option } from '../Select'; +import { Box, Flex } from 'design'; + +import { Option, SelectCreatable } from '../Select'; export default { title: 'Shared/SelectCreatable', diff --git a/web/packages/shared/components/Select/types.ts b/web/packages/shared/components/Select/types.ts index 9ed90bdbc934a..dfb134fea6fb1 100644 --- a/web/packages/shared/components/Select/types.ts +++ b/web/packages/shared/components/Select/types.ts @@ -17,7 +17,6 @@ */ import React, { FocusEvent } from 'react'; - import { StylesConfig } from 'react-select'; export type Props = { diff --git a/web/packages/shared/components/SplitPane/SplitPane.jsx b/web/packages/shared/components/SplitPane/SplitPane.jsx index 4058ee7c8703f..bb7e84186921f 100644 --- a/web/packages/shared/components/SplitPane/SplitPane.jsx +++ b/web/packages/shared/components/SplitPane/SplitPane.jsx @@ -18,8 +18,8 @@ import React from 'react'; import styled from 'styled-components'; -import { Flex, Box } from 'design'; +import { Box, Flex } from 'design'; import useDraggable from 'shared/hooks/useDraggable'; export default function SplitPane({ diff --git a/web/packages/shared/components/SplitPane/SplitPane.story.js b/web/packages/shared/components/SplitPane/SplitPane.story.js index 01c0082dff721..a7a550959fa28 100644 --- a/web/packages/shared/components/SplitPane/SplitPane.story.js +++ b/web/packages/shared/components/SplitPane/SplitPane.story.js @@ -16,9 +16,10 @@ * along with this program. If not, see . */ +import { storiesOf } from '@storybook/react'; import React from 'react'; import styled from 'styled-components'; -import { storiesOf } from '@storybook/react'; + import { Box } from 'design'; import SplitPane from './SplitPane'; diff --git a/web/packages/shared/components/SplitPane/index.js b/web/packages/shared/components/SplitPane/index.js index e8091bbc96112..51effc5f512fe 100644 --- a/web/packages/shared/components/SplitPane/index.js +++ b/web/packages/shared/components/SplitPane/index.js @@ -16,6 +16,7 @@ * along with this program. If not, see . */ -import SplitPane, { PaneSide, YHolder, XHolder } from './SplitPane'; +import SplitPane, { PaneSide, XHolder, YHolder } from './SplitPane'; + export default SplitPane; export { PaneSide, YHolder, XHolder }; diff --git a/web/packages/shared/components/TerminalSearch/TerminalSearch.test.tsx b/web/packages/shared/components/TerminalSearch/TerminalSearch.test.tsx index a2429a53119e8..0c205955b68d7 100644 --- a/web/packages/shared/components/TerminalSearch/TerminalSearch.test.tsx +++ b/web/packages/shared/components/TerminalSearch/TerminalSearch.test.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -import { render, act, screen } from 'design/utils/testing'; import { SearchAddon } from '@xterm/addon-search'; +import { act, render, screen } from 'design/utils/testing'; + import { TerminalSearch } from './TerminalSearch'; let searchCallback: SearchCallbackType; diff --git a/web/packages/shared/components/TerminalSearch/TerminalSearch.tsx b/web/packages/shared/components/TerminalSearch/TerminalSearch.tsx index 9e757caadcd0b..6aa6254e7e57d 100644 --- a/web/packages/shared/components/TerminalSearch/TerminalSearch.tsx +++ b/web/packages/shared/components/TerminalSearch/TerminalSearch.tsx @@ -16,11 +16,12 @@ * along with this program. If not, see . */ -import { useEffect, useState, useRef, useCallback } from 'react'; +import { SearchAddon } from '@xterm/addon-search'; +import { useCallback, useEffect, useRef, useState } from 'react'; import styled, { useTheme } from 'styled-components'; -import { Flex, ButtonIcon, Box, P2, Input } from 'design'; + +import { Box, ButtonIcon, Flex, Input, P2 } from 'design'; import { ChevronDown, ChevronUp, Cross } from 'design/Icon'; -import { SearchAddon } from '@xterm/addon-search'; export interface TerminalSearcher { getSearchAddon(): SearchAddon; diff --git a/web/packages/shared/components/TextEditor/StyledTextEditor.jsx b/web/packages/shared/components/TextEditor/StyledTextEditor.jsx index e57cec71263cb..b1395fcfce080 100644 --- a/web/packages/shared/components/TextEditor/StyledTextEditor.jsx +++ b/web/packages/shared/components/TextEditor/StyledTextEditor.jsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { color } from 'design/system'; const StyledTextEditor = styled.div` diff --git a/web/packages/shared/components/TextEditor/TextEditor.jsx b/web/packages/shared/components/TextEditor/TextEditor.jsx index 6ddf493c3fcde..0f45662fa17c1 100644 --- a/web/packages/shared/components/TextEditor/TextEditor.jsx +++ b/web/packages/shared/components/TextEditor/TextEditor.jsx @@ -16,18 +16,18 @@ * along with this program. If not, see . */ +import ace from 'ace-builds/src-min-noconflict/ace'; import React from 'react'; import styled from 'styled-components'; -import ace from 'ace-builds/src-min-noconflict/ace'; import 'ace-builds/src-noconflict/mode-json'; import 'ace-builds/src-noconflict/mode-yaml'; import 'ace-builds/src-noconflict/ext-searchbox'; + import { ButtonSecondary } from 'design/Button'; import Flex from 'design/Flex'; import { Copy, Download } from 'design/Icon'; import { copyToClipboard } from 'design/utils/copyToClipboard'; - import { downloadObject } from 'shared/utils/download'; import StyledTextEditor from './StyledTextEditor'; diff --git a/web/packages/shared/components/TextEditor/TextEditor.test.tsx b/web/packages/shared/components/TextEditor/TextEditor.test.tsx index d8868b64e49f7..c2969bdfd7a9d 100644 --- a/web/packages/shared/components/TextEditor/TextEditor.test.tsx +++ b/web/packages/shared/components/TextEditor/TextEditor.test.tsx @@ -17,9 +17,9 @@ */ import React from 'react'; -import { render, userEvent, screen } from 'design/utils/testing'; -import * as copyModule from 'design/utils/copyToClipboard'; +import * as copyModule from 'design/utils/copyToClipboard'; +import { render, screen, userEvent } from 'design/utils/testing'; import * as downloadsModule from 'shared/utils/download'; import TextEditor from '.'; diff --git a/web/packages/shared/components/TextEditor/index.js b/web/packages/shared/components/TextEditor/index.js index 8df430111cd68..cc25131452b00 100644 --- a/web/packages/shared/components/TextEditor/index.js +++ b/web/packages/shared/components/TextEditor/index.js @@ -17,4 +17,5 @@ */ import TextEditor from './TextEditor'; + export default TextEditor; diff --git a/web/packages/shared/components/TextSelectCopy/TextSelectCopy.tsx b/web/packages/shared/components/TextSelectCopy/TextSelectCopy.tsx index 7164e09aa4fc4..d5d8d5e240a44 100644 --- a/web/packages/shared/components/TextSelectCopy/TextSelectCopy.tsx +++ b/web/packages/shared/components/TextSelectCopy/TextSelectCopy.tsx @@ -19,10 +19,9 @@ import { useRef, useState } from 'react'; import { useTheme } from 'styled-components'; +import { Box, ButtonPrimary, Flex } from 'design'; import { copyToClipboard } from 'design/utils/copyToClipboard'; import selectElementContent from 'design/utils/selectElementContent'; -import { ButtonPrimary, Box, Flex } from 'design'; - import { wait } from 'shared/utils/wait'; export function TextSelectCopy({ diff --git a/web/packages/shared/components/TextSelectCopy/TextSelectCopyMulti.tsx b/web/packages/shared/components/TextSelectCopy/TextSelectCopyMulti.tsx index 3166ba965fa88..769ce0cd2f3a2 100644 --- a/web/packages/shared/components/TextSelectCopy/TextSelectCopyMulti.tsx +++ b/web/packages/shared/components/TextSelectCopy/TextSelectCopyMulti.tsx @@ -19,11 +19,10 @@ import React, { useRef } from 'react'; import styled from 'styled-components'; +import { Box, ButtonSecondary, Flex } from 'design'; +import { Check, Copy, Download } from 'design/Icon'; import { copyToClipboard } from 'design/utils/copyToClipboard'; import selectElementContent from 'design/utils/selectElementContent'; -import { ButtonSecondary, Box, Flex } from 'design'; -import { Copy, Check, Download } from 'design/Icon'; - import { saveOnDisk } from 'shared/utils/saveOnDisk'; const ONE_SECOND_IN_MS = 1000; diff --git a/web/packages/shared/components/ToolTip/HoverTooltip.tsx b/web/packages/shared/components/ToolTip/HoverTooltip.tsx index e242070ba809f..0613694a2f2cc 100644 --- a/web/packages/shared/components/ToolTip/HoverTooltip.tsx +++ b/web/packages/shared/components/ToolTip/HoverTooltip.tsx @@ -18,8 +18,9 @@ import React, { PropsWithChildren, useState } from 'react'; import styled from 'styled-components'; -import { Popover, Flex, Text } from 'design'; -import { JustifyContentProps, FlexBasisProps } from 'design/system'; + +import { Flex, Popover, Text } from 'design'; +import { FlexBasisProps, JustifyContentProps } from 'design/system'; type OriginProps = { vertical: string; diff --git a/web/packages/shared/components/ToolTip/ToolTip.story.tsx b/web/packages/shared/components/ToolTip/ToolTip.story.tsx index 95ee32c8f39ff..d50437e8496e1 100644 --- a/web/packages/shared/components/ToolTip/ToolTip.story.tsx +++ b/web/packages/shared/components/ToolTip/ToolTip.story.tsx @@ -17,7 +17,8 @@ */ import React from 'react'; -import { Text, Flex } from 'design'; + +import { Flex, Text } from 'design'; import { ToolTipInfo } from './ToolTip'; diff --git a/web/packages/shared/components/UnifiedResources/CardsView/CardsView.tsx b/web/packages/shared/components/UnifiedResources/CardsView/CardsView.tsx index 7bfdfffdefbb7..1d4031809f674 100644 --- a/web/packages/shared/components/UnifiedResources/CardsView/CardsView.tsx +++ b/web/packages/shared/components/UnifiedResources/CardsView/CardsView.tsx @@ -21,14 +21,10 @@ import styled from 'styled-components'; import { Flex } from 'design'; -import { FETCH_MORE_SIZE } from '../UnifiedResources'; - -import { ResourceViewProps } from '../types'; - import { LoadingSkeleton } from '../shared/LoadingSkeleton'; - +import { ResourceViewProps } from '../types'; +import { FETCH_MORE_SIZE } from '../UnifiedResources'; import { LoadingCard } from './LoadingCard'; - import { ResourceCard } from './ResourceCard'; export function CardsView({ diff --git a/web/packages/shared/components/UnifiedResources/CardsView/LoadingCard.tsx b/web/packages/shared/components/UnifiedResources/CardsView/LoadingCard.tsx index 21d0ff2358481..f8a3564416a12 100644 --- a/web/packages/shared/components/UnifiedResources/CardsView/LoadingCard.tsx +++ b/web/packages/shared/components/UnifiedResources/CardsView/LoadingCard.tsx @@ -17,7 +17,8 @@ */ import React, { useState } from 'react'; -import { Flex, Box } from 'design'; + +import { Box, Flex } from 'design'; import { ShimmerBox } from 'design/ShimmerBox'; export function LoadingCard() { diff --git a/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.story.tsx b/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.story.tsx index bf457bab6dc06..9e77949e99acc 100644 --- a/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.story.tsx +++ b/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.story.tsx @@ -16,9 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { Meta, StoryObj } from '@storybook/react'; - +import React from 'react'; import styled from 'styled-components'; import { ButtonBorder } from 'design'; @@ -26,25 +25,21 @@ import { gap, GapProps } from 'design/system'; import { apps } from 'teleport/Apps/fixtures'; import { databases } from 'teleport/Databases/fixtures'; - -import { kubes } from 'teleport/Kubes/fixtures'; import { desktops } from 'teleport/Desktops/fixtures'; +import { kubes } from 'teleport/Kubes/fixtures'; import { nodes } from 'teleport/Nodes/fixtures'; - +import { SamlAppActionProvider } from 'teleport/SamlApplications/useSamlAppActions'; import makeApp from 'teleport/services/apps/makeApps'; import { ResourceActionButton } from 'teleport/UnifiedResources/ResourceActionButton'; -import { SamlAppActionProvider } from 'teleport/SamlApplications/useSamlAppActions'; import { makeUnifiedResourceViewItemApp, makeUnifiedResourceViewItemDatabase, + makeUnifiedResourceViewItemDesktop, makeUnifiedResourceViewItemKube, makeUnifiedResourceViewItemNode, - makeUnifiedResourceViewItemDesktop, } from '../shared/viewItemsFactory'; - import { PinningSupport } from '../types'; - import { ResourceCard } from './ResourceCard'; const additionalResources = [ diff --git a/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.tsx b/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.tsx index 5fc09fc62f9cc..88c86c85d0f17 100644 --- a/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.tsx +++ b/web/packages/shared/components/UnifiedResources/CardsView/ResourceCard.tsx @@ -16,25 +16,23 @@ * along with this program. If not, see . */ -import React, { useState, useEffect, useLayoutEffect, useRef } from 'react'; +import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'; import styled, { css } from 'styled-components'; import { Box, ButtonLink, Flex, Label, Text } from 'design'; import { StyledCheckbox } from 'design/Checkbox'; - import { ResourceIcon } from 'design/ResourceIcon'; +import { HoverTooltip } from 'shared/components/ToolTip'; import { makeLabelTag } from 'teleport/components/formatters'; -import { HoverTooltip } from 'shared/components/ToolTip'; - -import { ResourceItemProps } from '../types'; -import { PinButton } from '../shared/PinButton'; import { CopyButton } from '../shared/CopyButton'; import { BackgroundColorProps, getBackgroundColor, } from '../shared/getBackgroundColor'; +import { PinButton } from '../shared/PinButton'; +import { ResourceItemProps } from '../types'; // Since we do a lot of manual resizing and some absolute positioning, we have // to put some layout constants in place here. diff --git a/web/packages/shared/components/UnifiedResources/FilterPanel.tsx b/web/packages/shared/components/UnifiedResources/FilterPanel.tsx index bb7f9888d0ec7..a2705e5e2391e 100644 --- a/web/packages/shared/components/UnifiedResources/FilterPanel.tsx +++ b/web/packages/shared/components/UnifiedResources/FilterPanel.tsx @@ -18,32 +18,31 @@ import React, { useState } from 'react'; import styled from 'styled-components'; + +import { Flex, Text, Toggle } from 'design'; import { ButtonBorder, ButtonPrimary, ButtonSecondary } from 'design/Button'; -import { SortDir } from 'design/DataTable/types'; -import { Text, Flex, Toggle } from 'design'; -import Menu, { MenuItem } from 'design/Menu'; import { StyledCheckbox } from 'design/Checkbox'; +import { SortDir } from 'design/DataTable/types'; import { - ArrowUp, ArrowDown, - ChevronDown, - SquaresFour, - Rows, ArrowsIn, ArrowsOut, + ArrowUp, + ChevronDown, Refresh, + Rows, + SquaresFour, } from 'design/Icon'; - +import Menu, { MenuItem } from 'design/Menu'; import { ViewMode } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; - import { HoverTooltip } from 'shared/components/ToolTip'; -import { ResourceAvailabilityFilter, FilterKind } from './UnifiedResources'; import { IncludedResourceMode, SharedUnifiedResource, UnifiedResourcesQueryParams, } from './types'; +import { FilterKind, ResourceAvailabilityFilter } from './UnifiedResources'; const kindToLabel: Record = { app: 'Application', diff --git a/web/packages/shared/components/UnifiedResources/ListView/ListView.tsx b/web/packages/shared/components/UnifiedResources/ListView/ListView.tsx index fcd8e58c8a39b..4883de1e21fe5 100644 --- a/web/packages/shared/components/UnifiedResources/ListView/ListView.tsx +++ b/web/packages/shared/components/UnifiedResources/ListView/ListView.tsx @@ -20,13 +20,11 @@ import React from 'react'; import { Flex } from 'design'; +import { LoadingSkeleton } from '../shared/LoadingSkeleton'; import { ResourceViewProps } from '../types'; import { FETCH_MORE_SIZE } from '../UnifiedResources'; - -import { LoadingSkeleton } from '../shared/LoadingSkeleton'; - -import { ResourceListItem } from './ResourceListItem'; import { LoadingListItem } from './LoadingListItem'; +import { ResourceListItem } from './ResourceListItem'; export function ListView({ mappedResources, diff --git a/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.story.tsx b/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.story.tsx index 0cc00e2928913..6b5aa4692311b 100644 --- a/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.story.tsx +++ b/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.story.tsx @@ -16,30 +16,26 @@ * along with this program. If not, see . */ -import React from 'react'; import { Meta, StoryObj } from '@storybook/react'; +import React from 'react'; import { ButtonBorder, Flex } from 'design'; import { apps } from 'teleport/Apps/fixtures'; import { databases } from 'teleport/Databases/fixtures'; - -import { kubes } from 'teleport/Kubes/fixtures'; import { desktops } from 'teleport/Desktops/fixtures'; +import { kubes } from 'teleport/Kubes/fixtures'; import { nodes } from 'teleport/Nodes/fixtures'; - import makeApp from 'teleport/services/apps/makeApps'; import { makeUnifiedResourceViewItemApp, makeUnifiedResourceViewItemDatabase, + makeUnifiedResourceViewItemDesktop, makeUnifiedResourceViewItemKube, makeUnifiedResourceViewItemNode, - makeUnifiedResourceViewItemDesktop, } from '../shared/viewItemsFactory'; - import { PinningSupport } from '../types'; - import { ResourceListItem } from './ResourceListItem'; const additionalResources = [ diff --git a/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.tsx b/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.tsx index 3f72320b7a5cc..dc0bb1763d127 100644 --- a/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.tsx +++ b/web/packages/shared/components/UnifiedResources/ListView/ResourceListItem.tsx @@ -23,18 +23,17 @@ import { Box, ButtonIcon, Flex, Label, Text } from 'design'; import { StyledCheckbox } from 'design/Checkbox'; import { Tags } from 'design/Icon'; import { ResourceIcon } from 'design/ResourceIcon'; +import { HoverTooltip } from 'shared/components/ToolTip'; import { makeLabelTag } from 'teleport/components/formatters'; -import { HoverTooltip } from 'shared/components/ToolTip'; - -import { ResourceItemProps } from '../types'; -import { PinButton } from '../shared/PinButton'; import { CopyButton } from '../shared/CopyButton'; import { BackgroundColorProps, getBackgroundColor, } from '../shared/getBackgroundColor'; +import { PinButton } from '../shared/PinButton'; +import { ResourceItemProps } from '../types'; export function ResourceListItem({ name, diff --git a/web/packages/shared/components/UnifiedResources/ResourceTab.tsx b/web/packages/shared/components/UnifiedResources/ResourceTab.tsx index 2533e2a203165..c453dd3480889 100644 --- a/web/packages/shared/components/UnifiedResources/ResourceTab.tsx +++ b/web/packages/shared/components/UnifiedResources/ResourceTab.tsx @@ -18,8 +18,8 @@ import React from 'react'; import styled from 'styled-components'; -import { Box, Text } from 'design'; +import { Box, Text } from 'design'; import { HoverTooltip } from 'shared/components/ToolTip'; import { PINNING_NOT_SUPPORTED_MESSAGE } from './UnifiedResources'; diff --git a/web/packages/shared/components/UnifiedResources/UnifiedResources.story.tsx b/web/packages/shared/components/UnifiedResources/UnifiedResources.story.tsx index 49dc8de455173..bf71c3f6c4ab4 100644 --- a/web/packages/shared/components/UnifiedResources/UnifiedResources.story.tsx +++ b/web/packages/shared/components/UnifiedResources/UnifiedResources.story.tsx @@ -19,16 +19,6 @@ import React, { useState } from 'react'; import { ButtonBorder } from 'design'; - -import { apps } from 'teleport/Apps/fixtures'; -import { databases } from 'teleport/Databases/fixtures'; -import { kubes } from 'teleport/Kubes/fixtures'; -import { desktops } from 'teleport/Desktops/fixtures'; -import { nodes } from 'teleport/Nodes/fixtures'; - -import { UrlResourcesParams } from 'teleport/config'; -import { ResourcesResponse } from 'teleport/services/agents'; - import { AvailableResourceMode, DefaultTab, @@ -36,15 +26,22 @@ import { UnifiedResourcePreferences, ViewMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; - import { makeErrorAttempt, makeProcessingAttempt } from 'shared/hooks/useAsync'; +import { apps } from 'teleport/Apps/fixtures'; +import { UrlResourcesParams } from 'teleport/config'; +import { databases } from 'teleport/Databases/fixtures'; +import { desktops } from 'teleport/Desktops/fixtures'; +import { kubes } from 'teleport/Kubes/fixtures'; +import { nodes } from 'teleport/Nodes/fixtures'; +import { ResourcesResponse } from 'teleport/services/agents'; + +import { SharedUnifiedResource, UnifiedResourcesQueryParams } from './types'; import { UnifiedResources, - useUnifiedResourcesFetch, UnifiedResourcesProps, + useUnifiedResourcesFetch, } from './UnifiedResources'; -import { SharedUnifiedResource, UnifiedResourcesQueryParams } from './types'; export default { title: 'Shared/UnifiedResources', diff --git a/web/packages/shared/components/UnifiedResources/UnifiedResources.tsx b/web/packages/shared/components/UnifiedResources/UnifiedResources.tsx index b9c9841b7f24e..1b00ea9e9da1c 100644 --- a/web/packages/shared/components/UnifiedResources/UnifiedResources.tsx +++ b/web/packages/shared/components/UnifiedResources/UnifiedResources.tsx @@ -17,68 +17,66 @@ */ import React, { - useEffect, - useLayoutEffect, - useState, - useCallback, Children, PropsWithChildren, + useCallback, + useEffect, + useLayoutEffect, useRef, + useState, } from 'react'; - import styled from 'styled-components'; + import { Box, - Flex, + ButtonBorder, ButtonLink, ButtonSecondary, + Flex, Text, - ButtonBorder, } from 'design'; -import { Icon, Magnifier, PushPin } from 'design/Icon'; import { Danger } from 'design/Alert'; +import { Icon, Magnifier, PushPin } from 'design/Icon'; import './unifiedStyles.css'; -import { ResourcesResponse } from 'teleport/services/agents'; - import { + AvailableResourceMode, DefaultTab, LabelsViewMode, UnifiedResourcePreferences, ViewMode, - AvailableResourceMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; - import { HoverTooltip } from 'shared/components/ToolTip'; import { + Attempt as AsyncAttempt, + hasFinished, makeEmptyAttempt, makeSuccessAttempt, useAsync, - Attempt as AsyncAttempt, - hasFinished, } from 'shared/hooks/useAsync'; +import { Attempt } from 'shared/hooks/useAttemptNext'; import { - useKeyBasedPagination, useInfiniteScroll, + useKeyBasedPagination, } from 'shared/hooks/useInfiniteScroll'; -import { Attempt } from 'shared/hooks/useAttemptNext'; import { makeAdvancedSearchQueryForLabel } from 'shared/utils/advancedSearchLabelQuery'; +import { ResourcesResponse } from 'teleport/services/agents'; + +import { CardsView } from './CardsView/CardsView'; +import { FilterPanel } from './FilterPanel'; +import { ListView } from './ListView/ListView'; +import { ResourceTab } from './ResourceTab'; +import { mapResourceToViewItem } from './shared/viewItemsFactory'; import { - SharedUnifiedResource, + IncludedResourceMode, PinningSupport, + SharedUnifiedResource, UnifiedResourcesPinning, UnifiedResourcesQueryParams, - IncludedResourceMode, } from './types'; -import { ResourceTab } from './ResourceTab'; -import { FilterPanel } from './FilterPanel'; -import { CardsView } from './CardsView/CardsView'; -import { ListView } from './ListView/ListView'; -import { mapResourceToViewItem } from './shared/viewItemsFactory'; - // get 48 resources to start const INITIAL_FETCH_SIZE = 48; // increment by 24 every fetch diff --git a/web/packages/shared/components/UnifiedResources/shared/CopyButton.tsx b/web/packages/shared/components/UnifiedResources/shared/CopyButton.tsx index a3a1a4ad12be6..59b4d57b17e0c 100644 --- a/web/packages/shared/components/UnifiedResources/shared/CopyButton.tsx +++ b/web/packages/shared/components/UnifiedResources/shared/CopyButton.tsx @@ -16,12 +16,11 @@ * along with this program. If not, see . */ -import React, { useState, useRef, useEffect } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import ButtonIcon from 'design/ButtonIcon'; import { Check, Copy } from 'design/Icon'; import { copyToClipboard } from 'design/utils/copyToClipboard'; - import { HoverTooltip } from 'shared/components/ToolTip'; export function CopyButton({ diff --git a/web/packages/shared/components/UnifiedResources/shared/LoadingSkeleton.tsx b/web/packages/shared/components/UnifiedResources/shared/LoadingSkeleton.tsx index 4c9b7aa8c0daf..dc0f698ecef86 100644 --- a/web/packages/shared/components/UnifiedResources/shared/LoadingSkeleton.tsx +++ b/web/packages/shared/components/UnifiedResources/shared/LoadingSkeleton.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState, useEffect, Fragment, ReactElement } from 'react'; +import React, { Fragment, ReactElement, useEffect, useState } from 'react'; const DISPLAY_SKELETON_AFTER_MS = 150; diff --git a/web/packages/shared/components/UnifiedResources/shared/PinButton.tsx b/web/packages/shared/components/UnifiedResources/shared/PinButton.tsx index 1eedee2db68a2..77963c1bc6468 100644 --- a/web/packages/shared/components/UnifiedResources/shared/PinButton.tsx +++ b/web/packages/shared/components/UnifiedResources/shared/PinButton.tsx @@ -18,13 +18,11 @@ import React, { useRef } from 'react'; -import { PushPinFilled, PushPin } from 'design/Icon'; import ButtonIcon from 'design/ButtonIcon'; - +import { PushPin, PushPinFilled } from 'design/Icon'; import { HoverTooltip } from 'shared/components/ToolTip'; import { PinningSupport } from '../types'; - import { PINNING_NOT_SUPPORTED_MESSAGE } from '../UnifiedResources'; export function PinButton({ diff --git a/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts b/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts index fa93ffd5e3670..b81ac47547e7b 100644 --- a/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts +++ b/web/packages/shared/components/UnifiedResources/shared/guessAppIcon.ts @@ -17,9 +17,9 @@ */ import { + iconNames, ResourceIconName, resourceIconSpecs, - iconNames, } from 'design/ResourceIcon'; import { UnifiedResourceApp } from '../types'; diff --git a/web/packages/shared/components/UnifiedResources/shared/viewItemsFactory.ts b/web/packages/shared/components/UnifiedResources/shared/viewItemsFactory.ts index 9a70b5951a329..3eaf6082b4de8 100644 --- a/web/packages/shared/components/UnifiedResources/shared/viewItemsFactory.ts +++ b/web/packages/shared/components/UnifiedResources/shared/viewItemsFactory.ts @@ -19,27 +19,25 @@ import { Application as ApplicationIcon, Database as DatabaseIcon, + Desktop as DesktopIcon, Kubernetes as KubernetesIcon, Server as ServerIcon, - Desktop as DesktopIcon, } from 'design/Icon'; import { ResourceIconName } from 'design/ResourceIcon'; - -import { DbProtocol } from 'shared/services/databases'; import { NodeSubKind } from 'shared/services'; +import { DbProtocol } from 'shared/services/databases'; import { - UnifiedResourceViewItem, - UnifiedResourceUi, - UnifiedResourceNode, + SharedUnifiedResource, UnifiedResourceApp, UnifiedResourceDatabase, UnifiedResourceDesktop, UnifiedResourceKube, + UnifiedResourceNode, + UnifiedResourceUi, UnifiedResourceUserGroup, - SharedUnifiedResource, + UnifiedResourceViewItem, } from '../types'; - import { guessAppIcon } from './guessAppIcon'; export function makeUnifiedResourceViewItemNode( diff --git a/web/packages/shared/components/UnifiedResources/types.ts b/web/packages/shared/components/UnifiedResources/types.ts index 22c0c52547181..b3259f69b02e2 100644 --- a/web/packages/shared/components/UnifiedResources/types.ts +++ b/web/packages/shared/components/UnifiedResources/types.ts @@ -18,13 +18,12 @@ import React from 'react'; -import { ResourceLabel } from 'teleport/services/agents'; - -import { ResourceIconName } from 'design/ResourceIcon'; import { Icon } from 'design/Icon'; - -import { DbProtocol } from 'shared/services/databases'; +import { ResourceIconName } from 'design/ResourceIcon'; import { NodeSubKind } from 'shared/services'; +import { DbProtocol } from 'shared/services/databases'; + +import { ResourceLabel } from 'teleport/services/agents'; export type UnifiedResourceApp = { kind: 'app'; diff --git a/web/packages/shared/components/Validation/Validation.test.tsx b/web/packages/shared/components/Validation/Validation.test.tsx index 19f40a8d44986..c789a8f66fe54 100644 --- a/web/packages/shared/components/Validation/Validation.test.tsx +++ b/web/packages/shared/components/Validation/Validation.test.tsx @@ -18,11 +18,10 @@ import React from 'react'; -import { render, fireEvent, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import Logger from '../../libs/logger'; - -import Validator, { Validation, useValidation } from './Validation'; +import Validator, { useValidation, Validation } from './Validation'; jest.mock('../../libs/logger', () => { const mockLogger = { diff --git a/web/packages/shared/components/Validation/index.ts b/web/packages/shared/components/Validation/index.ts index e94dd2bf13a88..956b9d15eaed7 100644 --- a/web/packages/shared/components/Validation/index.ts +++ b/web/packages/shared/components/Validation/index.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import Validator, { Validation, useValidation } from './Validation'; import useRule from './useRule'; +import Validator, { useValidation, Validation } from './Validation'; export default Validation; diff --git a/web/packages/shared/components/Validation/rules.test.ts b/web/packages/shared/components/Validation/rules.test.ts index d3868492e7cc9..0ebf3e0bcc3f3 100644 --- a/web/packages/shared/components/Validation/rules.test.ts +++ b/web/packages/shared/components/Validation/rules.test.ts @@ -17,13 +17,13 @@ */ import { - requiredToken, - requiredPassword, requiredConfirmedPassword, - requiredField, - requiredRoleArn, requiredEmailLike, + requiredField, requiredIamRoleName, + requiredPassword, + requiredRoleArn, + requiredToken, } from './rules'; describe('requiredField', () => { diff --git a/web/packages/shared/components/Validation/useRule.js b/web/packages/shared/components/Validation/useRule.js index ad0ca82157cbf..d266bd28f9865 100644 --- a/web/packages/shared/components/Validation/useRule.js +++ b/web/packages/shared/components/Validation/useRule.js @@ -19,7 +19,6 @@ import React from 'react'; import Logger from '../../libs/logger'; - import { useValidation } from './Validation'; const logger = Logger.create('validation'); diff --git a/web/packages/shared/components/Validation/useRule.test.js b/web/packages/shared/components/Validation/useRule.test.js index 544c63d6a1b0b..ed1c49b257edb 100644 --- a/web/packages/shared/components/Validation/useRule.test.js +++ b/web/packages/shared/components/Validation/useRule.test.js @@ -18,7 +18,7 @@ import React from 'react'; -import { render, fireEvent, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import Validation, { useRule } from '.'; diff --git a/web/packages/shared/components/Window/Window.tsx b/web/packages/shared/components/Window/Window.tsx index b91069c729112..afdbf05702320 100644 --- a/web/packages/shared/components/Window/Window.tsx +++ b/web/packages/shared/components/Window/Window.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import { WindowTitleBar } from './WindowTitleBar'; import { WindowContainer, WindowContentContainer } from './WindowComponents'; +import { WindowTitleBar } from './WindowTitleBar'; interface WindowProps { title: string; diff --git a/web/packages/shared/hooks/index.ts b/web/packages/shared/hooks/index.ts index de97b8ab675f4..3661669d7ff48 100644 --- a/web/packages/shared/hooks/index.ts +++ b/web/packages/shared/hooks/index.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import { useState, useRef, useEffect } from 'react'; +import { useEffect, useRef, useState } from 'react'; import useAttempt from './useAttempt'; -import useFavicon from './useFavicon'; -import useDocTitle from './useDocTitle'; import useAttemptNext from './useAttemptNext'; -import { useRefAutoFocus } from './useRefAutoFocus'; -import { useInterval } from './useInterval'; +import useDocTitle from './useDocTitle'; +import useFavicon from './useFavicon'; import { useInfiniteScroll } from './useInfiniteScroll'; +import { useInterval } from './useInterval'; +import { useRefAutoFocus } from './useRefAutoFocus'; export { useRef, diff --git a/web/packages/shared/hooks/useAsync.test.ts b/web/packages/shared/hooks/useAsync.test.ts index 881268e302d19..f3da5fccb0465 100644 --- a/web/packages/shared/hooks/useAsync.test.ts +++ b/web/packages/shared/hooks/useAsync.test.ts @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -import { renderHook, act, waitFor } from '@testing-library/react'; +import { act, renderHook, waitFor } from '@testing-library/react'; import { wait } from 'shared/utils/wait'; import { - useAsync, - CanceledError, Attempt, + CanceledError, + useAsync, useDelayedRepeatedAttempt, } from './useAsync'; diff --git a/web/packages/shared/hooks/useAsync.ts b/web/packages/shared/hooks/useAsync.ts index 9eeb2dca639e1..e2e4b749bc96d 100644 --- a/web/packages/shared/hooks/useAsync.ts +++ b/web/packages/shared/hooks/useAsync.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { useCallback, useState, useRef, useEffect } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; /** * `useAsync` lets you represent the state of an async operation as data. It accepts an async function diff --git a/web/packages/shared/hooks/useAttempt.ts b/web/packages/shared/hooks/useAttempt.ts index c54de0f9bca66..93bfdb6e73d17 100644 --- a/web/packages/shared/hooks/useAttempt.ts +++ b/web/packages/shared/hooks/useAttempt.ts @@ -19,6 +19,7 @@ import React from 'react'; import Logger from 'shared/libs/logger'; + const logger = Logger.create('shared/hooks/useAttempt'); const defaultState = { diff --git a/web/packages/shared/hooks/useAttemptNext.ts b/web/packages/shared/hooks/useAttemptNext.ts index 3509cac84e42d..a145bd94b897f 100644 --- a/web/packages/shared/hooks/useAttemptNext.ts +++ b/web/packages/shared/hooks/useAttemptNext.ts @@ -19,6 +19,7 @@ import React, { useCallback } from 'react'; import Logger from 'shared/libs/logger'; + const logger = Logger.create('shared/hooks/useAttempt'); // This is the next version of existing useAttempt hook diff --git a/web/packages/shared/hooks/useDraggable.js b/web/packages/shared/hooks/useDraggable.js index 8935f6ac8ec0b..7fbeb182d82d5 100644 --- a/web/packages/shared/hooks/useDraggable.js +++ b/web/packages/shared/hooks/useDraggable.js @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { useState, useCallback, useEffect } from 'react'; +import { useCallback, useEffect, useState } from 'react'; const POSITION = { x: 0, y: 0 }; diff --git a/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.test.tsx b/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.test.tsx index 0ff18bf309926..78d6481cd81f1 100644 --- a/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.test.tsx +++ b/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.test.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ +import { act, renderHook } from '@testing-library/react'; +import { mockIntersectionObserver } from 'jsdom-testing-mocks'; import React from 'react'; -import { renderHook, act } from '@testing-library/react'; import { render, screen } from 'design/utils/testing'; -import { mockIntersectionObserver } from 'jsdom-testing-mocks'; import { useInfiniteScroll } from './useInfiniteScroll'; diff --git a/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.ts b/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.ts index 2e90f6153339d..c8f9376849fdd 100644 --- a/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.ts +++ b/web/packages/shared/hooks/useInfiniteScroll/useInfiniteScroll.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { useLayoutEffect, useRef, useCallback } from 'react'; +import { useCallback, useLayoutEffect, useRef } from 'react'; /** * Calls fetch function whenever the `trigger` element intersects the diff --git a/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.test.ts b/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.test.ts index c7a72f8c9e944..92dbca79b95f0 100644 --- a/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.test.ts +++ b/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.test.ts @@ -16,17 +16,16 @@ * along with this program. If not, see . */ -import { renderHook, act } from '@testing-library/react'; +import { act, renderHook } from '@testing-library/react'; import { ApiError } from 'teleport/services/api/parseError'; - import { Node } from 'teleport/services/nodes'; +import { newFetchFunc, resourceClusterIds, resourceNames } from './testUtils'; import { - useKeyBasedPagination, KeyBasedPaginationOptions, + useKeyBasedPagination, } from './useKeyBasedPagination'; -import { newFetchFunc, resourceClusterIds, resourceNames } from './testUtils'; function hookProps(overrides: Partial> = {}) { return { diff --git a/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.ts b/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.ts index 8c13495985168..acb1d189bc200 100644 --- a/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.ts +++ b/web/packages/shared/hooks/useInfiniteScroll/useKeyBasedPagination.ts @@ -17,19 +17,19 @@ */ import { - useState, - useRef, - useCallback, MutableRefObject, + useCallback, useEffect, + useRef, + useState, } from 'react'; -import { ResourcesResponse } from 'teleport/services/agents'; -import { ApiError } from 'teleport/services/api/parseError'; - import { Attempt } from 'shared/hooks/useAttemptNext'; import { isAbortError } from 'shared/utils/abortError'; +import { ResourcesResponse } from 'teleport/services/agents'; +import { ApiError } from 'teleport/services/api/parseError'; + /** * Supports fetching more data from the server when more data is available. Pass * a `fetchFunc` that retrieves a single batch of data. After the initial diff --git a/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.test.tsx b/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.test.tsx index ffd5395662640..bae88bf5d77df 100644 --- a/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.test.tsx +++ b/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.test.tsx @@ -18,7 +18,7 @@ import React, { useState } from 'react'; -import { render, screen, fireEvent } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { useRefClickOutside } from './useRefClickOutside'; diff --git a/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.ts b/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.ts index 7e2d2b1afc31a..386e9c29c2e83 100644 --- a/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.ts +++ b/web/packages/shared/hooks/useRefClickOutside/useRefClickOutside.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { MutableRefObject, useEffect, useRef, useCallback } from 'react'; +import { MutableRefObject, useCallback, useEffect, useRef } from 'react'; // IGNORE_CLICK_CLASSNAME is the className that should be on elements which shouldn't trigger setOpen(false). export const IGNORE_CLICK_CLASSNAME = 'ignore-click'; diff --git a/web/packages/shared/libs/mergeRefs.test.tsx b/web/packages/shared/libs/mergeRefs.test.tsx index d901e8ac9c02f..004f8f88c976c 100644 --- a/web/packages/shared/libs/mergeRefs.test.tsx +++ b/web/packages/shared/libs/mergeRefs.test.tsx @@ -20,8 +20,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import * as React from 'react'; import { render } from '@testing-library/react'; +import * as React from 'react'; import { mergeRefs } from './mergeRefs'; diff --git a/web/packages/shared/libs/stores/useStore.test.tsx b/web/packages/shared/libs/stores/useStore.test.tsx index fba714b830365..fc3210052d025 100644 --- a/web/packages/shared/libs/stores/useStore.test.tsx +++ b/web/packages/shared/libs/stores/useStore.test.tsx @@ -20,8 +20,8 @@ import React from 'react'; import { act, render } from 'design/utils/testing'; -import useStore from './useStore'; import Store from './store'; +import useStore from './useStore'; test('components subscribes to store changes and unsubscribes on unmount', async () => { const store = new Store(); diff --git a/web/packages/shared/services/loc/index.ts b/web/packages/shared/services/loc/index.ts index 5166fb8a4ea4f..d3f4efd8a80db 100644 --- a/web/packages/shared/services/loc/index.ts +++ b/web/packages/shared/services/loc/index.ts @@ -17,9 +17,10 @@ */ import { + dateToUtc, displayDate, displayDateTime, displayUnixDate, - dateToUtc, } from './loc'; + export { displayDate, displayDateTime, displayUnixDate, dateToUtc }; diff --git a/web/packages/shared/services/loc/loc.test.ts b/web/packages/shared/services/loc/loc.test.ts index b66e546ae5abb..dd34b6e337a1e 100644 --- a/web/packages/shared/services/loc/loc.test.ts +++ b/web/packages/shared/services/loc/loc.test.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { displayDate, displayDateTime, dateTimeShortFormat } from './loc'; +import { dateTimeShortFormat, displayDate, displayDateTime } from './loc'; const testDate = new Date('2022-01-28T16:00:44.309Z'); diff --git a/web/packages/shared/services/loc/loc.ts b/web/packages/shared/services/loc/loc.ts index dc33c09b5cf2a..c467f19914ea9 100644 --- a/web/packages/shared/services/loc/loc.ts +++ b/web/packages/shared/services/loc/loc.ts @@ -18,8 +18,8 @@ import { format } from 'date-fns'; -import Logger from 'shared/libs/logger'; import cfg from 'shared/config'; +import Logger from 'shared/libs/logger'; const DEFAULT_LOCALE = 'en-US'; const isTest = process.env.NODE_ENV === 'test'; diff --git a/web/packages/shared/utils/base64/index.ts b/web/packages/shared/utils/base64/index.ts index 9ab93b8d5f4e3..9446195bcc34b 100644 --- a/web/packages/shared/utils/base64/index.ts +++ b/web/packages/shared/utils/base64/index.ts @@ -18,6 +18,7 @@ import { arrayBufferToBase64, base64ToArrayBuffer } from './base64-arraybuffer'; import { base64urlToBuffer, bufferToBase64url } from './base64url-arraybuffer'; + export { arrayBufferToBase64, base64ToArrayBuffer, diff --git a/web/packages/shared/utils/text.test.ts b/web/packages/shared/utils/text.test.ts index a76bb90fbb594..97ba838862aaa 100644 --- a/web/packages/shared/utils/text.test.ts +++ b/web/packages/shared/utils/text.test.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { pluralize, capitalizeFirstLetter, listToSentence } from './text'; +import { capitalizeFirstLetter, listToSentence, pluralize } from './text'; test('pluralize', () => { expect(pluralize(0, 'apple')).toBe('apples'); diff --git a/web/packages/shared/utils/wait.ts b/web/packages/shared/utils/wait.ts index 3f64695227310..477f855bf12f2 100644 --- a/web/packages/shared/utils/wait.ts +++ b/web/packages/shared/utils/wait.ts @@ -15,7 +15,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { useRef, useEffect } from 'react'; +import { useEffect, useRef } from 'react'; /** Resolves after a given duration. */ export function wait(ms: number, abortSignal?: AbortSignal): Promise { diff --git a/web/packages/teleport/src/AccessRequests/AccessRequests.story.test.tsx b/web/packages/teleport/src/AccessRequests/AccessRequests.story.test.tsx index 3507b887c4515..39b5f450b1f10 100644 --- a/web/packages/teleport/src/AccessRequests/AccessRequests.story.test.tsx +++ b/web/packages/teleport/src/AccessRequests/AccessRequests.story.test.tsx @@ -17,10 +17,11 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; -import { LockedAccessRequests } from 'teleport/AccessRequests/LockedAccessRequests/LockedAccessRequests'; import { ContextProvider } from 'teleport'; +import { LockedAccessRequests } from 'teleport/AccessRequests/LockedAccessRequests/LockedAccessRequests'; import { createTeleportContext } from 'teleport/mocks/contexts'; test('locked', () => { diff --git a/web/packages/teleport/src/AccessRequests/AccessRequests.story.tsx b/web/packages/teleport/src/AccessRequests/AccessRequests.story.tsx index 30e8c2a52b5ac..4a7fd1e5b44d5 100644 --- a/web/packages/teleport/src/AccessRequests/AccessRequests.story.tsx +++ b/web/packages/teleport/src/AccessRequests/AccessRequests.story.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import { LockedAccessRequests } from 'teleport/AccessRequests/LockedAccessRequests/LockedAccessRequests'; import { ContextProvider } from 'teleport'; +import { LockedAccessRequests } from 'teleport/AccessRequests/LockedAccessRequests/LockedAccessRequests'; import { createTeleportContext } from 'teleport/mocks/contexts'; export default { diff --git a/web/packages/teleport/src/AccessRequests/LockedAccessRequests/LockedAccessRequests.tsx b/web/packages/teleport/src/AccessRequests/LockedAccessRequests/LockedAccessRequests.tsx index 4bbed26167ab4..a1f6e6f8d266e 100644 --- a/web/packages/teleport/src/AccessRequests/LockedAccessRequests/LockedAccessRequests.tsx +++ b/web/packages/teleport/src/AccessRequests/LockedAccessRequests/LockedAccessRequests.tsx @@ -18,15 +18,15 @@ import React from 'react'; import styled from 'styled-components'; + import { Box, Card, Flex, Image, Link, Text } from 'design'; +import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; - import { CtaEvent } from 'teleport/services/userEvent'; import step1 from './assets/step1.png'; diff --git a/web/packages/teleport/src/AccessRequests/service.ts b/web/packages/teleport/src/AccessRequests/service.ts index 03b7e158d3f3b..b221d6ddaa51a 100644 --- a/web/packages/teleport/src/AccessRequests/service.ts +++ b/web/packages/teleport/src/AccessRequests/service.ts @@ -20,8 +20,6 @@ import { formatDuration } from 'date-fns'; import { RequestableResourceKind } from 'shared/components/AccessRequests/NewRequest/resource'; -import api from 'teleport/services/api'; -import cfg from 'teleport/config'; import { AccessRequest, AccessRequestResource, @@ -29,6 +27,8 @@ import { DurationOption, } from 'teleport/AccessRequests/types'; import { middleValues } from 'teleport/AccessRequests/utils'; +import cfg from 'teleport/config'; +import api from 'teleport/services/api'; export async function createAccessRequest( clusterId: string, diff --git a/web/packages/teleport/src/AccessRequests/types.ts b/web/packages/teleport/src/AccessRequests/types.ts index de08d61605961..7d06636b86e64 100644 --- a/web/packages/teleport/src/AccessRequests/types.ts +++ b/web/packages/teleport/src/AccessRequests/types.ts @@ -17,7 +17,6 @@ */ import { RequestableResourceKind } from 'shared/components/AccessRequests/NewRequest/resource'; - import type { Option } from 'shared/components/Select'; export type DurationOption = Option; diff --git a/web/packages/teleport/src/Account/Account.story.tsx b/web/packages/teleport/src/Account/Account.story.tsx index c1803ab8aeb6d..29803a89ee6e3 100644 --- a/web/packages/teleport/src/Account/Account.story.tsx +++ b/web/packages/teleport/src/Account/Account.story.tsx @@ -18,9 +18,8 @@ import React, { useEffect } from 'react'; -import { PasswordState } from 'teleport/services/user'; - import cfg from 'teleport/config'; +import { PasswordState } from 'teleport/services/user'; import { Account, AccountProps } from './Account'; diff --git a/web/packages/teleport/src/Account/Account.test.tsx b/web/packages/teleport/src/Account/Account.test.tsx index 6fb23549a0e36..32b571b6b1055 100644 --- a/web/packages/teleport/src/Account/Account.test.tsx +++ b/web/packages/teleport/src/Account/Account.test.tsx @@ -16,20 +16,19 @@ * along with this program. If not, see . */ -import { render, screen, waitFor } from 'design/utils/testing'; import { within } from '@testing-library/react'; - import userEvent from '@testing-library/user-event'; -import { ContextProvider } from 'teleport'; -import TeleportContext from 'teleport/teleportContext'; +import { render, screen, waitFor } from 'design/utils/testing'; +import { ContextProvider } from 'teleport'; import { AccountPage as Account } from 'teleport/Account/Account'; import cfg from 'teleport/config'; import { createTeleportContext } from 'teleport/mocks/contexts'; -import { PasswordState } from 'teleport/services/user'; import auth from 'teleport/services/auth/auth'; import MfaService, { MfaDevice } from 'teleport/services/mfa'; +import { PasswordState } from 'teleport/services/user'; +import TeleportContext from 'teleport/teleportContext'; const defaultAuthType = cfg.auth.second_factor; const defaultPasswordless = cfg.auth.allowPasswordless; diff --git a/web/packages/teleport/src/Account/Account.tsx b/web/packages/teleport/src/Account/Account.tsx index 27932b0260449..92f1485c3cc94 100644 --- a/web/packages/teleport/src/Account/Account.tsx +++ b/web/packages/teleport/src/Account/Account.tsx @@ -17,37 +17,34 @@ */ import React, { useState } from 'react'; -import { Box, Flex, Indicator, Text } from 'design'; import styled, { useTheme } from 'styled-components'; -import { Attempt } from 'shared/hooks/useAttemptNext'; + +import { Box, Flex, Indicator, Text } from 'design'; import * as Icon from 'design/Icon'; import { Notification, NotificationItem } from 'shared/components/Notification'; - +import { Attempt } from 'shared/hooks/useAttemptNext'; import { useStore } from 'shared/libs/stores'; -import useTeleport from 'teleport/useTeleport'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; - import cfg from 'teleport/config'; - import { DeviceUsage } from 'teleport/services/auth'; - import { PasswordState } from 'teleport/services/user'; +import useTeleport from 'teleport/useTeleport'; +import { ActionButtonPrimary, ActionButtonSecondary, Header } from './Header'; import { AuthDeviceList } from './ManageDevices/AuthDeviceList/AuthDeviceList'; import useManageDevices, { State as ManageDevicesState, } from './ManageDevices/useManageDevices'; -import { ActionButtonPrimary, ActionButtonSecondary, Header } from './Header'; -import { PasswordBox } from './PasswordBox'; import { AddAuthDeviceWizard, DeleteAuthDeviceWizard, } from './ManageDevices/wizards'; +import { PasswordBox } from './PasswordBox'; import { StatePill } from './StatePill'; export interface EnterpriseComponentProps { diff --git a/web/packages/teleport/src/Account/AccountNew.ts b/web/packages/teleport/src/Account/AccountNew.ts index f7700447856ef..cac7a19d7fb0d 100644 --- a/web/packages/teleport/src/Account/AccountNew.ts +++ b/web/packages/teleport/src/Account/AccountNew.ts @@ -19,6 +19,7 @@ // Compatibility aliases to prevent e/ from breaking. // TODO(bl-nero): Remove these once e/ stops referring to them. import { Account } from './Account'; + export type { EnterpriseComponentProps } from './Account'; export default Account; diff --git a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.story.tsx b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.story.tsx index 07283ae6c1c8d..de47f0a7a56ca 100644 --- a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.story.tsx +++ b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.story.tsx @@ -20,15 +20,14 @@ import React from 'react'; import Dialog from 'design/Dialog'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport'; - +import { createTeleportContext } from 'teleport/mocks/contexts'; import { MfaDevice } from 'teleport/services/mfa'; import { ChangePasswordStep, - ReauthenticateStep, createReauthOptions, + ReauthenticateStep, } from './ChangePasswordWizard'; export default { diff --git a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx index 952b9e4f46731..4895a3de126fe 100644 --- a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx +++ b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx @@ -16,21 +16,20 @@ * along with this program. If not, see . */ -import { render, screen } from 'design/utils/testing'; -import React from 'react'; - import { within } from '@testing-library/react'; import { userEvent, UserEvent } from '@testing-library/user-event'; +import React from 'react'; + +import { render, screen } from 'design/utils/testing'; import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; +import { ChangePasswordWizard } from '.'; import { ChangePasswordWizardProps, createReauthOptions, } from './ChangePasswordWizard'; -import { ChangePasswordWizard } from '.'; - const dummyCredential: Credential = { id: 'cred-id', type: 'public-key', diff --git a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx index 1bca1a3ef99c9..ff6e792275b41 100644 --- a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx +++ b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx @@ -16,14 +16,16 @@ * along with this program. If not, see . */ +import React, { useState } from 'react'; import styled from 'styled-components'; + import { OutlineDanger } from 'design/Alert/Alert'; +import Box from 'design/Box'; import { ButtonPrimary, ButtonSecondary } from 'design/Button'; import Dialog from 'design/Dialog'; import Flex from 'design/Flex'; import { RadioGroup } from 'design/RadioGroup'; -import { StepComponentProps, StepSlider, StepHeader } from 'design/StepSlider'; -import React, { useState } from 'react'; +import { StepComponentProps, StepHeader, StepSlider } from 'design/StepSlider'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { @@ -34,8 +36,6 @@ import { import { useAsync } from 'shared/hooks/useAsync'; import { Auth2faType } from 'shared/services'; -import Box from 'design/Box'; - import { ChangePasswordReq } from 'teleport/services/auth'; import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; import { MfaDevice } from 'teleport/services/mfa'; diff --git a/web/packages/teleport/src/Account/Header.tsx b/web/packages/teleport/src/Account/Header.tsx index 3df0ec84cdea3..cf777d40af6cb 100644 --- a/web/packages/teleport/src/Account/Header.tsx +++ b/web/packages/teleport/src/Account/Header.tsx @@ -16,6 +16,9 @@ * along with this program. If not, see . */ +import React from 'react'; +import styled, { css, useTheme } from 'styled-components'; + import { Box, ButtonPrimary, @@ -24,8 +27,6 @@ import { Indicator, Text, } from 'design'; -import React from 'react'; -import styled, { useTheme, css } from 'styled-components'; export interface HeaderProps { title: React.ReactNode; diff --git a/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.story.tsx b/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.story.tsx index ba8678459ac13..6934b09f460fb 100644 --- a/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.story.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.story.tsx @@ -21,7 +21,6 @@ import React from 'react'; import * as Icon from 'design/Icon'; import { ActionButtonSecondary, Header } from 'teleport/Account/Header'; - import { MfaDevice } from 'teleport/services/mfa'; import { AuthDeviceList } from './AuthDeviceList'; diff --git a/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.test.tsx b/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.test.tsx index 3e809cae0a538..d71f0a3f499eb 100644 --- a/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.test.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.test.tsx @@ -16,10 +16,11 @@ * along with this program. If not, see . */ -import { render, screen } from 'design/utils/testing'; import { within } from '@testing-library/react'; import React from 'react'; +import { render, screen } from 'design/utils/testing'; + import { MfaDevice } from 'teleport/services/mfa'; import { AuthDeviceList } from './AuthDeviceList'; diff --git a/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.tsx b/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.tsx index dcc3af1da3ac4..fe591a6c30b61 100644 --- a/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/AuthDeviceList/AuthDeviceList.tsx @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -import { Cell, DateCell } from 'design/DataTable'; -import Table from 'design/DataTable/Table'; import React from 'react'; - import styled from 'styled-components'; -import { MultiRowBox, Row } from 'design/MultiRowBox'; -import * as Icon from 'design/Icon'; + import { ButtonWarningBorder } from 'design/Button/Button'; +import { Cell, DateCell } from 'design/DataTable'; +import Table from 'design/DataTable/Table'; +import * as Icon from 'design/Icon'; +import { MultiRowBox, Row } from 'design/MultiRowBox'; import { MfaDevice } from 'teleport/services/mfa'; diff --git a/web/packages/teleport/src/Account/ManageDevices/useManageDevices.ts b/web/packages/teleport/src/Account/ManageDevices/useManageDevices.ts index 95929bf9d9714..e3c5e502f988b 100644 --- a/web/packages/teleport/src/Account/ManageDevices/useManageDevices.ts +++ b/web/packages/teleport/src/Account/ManageDevices/useManageDevices.ts @@ -17,13 +17,14 @@ */ import { useEffect, useState } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; -import Ctx from 'teleport/teleportContext'; import cfg from 'teleport/config'; import auth, { DeviceUsage } from 'teleport/services/auth'; -import { MfaDevice } from 'teleport/services/mfa'; import { MfaChallengeScope } from 'teleport/services/auth/auth'; +import { MfaDevice } from 'teleport/services/mfa'; +import Ctx from 'teleport/teleportContext'; export default function useManageDevices(ctx: Ctx) { const [devices, setDevices] = useState([]); diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx index 2fe468712bd85..6571ff7ad3fe8 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx @@ -16,21 +16,17 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; -import { Auth2faType } from 'shared/services'; - import Dialog from 'design/Dialog'; - -import { initialize, mswLoader } from 'msw-storybook-addon'; - -import { rest } from 'msw'; - -import { DeviceUsage } from 'teleport/services/auth'; -import { createTeleportContext } from 'teleport/mocks/contexts'; -import { ContextProvider } from 'teleport/index'; +import { Auth2faType } from 'shared/services'; import cfg from 'teleport/config'; +import { ContextProvider } from 'teleport/index'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import { DeviceUsage } from 'teleport/services/auth'; import { AddAuthDeviceWizardStepProps, diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx index 3d0c6bbb6bf43..68b47de8d9eec 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx @@ -16,23 +16,21 @@ * along with this program. If not, see . */ -import { render, screen } from 'design/utils/testing'; -import React from 'react'; - import { within } from '@testing-library/react'; import { userEvent, UserEvent } from '@testing-library/user-event'; +import React from 'react'; + +import { render, screen } from 'design/utils/testing'; -import TeleportContext from 'teleport/teleportContext'; import { ContextProvider } from 'teleport'; -import MfaService from 'teleport/services/mfa'; import auth from 'teleport/services/auth'; +import MfaService from 'teleport/services/mfa'; +import TeleportContext from 'teleport/teleportContext'; +import { AddAuthDeviceWizard } from '.'; import { AddAuthDeviceWizardStepProps } from './AddAuthDeviceWizard'; - import { deviceCases } from './deviceCases'; -import { AddAuthDeviceWizard } from '.'; - const dummyCredential: Credential = { id: 'cred-id', type: 'public-key' }; let ctx: TeleportContext; let user: UserEvent; diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.tsx index a3c6838ab9605..8ee94386a299d 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.tsx @@ -16,16 +16,18 @@ * along with this program. If not, see . */ +import React, { FormEvent, useEffect, useState } from 'react'; + import { OutlineDanger } from 'design/Alert/Alert'; +import Box from 'design/Box'; import { ButtonPrimary, ButtonSecondary } from 'design/Button'; import Dialog from 'design/Dialog'; import Flex from 'design/Flex'; import Image from 'design/Image'; import Indicator from 'design/Indicator'; import { RadioGroup } from 'design/RadioGroup'; -import { StepComponentProps, StepSlider } from 'design/StepSlider'; +import { StepComponentProps, StepHeader, StepSlider } from 'design/StepSlider'; import Text from 'design/Text'; -import React, { useState, useEffect, FormEvent } from 'react'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; @@ -34,18 +36,12 @@ import useAttempt from 'shared/hooks/useAttemptNext'; import { Auth2faType } from 'shared/services'; import createMfaOptions, { MfaOption } from 'shared/utils/createMfaOptions'; -import Box from 'design/Box'; - -import { StepHeader } from 'design/StepSlider'; - -import auth from 'teleport/services/auth/auth'; import { DeviceUsage } from 'teleport/services/auth'; -import useTeleport from 'teleport/useTeleport'; - +import auth from 'teleport/services/auth/auth'; import { MfaDevice } from 'teleport/services/mfa'; +import useTeleport from 'teleport/useTeleport'; import { PasskeyBlurb } from '../../../components/Passkeys/PasskeyBlurb'; - import { ReauthenticateStep, ReauthenticateStepProps, diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx index 5cfd6ad97aa3d..2bbfcc4ec4408 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx @@ -16,15 +16,13 @@ * along with this program. If not, see . */ +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import Dialog from 'design/Dialog'; -import { initialize, mswLoader } from 'msw-storybook-addon'; - -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport/index'; - +import { createTeleportContext } from 'teleport/mocks/contexts'; import { MfaDevice } from 'teleport/services/mfa'; import { diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx index 60b11e46cf805..b9b6be1fce88c 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx @@ -16,22 +16,20 @@ * along with this program. If not, see . */ -import { render, screen } from 'design/utils/testing'; -import React from 'react'; - import { within } from '@testing-library/react'; import { userEvent, UserEvent } from '@testing-library/user-event'; +import React from 'react'; + +import { render, screen } from 'design/utils/testing'; -import TeleportContext from 'teleport/teleportContext'; import { ContextProvider } from 'teleport'; -import MfaService from 'teleport/services/mfa'; import auth from 'teleport/services/auth'; - -import { DeleteAuthDeviceWizardStepProps } from './DeleteAuthDeviceWizard'; - -import { dummyPasskey, dummyHardwareDevice, deviceCases } from './deviceCases'; +import MfaService from 'teleport/services/mfa'; +import TeleportContext from 'teleport/teleportContext'; import { DeleteAuthDeviceWizard } from '.'; +import { DeleteAuthDeviceWizardStepProps } from './DeleteAuthDeviceWizard'; +import { deviceCases, dummyHardwareDevice, dummyPasskey } from './deviceCases'; let ctx: TeleportContext; let user: UserEvent; diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx index 44460e9cb6c6a..603d354dd1c19 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx @@ -16,22 +16,19 @@ * along with this program. If not, see . */ +import React, { useState } from 'react'; + import { OutlineDanger } from 'design/Alert/Alert'; +import Box from 'design/Box'; import { ButtonSecondary, ButtonWarning } from 'design/Button'; import Dialog from 'design/Dialog'; import Flex from 'design/Flex'; -import { StepComponentProps, StepSlider } from 'design/StepSlider'; -import React, { useState } from 'react'; +import { StepComponentProps, StepHeader, StepSlider } from 'design/StepSlider'; import useAttempt from 'shared/hooks/useAttemptNext'; import { Auth2faType } from 'shared/services'; -import Box from 'design/Box'; - -import { StepHeader } from 'design/StepSlider'; - -import useTeleport from 'teleport/useTeleport'; - import { MfaDevice } from 'teleport/services/mfa'; +import useTeleport from 'teleport/useTeleport'; import { ReauthenticateStep, diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.test.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.test.tsx index 88f18c1d724ef..f574ca91e8ee8 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.test.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { createReauthOptions } from './ReauthenticateStep'; import { deviceCases } from './deviceCases'; +import { createReauthOptions } from './ReauthenticateStep'; test.each` auth2faType | deviceCase | methods diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx index 83879114ef5fd..637bee64877b0 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx @@ -16,21 +16,20 @@ * along with this program. If not, see . */ +import React, { FormEvent, useState } from 'react'; + import { OutlineDanger } from 'design/Alert/Alert'; +import Box from 'design/Box'; import { ButtonPrimary, ButtonSecondary } from 'design/Button'; import Flex from 'design/Flex'; import { RadioGroup } from 'design/RadioGroup'; -import React, { useState, FormEvent } from 'react'; +import { StepComponentProps, StepHeader } from 'design/StepSlider'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; +import { Attempt } from 'shared/hooks/useAttemptNext'; import { Auth2faType } from 'shared/services'; import createMfaOptions, { MfaOption } from 'shared/utils/createMfaOptions'; -import { StepComponentProps, StepHeader } from 'design/StepSlider'; - -import Box from 'design/Box'; - -import { Attempt } from 'shared/hooks/useAttemptNext'; import useReAuthenticate from 'teleport/components/ReAuthenticate/useReAuthenticate'; import { MfaDevice } from 'teleport/services/mfa'; diff --git a/web/packages/teleport/src/Account/PasswordBox.tsx b/web/packages/teleport/src/Account/PasswordBox.tsx index 3e7bc564a2526..47088a023e20a 100644 --- a/web/packages/teleport/src/Account/PasswordBox.tsx +++ b/web/packages/teleport/src/Account/PasswordBox.tsx @@ -16,21 +16,19 @@ * along with this program. If not, see . */ -import { Box, Flex } from 'design'; -import { SingleRowBox } from 'design/MultiRowBox'; import React, { useState } from 'react'; +import { Box, Flex } from 'design'; import * as Icon from 'design/Icon'; +import { SingleRowBox } from 'design/MultiRowBox'; import cfg from 'teleport/config'; - import { MfaDevice } from 'teleport/services/mfa'; - import { PasswordState } from 'teleport/services/user'; -import { ActionButtonSecondary, Header } from './Header'; import { ChangePasswordWizard } from './ChangePasswordWizard'; -import { StatePill, AuthMethodState } from './StatePill'; +import { ActionButtonSecondary, Header } from './Header'; +import { AuthMethodState, StatePill } from './StatePill'; export interface PasswordBoxProps { changeDisabled: boolean; diff --git a/web/packages/teleport/src/AppLauncher/AppLauncher.test.tsx b/web/packages/teleport/src/AppLauncher/AppLauncher.test.tsx index 85aabbcd6e662..d826093c39d94 100644 --- a/web/packages/teleport/src/AppLauncher/AppLauncher.test.tsx +++ b/web/packages/teleport/src/AppLauncher/AppLauncher.test.tsx @@ -16,14 +16,15 @@ * along with this program. If not, see . */ -import React from 'react'; -import { render, waitFor, screen } from 'design/utils/testing'; import { createMemoryHistory } from 'history'; +import React from 'react'; import { Router } from 'react-router'; +import { render, screen, waitFor } from 'design/utils/testing'; + import { Route } from 'teleport/components/Router'; -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import service from 'teleport/services/apps'; import { AppLauncher } from './AppLauncher'; diff --git a/web/packages/teleport/src/AppLauncher/AppLauncher.tsx b/web/packages/teleport/src/AppLauncher/AppLauncher.tsx index 72281dc4df9ea..4e56ce76e49c9 100644 --- a/web/packages/teleport/src/AppLauncher/AppLauncher.tsx +++ b/web/packages/teleport/src/AppLauncher/AppLauncher.tsx @@ -17,13 +17,10 @@ */ import React, { useCallback, useEffect } from 'react'; - import { useLocation, useParams } from 'react-router'; import { Flex, Indicator } from 'design'; - import { AccessDenied } from 'design/CardError'; - import useAttempt from 'shared/hooks/useAttemptNext'; import { UrlLauncherParams } from 'teleport/config'; diff --git a/web/packages/teleport/src/Apps/AddApp/AddApp.tsx b/web/packages/teleport/src/Apps/AddApp/AddApp.tsx index 7567e8ae00c8f..a6403cc17153c 100644 --- a/web/packages/teleport/src/Apps/AddApp/AddApp.tsx +++ b/web/packages/teleport/src/Apps/AddApp/AddApp.tsx @@ -17,18 +17,16 @@ */ import React from 'react'; + import { Flex } from 'design'; import Dialog, { DialogTitle } from 'design/Dialog'; - import * as Icons from 'design/Icon'; -import useTeleport from 'teleport/useTeleport'; - import { TabIcon } from 'teleport/components/TabIcon'; - -import { Manually } from './Manually'; +import useTeleport from 'teleport/useTeleport'; import { Automatically } from './Automatically'; +import { Manually } from './Manually'; import useAddApp, { State } from './useAddApp'; export default function Container(props: Props) { diff --git a/web/packages/teleport/src/Apps/AddApp/Automatically.test.tsx b/web/packages/teleport/src/Apps/AddApp/Automatically.test.tsx index daa159c1f7f61..f2adc9c81c2ca 100644 --- a/web/packages/teleport/src/Apps/AddApp/Automatically.test.tsx +++ b/web/packages/teleport/src/Apps/AddApp/Automatically.test.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ +import { act } from '@testing-library/react'; import React from 'react'; -import { fireEvent, render, screen } from 'design/utils/testing'; -import { act } from '@testing-library/react'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { Automatically, createAppBashCommand } from './Automatically'; diff --git a/web/packages/teleport/src/Apps/AddApp/Automatically.tsx b/web/packages/teleport/src/Apps/AddApp/Automatically.tsx index 5c6c69f6ff44d..506f219fa3bd4 100644 --- a/web/packages/teleport/src/Apps/AddApp/Automatically.tsx +++ b/web/packages/teleport/src/Apps/AddApp/Automatically.tsx @@ -17,21 +17,22 @@ */ import React, { KeyboardEvent } from 'react'; + import { - Link, - Text, - Flex, Alert, - ButtonSecondary, ButtonPrimary, + ButtonSecondary, + Flex, + Link, + Text, } from 'design'; import { DialogContent, DialogFooter } from 'design/Dialog'; -import Validation, { Validator } from 'shared/components/Validation'; import FieldInput from 'shared/components/FieldInput'; +import Validation, { Validator } from 'shared/components/Validation'; import { Attempt } from 'shared/hooks/useAttemptNext'; -import cfg from 'teleport/config'; import TextSelectCopy from 'teleport/components/TextSelectCopy'; +import cfg from 'teleport/config'; import { State } from './useAddApp'; diff --git a/web/packages/teleport/src/Apps/AddApp/Manually.test.tsx b/web/packages/teleport/src/Apps/AddApp/Manually.test.tsx index c7d9ca011ee1c..3d982ef1fbfac 100644 --- a/web/packages/teleport/src/Apps/AddApp/Manually.test.tsx +++ b/web/packages/teleport/src/Apps/AddApp/Manually.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render, screen } from 'design/utils/testing'; import { Manually } from './Manually'; diff --git a/web/packages/teleport/src/Apps/AddApp/Manually.tsx b/web/packages/teleport/src/Apps/AddApp/Manually.tsx index da48610baf801..6128f9f779717 100644 --- a/web/packages/teleport/src/Apps/AddApp/Manually.tsx +++ b/web/packages/teleport/src/Apps/AddApp/Manually.tsx @@ -17,18 +17,19 @@ */ import React from 'react'; + import { - Text, Box, + ButtonLink, ButtonSecondary, - Link, Indicator, - ButtonLink, + Link, + Text, } from 'design'; import { DialogContent, DialogFooter } from 'design/Dialog'; -import TextSelectCopy from 'teleport/components/TextSelectCopy'; import DownloadLinks from 'teleport/components/DownloadLinks'; +import TextSelectCopy from 'teleport/components/TextSelectCopy'; import cfg from 'teleport/config'; import { State } from './useAddApp'; diff --git a/web/packages/teleport/src/Apps/AddApp/useAddApp.ts b/web/packages/teleport/src/Apps/AddApp/useAddApp.ts index 314475e63909d..be04b6cba17fd 100644 --- a/web/packages/teleport/src/Apps/AddApp/useAddApp.ts +++ b/web/packages/teleport/src/Apps/AddApp/useAddApp.ts @@ -17,11 +17,11 @@ */ import { useEffect, useState } from 'react'; -import useAttempt from 'shared/hooks/useAttemptNext'; -import TeleportContext from 'teleport/teleportContext'; +import useAttempt from 'shared/hooks/useAttemptNext'; import type { JoinToken } from 'teleport/services/joinToken'; +import TeleportContext from 'teleport/teleportContext'; export default function useAddApp(ctx: TeleportContext) { const { attempt, run } = useAttempt(''); diff --git a/web/packages/teleport/src/Audit/Audit.story.test.tsx b/web/packages/teleport/src/Audit/Audit.story.test.tsx index 1c4703148f216..78369d44d518e 100644 --- a/web/packages/teleport/src/Audit/Audit.story.test.tsx +++ b/web/packages/teleport/src/Audit/Audit.story.test.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; + import { render, screen } from 'design/utils/testing'; -import { LoadedSample, AllPossibleEvents } from './Audit.story'; +import { AllPossibleEvents, LoadedSample } from './Audit.story'; test('loaded audit log screen', async () => { const { container } = render(); diff --git a/web/packages/teleport/src/Audit/Audit.story.tsx b/web/packages/teleport/src/Audit/Audit.story.tsx index 9cc666a02cf6e..88092f26dcc46 100644 --- a/web/packages/teleport/src/Audit/Audit.story.tsx +++ b/web/packages/teleport/src/Audit/Audit.story.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ +import { createMemoryHistory } from 'history'; import React from 'react'; import { Router } from 'react-router'; -import { createMemoryHistory } from 'history'; -import { ContextProvider, Context } from 'teleport'; +import { Context, ContextProvider } from 'teleport'; import { AuditContainer as Audit } from './Audit'; import EventList from './EventList'; diff --git a/web/packages/teleport/src/Audit/Audit.tsx b/web/packages/teleport/src/Audit/Audit.tsx index b47d8b3ca83e6..1633f6ca54c24 100644 --- a/web/packages/teleport/src/Audit/Audit.tsx +++ b/web/packages/teleport/src/Audit/Audit.tsx @@ -18,23 +18,21 @@ import React, { useState } from 'react'; +import { Box, Indicator } from 'design'; import { Danger } from 'design/Alert'; -import { Indicator, Box } from 'design'; import { ClusterDropdown } from 'shared/components/ClusterDropdown/ClusterDropdown'; +import { ExternalAuditStorageCta } from '@gravitational/teleport/src/components/ExternalAuditStorageCta'; import RangePicker from 'teleport/components/EventRangePicker'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import useTeleport from 'teleport/useTeleport'; import useStickyClusterId from 'teleport/useStickyClusterId'; - -import { ExternalAuditStorageCta } from '@gravitational/teleport/src/components/ExternalAuditStorageCta'; +import useTeleport from 'teleport/useTeleport'; import EventList from './EventList'; - import useAuditEvents, { State } from './useAuditEvents'; export function AuditContainer() { diff --git a/web/packages/teleport/src/Audit/EventDialog/EventDialog.tsx b/web/packages/teleport/src/Audit/EventDialog/EventDialog.tsx index f2ad5105257f0..b992ca486cc41 100644 --- a/web/packages/teleport/src/Audit/EventDialog/EventDialog.tsx +++ b/web/packages/teleport/src/Audit/EventDialog/EventDialog.tsx @@ -16,17 +16,17 @@ * along with this program. If not, see . */ -import React from 'react'; import PropTypes from 'prop-types'; -import TextEditor from 'shared/components/TextEditor'; +import React from 'react'; + +import { ButtonSecondary } from 'design'; import Dialog, { + DialogContent, DialogFooter, DialogHeader, DialogTitle, - DialogContent, } from 'design/Dialog'; - -import { ButtonSecondary } from 'design'; +import TextEditor from 'shared/components/TextEditor'; import { Event } from 'teleport/services/audit'; diff --git a/web/packages/teleport/src/Audit/EventDialog/index.ts b/web/packages/teleport/src/Audit/EventDialog/index.ts index b831566f4be66..e2dfae41a85e7 100644 --- a/web/packages/teleport/src/Audit/EventDialog/index.ts +++ b/web/packages/teleport/src/Audit/EventDialog/index.ts @@ -17,4 +17,5 @@ */ import EventDialog from './EventDialog'; + export default EventDialog; diff --git a/web/packages/teleport/src/Audit/EventList/EventList.tsx b/web/packages/teleport/src/Audit/EventList/EventList.tsx index 2bf59d82ca5c7..646437701e292 100644 --- a/web/packages/teleport/src/Audit/EventList/EventList.tsx +++ b/web/packages/teleport/src/Audit/EventList/EventList.tsx @@ -17,15 +17,15 @@ */ import React, { useState } from 'react'; + import { ButtonBorder } from 'design'; import Table, { Cell } from 'design/DataTable'; import { dateTimeMatcher } from 'design/utils/match'; import { Event } from 'teleport/services/audit'; -import { State } from '../useAuditEvents'; import EventDialog from '../EventDialog'; - +import { State } from '../useAuditEvents'; import renderTypeCell from './EventTypeCell'; export default function EventList(props: Props) { diff --git a/web/packages/teleport/src/Audit/EventList/EventListCells.tsx b/web/packages/teleport/src/Audit/EventList/EventListCells.tsx index 0104c0a3fb931..18c4458b6ae27 100644 --- a/web/packages/teleport/src/Audit/EventList/EventListCells.tsx +++ b/web/packages/teleport/src/Audit/EventList/EventListCells.tsx @@ -17,8 +17,9 @@ */ import React from 'react'; -import { Cell } from 'design/DataTable'; + import { ButtonBorder } from 'design'; +import { Cell } from 'design/DataTable'; import { displayDateTime } from 'shared/services/loc'; import { Event } from 'teleport/services/audit'; diff --git a/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx b/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx index fdcb2e3d97393..6ab3ee38425f7 100644 --- a/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx +++ b/web/packages/teleport/src/Audit/EventList/EventTypeCell.tsx @@ -18,10 +18,11 @@ import React from 'react'; import styled from 'styled-components'; + import { Cell } from 'design/DataTable'; import * as Icons from 'design/Icon'; -import { eventCodes, Event, EventCode } from 'teleport/services/audit'; +import { Event, EventCode, eventCodes } from 'teleport/services/audit'; const EventIconMap: Record = { [eventCodes.AUTH_ATTEMPT_FAILURE]: Icons.Info, diff --git a/web/packages/teleport/src/Audit/EventList/index.ts b/web/packages/teleport/src/Audit/EventList/index.ts index b1c7ae9024079..71f0f5bbe025d 100644 --- a/web/packages/teleport/src/Audit/EventList/index.ts +++ b/web/packages/teleport/src/Audit/EventList/index.ts @@ -17,4 +17,5 @@ */ import EventList from './EventList'; + export default EventList; diff --git a/web/packages/teleport/src/Audit/useAuditEvents.ts b/web/packages/teleport/src/Audit/useAuditEvents.ts index 0dba36b065ef1..bfd248755bfb9 100644 --- a/web/packages/teleport/src/Audit/useAuditEvents.ts +++ b/web/packages/teleport/src/Audit/useAuditEvents.ts @@ -16,15 +16,16 @@ * along with this program. If not, see . */ -import { useEffect, useState, useMemo } from 'react'; +import { useEffect, useMemo, useState } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; -import Ctx from 'teleport/teleportContext'; import { - getRangeOptions, EventRange, + getRangeOptions, } from 'teleport/components/EventRangePicker'; import { Event, EventCode, formatters } from 'teleport/services/audit'; +import Ctx from 'teleport/teleportContext'; export default function useAuditEvents( ctx: Ctx, diff --git a/web/packages/teleport/src/AuthConnectors/AuthConnectors.tsx b/web/packages/teleport/src/AuthConnectors/AuthConnectors.tsx index 42a1663449db5..abbcf325df0a8 100644 --- a/web/packages/teleport/src/AuthConnectors/AuthConnectors.tsx +++ b/web/packages/teleport/src/AuthConnectors/AuthConnectors.tsx @@ -17,11 +17,8 @@ */ import React from 'react'; -import { Alert, Box, Flex, Indicator, Link, Text } from 'design'; -import { FeatureBox, FeatureHeaderTitle } from 'teleport/components/Layout'; -import ResourceEditor from 'teleport/components/ResourceEditor'; -import useResources from 'teleport/components/useResources'; +import { Alert, Box, Flex, Indicator, Link, Text } from 'design'; import { DesktopDescription, @@ -29,12 +26,15 @@ import { ResponsiveAddButton, ResponsiveFeatureHeader, } from 'teleport/AuthConnectors/styles/AuthConnectors.styles'; +import { FeatureBox, FeatureHeaderTitle } from 'teleport/components/Layout'; +import ResourceEditor from 'teleport/components/ResourceEditor'; +import useResources from 'teleport/components/useResources'; -import EmptyList from './EmptyList'; import ConnectorList from './ConnectorList'; import DeleteConnectorDialog from './DeleteConnectorDialog'; -import useAuthConnectors, { State } from './useAuthConnectors'; +import EmptyList from './EmptyList'; import templates from './templates'; +import useAuthConnectors, { State } from './useAuthConnectors'; export function AuthConnectorsContainer() { const state = useAuthConnectors(); diff --git a/web/packages/teleport/src/AuthConnectors/ConnectorList/ConnectorList.tsx b/web/packages/teleport/src/AuthConnectors/ConnectorList/ConnectorList.tsx index f73faed2a987b..7571c0fa2d24f 100644 --- a/web/packages/teleport/src/AuthConnectors/ConnectorList/ConnectorList.tsx +++ b/web/packages/teleport/src/AuthConnectors/ConnectorList/ConnectorList.tsx @@ -17,12 +17,12 @@ */ import React from 'react'; + import { Box, ButtonPrimary, Flex, ResourceIcon, Text } from 'design'; import { MenuIcon, MenuItem } from 'shared/components/MenuAction'; -import { State as ResourceState } from 'teleport/components/useResources'; - import { ResponsiveConnector } from 'teleport/AuthConnectors/styles/ConnectorBox.styles'; +import { State as ResourceState } from 'teleport/components/useResources'; import { State as AuthConnectorState } from '../useAuthConnectors'; diff --git a/web/packages/teleport/src/AuthConnectors/ConnectorList/index.ts b/web/packages/teleport/src/AuthConnectors/ConnectorList/index.ts index febac225e28bf..39ea41a98fe8b 100644 --- a/web/packages/teleport/src/AuthConnectors/ConnectorList/index.ts +++ b/web/packages/teleport/src/AuthConnectors/ConnectorList/index.ts @@ -17,4 +17,5 @@ */ import ConnectorList from './ConnectorList'; + export default ConnectorList; diff --git a/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/DeleteConnectorDialog.tsx b/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/DeleteConnectorDialog.tsx index 3dacfabe6d9b6..706eae52fed38 100644 --- a/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/DeleteConnectorDialog.tsx +++ b/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/DeleteConnectorDialog.tsx @@ -17,14 +17,15 @@ */ import React from 'react'; -import useAttempt from 'shared/hooks/useAttemptNext'; -import { ButtonWarning, ButtonSecondary, Text, Alert } from 'design'; + +import { Alert, ButtonSecondary, ButtonWarning, Text } from 'design'; import Dialog, { DialogContent, DialogFooter, DialogHeader, DialogTitle, } from 'design/DialogConfirmation'; +import useAttempt from 'shared/hooks/useAttemptNext'; import { State as ResourceState } from 'teleport/components/useResources'; diff --git a/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/index.ts b/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/index.ts index 0c55375d0b394..1eb15527a346f 100644 --- a/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/index.ts +++ b/web/packages/teleport/src/AuthConnectors/DeleteConnectorDialog/index.ts @@ -17,4 +17,5 @@ */ import DeleteConnectorDialog from './DeleteConnectorDialog'; + export default DeleteConnectorDialog; diff --git a/web/packages/teleport/src/AuthConnectors/EmptyList/EmptyList.tsx b/web/packages/teleport/src/AuthConnectors/EmptyList/EmptyList.tsx index 19087664eb2b2..91f1eb09d9232 100644 --- a/web/packages/teleport/src/AuthConnectors/EmptyList/EmptyList.tsx +++ b/web/packages/teleport/src/AuthConnectors/EmptyList/EmptyList.tsx @@ -17,17 +17,16 @@ */ import React from 'react'; + import { Card, Flex, ResourceIcon, Text } from 'design'; import { AuthProviderType } from 'shared/services'; +import getSsoIcon from 'teleport/AuthConnectors/ssoIcons/getSsoIcon'; import { ConnectorBox } from 'teleport/AuthConnectors/styles/ConnectorBox.styles'; - import { LockedFeatureButton, LockedFeatureContainer, } from 'teleport/AuthConnectors/styles/LockedFeatureContainer.styles'; - -import getSsoIcon from 'teleport/AuthConnectors/ssoIcons/getSsoIcon'; import { State as ResourceState } from 'teleport/components/useResources'; import { CtaEvent } from 'teleport/services/userEvent'; diff --git a/web/packages/teleport/src/AuthConnectors/EmptyList/index.ts b/web/packages/teleport/src/AuthConnectors/EmptyList/index.ts index 1383d4cf7d139..b72cc16af98f8 100644 --- a/web/packages/teleport/src/AuthConnectors/EmptyList/index.ts +++ b/web/packages/teleport/src/AuthConnectors/EmptyList/index.ts @@ -17,4 +17,5 @@ */ import EmptyList from './EmptyList'; + export default EmptyList; diff --git a/web/packages/teleport/src/AuthConnectors/ssoIcons/getSsoIcon.tsx b/web/packages/teleport/src/AuthConnectors/ssoIcons/getSsoIcon.tsx index 01101bff5ee94..cd1d993e79ad3 100644 --- a/web/packages/teleport/src/AuthConnectors/ssoIcons/getSsoIcon.tsx +++ b/web/packages/teleport/src/AuthConnectors/ssoIcons/getSsoIcon.tsx @@ -18,8 +18,9 @@ import React from 'react'; import styled from 'styled-components'; -import { AuthProviderType } from 'shared/services'; + import { Box, Flex, ResourceIcon } from 'design'; +import { AuthProviderType } from 'shared/services'; export default function getSsoIcon(kind: AuthProviderType) { const desc = formatConnectorTypeDesc(kind); diff --git a/web/packages/teleport/src/AuthConnectors/styles/AuthConnectors.styles.ts b/web/packages/teleport/src/AuthConnectors/styles/AuthConnectors.styles.ts index 94e79806bf287..5961eca28cf16 100644 --- a/web/packages/teleport/src/AuthConnectors/styles/AuthConnectors.styles.ts +++ b/web/packages/teleport/src/AuthConnectors/styles/AuthConnectors.styles.ts @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Box, ButtonPrimary, Text } from 'design'; import { FeatureHeader } from 'teleport/components/Layout'; diff --git a/web/packages/teleport/src/AuthConnectors/styles/ConnectorBox.styles.ts b/web/packages/teleport/src/AuthConnectors/styles/ConnectorBox.styles.ts index f88e5e7ad5646..48cc5bf361000 100644 --- a/web/packages/teleport/src/AuthConnectors/styles/ConnectorBox.styles.ts +++ b/web/packages/teleport/src/AuthConnectors/styles/ConnectorBox.styles.ts @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -import { Box, Flex } from 'design'; import styled from 'styled-components'; +import { Box, Flex } from 'design'; + export const ConnectorBox = styled(Box)` display: flex; flex-direction: column; diff --git a/web/packages/teleport/src/AuthConnectors/useAuthConnectors.tsx b/web/packages/teleport/src/AuthConnectors/useAuthConnectors.tsx index 3a59862671dbf..488d0c62736f6 100644 --- a/web/packages/teleport/src/AuthConnectors/useAuthConnectors.tsx +++ b/web/packages/teleport/src/AuthConnectors/useAuthConnectors.tsx @@ -17,6 +17,7 @@ */ import { useEffect, useState } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; import { Resource } from 'teleport/services/resources'; diff --git a/web/packages/teleport/src/Bots/Add/AddBots.tsx b/web/packages/teleport/src/Bots/Add/AddBots.tsx index 081919a8264d3..41c4f36eed87e 100644 --- a/web/packages/teleport/src/Bots/Add/AddBots.tsx +++ b/web/packages/teleport/src/Bots/Add/AddBots.tsx @@ -18,15 +18,13 @@ import React from 'react'; -import { Switch, Route } from 'teleport/components/Router'; -import cfg from 'teleport/config'; - import { FeatureBox } from 'teleport/components/Layout'; +import { Route, Switch } from 'teleport/components/Router'; +import cfg from 'teleport/config'; import { BotFlowType } from '../types'; - -import GitHubActionsFlow from './GitHubActions'; import { AddBotsPicker } from './AddBotsPicker'; +import GitHubActionsFlow from './GitHubActions'; export function AddBots() { return ( diff --git a/web/packages/teleport/src/Bots/Add/AddBotsPicker.story.tsx b/web/packages/teleport/src/Bots/Add/AddBotsPicker.story.tsx index 7551ba4035b9a..64dac92317e01 100644 --- a/web/packages/teleport/src/Bots/Add/AddBotsPicker.story.tsx +++ b/web/packages/teleport/src/Bots/Add/AddBotsPicker.story.tsx @@ -20,7 +20,6 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; - import { createTeleportContext } from 'teleport/mocks/contexts'; import { AddBotsPicker } from './AddBotsPicker'; diff --git a/web/packages/teleport/src/Bots/Add/AddBotsPicker.tsx b/web/packages/teleport/src/Bots/Add/AddBotsPicker.tsx index 8b5d1c12a6c38..b76c830016c43 100644 --- a/web/packages/teleport/src/Bots/Add/AddBotsPicker.tsx +++ b/web/packages/teleport/src/Bots/Add/AddBotsPicker.tsx @@ -20,22 +20,19 @@ import React from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; -import { Box, Flex, Link as ExternalLink, Text, ResourceIcon } from 'design'; - +import { Box, Link as ExternalLink, Flex, ResourceIcon, Text } from 'design'; import { Server } from 'design/Icon'; +import { FeatureHeader, FeatureHeaderTitle } from 'teleport/components/Layout'; +import { ToolTipNoPermBadge } from 'teleport/components/ToolTipNoPermBadge'; import cfg from 'teleport/config'; - +import { IntegrationTile } from 'teleport/Integrations'; import { IntegrationEnrollEvent, IntegrationEnrollKind, userEventService, } from 'teleport/services/userEvent'; -import { IntegrationTile } from 'teleport/Integrations'; -import { FeatureHeader, FeatureHeaderTitle } from 'teleport/components/Layout'; - import useTeleport from 'teleport/useTeleport'; -import { ToolTipNoPermBadge } from 'teleport/components/ToolTipNoPermBadge'; import { BotFlowType } from '../types'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.story.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.story.tsx index 62dd7da280a30..d98c8017f3741 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.story.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.story.tsx @@ -20,11 +20,9 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; - import { createTeleportContext } from 'teleport/mocks/contexts'; import { FlowStepProps } from '../Shared/GuidedFlow'; - import { AddBotToWorkflow } from './AddBotToWorkflow'; import { GitHubFlowProvider } from './useGitHubFlow'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.test.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.test.tsx index 92d4dbd75ee0f..3d915bc527158 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.test.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.test.tsx @@ -17,15 +17,16 @@ */ import React from 'react'; -import { render, screen } from 'design/utils/testing'; import { MemoryRouter } from 'react-router-dom'; +import { render, screen } from 'design/utils/testing'; + import { ContextProvider } from 'teleport'; -import TeleportContext from 'teleport/teleportContext'; import { allAccessAcl } from 'teleport/mocks/contexts'; +import TeleportContext from 'teleport/teleportContext'; -import { GitHubFlowProvider } from './useGitHubFlow'; import { ConfigureBot } from './ConfigureBot'; +import { GitHubFlowProvider } from './useGitHubFlow'; describe('addBotToWorkflow Component', () => { const setup = () => { diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.tsx index b36e6fe914594..75d59b5648330 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/AddBotToWorkflow.tsx @@ -19,16 +19,14 @@ import React from 'react'; import Box from 'design/Box'; +import Flex from 'design/Flex'; import Text from 'design/Text'; import TextEditor from 'shared/components/TextEditor'; -import Flex from 'design/Flex'; import useTeleport from 'teleport/useTeleport'; import { FlowButtons } from '../Shared/FlowButtons'; - import { FlowStepProps } from '../Shared/GuidedFlow'; - import { useGitHubFlow } from './useGitHubFlow'; export function AddBotToWorkflow({ prevStep, nextStep }: FlowStepProps) { diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.story.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.story.tsx index 6c7f230ecfa80..e1ea19bf16caa 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.story.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.story.tsx @@ -20,11 +20,9 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; - import { allAccessAcl, createTeleportContext } from 'teleport/mocks/contexts'; import { FlowStepProps } from '../Shared/GuidedFlow'; - import { ConfigureBot } from './ConfigureBot'; import { GitHubFlowProvider } from './useGitHubFlow'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.test.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.test.tsx index 8831e5f19c9d7..a56ae7055d9ca 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.test.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.test.tsx @@ -18,17 +18,17 @@ import React from 'react'; import { MemoryRouter } from 'react-router-dom'; + import { render, screen, userEvent } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; -import TeleportContext from 'teleport/teleportContext'; import { allAccessAcl } from 'teleport/mocks/contexts'; - -import { Access, Acl } from 'teleport/services/user'; import * as botService from 'teleport/services/bot/bot'; +import { Access, Acl } from 'teleport/services/user'; +import TeleportContext from 'teleport/teleportContext'; -import { GitHubFlowProvider } from './useGitHubFlow'; import { ConfigureBot } from './ConfigureBot'; +import { GitHubFlowProvider } from './useGitHubFlow'; type SetupProps = { access?: Acl; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.tsx index aa7590fddd14a..4f1a009337205 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/ConfigureBot.tsx @@ -19,26 +19,20 @@ import React, { useState } from 'react'; import styled from 'styled-components'; +import Alert from 'design/Alert'; import Box from 'design/Box'; -import useAttempt from 'shared/hooks/useAttemptNext'; -import Validation, { Validator } from 'shared/components/Validation'; - import Text from 'design/Text'; - import FieldInput from 'shared/components/FieldInput'; +import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; +import useAttempt from 'shared/hooks/useAttemptNext'; -import Alert from 'design/Alert'; - +import { LabelsInput } from 'teleport/components/LabelsInput'; import { getBot } from 'teleport/services/bot'; - import useTeleport from 'teleport/useTeleport'; -import { LabelsInput } from 'teleport/components/LabelsInput'; - -import { FlowStepProps } from '../Shared/GuidedFlow'; import { FlowButtons } from '../Shared/FlowButtons'; - +import { FlowStepProps } from '../Shared/GuidedFlow'; import { useGitHubFlow } from './useGitHubFlow'; export function ConfigureBot({ nextStep, prevStep }: FlowStepProps) { diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.story.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.story.tsx index cdf1feaf85c5a..5d501a988c1bf 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.story.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.story.tsx @@ -20,11 +20,9 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; - import { createTeleportContext } from 'teleport/mocks/contexts'; import { FlowStepProps } from '../Shared/GuidedFlow'; - import { ConnectGitHub } from './ConnectGitHub'; import { GitHubFlowProvider } from './useGitHubFlow'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.test.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.test.tsx index 9c468ddc64677..521fc0d082195 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.test.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.test.tsx @@ -17,18 +17,15 @@ */ import React from 'react'; - import { MemoryRouter } from 'react-router'; import { render, screen } from 'design/utils/testing'; -import { allAccessAcl } from 'teleport/mocks/contexts'; - import { ContextProvider } from 'teleport'; +import { allAccessAcl } from 'teleport/mocks/contexts'; import TeleportContext from 'teleport/teleportContext'; import { ConnectGitHub } from './ConnectGitHub'; - import { GitHubFlowProvider } from './useGitHubFlow'; describe('connectGitHub Component', () => { diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.tsx index 83cee7d93ae08..d094617cf310b 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/ConnectGitHub.tsx @@ -17,36 +17,32 @@ */ import React, { useState } from 'react'; -import styled from 'styled-components'; import ReactSelect from 'react-select'; +import styled from 'styled-components'; +import Alert from 'design/Alert'; import Box from 'design/Box'; -import Text from 'design/Text'; -import * as Icons from 'design/Icon'; -import { StyledSelect } from 'shared/components/Select'; -import Input from 'design/Input'; import { ButtonSecondary } from 'design/Button'; -import Validation, { Validator } from 'shared/components/Validation'; - -import Flex from 'design/Flex'; -import Card from 'design/Card'; import ButtonIcon from 'design/ButtonIcon'; -import FieldInput from 'shared/components/FieldInput'; - -import Alert from 'design/Alert'; - +import Card from 'design/Card'; +import Flex from 'design/Flex'; +import * as Icons from 'design/Icon'; +import Input from 'design/Input'; import Link from 'design/Link'; +import Text from 'design/Text'; +import FieldInput from 'shared/components/FieldInput'; +import { StyledSelect } from 'shared/components/Select'; +import Validation, { Validator } from 'shared/components/Validation'; import cfg from 'teleport/config'; import { FlowButtons } from '../Shared/FlowButtons'; import { FlowStepProps } from '../Shared/GuidedFlow'; - import { GITHUB_HOST, + parseRepoAddress, RefTypeOption, Rule, - parseRepoAddress, useGitHubFlow, } from './useGitHubFlow'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.test.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.test.tsx index 27555e2bf29f4..5dc4cb0f2cfdb 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.test.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.test.tsx @@ -18,14 +18,15 @@ import React from 'react'; import { MemoryRouter } from 'react-router-dom'; + import { render, screen } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; -import TeleportContext from 'teleport/teleportContext'; import cfg from 'teleport/config'; +import TeleportContext from 'teleport/teleportContext'; -import { GitHubFlowProvider, initialBotState } from './useGitHubFlow'; import { Finish } from './Finish'; +import { GitHubFlowProvider, initialBotState } from './useGitHubFlow'; describe('finish Component', () => { const setup = ({ botName }) => { diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.tsx index fee871e9508f6..676bed9c5b385 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/Finish.tsx @@ -19,14 +19,13 @@ import React from 'react'; import { Link } from 'react-router-dom'; +import { ButtonPrimary, ButtonSecondary } from 'design/Button'; import Flex from 'design/Flex'; import Image from 'design/Image'; - import Text from 'design/Text'; -import { ButtonPrimary, ButtonSecondary } from 'design/Button'; -import celebratePamPng from 'teleport/Discover/Shared/Finished/celebrate-pam.png'; import cfg from 'teleport/config'; +import celebratePamPng from 'teleport/Discover/Shared/Finished/celebrate-pam.png'; import { useGitHubFlow } from './useGitHubFlow'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.test.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.test.tsx index 653750175ebde..85b7fb3186126 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.test.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.test.tsx @@ -18,18 +18,16 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import { render, screen, userEvent } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; - import { allAccessAcl, noAccess } from 'teleport/mocks/contexts'; - import * as botService from 'teleport/services/bot/bot'; - import TeleportContext from 'teleport/teleportContext'; -import { GitHubFlowProvider } from './useGitHubFlow'; import { GitHubActions } from './GitHubActions'; +import { GitHubFlowProvider } from './useGitHubFlow'; const tokenName = 'generated-test-token'; const authVersion = 'v15.0.0'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.tsx index 21f43f51a8fd6..4332e2f466c6c 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/GitHubActions.tsx @@ -18,11 +18,9 @@ import { ResourceIcon } from 'design/ResourceIcon'; import { GuidedFlow, View } from '../Shared/GuidedFlow'; - -import { ConnectGitHub } from './ConnectGitHub'; - -import { ConfigureBot } from './ConfigureBot'; import { AddBotToWorkflow } from './AddBotToWorkflow'; +import { ConfigureBot } from './ConfigureBot'; +import { ConnectGitHub } from './ConnectGitHub'; import { Finish } from './Finish'; import { GitHubFlowProvider } from './useGitHubFlow'; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActions/useGitHubFlow.tsx b/web/packages/teleport/src/Bots/Add/GitHubActions/useGitHubFlow.tsx index 558bad33b4bfc..6dc71f0ced447 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActions/useGitHubFlow.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActions/useGitHubFlow.tsx @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -import React, { useState, useContext } from 'react'; -import { Option } from 'shared/components/Select'; +import React, { useContext, useState } from 'react'; +import { Option } from 'shared/components/Select'; import useAttempt, { Attempt } from 'shared/hooks/useAttemptNext'; import { ResourceLabel } from 'teleport/services/agents'; import { - createBot as serviceCreateBot, createBotToken, GITHUB_ACTIONS_LABEL_KEY, + createBot as serviceCreateBot, } from 'teleport/services/bot'; import { BotUiFlow, @@ -33,7 +33,6 @@ import { GitHubRepoRule, RefType, } from 'teleport/services/bot/types'; - import useTeleport from 'teleport/useTeleport'; export const GITHUB_HOST = 'github.com'; diff --git a/web/packages/teleport/src/Bots/Add/Shared/FlowButtons.test.tsx b/web/packages/teleport/src/Bots/Add/Shared/FlowButtons.test.tsx index f8bd3dcb67699..71f36dd8fa75a 100644 --- a/web/packages/teleport/src/Bots/Add/Shared/FlowButtons.test.tsx +++ b/web/packages/teleport/src/Bots/Add/Shared/FlowButtons.test.tsx @@ -16,10 +16,11 @@ * along with this program. If not, see . */ -import { render, screen, userEvent } from 'design/utils/testing'; import { createMemoryHistory } from 'history'; -import { Router, MemoryRouter } from 'react-router'; import React from 'react'; +import { MemoryRouter, Router } from 'react-router'; + +import { render, screen, userEvent } from 'design/utils/testing'; import cfg from 'teleport/config'; diff --git a/web/packages/teleport/src/Bots/DeleteBot.tsx b/web/packages/teleport/src/Bots/DeleteBot.tsx index f12a6ead41cd5..8b9c6ceefa8dd 100644 --- a/web/packages/teleport/src/Bots/DeleteBot.tsx +++ b/web/packages/teleport/src/Bots/DeleteBot.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Alert, ButtonSecondary, ButtonWarning, Text } from 'design'; import Dialog, { DialogContent, diff --git a/web/packages/teleport/src/Bots/EditBot.test.tsx b/web/packages/teleport/src/Bots/EditBot.test.tsx index 3a0e2f8cb4b25..7c24bdec2dd8d 100644 --- a/web/packages/teleport/src/Bots/EditBot.test.tsx +++ b/web/packages/teleport/src/Bots/EditBot.test.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { render, screen, userEvent } from 'design/utils/testing'; - import { waitFor } from '@testing-library/react'; +import { render, screen, userEvent } from 'design/utils/testing'; + import { EditBot } from 'teleport/Bots/EditBot'; import { EditBotProps } from 'teleport/Bots/types'; diff --git a/web/packages/teleport/src/Bots/EditBot.tsx b/web/packages/teleport/src/Bots/EditBot.tsx index f3ee5ab05c898..554d3d9897645 100644 --- a/web/packages/teleport/src/Bots/EditBot.tsx +++ b/web/packages/teleport/src/Bots/EditBot.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Alert, ButtonSecondary, ButtonWarning } from 'design'; import Dialog, { DialogContent, @@ -24,12 +25,11 @@ import Dialog, { DialogHeader, DialogTitle, } from 'design/DialogConfirmation'; - import FieldInput from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import { FieldSelectAsync } from 'shared/components/FieldSelect'; -import Validation from 'shared/components/Validation'; import { Option } from 'shared/components/Select'; +import Validation from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; import { EditBotProps } from 'teleport/Bots/types'; diff --git a/web/packages/teleport/src/Bots/List/ActionCell.tsx b/web/packages/teleport/src/Bots/List/ActionCell.tsx index ec98394a9d0a6..aab3a116fa32b 100644 --- a/web/packages/teleport/src/Bots/List/ActionCell.tsx +++ b/web/packages/teleport/src/Bots/List/ActionCell.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Cell } from 'design/DataTable'; import { MenuButton, MenuItem } from 'shared/components/MenuAction'; diff --git a/web/packages/teleport/src/Bots/List/BotList.test.tsx b/web/packages/teleport/src/Bots/List/BotList.test.tsx index 1439890e675cb..6b8b03bba1331 100644 --- a/web/packages/teleport/src/Bots/List/BotList.test.tsx +++ b/web/packages/teleport/src/Bots/List/BotList.test.tsx @@ -18,9 +18,9 @@ import { fireEvent, render, screen } from 'design/utils/testing'; +import { botsFixture } from 'teleport/Bots/fixtures'; import { BotList } from 'teleport/Bots/List/BotList'; import { BotListProps } from 'teleport/Bots/types'; -import { botsFixture } from 'teleport/Bots/fixtures'; import { BotUiFlow } from 'teleport/services/bot/types'; const makeProps = (): BotListProps => ({ diff --git a/web/packages/teleport/src/Bots/List/BotList.tsx b/web/packages/teleport/src/Bots/List/BotList.tsx index 4181bc674efca..8e91116b454e4 100644 --- a/web/packages/teleport/src/Bots/List/BotList.tsx +++ b/web/packages/teleport/src/Bots/List/BotList.tsx @@ -16,15 +16,14 @@ * along with this program. If not, see . */ -import Table, { LabelCell } from 'design/DataTable'; - import React, { useState } from 'react'; -import { BotOptionsCell } from 'teleport/Bots/List/ActionCell'; +import Table, { LabelCell } from 'design/DataTable'; -import { BotListProps } from 'teleport/Bots/types'; import { DeleteBot } from 'teleport/Bots/DeleteBot'; import { EditBot } from 'teleport/Bots/EditBot'; +import { BotOptionsCell } from 'teleport/Bots/List/ActionCell'; +import { BotListProps } from 'teleport/Bots/types'; import { ViewBot } from '../ViewBot'; diff --git a/web/packages/teleport/src/Bots/List/Bots.test.tsx b/web/packages/teleport/src/Bots/List/Bots.test.tsx index 4a411cf53063f..bac5d2d062ed6 100644 --- a/web/packages/teleport/src/Bots/List/Bots.test.tsx +++ b/web/packages/teleport/src/Bots/List/Bots.test.tsx @@ -18,16 +18,17 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import { render, screen, userEvent, waitFor } from 'design/utils/testing'; -import api from 'teleport/services/api'; import { botsApiResponseFixture } from 'teleport/Bots/fixtures'; +import { ContextProvider } from 'teleport/index'; import { allAccessAcl, createTeleportContext, noAccess, } from 'teleport/mocks/contexts'; -import { ContextProvider } from 'teleport/index'; +import api from 'teleport/services/api'; import TeleportContext from 'teleport/teleportContext'; import { Bots } from './Bots'; diff --git a/web/packages/teleport/src/Bots/List/Bots.tsx b/web/packages/teleport/src/Bots/List/Bots.tsx index 84e68d4dddbe7..fe72488e8fd2b 100644 --- a/web/packages/teleport/src/Bots/List/Bots.tsx +++ b/web/packages/teleport/src/Bots/List/Bots.tsx @@ -17,17 +17,19 @@ */ import React, { useEffect, useState } from 'react'; -import { useAttemptNext } from 'shared/hooks'; import { Link } from 'react-router-dom'; + +import { Alert, Box, ButtonPrimary, Flex, Indicator, Text } from 'design'; import { HoverTooltip } from 'shared/components/ToolTip'; -import { Alert, Flex, Box, ButtonPrimary, Indicator, Text } from 'design'; +import { useAttemptNext } from 'shared/hooks'; +import { BotList } from 'teleport/Bots/List/BotList'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import { BotList } from 'teleport/Bots/List/BotList'; +import cfg from 'teleport/config'; import { deleteBot, editBot, @@ -37,8 +39,6 @@ import { import { FlatBot } from 'teleport/services/bot/types'; import useTeleport from 'teleport/useTeleport'; -import cfg from 'teleport/config'; - import { EmptyState } from './EmptyState/EmptyState'; export function Bots() { diff --git a/web/packages/teleport/src/Bots/List/EmptyState/EmptyState.tsx b/web/packages/teleport/src/Bots/List/EmptyState/EmptyState.tsx index 990578de5c196..0563196854948 100644 --- a/web/packages/teleport/src/Bots/List/EmptyState/EmptyState.tsx +++ b/web/packages/teleport/src/Bots/List/EmptyState/EmptyState.tsx @@ -16,9 +16,11 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import styled, { useTheme } from 'styled-components'; +import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; +import styled, { useTheme } from 'styled-components'; + +import { Box, ButtonPrimary, Flex, H1, Image, Text } from 'design'; import { ResourceIcon } from 'design/ResourceIcon'; import { Description, @@ -29,18 +31,15 @@ import { FeatureSlider, Title, } from 'shared/components/EmptyState/EmptyState'; -import { Box, ButtonPrimary, Flex, H1, Image, Text } from 'design'; -import cfg from 'teleport/config'; import { DisplayTile } from 'teleport/Bots/Add/AddBotsPicker'; - -import elimiateSecretsImage from './eliminate-secrets.svg'; -import elimiateSecretsLightImage from './eliminate-secrets-light.svg'; - -import controlWorkflowsImage from './control-workflows.svg'; -import controlWorkflowsLightImage from './control-workflows-light.svg'; +import cfg from 'teleport/config'; import argoCD from './argocd.png'; +import controlWorkflowsLightImage from './control-workflows-light.svg'; +import controlWorkflowsImage from './control-workflows.svg'; +import elimiateSecretsLightImage from './eliminate-secrets-light.svg'; +import elimiateSecretsImage from './eliminate-secrets.svg'; const maxWidth = '1204px'; diff --git a/web/packages/teleport/src/Bots/ViewBot.story.tsx b/web/packages/teleport/src/Bots/ViewBot.story.tsx index c6435c5d4f725..bded5dbfff55b 100644 --- a/web/packages/teleport/src/Bots/ViewBot.story.tsx +++ b/web/packages/teleport/src/Bots/ViewBot.story.tsx @@ -18,13 +18,12 @@ import React from 'react'; -import { BotUiFlow } from 'teleport/services/bot/types'; - import { ContextProvider } from 'teleport'; import { createTeleportContext } from 'teleport/mocks/contexts'; +import { BotUiFlow } from 'teleport/services/bot/types'; -import { ViewBot } from './ViewBot'; import { ViewBotProps } from './types'; +import { ViewBot } from './ViewBot'; export default { title: 'Teleport/Bots/Add/ViewBot', diff --git a/web/packages/teleport/src/Bots/ViewBot.tsx b/web/packages/teleport/src/Bots/ViewBot.tsx index 35844ffce77d7..5f3f890881aaf 100644 --- a/web/packages/teleport/src/Bots/ViewBot.tsx +++ b/web/packages/teleport/src/Bots/ViewBot.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { ButtonSecondary, Flex, Text } from 'design'; import Dialog, { DialogContent, @@ -24,11 +25,9 @@ import Dialog, { DialogHeader, DialogTitle, } from 'design/DialogConfirmation'; - import TextEditor from 'shared/components/TextEditor'; import { ViewBotProps } from 'teleport/Bots/types'; - import useTeleport from 'teleport/useTeleport'; import { getWorkflowExampleYaml } from './Add/GitHubActions/AddBotToWorkflow'; diff --git a/web/packages/teleport/src/Bots/types.ts b/web/packages/teleport/src/Bots/types.ts index d694506f9b0e6..ead0fac477cb4 100644 --- a/web/packages/teleport/src/Bots/types.ts +++ b/web/packages/teleport/src/Bots/types.ts @@ -16,6 +16,7 @@ * along with this program. If not, see . */ import { Dispatch, SetStateAction } from 'react'; + import { Attempt } from 'shared/hooks/useAttemptNext'; import { FlatBot } from 'teleport/services/bot/types'; diff --git a/web/packages/teleport/src/Clusters/ClusterList/ClusterList.tsx b/web/packages/teleport/src/Clusters/ClusterList/ClusterList.tsx index 293bf38d15c90..3d3dc11902121 100644 --- a/web/packages/teleport/src/Clusters/ClusterList/ClusterList.tsx +++ b/web/packages/teleport/src/Clusters/ClusterList/ClusterList.tsx @@ -20,13 +20,13 @@ import React from 'react'; import { NavLink } from 'react-router-dom'; import styled from 'styled-components'; -import { MenuButton, MenuItem } from 'shared/components/MenuAction'; import Table, { Cell } from 'design/DataTable'; import { Primary, Secondary } from 'design/Label'; +import { MenuButton, MenuItem } from 'shared/components/MenuAction'; -import { Cluster } from 'teleport/services/clusters'; -import cfg from 'teleport/config'; import { DropdownDivider } from 'teleport/components/Dropdown'; +import cfg from 'teleport/config'; +import { Cluster } from 'teleport/services/clusters'; export default function ClustersList(props: Props) { const { clusters = [], pageSize = 50, menuFlags } = props; diff --git a/web/packages/teleport/src/Clusters/ClusterList/index.ts b/web/packages/teleport/src/Clusters/ClusterList/index.ts index 23ea1097d00f9..4e5711ece4ce7 100644 --- a/web/packages/teleport/src/Clusters/ClusterList/index.ts +++ b/web/packages/teleport/src/Clusters/ClusterList/index.ts @@ -17,4 +17,5 @@ */ import ClusterList from './ClusterList'; + export default ClusterList; diff --git a/web/packages/teleport/src/Clusters/Clusters.story.test.tsx b/web/packages/teleport/src/Clusters/Clusters.story.test.tsx index 9ea9964075df7..192b18fe6fe96 100644 --- a/web/packages/teleport/src/Clusters/Clusters.story.test.tsx +++ b/web/packages/teleport/src/Clusters/Clusters.story.test.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { render, screen } from 'design/utils/testing'; -import { Story, createContext } from './Clusters.story'; +import { createContext, Story } from './Clusters.story'; test('render clusters', async () => { const ctx = createContext(); diff --git a/web/packages/teleport/src/Clusters/Clusters.story.tsx b/web/packages/teleport/src/Clusters/Clusters.story.tsx index 899ba8de53a90..3b5f99f9e93bf 100644 --- a/web/packages/teleport/src/Clusters/Clusters.story.tsx +++ b/web/packages/teleport/src/Clusters/Clusters.story.tsx @@ -16,15 +16,13 @@ * along with this program. If not, see . */ +import { createMemoryHistory } from 'history'; import React from 'react'; import { Router } from 'react-router'; -import { createMemoryHistory } from 'history'; import * as teleport from 'teleport'; - -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; - import { getOSSFeatures } from 'teleport/features'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; import { ClusterListPage } from './Clusters'; import * as fixtures from './fixtures'; diff --git a/web/packages/teleport/src/Clusters/Clusters.tsx b/web/packages/teleport/src/Clusters/Clusters.tsx index 68f4acac1fe6f..c3a0c9492fab6 100644 --- a/web/packages/teleport/src/Clusters/Clusters.tsx +++ b/web/packages/teleport/src/Clusters/Clusters.tsx @@ -17,9 +17,9 @@ */ import React, { useEffect, useState } from 'react'; + import { Box, Indicator } from 'design'; import { Danger } from 'design/Alert'; - import useAttempt from 'shared/hooks/useAttemptNext'; import { @@ -27,15 +27,14 @@ import { FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import useTeleport from 'teleport/useTeleport'; - -import { useFeatures } from 'teleport/FeaturesContext'; import { Route, Switch } from 'teleport/components/Router'; import cfg from 'teleport/config'; +import { useFeatures } from 'teleport/FeaturesContext'; +import useTeleport from 'teleport/useTeleport'; import ClusterList from './ClusterList'; -import { buildACL } from './utils'; import { ManageCluster } from './ManageCluster'; +import { buildACL } from './utils'; export function Clusters() { return ( diff --git a/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.story.tsx b/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.story.tsx index 8d6732bd3b743..a5fa9a492b153 100644 --- a/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.story.tsx +++ b/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.story.tsx @@ -19,13 +19,12 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { createTeleportContext } from 'teleport/mocks/contexts'; +import { Route } from 'teleport/components/Router'; import { ContextProvider } from 'teleport/index'; import { ContentMinWidth } from 'teleport/Main/Main'; -import { Route } from 'teleport/components/Router'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { clusterInfoFixture } from '../fixtures'; - import { ManageCluster } from './ManageCluster'; export default { diff --git a/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.test.tsx b/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.test.tsx index bf0230bad0ed0..8d7bf7ed260b2 100644 --- a/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.test.tsx +++ b/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.test.tsx @@ -16,20 +16,19 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { setupServer } from 'msw/node'; import React from 'react'; import { MemoryRouter, Route } from 'react-router-dom'; -import { setupServer } from 'msw/node'; -import { rest } from 'msw'; -import { render, waitFor, screen } from 'design/utils/testing'; +import { render, screen, waitFor } from 'design/utils/testing'; +import cfg from 'teleport/config'; import { ContextProvider } from 'teleport/index'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContentMinWidth } from 'teleport/Main/Main'; -import cfg from 'teleport/config'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { clusterInfoFixture } from '../fixtures'; - import { ManageCluster } from './ManageCluster'; function renderElement(element, ctx) { diff --git a/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.tsx b/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.tsx index 3f8e6ccfdf1a2..96d5ce12a4ffa 100644 --- a/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.tsx +++ b/web/packages/teleport/src/Clusters/ManageCluster/ManageCluster.tsx @@ -17,30 +17,28 @@ */ import React, { useCallback, useEffect, useState } from 'react'; -import styled from 'styled-components'; -import { Link } from 'react-router-dom'; import { useParams } from 'react-router'; +import { Link } from 'react-router-dom'; +import styled from 'styled-components'; -import { useAsync, Attempt } from 'shared/hooks/useAsync'; - -import { MultiRowBox, Row } from 'design/MultiRowBox'; +import Alert from 'design/Alert'; +import Box, { BoxProps } from 'design/Box'; import Flex from 'design/Flex'; import * as Icons from 'design/Icon'; -import Text, { H2 } from 'design/Text'; import Indicator from 'design/Indicator'; -import Box, { BoxProps } from 'design/Box'; +import { MultiRowBox, Row } from 'design/MultiRowBox'; import { ShimmerBox } from 'design/ShimmerBox'; -import Alert from 'design/Alert'; - +import Text, { H2 } from 'design/Text'; import { LoadingSkeleton } from 'shared/components/UnifiedResources/shared/LoadingSkeleton'; +import { Attempt, useAsync } from 'shared/hooks/useAsync'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import { useTeleport } from 'teleport/index'; import cfg from 'teleport/config'; +import { useTeleport } from 'teleport/index'; import { useNoMinWidth } from 'teleport/Main'; import { ClusterInfo } from 'teleport/services/clusters'; diff --git a/web/packages/teleport/src/Clusters/utils.ts b/web/packages/teleport/src/Clusters/utils.ts index f105007a46a27..81618561de0cf 100644 --- a/web/packages/teleport/src/Clusters/utils.ts +++ b/web/packages/teleport/src/Clusters/utils.ts @@ -17,7 +17,6 @@ */ import * as Features from 'teleport/features'; - import type { TeleportFeature } from 'teleport/types'; export function buildACL(features: TeleportFeature[]) { diff --git a/web/packages/teleport/src/Console/ActionBar/ActionBar.tsx b/web/packages/teleport/src/Console/ActionBar/ActionBar.tsx index 36658aaefae33..8ac638f0e7444 100644 --- a/web/packages/teleport/src/Console/ActionBar/ActionBar.tsx +++ b/web/packages/teleport/src/Console/ActionBar/ActionBar.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { LatencyDiagnostic } from 'shared/components/LatencyDiagnostic'; - import { Flex } from 'design'; +import { LatencyDiagnostic } from 'shared/components/LatencyDiagnostic'; import { DocumentSsh } from 'teleport/Console/stores'; diff --git a/web/packages/teleport/src/Console/ActionBar/index.ts b/web/packages/teleport/src/Console/ActionBar/index.ts index 68780db3589b9..9d87648f34b85 100644 --- a/web/packages/teleport/src/Console/ActionBar/index.ts +++ b/web/packages/teleport/src/Console/ActionBar/index.ts @@ -17,4 +17,5 @@ */ import ActionBar from './ActionBar'; + export default ActionBar; diff --git a/web/packages/teleport/src/Console/Console.story.tsx b/web/packages/teleport/src/Console/Console.story.tsx index 20de70fb721d4..627e3c4bd9d3b 100644 --- a/web/packages/teleport/src/Console/Console.story.tsx +++ b/web/packages/teleport/src/Console/Console.story.tsx @@ -16,11 +16,12 @@ * along with this program. If not, see . */ -import React from 'react'; import { storiesOf } from '@storybook/react'; -import { Flex } from 'design'; import { createMemoryHistory } from 'history'; -import { Router, Route } from 'react-router'; +import React from 'react'; +import { Route, Router } from 'react-router'; + +import { Flex } from 'design'; import Console from './Console'; import ConsoleContext from './consoleContext'; diff --git a/web/packages/teleport/src/Console/Console.tsx b/web/packages/teleport/src/Console/Console.tsx index 36cf572586dbd..0f0da31907e5d 100644 --- a/web/packages/teleport/src/Console/Console.tsx +++ b/web/packages/teleport/src/Console/Console.tsx @@ -18,25 +18,25 @@ import React from 'react'; import styled from 'styled-components'; + import { Box, Flex, Indicator } from 'design'; import { Danger } from 'design/Alert'; - import useAttempt from 'shared/hooks/useAttemptNext'; import AjaxPoller from 'teleport/components/AjaxPoller'; +import ActionBar from './ActionBar'; import { useConsoleContext, useStoreDocs } from './consoleContextProvider'; +import DocumentBlank from './DocumentBlank'; +import DocumentKubeExec from './DocumentKubeExec'; +import DocumentNodes from './DocumentNodes'; +import DocumentSsh from './DocumentSsh'; import * as stores from './stores/types'; import Tabs from './Tabs'; -import ActionBar from './ActionBar'; -import DocumentSsh from './DocumentSsh'; -import DocumentNodes from './DocumentNodes'; -import DocumentKubeExec from './DocumentKubeExec'; -import DocumentBlank from './DocumentBlank'; +import useKeyboardNav from './useKeyboardNav'; +import useOnExitConfirmation from './useOnExitConfirmation'; import usePageTitle from './usePageTitle'; import useTabRouting from './useTabRouting'; -import useOnExitConfirmation from './useOnExitConfirmation'; -import useKeyboardNav from './useKeyboardNav'; const POLL_INTERVAL = 5000; // every 5 sec diff --git a/web/packages/teleport/src/Console/Document/Document.tsx b/web/packages/teleport/src/Console/Document/Document.tsx index 80b17f7de536f..1c997a43b3871 100644 --- a/web/packages/teleport/src/Console/Document/Document.tsx +++ b/web/packages/teleport/src/Console/Document/Document.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Flex } from 'design'; const Document: React.FC<{ visible: boolean; [x: string]: any }> = ({ diff --git a/web/packages/teleport/src/Console/Document/index.ts b/web/packages/teleport/src/Console/Document/index.ts index 53f8277a52916..16c6ec99d3f61 100644 --- a/web/packages/teleport/src/Console/Document/index.ts +++ b/web/packages/teleport/src/Console/Document/index.ts @@ -17,4 +17,5 @@ */ import Document from './Document'; + export default Document; diff --git a/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.test.tsx b/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.test.tsx index 951df05b5a0b8..4b0d371beee8c 100644 --- a/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.test.tsx +++ b/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.test.tsx @@ -17,7 +17,9 @@ */ import React from 'react'; + import 'jest-canvas-mock'; + import { render } from 'design/utils/testing'; import { Blank } from './DocumentBlank.story'; diff --git a/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.tsx b/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.tsx index 7170e19589c3f..8ca1a5035b4a6 100644 --- a/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.tsx +++ b/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.story.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import DocumentBlank from './DocumentBlank'; import { TestLayout } from './../Console.story'; +import DocumentBlank from './DocumentBlank'; export default { title: 'Teleport/Console/DocumentBlank', diff --git a/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.tsx b/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.tsx index b9de37ff20ce4..eeb6f43c7913e 100644 --- a/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.tsx +++ b/web/packages/teleport/src/Console/DocumentBlank/DocumentBlank.tsx @@ -17,7 +17,8 @@ */ import React from 'react'; -import { Flex, ButtonPrimary } from 'design'; + +import { ButtonPrimary, Flex } from 'design'; import * as Icons from 'design/Icon'; import { useConsoleContext } from 'teleport/Console/consoleContextProvider'; diff --git a/web/packages/teleport/src/Console/DocumentBlank/index.ts b/web/packages/teleport/src/Console/DocumentBlank/index.ts index 24aaf09504bed..56eb738d42d4b 100644 --- a/web/packages/teleport/src/Console/DocumentBlank/index.ts +++ b/web/packages/teleport/src/Console/DocumentBlank/index.ts @@ -17,4 +17,5 @@ */ import DocumentBlank from './DocumentBlank'; + export default DocumentBlank; diff --git a/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.story.tsx b/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.story.tsx index 408bf819a5de0..1655af9382318 100644 --- a/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.story.tsx +++ b/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.story.tsx @@ -18,18 +18,16 @@ import React from 'react'; -import { createTeleportContext } from 'teleport/mocks/contexts'; -import ConsoleCtx from 'teleport/Console/consoleContext'; - import { ContextProvider } from 'teleport'; import { TestLayout } from 'teleport/Console/Console.story'; -import TeleportContext from 'teleport/teleportContext'; +import ConsoleCtx from 'teleport/Console/consoleContext'; import * as stores from 'teleport/Console/stores/types'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import type { Session } from 'teleport/services/session'; +import TeleportContext from 'teleport/teleportContext'; import DocumentKubeExec from './DocumentKubeExec'; -import type { Session } from 'teleport/services/session'; - export default { title: 'Teleport/Console/DocumentKubeExec', }; diff --git a/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.test.tsx b/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.test.tsx index bcda94ac5df4d..02d5ddd871521 100644 --- a/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.test.tsx +++ b/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.test.tsx @@ -15,29 +15,27 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import React from 'react'; import { render, screen } from '@testing-library/react'; +import React from 'react'; import '@testing-library/jest-dom'; import { ThemeProvider } from 'styled-components'; + import 'jest-canvas-mock'; -import { darkTheme } from 'design/theme'; +import { darkTheme } from 'design/theme'; import { act } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; import { TestLayout } from 'teleport/Console/Console.story'; import ConsoleCtx from 'teleport/Console/consoleContext'; -import { createTeleportContext } from 'teleport/mocks/contexts'; - import Tty from 'teleport/lib/term/tty'; - -import useKubeExecSession, { Status } from './useKubeExecSession'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import type { Session } from 'teleport/services/session'; import DocumentKubeExec from './DocumentKubeExec'; - -import type { Session } from 'teleport/services/session'; +import useKubeExecSession, { Status } from './useKubeExecSession'; jest.mock('./useKubeExecSession'); diff --git a/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.tsx b/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.tsx index 1589c6ef7d347..c85a21244b235 100644 --- a/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.tsx +++ b/web/packages/teleport/src/Console/DocumentKubeExec/DocumentKubeExec.tsx @@ -15,18 +15,17 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import React, { useRef, useEffect } from 'react'; - +import React, { useEffect, useRef } from 'react'; import { useTheme } from 'styled-components'; + import { Box, Indicator } from 'design'; -import * as stores from 'teleport/Console/stores/types'; +import AuthnDialog from 'teleport/components/AuthnDialog'; +import Document from 'teleport/Console/Document'; +import useKubeExecSession from 'teleport/Console/DocumentKubeExec/useKubeExecSession'; import { Terminal, TerminalRef } from 'teleport/Console/DocumentSsh/Terminal'; +import * as stores from 'teleport/Console/stores/types'; import useWebAuthn from 'teleport/lib/useWebAuthn'; -import useKubeExecSession from 'teleport/Console/DocumentKubeExec/useKubeExecSession'; - -import Document from 'teleport/Console/Document'; -import AuthnDialog from 'teleport/components/AuthnDialog'; import KubeExecData from './KubeExecDataDialog'; diff --git a/web/packages/teleport/src/Console/DocumentKubeExec/KubeExecDataDialog.tsx b/web/packages/teleport/src/Console/DocumentKubeExec/KubeExecDataDialog.tsx index 36b8b7a505820..cf266a04e61f2 100644 --- a/web/packages/teleport/src/Console/DocumentKubeExec/KubeExecDataDialog.tsx +++ b/web/packages/teleport/src/Console/DocumentKubeExec/KubeExecDataDialog.tsx @@ -17,12 +17,7 @@ */ import React, { useState } from 'react'; -import Dialog, { - DialogContent, - DialogFooter, - DialogHeader, - DialogTitle, -} from 'design/Dialog'; + import { Box, ButtonPrimary, @@ -31,11 +26,16 @@ import { Text, Toggle, } from 'design'; - -import Validation from 'shared/components/Validation'; +import Dialog, { + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from 'design/Dialog'; import FieldInput from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import { ToolTipInfo } from 'shared/components/ToolTip'; +import Validation from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; type Props = { onClose(): void; diff --git a/web/packages/teleport/src/Console/DocumentKubeExec/index.ts b/web/packages/teleport/src/Console/DocumentKubeExec/index.ts index 14f5557a9dbb6..0c5cef524a599 100644 --- a/web/packages/teleport/src/Console/DocumentKubeExec/index.ts +++ b/web/packages/teleport/src/Console/DocumentKubeExec/index.ts @@ -17,4 +17,5 @@ */ import DocumentKubeExec from './DocumentKubeExec'; + export default DocumentKubeExec; diff --git a/web/packages/teleport/src/Console/DocumentKubeExec/useKubeExecSession.tsx b/web/packages/teleport/src/Console/DocumentKubeExec/useKubeExecSession.tsx index 387783b0ad4d5..4e2c29b56c188 100644 --- a/web/packages/teleport/src/Console/DocumentKubeExec/useKubeExecSession.tsx +++ b/web/packages/teleport/src/Console/DocumentKubeExec/useKubeExecSession.tsx @@ -16,17 +16,15 @@ * along with this program. If not, see . */ -import React from 'react'; - import { context, trace } from '@opentelemetry/api'; +import React from 'react'; import cfg from 'teleport/config'; -import { TermEvent } from 'teleport/lib/term/enums'; -import Tty from 'teleport/lib/term/tty'; import ConsoleContext from 'teleport/Console/consoleContext'; import { useConsoleContext } from 'teleport/Console/consoleContextProvider'; import { DocumentKubeExec } from 'teleport/Console/stores'; - +import { TermEvent } from 'teleport/lib/term/enums'; +import Tty from 'teleport/lib/term/tty'; import type { ParticipantMode, Session, diff --git a/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/ClusterSelector.tsx b/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/ClusterSelector.tsx index d57fafb144bd4..1295fa367b53b 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/ClusterSelector.tsx +++ b/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/ClusterSelector.tsx @@ -17,6 +17,7 @@ */ import React, { useState } from 'react'; + import { Box, LabelInput } from 'design'; import { SelectAsync } from 'shared/components/Select'; diff --git a/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/index.ts b/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/index.ts index 64b0d10663aa4..28daa8b80a9fb 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/index.ts +++ b/web/packages/teleport/src/Console/DocumentNodes/ClusterSelector/index.ts @@ -17,4 +17,5 @@ */ import ClusterSelector from './ClusterSelector'; + export default ClusterSelector; diff --git a/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.test.tsx b/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.test.tsx index b07b045eca09d..749de2a6d1d2f 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.test.tsx +++ b/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.test.tsx @@ -17,10 +17,12 @@ */ import React from 'react'; + import 'jest-canvas-mock'; -import { waitFor, render } from 'design/utils/testing'; -import { Document, createContext } from './DocumentNodes.story'; +import { render, waitFor } from 'design/utils/testing'; + +import { createContext, Document } from './DocumentNodes.story'; test('render DocumentNodes', async () => { const ctx = createContext(); diff --git a/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.tsx b/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.tsx index 58dbb1ab37a9b..38f482d6d0c62 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.tsx +++ b/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.story.tsx @@ -20,9 +20,9 @@ import React from 'react'; import { Node } from 'teleport/services/nodes/types'; -import DocumentNodes from './DocumentNodes'; -import ConsoleCtx from './../consoleContext'; import { TestLayout } from './../Console.story'; +import ConsoleCtx from './../consoleContext'; +import DocumentNodes from './DocumentNodes'; export default { title: 'Teleport/Console/DocumentNodes', diff --git a/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.tsx b/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.tsx index c5974855edf98..a3428df8cc243 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.tsx +++ b/web/packages/teleport/src/Console/DocumentNodes/DocumentNodes.tsx @@ -18,15 +18,14 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { Indicator, Box } from 'design'; -import { Danger } from 'design/Alert'; +import { Box, Indicator } from 'design'; +import { Danger } from 'design/Alert'; import { ClusterDropdown } from 'shared/components/ClusterDropdown/ClusterDropdown'; -import NodeList from 'teleport/components/NodeList'; import ErrorMessage from 'teleport/components/AgentErrorMessage'; +import NodeList from 'teleport/components/NodeList'; import Document from 'teleport/Console/Document'; - import * as stores from 'teleport/Console/stores/types'; import useNodes from './useNodes'; diff --git a/web/packages/teleport/src/Console/DocumentNodes/consoleTheme.ts b/web/packages/teleport/src/Console/DocumentNodes/consoleTheme.ts index d76a9f3bf940f..f977f8b0c24c0 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/consoleTheme.ts +++ b/web/packages/teleport/src/Console/DocumentNodes/consoleTheme.ts @@ -17,17 +17,17 @@ */ import { fonts } from 'design/theme/fonts'; -import { getContrastRatio } from 'design/theme/utils/colorManipulator'; import { + blueGrey, lightBlue, - red, - teal, orange, pink, - blueGrey, + red, + teal, yellow, } from 'design/theme/palette'; import typography, { fontSizes, fontWeights } from 'design/theme/typography'; +import { getContrastRatio } from 'design/theme/utils/colorManipulator'; const space = [0, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80]; const contrastThreshold = 3; diff --git a/web/packages/teleport/src/Console/DocumentNodes/index.ts b/web/packages/teleport/src/Console/DocumentNodes/index.ts index b31c7c7f33fb1..43b6c70af095d 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/index.ts +++ b/web/packages/teleport/src/Console/DocumentNodes/index.ts @@ -17,4 +17,5 @@ */ import DocumentNodes from './DocumentNodes'; + export default DocumentNodes; diff --git a/web/packages/teleport/src/Console/DocumentNodes/useNodes.ts b/web/packages/teleport/src/Console/DocumentNodes/useNodes.ts index 85338911bd4f8..e25856f7c95a8 100644 --- a/web/packages/teleport/src/Console/DocumentNodes/useNodes.ts +++ b/web/packages/teleport/src/Console/DocumentNodes/useNodes.ts @@ -19,14 +19,13 @@ import { useEffect } from 'react'; import { - useUrlFiltering, useServerSidePagination, + useUrlFiltering, } from 'teleport/components/hooks'; +import type { Node } from 'teleport/services/nodes'; -import * as stores from './../stores'; import { useConsoleContext } from './../consoleContextProvider'; - -import type { Node } from 'teleport/services/nodes'; +import * as stores from './../stores'; export default function useNodes({ clusterId, id }: stores.DocumentNodes) { const consoleCtx = useConsoleContext(); diff --git a/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.story.tsx b/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.story.tsx index 3e003cc7846e4..ee55d88bb680e 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.story.tsx +++ b/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.story.tsx @@ -19,19 +19,14 @@ import React from 'react'; import { ContextProvider } from 'teleport'; - +import * as stores from 'teleport/Console/stores/types'; import { createTeleportContext } from 'teleport/mocks/contexts'; - +import type { Session } from 'teleport/services/session'; import TeleportContext from 'teleport/teleportContext'; -import * as stores from 'teleport/Console/stores/types'; - -import DocumentSsh from './DocumentSsh'; - import { TestLayout } from './../Console.story'; import ConsoleCtx from './../consoleContext'; - -import type { Session } from 'teleport/services/session'; +import DocumentSsh from './DocumentSsh'; export const Connected = () => { const { ctx, consoleCtx } = getContexts(); diff --git a/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.test.tsx b/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.test.tsx index 0003326ef754f..1416623548ced 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.test.tsx +++ b/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.test.tsx @@ -16,17 +16,18 @@ * along with this program. If not, see . */ -import { render, screen } from 'design/utils/testing'; import { MemoryRouter } from 'react-router'; + +import { render, screen } from 'design/utils/testing'; + import 'jest-canvas-mock'; import { allAccessAcl } from 'teleport/mocks/contexts'; +import DocumentSsh from '.'; import ConsoleContext from '../consoleContext'; import ConsoleContextProvider from '../consoleContextProvider'; -import DocumentSsh from '.'; - test('file transfer buttons are disabled if user does not have access', async () => { const ctx = new ConsoleContext(); ctx.storeUser.setState({ diff --git a/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.tsx b/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.tsx index 7bbd0dfa16b0c..7d25db6121b81 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.tsx +++ b/web/packages/teleport/src/Console/DocumentSsh/DocumentSsh.tsx @@ -16,31 +16,27 @@ * along with this program. If not, see . */ -import React, { useRef, useEffect, useState, useCallback } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useTheme } from 'styled-components'; -import { Indicator, Box } from 'design'; - +import { Box, Indicator } from 'design'; import { - FileTransferActionBar, FileTransfer, - FileTransferRequests, + FileTransferActionBar, FileTransferContextProvider, + FileTransferRequests, } from 'shared/components/FileTransfer'; import { TerminalSearch } from 'shared/components/TerminalSearch'; -import * as stores from 'teleport/Console/stores'; - import AuthnDialog from 'teleport/components/AuthnDialog'; +import * as stores from 'teleport/Console/stores'; import useWebAuthn from 'teleport/lib/useWebAuthn'; -import Document from '../Document'; - import { useConsoleContext } from '../consoleContextProvider'; - +import Document from '../Document'; import { Terminal, TerminalRef } from './Terminal'; -import useSshSession from './useSshSession'; import { useFileTransfer } from './useFileTransfer'; +import useSshSession from './useSshSession'; export default function DocumentSshWrapper(props: PropTypes) { return ( diff --git a/web/packages/teleport/src/Console/DocumentSsh/ShareSession/ShareSession.tsx b/web/packages/teleport/src/Console/DocumentSsh/ShareSession/ShareSession.tsx index 4557a24597ff1..4841d103a24d3 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/ShareSession/ShareSession.tsx +++ b/web/packages/teleport/src/Console/DocumentSsh/ShareSession/ShareSession.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { Text, ButtonSecondary } from 'design'; + +import { ButtonSecondary, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; import TextSelectCopy from 'teleport/components/TextSelectCopy'; diff --git a/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx b/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx index e235b296ac7a4..1de65ff075bac 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx +++ b/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import { ITheme } from '@xterm/xterm'; import React, { forwardRef, useEffect, @@ -23,14 +24,13 @@ import React, { useRef, } from 'react'; import styled from 'styled-components'; -import { Flex } from 'design'; -import { ITheme } from '@xterm/xterm'; +import { Flex } from 'design'; import { getPlatformType } from 'design/platform'; -import Tty from 'teleport/lib/term/tty'; -import XTermCtrl from 'teleport/lib/term/terminal'; import { getMappedAction } from 'teleport/Console/useKeyboardNav'; +import XTermCtrl from 'teleport/lib/term/terminal'; +import Tty from 'teleport/lib/term/tty'; import StyledXterm from '../../StyledXterm'; diff --git a/web/packages/teleport/src/Console/DocumentSsh/httpFileTransferHandlers.ts b/web/packages/teleport/src/Console/DocumentSsh/httpFileTransferHandlers.ts index 9bf702453fd1a..bfa16b9e4a8f3 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/httpFileTransferHandlers.ts +++ b/web/packages/teleport/src/Console/DocumentSsh/httpFileTransferHandlers.ts @@ -17,9 +17,9 @@ */ import { + createFileTransferEventsEmitter, FileTransferEventsEmitter, FileTransferListeners, - createFileTransferEventsEmitter, } from 'shared/components/FileTransfer'; import { getAuthHeaders, getNoCacheHeaders } from 'teleport/services/api'; diff --git a/web/packages/teleport/src/Console/DocumentSsh/index.ts b/web/packages/teleport/src/Console/DocumentSsh/index.ts index de39fe6acc89d..a08f4a387bd8b 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/index.ts +++ b/web/packages/teleport/src/Console/DocumentSsh/index.ts @@ -17,4 +17,5 @@ */ import DocumentSsh from './DocumentSsh'; + export default DocumentSsh; diff --git a/web/packages/teleport/src/Console/DocumentSsh/useFileTransfer.ts b/web/packages/teleport/src/Console/DocumentSsh/useFileTransfer.ts index 4c8efb51b5941..8ae62101f5c5e 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/useFileTransfer.ts +++ b/web/packages/teleport/src/Console/DocumentSsh/useFileTransfer.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -import { useEffect, useState, useCallback } from 'react'; +import { useCallback, useEffect, useState } from 'react'; + import { useFileTransferContext } from 'shared/components/FileTransfer'; -import Tty from 'teleport/lib/term/tty'; +import { DocumentSsh } from 'teleport/Console/stores'; import { EventType } from 'teleport/lib/term/enums'; +import Tty from 'teleport/lib/term/tty'; import { Session } from 'teleport/services/session'; -import { DocumentSsh } from 'teleport/Console/stores'; import { useConsoleContext } from '../consoleContextProvider'; - import { getHttpFileTransferHandlers } from './httpFileTransferHandlers'; import useGetScpUrl from './useGetScpUrl'; diff --git a/web/packages/teleport/src/Console/DocumentSsh/useGetScpUrl.ts b/web/packages/teleport/src/Console/DocumentSsh/useGetScpUrl.ts index 220b925d3996f..d98d461c9775d 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/useGetScpUrl.ts +++ b/web/packages/teleport/src/Console/DocumentSsh/useGetScpUrl.ts @@ -17,6 +17,7 @@ */ import { useCallback } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; import cfg, { UrlScpParams } from 'teleport/config'; diff --git a/web/packages/teleport/src/Console/DocumentSsh/useSshSession.ts b/web/packages/teleport/src/Console/DocumentSsh/useSshSession.ts index d9444d8f74bbf..00437c034d1c4 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/useSshSession.ts +++ b/web/packages/teleport/src/Console/DocumentSsh/useSshSession.ts @@ -16,17 +16,15 @@ * along with this program. If not, see . */ -import React from 'react'; - import { context, trace } from '@opentelemetry/api'; +import React from 'react'; import cfg from 'teleport/config'; -import { TermEvent } from 'teleport/lib/term/enums'; -import Tty from 'teleport/lib/term/tty'; import ConsoleContext from 'teleport/Console/consoleContext'; import { useConsoleContext } from 'teleport/Console/consoleContextProvider'; import { DocumentSsh } from 'teleport/Console/stores'; - +import { TermEvent } from 'teleport/lib/term/enums'; +import Tty from 'teleport/lib/term/tty'; import type { ParticipantMode, Session, diff --git a/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx b/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx index 07f0aba027f99..340c7f32e9433 100644 --- a/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx +++ b/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Box } from 'design'; import '@xterm/xterm/css/xterm.css'; diff --git a/web/packages/teleport/src/Console/StyledXterm/index.ts b/web/packages/teleport/src/Console/StyledXterm/index.ts index 5f2a3a0a23b6c..e93c0eaa538f0 100644 --- a/web/packages/teleport/src/Console/StyledXterm/index.ts +++ b/web/packages/teleport/src/Console/StyledXterm/index.ts @@ -17,4 +17,5 @@ */ import StyledXterm from './StyledXterm'; + export default StyledXterm; diff --git a/web/packages/teleport/src/Console/Tabs/JoinedUsers/JoinedUsers.jsx b/web/packages/teleport/src/Console/Tabs/JoinedUsers/JoinedUsers.jsx index ca58f932b8bce..51cac1ea77498 100644 --- a/web/packages/teleport/src/Console/Tabs/JoinedUsers/JoinedUsers.jsx +++ b/web/packages/teleport/src/Console/Tabs/JoinedUsers/JoinedUsers.jsx @@ -18,8 +18,9 @@ import React from 'react'; import styled from 'styled-components'; -import Popover from 'design/Popover'; + import { Box } from 'design'; +import Popover from 'design/Popover'; import { debounce } from 'shared/utils/highbar'; export default function JoinedUsers(props) { diff --git a/web/packages/teleport/src/Console/Tabs/JoinedUsers/index.js b/web/packages/teleport/src/Console/Tabs/JoinedUsers/index.js index 4b609f7c85b37..82acee21b8b27 100644 --- a/web/packages/teleport/src/Console/Tabs/JoinedUsers/index.js +++ b/web/packages/teleport/src/Console/Tabs/JoinedUsers/index.js @@ -17,4 +17,5 @@ */ import JoinedUsers from './JoinedUsers'; + export default JoinedUsers; diff --git a/web/packages/teleport/src/Console/Tabs/TabItem.tsx b/web/packages/teleport/src/Console/Tabs/TabItem.tsx index 3c212f7ce7ee7..67384194ef77f 100644 --- a/web/packages/teleport/src/Console/Tabs/TabItem.tsx +++ b/web/packages/teleport/src/Console/Tabs/TabItem.tsx @@ -18,9 +18,10 @@ import React from 'react'; import styled from 'styled-components'; + +import { Flex, Text } from 'design'; import { Cross as CloseIcon } from 'design/Icon'; import { space } from 'design/system'; -import { Flex, Text } from 'design'; import JoinedUsers from './JoinedUsers'; diff --git a/web/packages/teleport/src/Console/Tabs/Tabs.story.test.tsx b/web/packages/teleport/src/Console/Tabs/Tabs.story.test.tsx index 5c8d46de00ce8..d05fb891111cd 100644 --- a/web/packages/teleport/src/Console/Tabs/Tabs.story.test.tsx +++ b/web/packages/teleport/src/Console/Tabs/Tabs.story.test.tsx @@ -17,7 +17,9 @@ */ import React from 'react'; + import 'jest-canvas-mock'; + import { render } from 'design/utils/testing'; import { ConsoleTabs } from './Tabs.story'; diff --git a/web/packages/teleport/src/Console/Tabs/Tabs.story.tsx b/web/packages/teleport/src/Console/Tabs/Tabs.story.tsx index e203a07b78e71..cfa8e94b9b065 100644 --- a/web/packages/teleport/src/Console/Tabs/Tabs.story.tsx +++ b/web/packages/teleport/src/Console/Tabs/Tabs.story.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import Tabs from './Tabs'; import { TestLayout } from './../Console.story'; +import Tabs from './Tabs'; export default { title: 'Teleport/Console', diff --git a/web/packages/teleport/src/Console/Tabs/Tabs.tsx b/web/packages/teleport/src/Console/Tabs/Tabs.tsx index 531870d858881..4cf0ae34cd242 100644 --- a/web/packages/teleport/src/Console/Tabs/Tabs.tsx +++ b/web/packages/teleport/src/Console/Tabs/Tabs.tsx @@ -18,17 +18,15 @@ import React from 'react'; import styled from 'styled-components'; -import { typography } from 'design/system'; -import * as Icons from 'design/Icon'; import { Box, ButtonIcon } from 'design'; - -import { useStore } from 'shared/libs/stores'; - +import * as Icons from 'design/Icon'; +import { typography } from 'design/system'; import { TypographyProps } from 'design/system/typography'; +import { useStore } from 'shared/libs/stores'; -import * as stores from 'teleport/Console/stores'; import { useConsoleContext } from 'teleport/Console/consoleContextProvider'; +import * as stores from 'teleport/Console/stores'; import TabItem from './TabItem'; diff --git a/web/packages/teleport/src/Console/consoleContext.tsx b/web/packages/teleport/src/Console/consoleContext.tsx index e875bb557f73c..daf8b3fba12d9 100644 --- a/web/packages/teleport/src/Console/consoleContext.tsx +++ b/web/packages/teleport/src/Console/consoleContext.tsx @@ -16,33 +16,33 @@ * along with this program. If not, see . */ -import Logger from 'shared/libs/logger'; - import { context, defaultTextMapSetter, trace } from '@opentelemetry/api'; import { W3CTraceContextPropagator } from '@opentelemetry/core'; -import webSession from 'teleport/services/websession'; -import history from 'teleport/services/history'; +import Logger from 'shared/libs/logger'; + import cfg, { UrlKubeExecParams, UrlSshParams } from 'teleport/config'; -import { getHostName } from 'teleport/services/api'; import Tty from 'teleport/lib/term/tty'; import TtyAddressResolver from 'teleport/lib/term/ttyAddressResolver'; +import { getHostName } from 'teleport/services/api'; +import ClustersService from 'teleport/services/clusters'; +import history from 'teleport/services/history'; +import ServiceNodes from 'teleport/services/nodes'; import serviceSession, { - Session, ParticipantList, ParticipantMode, + Session, } from 'teleport/services/session'; -import ServiceNodes from 'teleport/services/nodes'; -import ClustersService from 'teleport/services/clusters'; -import { StoreUserContext } from 'teleport/stores'; import usersService from 'teleport/services/user'; +import webSession from 'teleport/services/websession'; +import { StoreUserContext } from 'teleport/stores'; import { - StoreParties, - StoreDocs, - DocumentSsh, - DocumentKubeExec, Document, + DocumentKubeExec, + DocumentSsh, + StoreDocs, + StoreParties, } from './stores'; const logger = Logger.create('teleport/console'); diff --git a/web/packages/teleport/src/Console/consoleContextProvider.tsx b/web/packages/teleport/src/Console/consoleContextProvider.tsx index 82ad48a753b6d..cc28c3eb901dd 100644 --- a/web/packages/teleport/src/Console/consoleContextProvider.tsx +++ b/web/packages/teleport/src/Console/consoleContextProvider.tsx @@ -17,6 +17,7 @@ */ import React, { PropsWithChildren } from 'react'; + import { useStore } from 'shared/libs/stores'; import ConsoleContext from './consoleContext'; diff --git a/web/packages/teleport/src/Console/stores/index.ts b/web/packages/teleport/src/Console/stores/index.ts index d417f9903b295..5794c8c0be5dd 100644 --- a/web/packages/teleport/src/Console/stores/index.ts +++ b/web/packages/teleport/src/Console/stores/index.ts @@ -18,6 +18,7 @@ import StoreDocs from './storeDocs'; import StoreParties from './storeParties'; + export { StoreParties, StoreDocs }; export * from './types'; diff --git a/web/packages/teleport/src/Console/useTabRouting.test.tsx b/web/packages/teleport/src/Console/useTabRouting.test.tsx index 86a667f989622..e14054f7e4bb9 100644 --- a/web/packages/teleport/src/Console/useTabRouting.test.tsx +++ b/web/packages/teleport/src/Console/useTabRouting.test.tsx @@ -16,13 +16,14 @@ * along with this program. If not, see . */ -import React from 'react'; import { createMemoryHistory } from 'history'; +import React from 'react'; import { Router } from 'react-router'; + import renderHook from 'design/utils/renderHook'; -import useTabRouting from './useTabRouting'; import ConsoleContext from './consoleContext'; +import useTabRouting from './useTabRouting'; test('handling of index route', async () => { const ctx = new ConsoleContext(); diff --git a/web/packages/teleport/src/Console/useTabRouting.ts b/web/packages/teleport/src/Console/useTabRouting.ts index b80b5203a1c59..fe78aed6790a3 100644 --- a/web/packages/teleport/src/Console/useTabRouting.ts +++ b/web/packages/teleport/src/Console/useTabRouting.ts @@ -17,7 +17,7 @@ */ import React from 'react'; -import { useRouteMatch, useParams, useLocation } from 'react-router'; +import { useLocation, useParams, useRouteMatch } from 'react-router'; import cfg, { UrlKubeExecParams, UrlSshParams } from 'teleport/config'; import { ParticipantMode } from 'teleport/services/session'; diff --git a/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.test.tsx b/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.test.tsx index 025e51d1131a2..633bd08bf01ff 100644 --- a/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.test.tsx +++ b/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render, screen } from 'design/utils/testing'; import ConnectDialog, { Props } from './ConnectDialog'; diff --git a/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.tsx b/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.tsx index 20394973f0459..85875821408ef 100644 --- a/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.tsx +++ b/web/packages/teleport/src/Databases/ConnectDialog/ConnectDialog.tsx @@ -17,18 +17,19 @@ */ import React from 'react'; -import { Text, Box, ButtonSecondary, Link } from 'design'; + +import { Box, ButtonSecondary, Link, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; import { DbProtocol } from 'shared/services/databases'; -import { AuthType } from 'teleport/services/user'; import TextSelectCopy from 'teleport/components/TextSelectCopy'; import { generateTshLoginCommand } from 'teleport/lib/util'; +import { AuthType } from 'teleport/services/user'; export default function ConnectDialog({ username, diff --git a/web/packages/teleport/src/Databases/ConnectDialog/index.ts b/web/packages/teleport/src/Databases/ConnectDialog/index.ts index 36057e0d81bec..739fa3d5ba5a6 100644 --- a/web/packages/teleport/src/Databases/ConnectDialog/index.ts +++ b/web/packages/teleport/src/Databases/ConnectDialog/index.ts @@ -17,4 +17,5 @@ */ import ConnectDialog from './ConnectDialog'; + export default ConnectDialog; diff --git a/web/packages/teleport/src/DesktopSession/ActionMenu.tsx b/web/packages/teleport/src/DesktopSession/ActionMenu.tsx index aea014ba522b7..ee94f27089cc0 100644 --- a/web/packages/teleport/src/DesktopSession/ActionMenu.tsx +++ b/web/packages/teleport/src/DesktopSession/ActionMenu.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { MenuIcon, MenuItem, MenuItemIcon } from 'shared/components/MenuAction'; -import * as Icons from 'design/Icon'; + import { Flex } from 'design'; +import * as Icons from 'design/Icon'; +import { MenuIcon, MenuItem, MenuItemIcon } from 'shared/components/MenuAction'; export default function ActionMenu(props: Props) { const { showShareDirectory, onShareDirectory, onDisconnect, onCtrlAltDel } = diff --git a/web/packages/teleport/src/DesktopSession/DesktopSession.story.test.tsx b/web/packages/teleport/src/DesktopSession/DesktopSession.story.test.tsx index 5ee242630efd5..0915d5978eaab 100644 --- a/web/packages/teleport/src/DesktopSession/DesktopSession.story.test.tsx +++ b/web/packages/teleport/src/DesktopSession/DesktopSession.story.test.tsx @@ -17,21 +17,23 @@ */ import React from 'react'; + import 'jest-canvas-mock'; + import { render, screen } from 'design/utils/testing'; import { + AnotherSessionActive, BothProcessing, - TdpProcessing, - FetchProcessing, ConnectedSettingsFalse, ConnectedSettingsTrue, Disconnected, FetchError, + FetchProcessing, TdpError, + TdpProcessing, UnintendedDisconnect, WebAuthnPrompt, - AnotherSessionActive, } from './DesktopSession.story'; test('processing', () => { diff --git a/web/packages/teleport/src/DesktopSession/DesktopSession.story.tsx b/web/packages/teleport/src/DesktopSession/DesktopSession.story.tsx index a6406dc6eb5fb..21223c6bdfdbe 100644 --- a/web/packages/teleport/src/DesktopSession/DesktopSession.story.tsx +++ b/web/packages/teleport/src/DesktopSession/DesktopSession.story.tsx @@ -17,14 +17,15 @@ */ import React, { useState } from 'react'; + import { ButtonPrimary } from 'design/Button'; import { NotificationItem } from 'shared/components/Notification'; import { throttle } from 'shared/utils/highbar'; import { TdpClient, TdpClientEvent } from 'teleport/lib/tdp'; -import { State } from './useDesktopSession'; import { DesktopSession } from './DesktopSession'; +import { State } from './useDesktopSession'; export default { title: 'Teleport/DesktopSession', diff --git a/web/packages/teleport/src/DesktopSession/DesktopSession.tsx b/web/packages/teleport/src/DesktopSession/DesktopSession.tsx index 9d5cb9bb29abf..73282c5aa79ad 100644 --- a/web/packages/teleport/src/DesktopSession/DesktopSession.tsx +++ b/web/packages/teleport/src/DesktopSession/DesktopSession.tsx @@ -16,30 +16,31 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import { Indicator, Box, Flex, ButtonSecondary, ButtonPrimary } from 'design'; +import React, { useEffect, useState } from 'react'; + +import { Box, ButtonPrimary, ButtonSecondary, Flex, Indicator } from 'design'; import { Info } from 'design/Alert'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; import { Attempt } from 'shared/hooks/useAttemptNext'; -import TdpClientCanvas from 'teleport/components/TdpClientCanvas'; import AuthnDialog from 'teleport/components/AuthnDialog'; +import TdpClientCanvas from 'teleport/components/TdpClientCanvas'; +import type { WebAuthnState } from 'teleport/lib/useWebAuthn'; +import TopBar from './TopBar'; import useDesktopSession, { clipboardSharingMessage, directorySharingPossible, isSharingClipboard, isSharingDirectory, + type State, + type WebsocketAttempt, } from './useDesktopSession'; -import TopBar from './TopBar'; - -import type { State, WebsocketAttempt } from './useDesktopSession'; -import type { WebAuthnState } from 'teleport/lib/useWebAuthn'; export function DesktopSessionContainer() { const state = useDesktopSession(); diff --git a/web/packages/teleport/src/DesktopSession/KeyboardHandler.tsx b/web/packages/teleport/src/DesktopSession/KeyboardHandler.tsx index a7bb98061e901..c6fab9b435ee7 100644 --- a/web/packages/teleport/src/DesktopSession/KeyboardHandler.tsx +++ b/web/packages/teleport/src/DesktopSession/KeyboardHandler.tsx @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -import { Platform, getPlatform } from 'design/platform'; +import { getPlatform, Platform } from 'design/platform'; -import { TdpClient, ButtonState } from 'teleport/lib/tdp'; +import { ButtonState, TdpClient } from 'teleport/lib/tdp'; import { SyncKeys } from 'teleport/lib/tdp/codec'; import { Withholder } from './Withholder'; diff --git a/web/packages/teleport/src/DesktopSession/TopBar.tsx b/web/packages/teleport/src/DesktopSession/TopBar.tsx index b6f0dc6ba1170..80d258451521f 100644 --- a/web/packages/teleport/src/DesktopSession/TopBar.tsx +++ b/web/packages/teleport/src/DesktopSession/TopBar.tsx @@ -18,16 +18,15 @@ import React from 'react'; import { useTheme } from 'styled-components'; -import { Text, TopNav, Flex } from 'design'; -import { Clipboard, FolderShared } from 'design/Icon'; +import { Flex, Text, TopNav } from 'design'; +import { Clipboard, FolderShared } from 'design/Icon'; +import type { NotificationItem } from 'shared/components/Notification'; import { HoverTooltip } from 'shared/components/ToolTip'; import ActionMenu from './ActionMenu'; import { WarningDropdown } from './WarningDropdown'; -import type { NotificationItem } from 'shared/components/Notification'; - export default function TopBar(props: Props) { const { userHost, diff --git a/web/packages/teleport/src/DesktopSession/WarningDropdown.tsx b/web/packages/teleport/src/DesktopSession/WarningDropdown.tsx index b658c369e98cf..602e88e0b7fc8 100644 --- a/web/packages/teleport/src/DesktopSession/WarningDropdown.tsx +++ b/web/packages/teleport/src/DesktopSession/WarningDropdown.tsx @@ -17,13 +17,15 @@ */ import React, { useRef, useState } from 'react'; -import { Text, Flex, Button, Card, ButtonIcon } from 'design'; import styled, { useTheme } from 'styled-components'; -import { Notification } from 'shared/components/Notification'; -import { Warning, Cross } from 'design/Icon'; -import { useClickOutside } from 'shared/hooks/useClickOutside'; -import type { NotificationItem } from 'shared/components/Notification'; +import { Button, ButtonIcon, Card, Flex, Text } from 'design'; +import { Cross, Warning } from 'design/Icon'; +import { + Notification, + type NotificationItem, +} from 'shared/components/Notification'; +import { useClickOutside } from 'shared/hooks/useClickOutside'; export function WarningDropdown({ warnings, onRemoveWarning }: Props) { const [showDropdown, setShowDropdown] = useState(false); diff --git a/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx b/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx index 9849c39fa269f..34b0d8abac0dc 100644 --- a/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx +++ b/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx @@ -16,11 +16,13 @@ * along with this program. If not, see . */ -import { useEffect, useState, useMemo, Dispatch, SetStateAction } from 'react'; +import { Dispatch, SetStateAction, useEffect, useMemo, useState } from 'react'; import { useParams } from 'react-router'; +import type { NotificationItem } from 'shared/components/Notification'; import useAttempt from 'shared/hooks/useAttemptNext'; +import type { UrlDesktopParams } from 'teleport/config'; import { ButtonState } from 'teleport/lib/tdp'; import useWebAuthn from 'teleport/lib/useWebAuthn'; import desktopService from 'teleport/services/desktops'; @@ -28,9 +30,6 @@ import userService from 'teleport/services/user'; import useTdpClientCanvas from './useTdpClientCanvas'; -import type { UrlDesktopParams } from 'teleport/config'; -import type { NotificationItem } from 'shared/components/Notification'; - export default function useDesktopSession() { const { attempt: fetchAttempt, run } = useAttempt('processing'); diff --git a/web/packages/teleport/src/DesktopSession/useTdpClientCanvas.tsx b/web/packages/teleport/src/DesktopSession/useTdpClientCanvas.tsx index 91fbb4d154e7e..e1e7fbe967ff7 100644 --- a/web/packages/teleport/src/DesktopSession/useTdpClientCanvas.tsx +++ b/web/packages/teleport/src/DesktopSession/useTdpClientCanvas.tsx @@ -17,34 +17,34 @@ * along with this program. If not, see . */ -import { useState, useEffect, useRef } from 'react'; -import { Attempt } from 'shared/hooks/useAttemptNext'; +import { useEffect, useRef, useState } from 'react'; + import { NotificationItem } from 'shared/components/Notification'; +import { Attempt } from 'shared/hooks/useAttemptNext'; import { debounce } from 'shared/utils/highbar'; -import { TdpClient, ButtonState, ScrollAxis } from 'teleport/lib/tdp'; +import cfg from 'teleport/config'; +import { ButtonState, ScrollAxis, TdpClient } from 'teleport/lib/tdp'; +import type { BitmapFrame } from 'teleport/lib/tdp/client'; import { ClientScreenSpec, ClipboardData, PngFrame, } from 'teleport/lib/tdp/codec'; -import { getHostName } from 'teleport/services/api'; -import cfg from 'teleport/config'; import { Sha256Digest } from 'teleport/lib/util'; +import { getHostName } from 'teleport/services/api'; +import { KeyboardHandler } from './KeyboardHandler'; import { TopBarHeight } from './TopBar'; import { - ClipboardSharingState, - DirectorySharingState, - Setter, clipboardSharingPossible, + ClipboardSharingState, defaultClipboardSharingState, defaultDirectorySharingState, + DirectorySharingState, isSharingClipboard, + Setter, } from './useDesktopSession'; -import { KeyboardHandler } from './KeyboardHandler'; - -import type { BitmapFrame } from 'teleport/lib/tdp/client'; declare global { interface Navigator { diff --git a/web/packages/teleport/src/DeviceTrust/DeviceTrustLocked.tsx b/web/packages/teleport/src/DeviceTrust/DeviceTrustLocked.tsx index db45bdd3c3cd4..af56f179c5a47 100644 --- a/web/packages/teleport/src/DeviceTrust/DeviceTrustLocked.tsx +++ b/web/packages/teleport/src/DeviceTrust/DeviceTrustLocked.tsx @@ -19,26 +19,22 @@ import React from 'react'; import styled from 'styled-components'; -import { Box, Text, Flex, Link } from 'design'; - -import { IconCircle } from 'design/Icon/IconCircle'; - -import { Windows, Linux, Apple, Lock } from 'design/Icon'; - +import { Box, Flex, Link, Text } from 'design'; import Table, { Cell } from 'design/DataTable'; +import { Apple, Linux, Lock, Windows } from 'design/Icon'; +import { IconCircle } from 'design/Icon/IconCircle'; -import { - DeviceListProps, - TrustedDeviceOSType, -} from 'teleport/DeviceTrust/types'; - +import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; +import { + DeviceListProps, + TrustedDeviceOSType, +} from 'teleport/DeviceTrust/types'; import { CtaEvent } from 'teleport/services/userEvent'; -import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; export function DeviceTrustLocked() { return ( diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/AppCreatedDialog.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/AppCreatedDialog.tsx index ff53f39b67a1b..61f0bf3ed287b 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/AppCreatedDialog.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/AppCreatedDialog.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { Text, Flex, ButtonPrimary } from 'design'; -import * as Icons from 'design/Icon'; + +import { ButtonPrimary, Flex, Text } from 'design'; import Dialog, { DialogContent } from 'design/DialogConfirmation'; +import * as Icons from 'design/Icon'; export function AppCreatedDialog({ toNextStep, diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.story.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.story.tsx index eb3d36105bb8c..187382f358baf 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.story.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.story.tsx @@ -16,24 +16,25 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; + import { Info } from 'design/Alert'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; -import { ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverEventResource } from 'teleport/services/userEvent'; import { CreateAppAccess } from './CreateAppAccess'; diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.test.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.test.tsx index fd5c85926dec6..93d5e11bd9596 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.test.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.test.tsx @@ -18,29 +18,29 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import { render, screen, userEvent } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; -import { - IntegrationKind, - IntegrationStatusCode, - integrationService, -} from 'teleport/services/integrations'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import cfg from 'teleport/config'; -import TeleportContext from 'teleport/teleportContext'; +import { app } from 'teleport/Discover/AwsMangementConsole/fixtures'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverContextState, DiscoverProvider, } from 'teleport/Discover/useDiscover'; import { FeaturesContextProvider } from 'teleport/FeaturesContext'; - +import { createTeleportContext } from 'teleport/mocks/contexts'; +import { + IntegrationKind, + integrationService, + IntegrationStatusCode, +} from 'teleport/services/integrations'; import { DiscoverEventResource, userEventService, } from 'teleport/services/userEvent'; -import { app } from 'teleport/Discover/AwsMangementConsole/fixtures'; -import { ResourceKind } from 'teleport/Discover/Shared'; +import TeleportContext from 'teleport/teleportContext'; import { CreateAppAccess } from './CreateAppAccess'; diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.tsx index 3fe2b270d8c64..fe5e6b9bfcda9 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/CreateAppAccess/CreateAppAccess.tsx @@ -18,21 +18,21 @@ import React from 'react'; import styled from 'styled-components'; -import { Box, Text, Flex, Link, Mark } from 'design'; -import TextEditor from 'shared/components/TextEditor'; + +import { Box, Flex, Link, Mark, Text } from 'design'; import { Danger } from 'design/Alert'; +import TextEditor from 'shared/components/TextEditor'; import { ToolTipInfo } from 'shared/components/ToolTip'; import { useAsync } from 'shared/hooks/useAsync'; import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; -import { useDiscover } from 'teleport/Discover/useDiscover'; -import { integrationService } from 'teleport/services/integrations'; import cfg from 'teleport/config'; import { Container } from 'teleport/Discover/Shared/CommandBox'; +import { useDiscover } from 'teleport/Discover/useDiscover'; +import { integrationService } from 'teleport/services/integrations'; import { splitAwsIamArn } from 'teleport/services/integrations/aws'; import { ActionButtons, Header } from '../../Shared'; - import { AppCreatedDialog } from './AppCreatedDialog'; const IAM_POLICY_NAME = 'AWSAppAccess'; diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.story.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.story.tsx index 9f35c5aba6124..d6ecebb43f5eb 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.story.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.story.tsx @@ -16,28 +16,28 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; + import { AwsRole } from 'shared/services/apps'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; -import { ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverEventResource } from 'teleport/services/userEvent'; import { app } from '../fixtures'; - import { SetupAccess } from './SetupAccess'; export default { diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.tsx index 0308726d7ecb7..5e9063bc27da4 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/SetupAccess/SetupAccess.tsx @@ -16,23 +16,23 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import { LabelInput, Text, Link, Mark } from 'design'; +import React, { useEffect, useState } from 'react'; import { useTheme } from 'styled-components'; -import { Cross } from 'design/Icon'; +import { LabelInput, Link, Mark, Text } from 'design'; import { OutlineInfo } from 'design/Alert/Alert'; +import { Cross } from 'design/Icon'; import { FieldSelectCreatable } from 'shared/components/FieldSelect'; import Validation, { Validator } from 'shared/components/Validation'; +import { AWS_TAG_INFO_LINK } from 'teleport/Discover/Shared/const'; import { Option } from 'teleport/Discover/Shared/SelectCreatable'; -import { IAM_ROLE_ARN_REGEX } from 'teleport/services/integrations/aws'; +import { styles } from 'teleport/Discover/Shared/SelectCreatable/SelectCreatable'; import { - useUserTraits, SetupAccessWrapper, + useUserTraits, } from 'teleport/Discover/Shared/SetupAccess'; -import { styles } from 'teleport/Discover/Shared/SelectCreatable/SelectCreatable'; -import { AWS_TAG_INFO_LINK } from 'teleport/Discover/Shared/const'; +import { IAM_ROLE_ARN_REGEX } from 'teleport/services/integrations/aws'; export function SetupAccess() { const { diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.story.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.story.tsx index 3502bb6f37d93..8b36bacf8bf04 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.story.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.story.tsx @@ -21,14 +21,13 @@ import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { app } from '../fixtures'; - import { TestConnection as Comp } from './TestConnection'; export default { diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.tsx index 14efaee51a710..eff6e8d5f0bb7 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/TestConnection/TestConnection.tsx @@ -17,27 +17,26 @@ */ import React, { useState } from 'react'; -import { Text, Box, Link, Mark } from 'design'; -import Select from 'shared/components/Select'; + +import { Box, Link, Mark, Text } from 'design'; import { OutlineInfo } from 'design/Alert/Alert'; +import Select, { type Option } from 'shared/components/Select'; import { TextSelectCopy } from 'shared/components/TextSelectCopy'; import cfg from 'teleport/config'; -import { generateTshLoginCommand, openNewTab } from 'teleport/lib/util'; import { - Header, ActionButtons, + Header, HeaderSubtitle, StyledBox, } from 'teleport/Discover/Shared'; -import useTeleport from 'teleport/useTeleport'; -import { splitAwsIamArn } from 'teleport/services/integrations/aws'; import { AWS_TAG_INFO_LINK } from 'teleport/Discover/Shared/const'; +import { generateTshLoginCommand, openNewTab } from 'teleport/lib/util'; +import { splitAwsIamArn } from 'teleport/services/integrations/aws'; +import useTeleport from 'teleport/useTeleport'; import { AppMeta, useDiscover } from '../../useDiscover'; -import type { Option } from 'shared/components/Select'; - export function TestConnection() { const ctx = useTeleport(); const { username, authType } = ctx.storeUser.state; diff --git a/web/packages/teleport/src/Discover/AwsMangementConsole/index.tsx b/web/packages/teleport/src/Discover/AwsMangementConsole/index.tsx index 52e53ceef419c..f2636f23901aa 100644 --- a/web/packages/teleport/src/Discover/AwsMangementConsole/index.tsx +++ b/web/packages/teleport/src/Discover/AwsMangementConsole/index.tsx @@ -16,10 +16,9 @@ * along with this program. If not, see . */ -import { AwsAccount, ResourceKind, Finished } from 'teleport/Discover/Shared'; import { ResourceViewConfig } from 'teleport/Discover/flow'; import { ResourceSpec } from 'teleport/Discover/SelectResource'; - +import { AwsAccount, Finished, ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverEvent } from 'teleport/services/userEvent'; import { CreateAppAccess } from './CreateAppAccess/CreateAppAccess'; diff --git a/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.story.tsx b/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.story.tsx index 333ae2976b9d1..da4ff134b529d 100644 --- a/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.story.tsx +++ b/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.story.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; import { OverrideUserAgent, @@ -28,9 +28,9 @@ import { import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { UserContext } from 'teleport/User/UserContext'; import { createTeleportContext } from 'teleport/mocks/contexts'; import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/userPreferences'; +import { UserContext } from 'teleport/User/UserContext'; import { SetupConnect } from './SetupConnect'; diff --git a/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.test.ts b/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.test.ts index 4010401f684b7..f121720cc7323 100644 --- a/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.test.ts +++ b/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.test.ts @@ -18,12 +18,11 @@ import { renderHook, waitFor } from '@testing-library/react'; -import * as useTeleport from 'teleport/useTeleport'; +import { nodes } from 'teleport/Nodes/fixtures'; import NodeService, { Node } from 'teleport/services/nodes'; import UserService from 'teleport/services/user'; import TeleportContext from 'teleport/teleportContext'; - -import { nodes } from 'teleport/Nodes/fixtures'; +import * as useTeleport from 'teleport/useTeleport'; import { usePollForConnectMyComputerNode } from './SetupConnect'; diff --git a/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.tsx b/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.tsx index 8d1c2a911027f..e391f147bb342 100644 --- a/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.tsx +++ b/web/packages/teleport/src/Discover/ConnectMyComputer/SetupConnect/SetupConnect.tsx @@ -16,37 +16,35 @@ * along with this program. If not, see . */ -import React, { useEffect, useCallback, useState, useRef } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import { Link } from 'react-router-dom'; +import { Flex, Text } from 'design'; import { ButtonSecondary } from 'design/Button'; -import { getPlatform } from 'design/platform'; -import { Text, Flex } from 'design'; import * as Icons from 'design/Icon'; -import { makeDeepLinkWithSafeInput } from 'shared/deepLinks'; -import * as connectMyComputer from 'shared/connectMyComputer'; +import { getPlatform } from 'design/platform'; import { DownloadConnect, getConnectDownloadLinks, } from 'shared/components/DownloadConnect/DownloadConnect'; +import * as connectMyComputer from 'shared/connectMyComputer'; +import { makeDeepLinkWithSafeInput } from 'shared/deepLinks'; import cfg from 'teleport/config'; -import useTeleport from 'teleport/useTeleport'; -import { Node } from 'teleport/services/nodes'; - import { ActionButtons, Header, StyledBox, TextIcon, } from 'teleport/Discover/Shared'; -import { usePoll } from 'teleport/Discover/Shared/usePoll'; - import { HintBox, SuccessBox, WaitingInfo, } from 'teleport/Discover/Shared/HintBox'; +import { usePoll } from 'teleport/Discover/Shared/usePoll'; +import { Node } from 'teleport/services/nodes'; +import useTeleport from 'teleport/useTeleport'; import type { AgentStepProps } from '../../types'; diff --git a/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.story.tsx b/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.story.tsx index f2ee04e302356..2b0ee97109f61 100644 --- a/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.story.tsx +++ b/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.story.tsx @@ -16,19 +16,19 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { nodes } from 'teleport/Nodes/fixtures'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import { nodes } from 'teleport/Nodes/fixtures'; import { TestConnection } from './TestConnection'; diff --git a/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.tsx index c0bb48ea995ed..1074e8a6a8044 100644 --- a/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/ConnectMyComputer/TestConnection/TestConnection.tsx @@ -16,45 +16,43 @@ * along with this program. If not, see . */ -import React, { useState, useEffect, useCallback, useRef } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; + import { + Box, ButtonPrimary, ButtonSecondary, - Text, - Box, - LabelInput, Indicator, + LabelInput, Link, + Text, } from 'design'; -import Select from 'shared/components/Select'; -import { useAsync } from 'shared/hooks/useAsync'; import * as Icons from 'design/Icon'; +import Select, { type Option } from 'shared/components/Select'; import * as connectMyComputer from 'shared/connectMyComputer'; +import { useAsync } from 'shared/hooks/useAsync'; -import cfg from 'teleport/config'; -import useTeleport from 'teleport/useTeleport'; import ReAuthenticate from 'teleport/components/ReAuthenticate'; -import { openNewTab } from 'teleport/lib/util'; +import cfg from 'teleport/config'; import { - useConnectionDiagnostic, - Header, ActionButtons, - HeaderSubtitle, ConnectionDiagnosticResult, + Header, + HeaderSubtitle, StyledBox, TextIcon, + useConnectionDiagnostic, } from 'teleport/Discover/Shared'; -import { sortNodeLogins } from 'teleport/services/nodes'; +import { openNewTab } from 'teleport/lib/util'; +import type { ConnectionDiagnosticRequest } from 'teleport/services/agents'; import { ApiError } from 'teleport/services/api/parseError'; - import { MfaChallengeScope } from 'teleport/services/auth/auth'; +import type { MfaAuthnResponse } from 'teleport/services/mfa'; +import { sortNodeLogins } from 'teleport/services/nodes'; +import useTeleport from 'teleport/useTeleport'; -import { NodeMeta } from '../../useDiscover'; - -import type { Option } from 'shared/components/Select'; import type { AgentStepProps } from '../../types'; -import type { MfaAuthnResponse } from 'teleport/services/mfa'; -import type { ConnectionDiagnosticRequest } from 'teleport/services/agents'; +import { NodeMeta } from '../../useDiscover'; export function TestConnection(props: AgentStepProps) { const { userService, storeUser } = useTeleport(); diff --git a/web/packages/teleport/src/Discover/ConnectMyComputer/index.ts b/web/packages/teleport/src/Discover/ConnectMyComputer/index.ts index 2d3007266a999..9d53076abeed6 100644 --- a/web/packages/teleport/src/Discover/ConnectMyComputer/index.ts +++ b/web/packages/teleport/src/Discover/ConnectMyComputer/index.ts @@ -21,7 +21,6 @@ import { Finished, ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverEvent } from 'teleport/services/userEvent'; import { ResourceSpec } from '../SelectResource'; - import { SetupConnect } from './SetupConnect'; import { TestConnection } from './TestConnection'; diff --git a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.story.tsx b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.story.tsx index e9bc69d291f02..142bf9c4ba6ad 100644 --- a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.story.tsx +++ b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.story.tsx @@ -20,9 +20,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { DatabaseEngine, DatabaseLocation } from '../../SelectResource'; - import { CreateDatabaseView } from './CreateDatabase'; - import type { State } from './useCreateDatabase'; export default { diff --git a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx index e04b63962e0c2..cb7304a9ad358 100644 --- a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx +++ b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx @@ -16,30 +16,29 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import { Text, Box, Flex, Mark } from 'design'; +import React, { useEffect, useState } from 'react'; -import Validation, { Validator } from 'shared/components/Validation'; +import { Box, Flex, Mark, Text } from 'design'; import FieldInput from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import TextEditor from 'shared/components/TextEditor'; +import Validation, { Validator } from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; + +import type { ResourceLabel } from 'teleport/services/agents'; +import { + getDatabaseProtocol, + getDefaultDatabasePort, +} from '../../SelectResource'; import { ActionButtons, + Header, HeaderSubtitle, LabelsCreater, - Header, } from '../../Shared'; import { dbCU } from '../../yamlTemplates'; -import { - getDatabaseProtocol, - getDefaultDatabasePort, -} from '../../SelectResource'; - -import { useCreateDatabase, State } from './useCreateDatabase'; import { CreateDatabaseDialog } from './CreateDatabaseDialog'; - -import type { ResourceLabel } from 'teleport/services/agents'; +import { State, useCreateDatabase } from './useCreateDatabase'; export function CreateDatabase() { const state = useCreateDatabase(); diff --git a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.story.tsx b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.story.tsx index 92698e3b1871c..7114bcd42d3cc 100644 --- a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.story.tsx +++ b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.story.tsx @@ -17,13 +17,14 @@ */ import React from 'react'; + import { Info } from 'design/Alert'; +import { dbWithoutDbServerExistsErrorMsg, timeoutErrorMsg } from './const'; import { CreateDatabaseDialog, CreateDatabaseDialogProps, } from './CreateDatabaseDialog'; -import { dbWithoutDbServerExistsErrorMsg, timeoutErrorMsg } from './const'; export default { title: 'Teleport/Discover/Database/CreateDatabase/Dialog', diff --git a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.tsx b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.tsx index 6fd7ebc94f0a6..9b94243c918d0 100644 --- a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.tsx +++ b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabaseDialog.tsx @@ -17,24 +17,24 @@ */ import React from 'react'; + import { - Text, - Flex, AnimatedProgressBar, ButtonPrimary, ButtonSecondary, ButtonWarning, + Flex, + Text, } from 'design'; -import * as Icons from 'design/Icon'; import Dialog, { DialogContent } from 'design/DialogConfirmation'; +import * as Icons from 'design/Icon'; +import type { Attempt } from 'shared/hooks/useAttemptNext'; -import { Timeout } from 'teleport/Discover/Shared/Timeout'; import { TextIcon } from 'teleport/Discover/Shared'; +import { Timeout } from 'teleport/Discover/Shared/Timeout'; import { dbWithoutDbServerExistsErrorMsg, timeoutErrorMsg } from './const'; -import type { Attempt } from 'shared/hooks/useAttemptNext'; - export type CreateDatabaseDialogProps = { pollTimeout: number; attempt: Attempt; diff --git a/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.test.tsx b/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.test.tsx index 48c00a6a1b231..a25417dec39d6 100644 --- a/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.test.tsx +++ b/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.test.tsx @@ -16,32 +16,32 @@ * along with this program. If not, see . */ +import { act, renderHook, waitFor } from '@testing-library/react'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { renderHook, act, waitFor } from '@testing-library/react'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport'; -import { - DiscoverProvider, - DiscoverContextState, -} from 'teleport/Discover/useDiscover'; -import api from 'teleport/services/api'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; -import { userEventService } from 'teleport/services/userEvent'; import cfg from 'teleport/config'; import { DatabaseEngine, DatabaseLocation, } from 'teleport/Discover/SelectResource'; import { - IamPolicyStatus, + DiscoverContextState, + DiscoverProvider, +} from 'teleport/Discover/useDiscover'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import api from 'teleport/services/api'; +import { CreateDatabaseRequest, + IamPolicyStatus, } from 'teleport/services/databases'; +import { userEventService } from 'teleport/services/userEvent'; import { - useCreateDatabase, findActiveDatabaseSvc, + useCreateDatabase, WAITING_TIMEOUT, } from './useCreateDatabase'; diff --git a/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.ts b/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.ts index 8b2ab77e7f8d2..a184ec7a3de12 100644 --- a/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.ts +++ b/web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.ts @@ -21,27 +21,24 @@ import { useEffect, useState } from 'react'; import useAttempt from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; -import useTeleport from 'teleport/useTeleport'; -import { useDiscover } from 'teleport/Discover/useDiscover'; +import cfg from 'teleport/config'; +import { DatabaseLocation } from 'teleport/Discover/SelectResource'; import { usePoll } from 'teleport/Discover/Shared/usePoll'; +import { useDiscover, type DbMeta } from 'teleport/Discover/useDiscover'; import { compareByString } from 'teleport/lib/util'; +import type { ResourceLabel } from 'teleport/services/agents'; import { ApiError } from 'teleport/services/api/parseError'; -import { DatabaseLocation } from 'teleport/Discover/SelectResource'; -import { IamPolicyStatus } from 'teleport/services/databases'; -import cfg from 'teleport/config'; +import { + IamPolicyStatus, + type CreateDatabaseRequest, + type Database as DatabaseResource, + type DatabaseService, +} from 'teleport/services/databases'; +import useTeleport from 'teleport/useTeleport'; import { matchLabels } from '../common'; - import { dbWithoutDbServerExistsErrorMsg, timeoutErrorMsg } from './const'; -import type { - CreateDatabaseRequest, - Database as DatabaseResource, - DatabaseService, -} from 'teleport/services/databases'; -import type { ResourceLabel } from 'teleport/services/agents'; -import type { DbMeta } from 'teleport/Discover/useDiscover'; - export const WAITING_TIMEOUT = 30000; // 30 seconds export function useCreateDatabase() { diff --git a/web/packages/teleport/src/Discover/Database/DatabaseWrapper.tsx b/web/packages/teleport/src/Discover/Database/DatabaseWrapper.tsx index 008ad5d09b352..0f17ea044532f 100644 --- a/web/packages/teleport/src/Discover/Database/DatabaseWrapper.tsx +++ b/web/packages/teleport/src/Discover/Database/DatabaseWrapper.tsx @@ -18,9 +18,8 @@ import React, { useEffect } from 'react'; -import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; import { PING_INTERVAL } from 'teleport/Discover/Database/config'; - +import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { ResourceKind } from '../Shared'; diff --git a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.story.tsx b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.story.tsx index ee5042fa95f0e..afdfa82bc1da9 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.story.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.story.tsx @@ -16,25 +16,22 @@ * along with this program. If not, see . */ -import React from 'react'; -import { initialize, mswLoader } from 'msw-storybook-addon'; import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; +import React from 'react'; import cfg from 'teleport/config'; - -import { ResourceKind } from 'teleport/Discover/Shared'; - import { ComponentWrapper, getDbMeta, getDbResourceSpec, } from 'teleport/Discover/Fixtures/databases'; - import { TeleportProvider } from 'teleport/Discover/Fixtures/fixtures'; import { DatabaseEngine, DatabaseLocation, } from 'teleport/Discover/SelectResource'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { AutoDeploy } from './AutoDeploy'; diff --git a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.test.tsx b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.test.tsx index 97fc6d979408b..ae22b58f336ee 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.test.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.test.tsx @@ -18,9 +18,25 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import { act, fireEvent, render, screen } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; +import cfg from 'teleport/config'; +import { + DatabaseEngine, + DatabaseLocation, +} from 'teleport/Discover/SelectResource'; +import { ResourceKind } from 'teleport/Discover/Shared'; +import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; +import { SHOW_HINT_TIMEOUT } from 'teleport/Discover/Shared/useShowHint'; +import { + DbMeta, + DiscoverContextState, + DiscoverProvider, +} from 'teleport/Discover/useDiscover'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { AwsRdsDatabase, Integration, @@ -29,24 +45,8 @@ import { IntegrationStatusCode, Regions, } from 'teleport/services/integrations'; -import { createTeleportContext } from 'teleport/mocks/contexts'; -import cfg from 'teleport/config'; -import TeleportContext from 'teleport/teleportContext'; -import { - DbMeta, - DiscoverContextState, - DiscoverProvider, -} from 'teleport/Discover/useDiscover'; -import { - DatabaseEngine, - DatabaseLocation, -} from 'teleport/Discover/SelectResource'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; -import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; -import { ResourceKind } from 'teleport/Discover/Shared'; -import { SHOW_HINT_TIMEOUT } from 'teleport/Discover/Shared/useShowHint'; - import { userEventService } from 'teleport/services/userEvent'; +import TeleportContext from 'teleport/teleportContext'; import { AutoDeploy } from './AutoDeploy'; diff --git a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.tsx b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.tsx index 21e8beb1dd1dd..4504598e3b05f 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.tsx @@ -16,61 +16,59 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import styled, { useTheme } from 'styled-components'; + import { Box, ButtonSecondary, + Link as ExternalLink, + Flex, + H3, Link, - Text, Mark, - H3, Subtitle3, - Link as ExternalLink, - Flex, + Text, } from 'design'; import * as Icons from 'design/Icon'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; -import useAttempt from 'shared/hooks/useAttemptNext'; import { requiredIamRoleName } from 'shared/components/Validation/rules'; +import useAttempt from 'shared/hooks/useAttemptNext'; import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; -import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; +import cfg from 'teleport/config'; import { HintBox, SuccessBox, WaitingInfo, } from 'teleport/Discover/Shared/HintBox'; +import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; +import { DbMeta, useDiscover } from 'teleport/Discover/useDiscover'; +import type { Database } from 'teleport/services/databases'; import { integrationService, Regions } from 'teleport/services/integrations'; -import { useDiscover, DbMeta } from 'teleport/Discover/useDiscover'; +import { splitAwsIamArn } from 'teleport/services/integrations/aws'; import { DiscoverEventStatus, DiscoverServiceDeployMethod, DiscoverServiceDeployType, } from 'teleport/services/userEvent'; -import cfg from 'teleport/config'; -import { splitAwsIamArn } from 'teleport/services/integrations/aws'; import { ActionButtons, + AlternateInstructionButton, + Header, HeaderSubtitle, TextIcon, useShowHint, - Header, - AlternateInstructionButton, } from '../../../Shared'; -import awsEcsLight from '../../aws-ecs-light.svg'; -import awsEcsDark from '../../aws-ecs-dark.svg'; import awsEcsBblp from '../../aws-ecs-bblp.svg'; - +import awsEcsDark from '../../aws-ecs-dark.svg'; +import awsEcsLight from '../../aws-ecs-light.svg'; import { DeployServiceProp } from '../DeployService'; - import { SelectSecurityGroups } from './SelectSecurityGroups'; import { SelectSubnetIds } from './SelectSubnetIds'; -import type { Database } from 'teleport/services/databases'; - export function AutoDeploy({ toggleDeployMethod }: DeployServiceProp) { const { emitErrorEvent, nextStep, emitEvent, agentMeta, updateAgentMeta } = useDiscover(); diff --git a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSecurityGroups.tsx b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSecurityGroups.tsx index cc5ed4bb590b4..67d741383c47e 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSecurityGroups.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSecurityGroups.tsx @@ -16,29 +16,29 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; -import { Text, Flex, Box, Indicator, ButtonSecondary, Subtitle3 } from 'design'; -import * as Icons from 'design/Icon'; +import { Box, ButtonSecondary, Flex, Indicator, Subtitle3, Text } from 'design'; import { FetchStatus } from 'design/DataTable/types'; +import * as Icons from 'design/Icon'; +import { P, P3 } from 'design/Text/Text'; import { HoverTooltip, ToolTipInfo } from 'shared/components/ToolTip'; import useAttempt from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; import { pluralize } from 'shared/utils/text'; -import { P, P3 } from 'design/Text/Text'; +import { DbMeta } from 'teleport/Discover/useDiscover'; import { AwsRdsDatabase, integrationService, SecurityGroup, SecurityGroupRule, } from 'teleport/services/integrations'; -import { DbMeta } from 'teleport/Discover/useDiscover'; import { + ButtonBlueText, SecurityGroupPicker, SecurityGroupWithRecommendation, - ButtonBlueText, } from '../../../Shared'; type TableData = { diff --git a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSubnetIds.tsx b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSubnetIds.tsx index 785ec15fbda9e..71b7e1db34cef 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSubnetIds.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/SelectSubnetIds.tsx @@ -16,27 +16,27 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { - Text, - Flex, Box, - Indicator, ButtonSecondary, - Subtitle3, + Flex, + Indicator, P3, + Subtitle3, + Text, } from 'design'; -import * as Icons from 'design/Icon'; import { FetchStatus } from 'design/DataTable/types'; +import * as Icons from 'design/Icon'; import { HoverTooltip, ToolTipInfo } from 'shared/components/ToolTip'; -import { pluralize } from 'shared/utils/text'; import useAttempt from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; +import { pluralize } from 'shared/utils/text'; import { SubnetIdPicker } from 'teleport/Discover/Shared/SubnetIdPicker'; -import { integrationService, Subnet } from 'teleport/services/integrations'; import { DbMeta } from 'teleport/Discover/useDiscover'; +import { integrationService, Subnet } from 'teleport/services/integrations'; import useTeleport from 'teleport/useTeleport'; import { ButtonBlueText } from '../../../Shared'; diff --git a/web/packages/teleport/src/Discover/Database/DeployService/DeployService.tsx b/web/packages/teleport/src/Discover/Database/DeployService/DeployService.tsx index 1025c6fa6c3ac..73eaacc978670 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/DeployService.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/DeployService.tsx @@ -19,9 +19,8 @@ import React, { useState } from 'react'; import { ServiceDeployMethod } from '../common'; - -import { ManualDeploy } from './ManualDeploy'; import { AutoDeploy } from './AutoDeploy'; +import { ManualDeploy } from './ManualDeploy'; export function DeployService() { const [deployMethod, setDeployMethod] = useState('auto'); diff --git a/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.story.tsx b/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.story.tsx index f88c93444409a..e49e617617660 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.story.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.story.tsx @@ -19,20 +19,20 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { Context as TeleportContext, ContextProvider } from 'teleport'; +import { ContextProvider, Context as TeleportContext } from 'teleport'; import cfg from 'teleport/config'; -import { ResourceKind } from 'teleport/Discover/Shared'; -import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; -import { getUserContext } from 'teleport/mocks/contexts'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; import { DatabaseEngine, DatabaseLocation, } from 'teleport/Discover/SelectResource'; +import { ResourceKind } from 'teleport/Discover/Shared'; +import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { getUserContext } from 'teleport/mocks/contexts'; import ManualDeploy from './ManualDeploy'; diff --git a/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.tsx b/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.tsx index 7dcc1c9424cd5..3b052491ec1a6 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.tsx +++ b/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/ManualDeploy.tsx @@ -16,32 +16,30 @@ * along with this program. If not, see . */ -import React, { Suspense, useState, useEffect } from 'react'; -import { Box, ButtonSecondary, Text, Mark } from 'design'; +import React, { Suspense, useEffect, useState } from 'react'; + +import { Box, ButtonSecondary, Mark, Text } from 'design'; import * as Icons from 'design/Icon'; import Validation, { Validator } from 'shared/components/Validation'; import { CatchError } from 'teleport/components/CatchError'; -import { - clearCachedJoinTokenResult, - useJoinTokenSuspender, -} from 'teleport/Discover/Shared/useJoinTokenSuspender'; -import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; -import { ResourceLabel } from 'teleport/services/agents'; -import cfg from 'teleport/config'; -import { Database } from 'teleport/services/databases'; - import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; - +import cfg from 'teleport/config'; +import { DatabaseLocation } from 'teleport/Discover/SelectResource'; +import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; import { HintBox, SuccessBox, WaitingInfo, } from 'teleport/Discover/Shared/HintBox'; - -import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; +import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; +import { + clearCachedJoinTokenResult, + useJoinTokenSuspender, +} from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { useDiscover } from 'teleport/Discover/useDiscover'; -import { DatabaseLocation } from 'teleport/Discover/SelectResource'; +import { ResourceLabel } from 'teleport/services/agents'; +import { Database } from 'teleport/services/databases'; import { DiscoverEventStatus, DiscoverServiceDeployMethod, @@ -58,7 +56,7 @@ import { TextIcon, useShowHint, } from '../../../Shared'; -import { Labels, hasMatchingLabels } from '../../common'; +import { hasMatchingLabels, Labels } from '../../common'; import { DeployServiceProp } from '../DeployService'; export default function Container({ toggleDeployMethod }: DeployServiceProp) { diff --git a/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/index.ts b/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/index.ts index 7919452715950..86e2646226dbc 100644 --- a/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/index.ts +++ b/web/packages/teleport/src/Discover/Database/DeployService/ManualDeploy/index.ts @@ -17,4 +17,5 @@ */ import ManualDeploy from './ManualDeploy'; + export { ManualDeploy }; diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoDiscoverToggle.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoDiscoverToggle.tsx index 204e30b3e79d1..2287d4b00e4b1 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoDiscoverToggle.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoDiscoverToggle.tsx @@ -17,8 +17,8 @@ */ import React from 'react'; -import { Box, Toggle } from 'design'; +import { Box, Toggle } from 'design'; import { ToolTipInfo } from 'shared/components/ToolTip'; export function AutoDiscoverToggle({ diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoEnrollment.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoEnrollment.tsx index 7a4d178952552..0317653f3296e 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoEnrollment.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/AutoEnrollment.tsx @@ -16,34 +16,34 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import { Text, Flex, ButtonSecondary } from 'design'; +import React, { useEffect, useState } from 'react'; + +import { ButtonSecondary, Flex, Text } from 'design'; +import Alert from 'design/Alert/Alert'; import { FetchStatus } from 'design/DataTable/types'; import useAttempt, { Attempt } from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; -import Alert from 'design/Alert/Alert'; +import cfg from 'teleport/config'; +import { CreatedDiscoveryConfigDialog } from 'teleport/Discover/Shared/ConfigureDiscoveryService'; import { DbMeta, useDiscover } from 'teleport/Discover/useDiscover'; +import { + createDiscoveryConfig, + DISCOVERY_GROUP_CLOUD, +} from 'teleport/services/discovery'; import { AwsRdsDatabase, + integrationService, Regions, Vpc, - integrationService, } from 'teleport/services/integrations'; -import cfg from 'teleport/config'; -import { - DISCOVERY_GROUP_CLOUD, - createDiscoveryConfig, -} from 'teleport/services/discovery'; -import useTeleport from 'teleport/useTeleport'; import { DiscoverEvent, DiscoverEventStatus, } from 'teleport/services/userEvent'; -import { CreatedDiscoveryConfigDialog } from 'teleport/Discover/Shared/ConfigureDiscoveryService'; +import useTeleport from 'teleport/useTeleport'; import { ActionButtons } from '../../Shared'; - import { DatabaseList } from './RdsDatabaseList'; type TableData = { diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.story.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.story.tsx index 1974723bd48cc..74dab9a2f4df2 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.story.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.story.tsx @@ -16,27 +16,28 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React, { useEffect } from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; + import { Info } from 'design/Alert'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { - DiscoverProvider, + DatabaseEngine, + DatabaseLocation, +} from 'teleport/Discover/SelectResource'; +import { DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; -import { - DatabaseEngine, - DatabaseLocation, -} from 'teleport/Discover/SelectResource'; import { EnrollRdsDatabase } from './EnrollRdsDatabase'; diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.test.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.test.tsx index f9a219a2749c7..c256a11328719 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.test.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.test.tsx @@ -17,18 +17,19 @@ */ import React from 'react'; -import { render, screen, fireEvent, act } from 'design/utils/testing'; +import { act, fireEvent, render, screen } from 'design/utils/testing'; + +import cfg from 'teleport/config'; +import { ComponentWrapper } from 'teleport/Discover/Fixtures/databases'; +import DatabaseService from 'teleport/services/databases/databases'; +import * as discoveryService from 'teleport/services/discovery/discovery'; +import { DISCOVERY_GROUP_CLOUD } from 'teleport/services/discovery/discovery'; import { AwsRdsDatabase, integrationService, } from 'teleport/services/integrations'; import { userEventService } from 'teleport/services/userEvent'; -import DatabaseService from 'teleport/services/databases/databases'; -import * as discoveryService from 'teleport/services/discovery/discovery'; -import { ComponentWrapper } from 'teleport/Discover/Fixtures/databases'; -import cfg from 'teleport/config'; -import { DISCOVERY_GROUP_CLOUD } from 'teleport/services/discovery/discovery'; import { EnrollRdsDatabase } from './EnrollRdsDatabase'; diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.tsx index ab7a884d83bbc..54717ea9484f2 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/EnrollRdsDatabase.tsx @@ -17,30 +17,30 @@ */ import React, { useState } from 'react'; + import { Box, Indicator } from 'design'; import { Danger } from 'design/Alert'; +import { P } from 'design/Text/Text'; import useAttempt from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; -import { P } from 'design/Text/Text'; +import { ConfigureIamPerms } from 'teleport/Discover/Shared/Aws/ConfigureIamPerms'; +import { isIamPermError } from 'teleport/Discover/Shared/Aws/error'; +import { AwsRegionSelector } from 'teleport/Discover/Shared/AwsRegionSelector'; import { useDiscover } from 'teleport/Discover/useDiscover'; import { + integrationService, Regions, Vpc, - integrationService, } from 'teleport/services/integrations'; -import { AwsRegionSelector } from 'teleport/Discover/Shared/AwsRegionSelector'; -import { ConfigureIamPerms } from 'teleport/Discover/Shared/Aws/ConfigureIamPerms'; -import { isIamPermError } from 'teleport/Discover/Shared/Aws/error'; import { splitAwsIamArn } from 'teleport/services/integrations/aws'; import useTeleport from 'teleport/useTeleport'; import { Header } from '../../Shared'; - -import { VpcOption, VpcSelector } from './VpcSelector'; import { AutoDiscoverToggle } from './AutoDiscoverToggle'; import { AutoEnrollment } from './AutoEnrollment'; import { SingleEnrollment } from './SingleEnrollment'; +import { VpcOption, VpcSelector } from './VpcSelector'; export function EnrollRdsDatabase() { const ctx = useTeleport(); diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/RdsDatabaseList.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/RdsDatabaseList.tsx index c5ca31114afea..1ad035ec9075b 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/RdsDatabaseList.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/RdsDatabaseList.tsx @@ -17,16 +17,17 @@ */ import React from 'react'; + import Table from 'design/DataTable'; import { FetchStatus } from 'design/DataTable/types'; import { DisableableCell as Cell, - StatusCell, ItemStatus, - RadioCell, - Labels, labelMatcher, + Labels, + RadioCell, + StatusCell, } from 'teleport/Discover/Shared'; import { CheckedAwsRdsDatabase } from './SingleEnrollment'; diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/SingleEnrollment.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/SingleEnrollment.tsx index 1d7203366f94a..a5eafe22b0b16 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/SingleEnrollment.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/SingleEnrollment.tsx @@ -16,27 +16,26 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; + import { Text } from 'design'; import { FetchStatus } from 'design/DataTable/types'; import { Attempt } from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; +import { getRdsEngineIdentifier } from 'teleport/Discover/SelectResource/types'; import { useDiscover } from 'teleport/Discover/useDiscover'; +import { Database } from 'teleport/services/databases'; import { AwsRdsDatabase, + integrationService, Regions, Vpc, - integrationService, } from 'teleport/services/integrations'; -import { Database } from 'teleport/services/databases'; -import { getRdsEngineIdentifier } from 'teleport/Discover/SelectResource/types'; import { ActionButtons } from '../../Shared'; - -import { useCreateDatabase } from '../CreateDatabase/useCreateDatabase'; import { CreateDatabaseDialog } from '../CreateDatabase/CreateDatabaseDialog'; - +import { useCreateDatabase } from '../CreateDatabase/useCreateDatabase'; import { DatabaseList } from './RdsDatabaseList'; type TableData = { diff --git a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/VpcSelector.tsx b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/VpcSelector.tsx index 792624858e17b..ef5403030efd5 100644 --- a/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/VpcSelector.tsx +++ b/web/packages/teleport/src/Discover/Database/EnrollRdsDatabase/VpcSelector.tsx @@ -18,9 +18,10 @@ import React from 'react'; import { components } from 'react-select'; -import { Box, Flex, LabelInput, Link, ButtonIcon } from 'design'; -import Select from 'shared/components/Select'; + +import { Box, ButtonIcon, Flex, LabelInput, Link } from 'design'; import { NewTab } from 'design/Icon'; +import Select from 'shared/components/Select'; import { Regions, Vpc } from 'teleport/services/integrations'; diff --git a/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.story.tsx b/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.story.tsx index 2ee7837ef6298..c669868641ad0 100644 --- a/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.story.tsx +++ b/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.story.tsx @@ -20,7 +20,6 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { IamPolicyView } from './IamPolicy'; - import type { State } from './useIamPolicy'; export default { diff --git a/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.tsx b/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.tsx index f9df092b48d8d..73f8289e2f6ff 100644 --- a/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.tsx +++ b/web/packages/teleport/src/Discover/Database/IamPolicy/IamPolicy.tsx @@ -17,22 +17,21 @@ */ import React from 'react'; -import { Text, Box, Flex, Indicator, Link } from 'design'; + +import { Box, Flex, Indicator, Link, Text } from 'design'; import * as Icons from 'design/Icon'; -import useTeleport from 'teleport/useTeleport'; import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; +import useTeleport from 'teleport/useTeleport'; import { - HeaderSubtitle, ActionButtons, - Header, ButtonBlueText, + Header, + HeaderSubtitle, } from '../../Shared'; - -import { useIamPolicy, State } from './useIamPolicy'; - import type { AgentStepProps } from '../../types'; +import { State, useIamPolicy } from './useIamPolicy'; export function IamPolicy(props: AgentStepProps) { const ctx = useTeleport(); diff --git a/web/packages/teleport/src/Discover/Database/IamPolicy/useIamPolicy.ts b/web/packages/teleport/src/Discover/Database/IamPolicy/useIamPolicy.ts index b6e77735e99a3..30e2d938319be 100644 --- a/web/packages/teleport/src/Discover/Database/IamPolicy/useIamPolicy.ts +++ b/web/packages/teleport/src/Discover/Database/IamPolicy/useIamPolicy.ts @@ -20,11 +20,11 @@ import { useEffect, useState } from 'react'; import useAttempt from 'shared/hooks/useAttemptNext'; -import TeleportContext from 'teleport/teleportContext'; import { useDiscover } from 'teleport/Discover/useDiscover'; +import type { DatabaseIamPolicyResponse } from 'teleport/services/databases'; +import TeleportContext from 'teleport/teleportContext'; import type { AgentStepProps } from '../../types'; -import type { DatabaseIamPolicyResponse } from 'teleport/services/databases'; export function useIamPolicy({ ctx, props }: Props) { const { attempt, run } = useAttempt(''); diff --git a/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.story.tsx b/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.story.tsx index 1cbe2763e41fc..a4ffc72705741 100644 --- a/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.story.tsx +++ b/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.story.tsx @@ -20,9 +20,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { DatabaseEngine } from '../../SelectResource'; - import { MutualTlsView } from './MutualTls'; - import type { State } from './useMutualTls'; export default { diff --git a/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.tsx b/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.tsx index 3fa3e47cdd906..53d8d02d14689 100644 --- a/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.tsx +++ b/web/packages/teleport/src/Discover/Database/MutualTls/MutualTls.tsx @@ -17,24 +17,23 @@ */ import React, { useState } from 'react'; -import { Text, Box, Flex, Link, Mark } from 'design'; + +import { Box, Flex, Link, Mark, Text } from 'design'; import { Danger } from 'design/Alert'; import { Info } from 'design/Icon'; -import TextEditor from 'shared/components/TextEditor'; import { FieldTextArea } from 'shared/components/FieldTextArea'; +import TextEditor from 'shared/components/TextEditor'; import Validation from 'shared/components/Validation'; -import useTeleport from 'teleport/useTeleport'; -import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; import { Tabs } from 'teleport/components/Tabs'; +import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; +import useTeleport from 'teleport/useTeleport'; -import { HeaderSubtitle, ActionButtons, Header, StyledBox } from '../../Shared'; -import { dbCU } from '../../yamlTemplates'; import { DatabaseEngine } from '../../SelectResource'; - -import { useMutualTls, State } from './useMutualTls'; - +import { ActionButtons, Header, HeaderSubtitle, StyledBox } from '../../Shared'; import type { AgentStepProps } from '../../types'; +import { dbCU } from '../../yamlTemplates'; +import { State, useMutualTls } from './useMutualTls'; export function MutualTls(props: AgentStepProps) { const ctx = useTeleport(); diff --git a/web/packages/teleport/src/Discover/Database/MutualTls/useMutualTls.ts b/web/packages/teleport/src/Discover/Database/MutualTls/useMutualTls.ts index 0a73b10959eb2..60db47e5b6234 100644 --- a/web/packages/teleport/src/Discover/Database/MutualTls/useMutualTls.ts +++ b/web/packages/teleport/src/Discover/Database/MutualTls/useMutualTls.ts @@ -21,16 +21,15 @@ import { useEffect, useState } from 'react'; import useAttempt from 'shared/hooks/useAttemptNext'; import cfg from 'teleport/config'; -import TeleportContext from 'teleport/teleportContext'; -import { useJoinTokenSuspender } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { - resourceKindToJoinRole, ResourceKind, + resourceKindToJoinRole, } from 'teleport/Discover/Shared/ResourceKind'; - -import { DbMeta, useDiscover } from '../../useDiscover'; +import { useJoinTokenSuspender } from 'teleport/Discover/Shared/useJoinTokenSuspender'; +import TeleportContext from 'teleport/teleportContext'; import type { AgentStepProps } from '../../types'; +import { DbMeta, useDiscover } from '../../useDiscover'; export function useMutualTls({ ctx, props }: Props) { const { attempt, run } = useAttempt(''); diff --git a/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.story.tsx b/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.story.tsx index 328ca17943723..fde360cd3a949 100644 --- a/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.story.tsx +++ b/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.story.tsx @@ -16,22 +16,21 @@ * along with this program. If not, see . */ -import React from 'react'; -import { initialize, mswLoader } from 'msw-storybook-addon'; import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; +import React from 'react'; -import { noAccess, getAcl } from 'teleport/mocks/contexts'; import cfg from 'teleport/config'; -import { ResourceKind } from 'teleport/Discover/Shared'; -import { TeleportProvider } from 'teleport/Discover/Fixtures/fixtures'; import { ComponentWrapper, getDbMeta, getDbResourceSpec, } from 'teleport/Discover/Fixtures/databases'; +import { TeleportProvider } from 'teleport/Discover/Fixtures/fixtures'; +import { ResourceKind } from 'teleport/Discover/Shared'; +import { getAcl, noAccess } from 'teleport/mocks/contexts'; import { DatabaseEngine, DatabaseLocation } from '../../SelectResource'; - import SetupAccess from './SetupAccess'; export default { diff --git a/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx b/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx index da069a76a5329..f195d93b5da8f 100644 --- a/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx +++ b/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx @@ -16,27 +16,27 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import { Box, Text, Flex, Link, Mark } from 'design'; +import React, { useEffect, useState } from 'react'; + +import { Box, Flex, Link, Mark, Text } from 'design'; import { Info as InfoIcon } from 'design/Icon'; +import { Tabs } from 'teleport/components/Tabs'; +import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; +import { StyledBox } from 'teleport/Discover/Shared'; import { - SelectCreatable, Option, + SelectCreatable, } from 'teleport/Discover/Shared/SelectCreatable'; import { - useUserTraits, SetupAccessWrapper, + useUserTraits, + type State, } from 'teleport/Discover/Shared/SetupAccess'; -import { StyledBox } from 'teleport/Discover/Shared'; -import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; import { DbMeta } from 'teleport/Discover/useDiscover'; -import { Tabs } from 'teleport/components/Tabs'; import { DatabaseEngine, DatabaseLocation } from '../../SelectResource'; -import type { State } from 'teleport/Discover/Shared/SetupAccess'; - export default function Container() { const state = useUserTraits(); return ; diff --git a/web/packages/teleport/src/Discover/Database/SetupAccess/index.ts b/web/packages/teleport/src/Discover/Database/SetupAccess/index.ts index 9dff28d2505a0..dff3646fb943b 100644 --- a/web/packages/teleport/src/Discover/Database/SetupAccess/index.ts +++ b/web/packages/teleport/src/Discover/Database/SetupAccess/index.ts @@ -17,4 +17,5 @@ */ import SetupAccess from './SetupAccess'; + export { SetupAccess }; diff --git a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.story.tsx b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.story.tsx index 9c048edfbb609..4cd1ec4927fa8 100644 --- a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.story.tsx +++ b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.story.tsx @@ -21,18 +21,17 @@ import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; import { DatabaseEngine, DatabaseLocation } from '../../SelectResource'; - import { TestConnection } from './TestConnection'; export default { diff --git a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.test.tsx b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.test.tsx index 833fd882a8eab..a75e925a7beae 100644 --- a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.test.tsx +++ b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.test.tsx @@ -17,20 +17,21 @@ */ import React from 'react'; + import { render, screen, userEvent } from 'design/utils/testing'; -import { userEventService } from 'teleport/services/userEvent'; import { ComponentWrapper, getDbMeta, getDbResourceSpec, } from 'teleport/Discover/Fixtures/databases'; -import { agentService } from 'teleport/services/agents'; import { DatabaseEngine, DatabaseLocation, } from 'teleport/Discover/SelectResource'; +import { agentService } from 'teleport/services/agents'; import auth from 'teleport/services/auth/auth'; +import { userEventService } from 'teleport/services/userEvent'; import { TestConnection } from './TestConnection'; diff --git a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx index c4e68434ad510..4bdf9c914e279 100644 --- a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx @@ -17,31 +17,30 @@ */ import React, { useState } from 'react'; -import { Text, Box, LabelInput } from 'design'; +import { Box, LabelInput, Text } from 'design'; import Select, { Option } from 'shared/components/Select'; import Validation, { Validator } from 'shared/components/Validation'; -import TextSelectCopy from 'teleport/components/TextSelectCopy'; -import useStickyClusterId from 'teleport/useStickyClusterId'; -import { generateTshLoginCommand } from 'teleport/lib/util'; import ReAuthenticate from 'teleport/components/ReAuthenticate'; +import TextSelectCopy from 'teleport/components/TextSelectCopy'; +import { WILD_CARD } from 'teleport/Discover/Shared/const'; import { CustomInputFieldForAsterisks } from 'teleport/Discover/Shared/CustomInputFieldForAsterisks'; - -import { MfaChallengeScope } from 'teleport/services/auth/auth'; import { DbMeta, useDiscover } from 'teleport/Discover/useDiscover'; +import { generateTshLoginCommand } from 'teleport/lib/util'; +import { MfaChallengeScope } from 'teleport/services/auth/auth'; import { MfaAuthnResponse } from 'teleport/services/mfa'; -import { WILD_CARD } from 'teleport/Discover/Shared/const'; +import useStickyClusterId from 'teleport/useStickyClusterId'; +import { DatabaseEngine, getDatabaseProtocol } from '../../SelectResource'; import { ActionButtons, - HeaderSubtitle, - Header, ConnectionDiagnosticResult, + Header, + HeaderSubtitle, StyledBox, useConnectionDiagnostic, } from '../../Shared'; -import { DatabaseEngine, getDatabaseProtocol } from '../../SelectResource'; export function TestConnection() { const { resourceSpec, agentMeta } = useDiscover(); diff --git a/web/packages/teleport/src/Discover/Database/common.tsx b/web/packages/teleport/src/Discover/Database/common.tsx index 8efa07bd16773..09557555e94dc 100644 --- a/web/packages/teleport/src/Discover/Database/common.tsx +++ b/web/packages/teleport/src/Discover/Database/common.tsx @@ -17,11 +17,12 @@ */ import React from 'react'; -import { Box, Label as Pill, Text, Mark } from 'design'; + +import { Box, Mark, Label as Pill, Text } from 'design'; import * as Icons from 'design/Icon'; -import { ResourceLabel } from 'teleport/services/agents'; import { LabelsCreater, TextIcon } from 'teleport/Discover/Shared'; +import { ResourceLabel } from 'teleport/services/agents'; import { Regions } from 'teleport/services/integrations'; // serviceDeployedMethod is a flag to determine if user opted to diff --git a/web/packages/teleport/src/Discover/Database/index.tsx b/web/packages/teleport/src/Discover/Database/index.tsx index a3fa5a1194a25..1748c3ecf5120 100644 --- a/web/packages/teleport/src/Discover/Database/index.tsx +++ b/web/packages/teleport/src/Discover/Database/index.tsx @@ -18,24 +18,23 @@ import React from 'react'; -import { AwsAccount, ResourceKind, Finished } from 'teleport/Discover/Shared'; -import { ResourceViewConfig } from 'teleport/Discover/flow'; -import { DatabaseWrapper } from 'teleport/Discover/Database/DatabaseWrapper'; -import { - ResourceSpec, - DatabaseLocation, -} from 'teleport/Discover/SelectResource'; import cfg from 'teleport/config'; - import { CreateDatabase } from 'teleport/Discover/Database/CreateDatabase'; -import { SetupAccess } from 'teleport/Discover/Database/SetupAccess'; +import { DatabaseWrapper } from 'teleport/Discover/Database/DatabaseWrapper'; import { DeployService } from 'teleport/Discover/Database/DeployService'; import { ManualDeploy } from 'teleport/Discover/Database/DeployService/ManualDeploy'; +import { EnrollRdsDatabase } from 'teleport/Discover/Database/EnrollRdsDatabase'; +import { IamPolicy } from 'teleport/Discover/Database/IamPolicy'; import { MutualTls } from 'teleport/Discover/Database/MutualTls'; +import { SetupAccess } from 'teleport/Discover/Database/SetupAccess'; import { TestConnection } from 'teleport/Discover/Database/TestConnection'; +import { ResourceViewConfig } from 'teleport/Discover/flow'; +import { + DatabaseLocation, + ResourceSpec, +} from 'teleport/Discover/SelectResource'; +import { AwsAccount, Finished, ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverEvent } from 'teleport/services/userEvent'; -import { EnrollRdsDatabase } from 'teleport/Discover/Database/EnrollRdsDatabase'; -import { IamPolicy } from 'teleport/Discover/Database/IamPolicy'; import { ConfigureDiscoveryService } from '../Shared/ConfigureDiscoveryService'; diff --git a/web/packages/teleport/src/Discover/Discover.test.tsx b/web/packages/teleport/src/Discover/Discover.test.tsx index 21ac7e693ccc8..f798f7a638a78 100644 --- a/web/packages/teleport/src/Discover/Discover.test.tsx +++ b/web/packages/teleport/src/Discover/Discover.test.tsx @@ -17,40 +17,35 @@ */ import React from 'react'; - import { MemoryRouter } from 'react-router'; import { render, screen } from 'design/utils/testing'; - import { Resource } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; -import TeleportContextProvider from 'teleport/TeleportContextProvider'; +import cfg from 'teleport/config'; import { Discover, DiscoverComponent } from 'teleport/Discover/Discover'; import { ResourceViewConfig } from 'teleport/Discover/flow'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; -import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; -import { getOSSFeatures } from 'teleport/features'; -import cfg from 'teleport/config'; -import { - APPLICATIONS, - KUBERNETES, - SERVERS, -} from 'teleport/Discover/SelectResource/resources'; import { DATABASES, DATABASES_UNGUIDED, DATABASES_UNGUIDED_DOC, } from 'teleport/Discover/SelectResource/databases'; - -import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; -import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; - +import { + APPLICATIONS, + KUBERNETES, + SERVERS, +} from 'teleport/Discover/SelectResource/resources'; +import type { ResourceSpec } from 'teleport/Discover/SelectResource/types'; +import { getOSSFeatures } from 'teleport/features'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/userPreferences'; +import TeleportContextProvider from 'teleport/TeleportContextProvider'; +import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; +import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; import { ResourceKind } from './Shared'; -import { useDiscover, DiscoverUpdateProps } from './useDiscover'; - -import type { ResourceSpec } from 'teleport/Discover/SelectResource/types'; +import { DiscoverUpdateProps, useDiscover } from './useDiscover'; beforeEach(() => { jest.restoreAllMocks(); diff --git a/web/packages/teleport/src/Discover/Discover.tsx b/web/packages/teleport/src/Discover/Discover.tsx index f3bdd2262323f..8108c17a3d98b 100644 --- a/web/packages/teleport/src/Discover/Discover.tsx +++ b/web/packages/teleport/src/Discover/Discover.tsx @@ -19,22 +19,22 @@ import React from 'react'; import { useLocation } from 'react-router'; import { Prompt } from 'react-router-dom'; + import { Box } from 'design'; -import { Navigation } from 'teleport/components/Wizard/Navigation'; import { FeatureBox } from 'teleport/components/Layout'; -import { SelectResource } from 'teleport/Discover/SelectResource/SelectResource'; -import cfg from 'teleport/config'; import { findViewAtIndex } from 'teleport/components/Wizard/flow'; +import { Navigation } from 'teleport/components/Wizard/Navigation'; +import cfg from 'teleport/config'; +import { SelectResource } from 'teleport/Discover/SelectResource/SelectResource'; +import { DiscoverIcon } from './SelectResource/icons'; import { EViewConfigs } from './types'; - import { DiscoverProvider, - useDiscover, DiscoverUpdateProps, + useDiscover, } from './useDiscover'; -import { DiscoverIcon } from './SelectResource/icons'; function DiscoverContent() { const { diff --git a/web/packages/teleport/src/Discover/Fixtures/databases.tsx b/web/packages/teleport/src/Discover/Fixtures/databases.tsx index 0504c23536bd5..d39910f2efc30 100644 --- a/web/packages/teleport/src/Discover/Fixtures/databases.tsx +++ b/web/packages/teleport/src/Discover/Fixtures/databases.tsx @@ -23,16 +23,15 @@ import { DatabaseLocation, ResourceSpec, } from 'teleport/Discover/SelectResource'; +import { DbMeta } from 'teleport/Discover/useDiscover'; +import { IamPolicyStatus } from 'teleport/services/databases'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; -import { DbMeta } from 'teleport/Discover/useDiscover'; -import { IamPolicyStatus } from 'teleport/services/databases'; import { DATABASES } from '../SelectResource/databases'; import { ResourceKind } from '../Shared'; - import { TeleportProvider } from './fixtures'; export function getDbResourceSpec( diff --git a/web/packages/teleport/src/Discover/Fixtures/fixtures.tsx b/web/packages/teleport/src/Discover/Fixtures/fixtures.tsx index 912599e1f8f0b..d31990123f2e0 100644 --- a/web/packages/teleport/src/Discover/Fixtures/fixtures.tsx +++ b/web/packages/teleport/src/Discover/Fixtures/fixtures.tsx @@ -19,18 +19,18 @@ import React, { PropsWithChildren } from 'react'; import { MemoryRouter } from 'react-router'; -import { ResourceSpec } from 'teleport/Discover/SelectResource'; import { ContextProvider } from 'teleport'; +import cfg from 'teleport/config'; +import { ResourceSpec } from 'teleport/Discover/SelectResource'; +import { ResourceKind } from 'teleport/Discover/Shared'; +import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; import { - DiscoverProvider, - DiscoverContextState, AgentMeta, + DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; -import { createTeleportContext } from 'teleport/mocks/contexts'; -import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; import { FeaturesContextProvider } from 'teleport/FeaturesContext'; -import { ResourceKind } from 'teleport/Discover/Shared'; -import cfg from 'teleport/config'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { Acl, AuthType } from 'teleport/services/user'; export const TeleportProvider: React.FC< diff --git a/web/packages/teleport/src/Discover/Fixtures/kubernetes.tsx b/web/packages/teleport/src/Discover/Fixtures/kubernetes.tsx index 5399d6f0ffded..3c57e36be34e8 100644 --- a/web/packages/teleport/src/Discover/Fixtures/kubernetes.tsx +++ b/web/packages/teleport/src/Discover/Fixtures/kubernetes.tsx @@ -19,14 +19,14 @@ import React, { PropsWithChildren } from 'react'; import { TeleportProvider } from 'teleport/Discover/Fixtures/fixtures'; -import { ResourceKind } from 'teleport/Discover/Shared'; import { KubeLocation, ResourceSpec } from 'teleport/Discover/SelectResource'; +import { KUBERNETES } from 'teleport/Discover/SelectResource/resources'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { EksMeta } from 'teleport/Discover/useDiscover'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; -import { KUBERNETES } from 'teleport/Discover/SelectResource/resources'; export function getKubeResourceSpec(location?: KubeLocation): ResourceSpec { return { diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/AgentWaitingDialog.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/AgentWaitingDialog.tsx index b36c2a345f618..cf39ae94fe203 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/AgentWaitingDialog.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/AgentWaitingDialog.tsx @@ -15,23 +15,23 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import Dialog, { DialogContent } from 'design/DialogConfirmation'; +import React, { useEffect } from 'react'; + import { AnimatedProgressBar, Box, ButtonPrimary, - Text, Flex, Mark, + Text, } from 'design'; -import React, { useEffect } from 'react'; - +import Dialog, { DialogContent } from 'design/DialogConfirmation'; import * as Icons from 'design/Icon'; -import { Kube } from 'teleport/services/kube'; -import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; import { TextIcon, useShowHint } from 'teleport/Discover/Shared'; import { HintBox } from 'teleport/Discover/Shared/HintBox'; +import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; +import { Kube } from 'teleport/services/kube'; type AgentWaitingDialogProps = { joinResourceId: string; diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/Dialogs.story.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/Dialogs.story.tsx index 913fc734e0fd2..b3a2212520f5b 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/Dialogs.story.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/Dialogs.story.tsx @@ -16,36 +16,34 @@ * along with this program. If not, see . */ -import React, { useEffect, useState } from 'react'; -import { MemoryRouter } from 'react-router'; import { rest } from 'msw'; import { mswLoader } from 'msw-storybook-addon'; +import React, { useEffect, useState } from 'react'; +import { MemoryRouter } from 'react-router'; +import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; +import { generateCmd } from 'teleport/Discover/Kubernetes/HelmChart/HelmChart'; import { ResourceKind } from 'teleport/Discover/Shared'; import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; -import { ContextProvider } from 'teleport'; - -import { - INTERNAL_RESOURCE_ID_LABEL_KEY, - JoinToken, -} from 'teleport/services/joinToken'; import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { DiscoverContextState, DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; +import { + INTERNAL_RESOURCE_ID_LABEL_KEY, + JoinToken, +} from 'teleport/services/joinToken'; import { DiscoverEventResource } from 'teleport/services/userEvent'; -import { generateCmd } from 'teleport/Discover/Kubernetes/HelmChart/HelmChart'; - -import { EnrollmentDialog } from './EnrollmentDialog'; import { AgentWaitingDialog } from './AgentWaitingDialog'; +import { EnrollmentDialog } from './EnrollmentDialog'; import { ManualHelmDialog } from './ManualHelmDialog'; export default { diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EksClustersList.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EksClustersList.tsx index 711efb508c861..3bf2c0573e6ed 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EksClustersList.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EksClustersList.tsx @@ -17,20 +17,20 @@ */ import React from 'react'; + import Table from 'design/DataTable'; import { FetchStatus } from 'design/DataTable/types'; +import cfg from 'teleport/config'; import { DisableableCell as Cell, - StatusCell, ItemStatus, - RadioCell, - Labels, labelMatcher, + Labels, + RadioCell, + StatusCell, } from 'teleport/Discover/Shared'; -import cfg from 'teleport/config'; - import { CheckedEksCluster } from './EnrollEksCluster'; type Props = { diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEKSCluster.test.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEKSCluster.test.tsx index 2b92c007131d8..e11d8383df096 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEKSCluster.test.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEKSCluster.test.tsx @@ -17,21 +17,22 @@ */ import React from 'react'; -import { render, screen, fireEvent, act } from 'design/utils/testing'; +import { act, fireEvent, render, screen } from 'design/utils/testing'; + +import cfg from 'teleport/config'; +import { ComponentWrapper } from 'teleport/Discover/Fixtures/kubernetes'; +import * as discoveryService from 'teleport/services/discovery/discovery'; +import { + DEFAULT_DISCOVERY_GROUP_NON_CLOUD, + DISCOVERY_GROUP_CLOUD, +} from 'teleport/services/discovery/discovery'; import { AwsEksCluster, integrationService, } from 'teleport/services/integrations'; -import { userEventService } from 'teleport/services/userEvent'; import KubeService from 'teleport/services/kube/kube'; -import * as discoveryService from 'teleport/services/discovery/discovery'; -import { ComponentWrapper } from 'teleport/Discover/Fixtures/kubernetes'; -import cfg from 'teleport/config'; -import { - DISCOVERY_GROUP_CLOUD, - DEFAULT_DISCOVERY_GROUP_NON_CLOUD, -} from 'teleport/services/discovery/discovery'; +import { userEventService } from 'teleport/services/userEvent'; import { EnrollEksCluster } from './EnrollEksCluster'; diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.story.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.story.tsx index 308bfb5319343..7a46420f1799b 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.story.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.story.tsx @@ -15,33 +15,31 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React, { useEffect } from 'react'; - import { MemoryRouter } from 'react-router'; import { Info } from 'design/Alert'; -import { rest } from 'msw'; -import { initialize, mswLoader } from 'msw-storybook-addon'; - import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { - AwsEksCluster, - IntegrationKind, - IntegrationStatusCode, -} from 'teleport/services/integrations'; +import { ResourceKind } from 'teleport/Discover/Shared'; +import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; +import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { DiscoverContextState, DiscoverProvider, } from 'teleport/Discover/useDiscover'; import { createTeleportContext, getUserContext } from 'teleport/mocks/contexts'; -import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; -import { ResourceKind } from 'teleport/Discover/Shared'; +import { + AwsEksCluster, + IntegrationKind, + IntegrationStatusCode, +} from 'teleport/services/integrations'; import { INTERNAL_RESOURCE_ID_LABEL_KEY } from 'teleport/services/joinToken'; -import { DiscoverEventResource } from 'teleport/services/userEvent/types'; import { Kube } from 'teleport/services/kube'; -import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; +import { DiscoverEventResource } from 'teleport/services/userEvent/types'; import { EnrollEksCluster } from './EnrollEksCluster'; diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.tsx index c1e7cfeab5768..6c3dc50698f1d 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollEksCluster.tsx @@ -16,55 +16,51 @@ * along with this program. If not, see . */ -import React, { useState, useCallback } from 'react'; -import { Box, ButtonPrimary, ButtonText, Link, Text, Toggle } from 'design'; +import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; -import { FetchStatus } from 'design/DataTable/types'; -import { Danger } from 'design/Alert'; -import useAttempt from 'shared/hooks/useAttemptNext'; +import { Box, ButtonPrimary, ButtonText, Link, Text, Toggle } from 'design'; +import { Danger } from 'design/Alert'; +import { FetchStatus } from 'design/DataTable/types'; import { ToolTipInfo } from 'shared/components/ToolTip'; +import useAttempt from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; -import { EksMeta, useDiscover } from 'teleport/Discover/useDiscover'; -import { - Regions, - integrationService, - AwsEksCluster, -} from 'teleport/services/integrations'; - -import { - DISCOVERY_GROUP_CLOUD, - DEFAULT_DISCOVERY_GROUP_NON_CLOUD, - DiscoveryConfig, - createDiscoveryConfig, -} from 'teleport/services/discovery'; -import { AwsRegionSelector } from 'teleport/Discover/Shared/AwsRegionSelector'; +import cfg from 'teleport/config'; +import { generateCmd } from 'teleport/Discover/Kubernetes/HelmChart/HelmChart'; import { ConfigureIamPerms } from 'teleport/Discover/Shared/Aws/ConfigureIamPerms'; import { isIamPermError } from 'teleport/Discover/Shared/Aws/error'; -import { AgentStepProps } from 'teleport/Discover/types'; -import useTeleport from 'teleport/useTeleport'; - -import { generateCmd } from 'teleport/Discover/Kubernetes/HelmChart/HelmChart'; -import { Kube } from 'teleport/services/kube'; - -import { JoinToken } from 'teleport/services/joinToken'; -import cfg from 'teleport/config'; +import { AwsRegionSelector } from 'teleport/Discover/Shared/AwsRegionSelector'; import { ConfigureDiscoveryServiceDirections, CreatedDiscoveryConfigDialog, } from 'teleport/Discover/Shared/ConfigureDiscoveryService'; +import { AgentStepProps } from 'teleport/Discover/types'; +import { EksMeta, useDiscover } from 'teleport/Discover/useDiscover'; +import { + createDiscoveryConfig, + DEFAULT_DISCOVERY_GROUP_NON_CLOUD, + DISCOVERY_GROUP_CLOUD, + DiscoveryConfig, +} from 'teleport/services/discovery'; +import { + AwsEksCluster, + integrationService, + Regions, +} from 'teleport/services/integrations'; +import { JoinToken } from 'teleport/services/joinToken'; +import { Kube } from 'teleport/services/kube'; import { DiscoverEvent, DiscoverEventStatus, } from 'teleport/services/userEvent'; +import useTeleport from 'teleport/useTeleport'; import { ActionButtons, Header } from '../../Shared'; - +import { AgentWaitingDialog } from './AgentWaitingDialog'; import { ClustersList } from './EksClustersList'; -import ManualHelmDialog from './ManualHelmDialog'; import { EnrollmentDialog } from './EnrollmentDialog'; -import { AgentWaitingDialog } from './AgentWaitingDialog'; +import ManualHelmDialog from './ManualHelmDialog'; type TableData = { items: CheckedEksCluster[]; diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollmentDialog.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollmentDialog.tsx index 8b7d89cf0d6f2..15533b50c7394 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollmentDialog.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/EnrollmentDialog.tsx @@ -16,16 +16,16 @@ * along with this program. If not, see . */ import React from 'react'; + import { AnimatedProgressBar, ButtonPrimary, - Text, - Flex, ButtonSecondary, + Flex, + Text, } from 'design'; - -import * as Icons from 'design/Icon'; import Dialog, { DialogContent } from 'design/DialogConfirmation'; +import * as Icons from 'design/Icon'; import { TextIcon } from 'teleport/Discover/Shared'; diff --git a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/ManualHelmDialog.tsx b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/ManualHelmDialog.tsx index f77f134f79acc..eb3b471f7b7b5 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/ManualHelmDialog.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/EnrollEKSCluster/ManualHelmDialog.tsx @@ -16,29 +16,26 @@ * along with this program. If not, see . */ -import Dialog, { DialogContent, DialogFooter } from 'design/DialogConfirmation'; +import React, { Suspense, useEffect, useState } from 'react'; +import styled from 'styled-components'; + import { Box, - Flex, ButtonPrimary, ButtonSecondary, - Text, + Flex, Indicator, + Text, } from 'design'; - -import React, { Suspense, useState, useEffect } from 'react'; - -import styled from 'styled-components'; - +import Dialog, { DialogContent, DialogFooter } from 'design/DialogConfirmation'; import * as Icons from 'design/Icon'; +import { CatchError } from 'teleport/components/CatchError'; import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; +import { ResourceKind, TextIcon } from 'teleport/Discover/Shared'; import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; - import { useJoinTokenSuspender } from 'teleport/Discover/Shared/useJoinTokenSuspender'; -import { ResourceKind, TextIcon } from 'teleport/Discover/Shared'; import { JoinToken } from 'teleport/services/joinToken'; -import { CatchError } from 'teleport/components/CatchError'; type ManualHelmDialogProps = { setJoinTokenAndGetCommand(token: JoinToken): string; diff --git a/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.story.tsx b/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.story.tsx index 6640a041a6c56..82c125414ab2e 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.story.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.story.tsx @@ -19,11 +19,11 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { Context as TeleportContext, ContextProvider } from 'teleport'; +import { ContextProvider, Context as TeleportContext } from 'teleport'; import cfg from 'teleport/config'; import { ResourceKind } from 'teleport/Discover/Shared'; -import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; +import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { getUserContext } from 'teleport/mocks/contexts'; import HelmChart from './HelmChart'; diff --git a/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx b/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx index d3dba75b8e1f9..a48caa4608ea5 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx @@ -18,29 +18,31 @@ import React, { Suspense, useState } from 'react'; import styled from 'styled-components'; -import { Box, ButtonSecondary, Link, Text, Mark } from 'design'; + +import { Box, ButtonSecondary, Link, Mark, Text } from 'design'; import * as Icons from 'design/Icon'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; -import { ResourceLabel } from 'teleport/services/agents'; -import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; import { CatchError } from 'teleport/components/CatchError'; -import { - clearCachedJoinTokenResult, - useJoinTokenSuspender, -} from 'teleport/Discover/Shared/useJoinTokenSuspender'; -import useTeleport from 'teleport/useTeleport'; -import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; - +import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; +import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; import { HintBox, SuccessBox, WaitingInfo, } from 'teleport/Discover/Shared/HintBox'; - -import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; +import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; +import { + clearCachedJoinTokenResult, + useJoinTokenSuspender, +} from 'teleport/Discover/Shared/useJoinTokenSuspender'; +import type { AgentMeta, KubeMeta } from 'teleport/Discover/useDiscover'; +import { ResourceLabel } from 'teleport/services/agents'; +import type { JoinRole, JoinToken } from 'teleport/services/joinToken'; +import type { Kube } from 'teleport/services/kube'; +import useTeleport from 'teleport/useTeleport'; import { ActionButtons, @@ -50,11 +52,7 @@ import { TextIcon, useShowHint, } from '../../Shared'; - import type { AgentStepProps } from '../../types'; -import type { JoinRole, JoinToken } from 'teleport/services/joinToken'; -import type { AgentMeta, KubeMeta } from 'teleport/Discover/useDiscover'; -import type { Kube } from 'teleport/services/kube'; export default function Container(props: AgentStepProps) { const [namespace, setNamespace] = useState(''); diff --git a/web/packages/teleport/src/Discover/Kubernetes/KubeWrapper.tsx b/web/packages/teleport/src/Discover/Kubernetes/KubeWrapper.tsx index c9496892e2d53..7f5d20bb73bcd 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/KubeWrapper.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/KubeWrapper.tsx @@ -19,7 +19,6 @@ import React, { useEffect } from 'react'; import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; - import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { ResourceKind } from '../Shared'; diff --git a/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.story.tsx b/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.story.tsx index f88fc7b688c45..707cbd3ac3c30 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.story.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.story.tsx @@ -19,12 +19,13 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initSelectedOptionsHelper } from 'teleport/Discover/Shared/SetupAccess'; +import { + initSelectedOptionsHelper, + type State, +} from 'teleport/Discover/Shared/SetupAccess'; import { SetupAccess } from './SetupAccess'; -import type { State } from 'teleport/Discover/Shared/SetupAccess'; - export default { title: 'Teleport/Discover/Kube/SetupAccess', }; diff --git a/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.tsx b/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.tsx index 4c071b92b28ae..93b61b059ff0f 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/SetupAccess.tsx @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; + import { Box, Text } from 'design'; import { - SelectCreatable, Option, + SelectCreatable, } from 'teleport/Discover/Shared/SelectCreatable'; import { - useUserTraits, SetupAccessWrapper, + useUserTraits, + type State, } from 'teleport/Discover/Shared/SetupAccess'; -import type { State } from 'teleport/Discover/Shared/SetupAccess'; - export default function Container() { const state = useUserTraits(); return ; diff --git a/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/index.ts b/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/index.ts index 9dff28d2505a0..dff3646fb943b 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/index.ts +++ b/web/packages/teleport/src/Discover/Kubernetes/SetupAccess/index.ts @@ -17,4 +17,5 @@ */ import SetupAccess from './SetupAccess'; + export { SetupAccess }; diff --git a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.story.tsx b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.story.tsx index 7dbf24c89ae40..12333e74701a8 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.story.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.story.tsx @@ -20,7 +20,6 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { TestConnection } from './TestConnection'; - import type { State } from './useTestConnection'; export default { diff --git a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx index f674012789724..39ce381610536 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx @@ -17,31 +17,29 @@ */ import React, { useState } from 'react'; -import { Text, Box } from 'design'; -import Validation, { Validator } from 'shared/components/Validation'; + +import { Box, Text } from 'design'; import FieldInput from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import FieldSelect from 'shared/components/FieldSelect'; import { Option } from 'shared/components/Select'; +import Validation, { Validator } from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; +import ReAuthenticate from 'teleport/components/ReAuthenticate'; import TextSelectCopy from 'teleport/components/TextSelectCopy'; import { generateTshLoginCommand } from 'teleport/lib/util'; -import ReAuthenticate from 'teleport/components/ReAuthenticate'; - +import type { KubeImpersonation } from 'teleport/services/agents'; import { MfaChallengeScope } from 'teleport/services/auth/auth'; import { ActionButtons, - HeaderSubtitle, - Header, ConnectionDiagnosticResult, + Header, + HeaderSubtitle, StyledBox, } from '../../Shared'; - -import { useTestConnection, State } from './useTestConnection'; - import type { AgentStepProps } from '../../types'; -import type { KubeImpersonation } from 'teleport/services/agents'; +import { State, useTestConnection } from './useTestConnection'; /** * @deprecated Refactor Discover/Kubernetes/TestConnection away from the container component diff --git a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/index.ts b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/index.ts index a3d519d9b3727..4e3dbecca4936 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/index.ts +++ b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/index.ts @@ -17,4 +17,5 @@ */ import TestConnection from './TestConnection'; + export { TestConnection }; diff --git a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/useTestConnection.ts b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/useTestConnection.ts index 4c182604a85af..b600124e4149d 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/useTestConnection.ts +++ b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/useTestConnection.ts @@ -17,13 +17,12 @@ */ import { useConnectionDiagnostic } from 'teleport/Discover/Shared'; - -import { KubeMeta } from '../../useDiscover'; - import type { KubeImpersonation } from 'teleport/services/agents'; -import type { AgentStepProps } from '../../types'; import type { MfaAuthnResponse } from 'teleport/services/mfa'; +import type { AgentStepProps } from '../../types'; +import { KubeMeta } from '../../useDiscover'; + /** * @deprecated Refactor Discover/Kubernetes/TestConnection away from the container component * pattern. See https://github.com/gravitational/teleport/pull/34952. diff --git a/web/packages/teleport/src/Discover/Kubernetes/index.tsx b/web/packages/teleport/src/Discover/Kubernetes/index.tsx index 1b9367deba1af..347569b7ef50c 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/index.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/index.tsx @@ -18,15 +18,15 @@ import React from 'react'; -import { AwsAccount, Finished, ResourceKind } from 'teleport/Discover/Shared'; import { ResourceViewConfig } from 'teleport/Discover/flow'; -import { DiscoverEvent } from 'teleport/services/userEvent'; -import { KubeLocation, ResourceSpec } from 'teleport/Discover/SelectResource'; import { EnrollEksCluster } from 'teleport/Discover/Kubernetes/EnrollEKSCluster'; +import { KubeLocation, ResourceSpec } from 'teleport/Discover/SelectResource'; +import { AwsAccount, Finished, ResourceKind } from 'teleport/Discover/Shared'; +import { DiscoverEvent } from 'teleport/services/userEvent'; +import { HelmChart } from './HelmChart'; import { KubeWrapper } from './KubeWrapper'; import { SetupAccess } from './SetupAccess'; -import { HelmChart } from './HelmChart'; import { TestConnection } from './TestConnection'; export const KubernetesResource: ResourceViewConfig = { diff --git a/web/packages/teleport/src/Discover/SelectResource/PermissionsErrorMessage.tsx b/web/packages/teleport/src/Discover/SelectResource/PermissionsErrorMessage.tsx index bcc97de3a4cce..e24f4e149079b 100644 --- a/web/packages/teleport/src/Discover/SelectResource/PermissionsErrorMessage.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/PermissionsErrorMessage.tsx @@ -17,10 +17,10 @@ */ import React from 'react'; -import { Text, Box } from 'design'; -import { ResourceKind } from '../Shared'; +import { Box, Text } from 'design'; +import { ResourceKind } from '../Shared'; import { ResourceSpec } from './types'; export function PermissionsErrorMessage({ diff --git a/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.test.tsx b/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.test.tsx index 767b71b60af5b..6ba0cff410123 100644 --- a/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.test.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.test.tsx @@ -17,17 +17,18 @@ */ import React from 'react'; -import { render } from 'design/utils/testing'; + import { UserAgent } from 'design/platform'; +import { render } from 'design/utils/testing'; -import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; +import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; import { AllAccess, + InitRouteEntryServer, NoAccess, PartialAccess, - InitRouteEntryServer, } from './SelectResource.story'; beforeEach(() => { diff --git a/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.tsx b/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.tsx index f9de6452bf2f3..517792f6090d5 100644 --- a/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/SelectResource.story.tsx @@ -20,21 +20,17 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { Resource } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; - import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; +import { ContextProvider } from 'teleport'; import { createTeleportContext, getAcl, noAccess, } from 'teleport/mocks/contexts'; -import { ContextProvider } from 'teleport'; - -import { UserContext } from 'teleport/User/UserContext'; - -import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/userPreferences'; - import { Acl } from 'teleport/services/user'; +import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/userPreferences'; +import { UserContext } from 'teleport/User/UserContext'; import { SelectResource } from './SelectResource'; diff --git a/web/packages/teleport/src/Discover/SelectResource/SelectResource.test.tsx b/web/packages/teleport/src/Discover/SelectResource/SelectResource.test.tsx index b457cd50a1859..b008845dc52bd 100644 --- a/web/packages/teleport/src/Discover/SelectResource/SelectResource.test.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/SelectResource.test.tsx @@ -17,19 +17,16 @@ */ import { Platform, UserAgent } from 'design/platform'; - import { OnboardUserPreferences, Resource, } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; -import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/userPreferences'; - import { OnboardDiscover } from 'teleport/services/user'; +import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/userPreferences'; import { ResourceKind } from '../Shared'; import { resourceKindToPreferredResource } from '../Shared/ResourceKind'; - import { filterResources, sortResources } from './SelectResource'; import { ResourceSpec } from './types'; diff --git a/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx b/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx index 46c4694d9ffa2..91984654233eb 100644 --- a/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/SelectResource.tsx @@ -18,43 +18,41 @@ import React, { useEffect, useState } from 'react'; import { useHistory, useLocation } from 'react-router'; - -import * as Icons from 'design/Icon'; import styled from 'styled-components'; + import { Box, Flex, Link, Text } from 'design'; +import * as Icons from 'design/Icon'; import { getPlatform, Platform } from 'design/platform'; - -import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; - import { Resource } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; +import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; -import useTeleport from 'teleport/useTeleport'; +import AddApp from 'teleport/Apps/AddApp'; import { ToolTipNoPermBadge } from 'teleport/components/ToolTipNoPermBadge'; -import { Acl, AuthType, OnboardDiscover } from 'teleport/services/user'; +import cfg from 'teleport/config'; +import { + BASE_RESOURCES, + getResourcePretitle, +} from 'teleport/Discover/SelectResource/resources'; import { Header, HeaderSubtitle, PermissionsErrorMessage, ResourceKind, } from 'teleport/Discover/Shared'; -import { - BASE_RESOURCES, - getResourcePretitle, -} from 'teleport/Discover/SelectResource/resources'; -import AddApp from 'teleport/Apps/AddApp'; -import { useUser } from 'teleport/User/UserContext'; -import { storageService } from 'teleport/services/storageService'; -import cfg from 'teleport/config'; - import { resourceKindToPreferredResource } from 'teleport/Discover/Shared/ResourceKind'; +import { storageService } from 'teleport/services/storageService'; +import { Acl, AuthType, OnboardDiscover } from 'teleport/services/user'; +import { useUser } from 'teleport/User/UserContext'; +import useTeleport from 'teleport/useTeleport'; import { getMarketingTermMatches } from './getMarketingTermMatches'; import { DiscoverIcon } from './icons'; - -import { PrioritizedResources, SearchResource } from './types'; import { SAML_APPLICATIONS } from './resourcesE'; - -import type { ResourceSpec } from './types'; +import { + PrioritizedResources, + SearchResource, + type ResourceSpec, +} from './types'; interface SelectResourceProps { onSelect: (resource: ResourceSpec) => void; diff --git a/web/packages/teleport/src/Discover/SelectResource/databases.tsx b/web/packages/teleport/src/Discover/SelectResource/databases.tsx index 388bfcc9be684..6b38097f32c40 100644 --- a/web/packages/teleport/src/Discover/SelectResource/databases.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/databases.tsx @@ -16,15 +16,13 @@ * along with this program. If not, see . */ -import { DbProtocol } from 'shared/services/databases'; - import { Platform } from 'design/platform'; +import { DbProtocol } from 'shared/services/databases'; import { DiscoverEventResource } from 'teleport/services/userEvent'; import { ResourceKind } from '../Shared/ResourceKind'; - -import { ResourceSpec, DatabaseLocation, DatabaseEngine } from './types'; +import { DatabaseEngine, DatabaseLocation, ResourceSpec } from './types'; const baseDatabaseKeywords = 'db database databases'; const awsKeywords = baseDatabaseKeywords + 'aws amazon web services'; diff --git a/web/packages/teleport/src/Discover/SelectResource/resources.tsx b/web/packages/teleport/src/Discover/SelectResource/resources.tsx index 56bf1a77f1aec..3267055fb092e 100644 --- a/web/packages/teleport/src/Discover/SelectResource/resources.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/resources.tsx @@ -17,7 +17,6 @@ */ import { Platform } from 'design/platform'; - import { assertUnreachable } from 'shared/utils/assertUnreachable'; import { @@ -26,7 +25,6 @@ import { } from 'teleport/services/userEvent'; import { ResourceKind } from '../Shared/ResourceKind'; - import { DATABASES, DATABASES_UNGUIDED, diff --git a/web/packages/teleport/src/Discover/SelectResource/resourcesE.tsx b/web/packages/teleport/src/Discover/SelectResource/resourcesE.tsx index 25a0d7f9e3a11..e6186c866c15c 100644 --- a/web/packages/teleport/src/Discover/SelectResource/resourcesE.tsx +++ b/web/packages/teleport/src/Discover/SelectResource/resourcesE.tsx @@ -16,11 +16,10 @@ * along with this program. If not, see . */ -import { DiscoverEventResource } from 'teleport/services/userEvent'; import { SamlServiceProviderPreset } from 'teleport/services/samlidp/types'; +import { DiscoverEventResource } from 'teleport/services/userEvent'; import { ResourceKind } from '../Shared'; - import { ResourceSpec } from './types'; export const SAML_APPLICATIONS: ResourceSpec[] = [ diff --git a/web/packages/teleport/src/Discover/SelectResource/types.ts b/web/packages/teleport/src/Discover/SelectResource/types.ts index d1ce98b55b261..87ab84eb420aa 100644 --- a/web/packages/teleport/src/Discover/SelectResource/types.ts +++ b/web/packages/teleport/src/Discover/SelectResource/types.ts @@ -17,21 +17,18 @@ */ import { Platform } from 'design/platform'; - +import type { ResourceIconName } from 'design/ResourceIcon'; import { Resource } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; -import { AuthType } from 'teleport/services/user'; import { RdsEngineIdentifier } from 'teleport/services/integrations'; - -import { ResourceKind } from '../Shared/ResourceKind'; - +import type { SamlServiceProviderPreset } from 'teleport/services/samlidp/types'; +import { AuthType } from 'teleport/services/user'; import type { DiscoverDiscoveryConfigMethod, DiscoverEventResource, } from 'teleport/services/userEvent'; -import type { ResourceIconName } from 'design/ResourceIcon'; -import type { SamlServiceProviderPreset } from 'teleport/services/samlidp/types'; +import { ResourceKind } from '../Shared/ResourceKind'; export enum DatabaseLocation { Aws, diff --git a/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.story.tsx b/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.story.tsx index 2b04302436b95..c359c013b4598 100644 --- a/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.story.tsx +++ b/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.story.tsx @@ -16,21 +16,20 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; - import { Info } from 'design/Alert'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { Ec2InstanceConnectEndpoint, IntegrationKind, diff --git a/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.tsx b/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.tsx index 8d221177d77cf..459b7631d0002 100644 --- a/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.tsx +++ b/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2Ice.tsx @@ -16,32 +16,32 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import Table from 'design/DataTable'; -import { Box, Indicator, Text, Flex } from 'design'; -import { Warning } from 'design/Icon'; +import React, { useEffect, useState } from 'react'; + +import { Box, Flex, Indicator, Text } from 'design'; import { Danger } from 'design/Alert'; +import Table from 'design/DataTable'; import { FetchStatus } from 'design/DataTable/types'; - +import { Warning } from 'design/Icon'; import useAttempt, { Attempt } from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; +import { + ActionButtons, + ButtonBlueText, + Header, + SecurityGroupPicker, +} from 'teleport/Discover/Shared'; +import { NodeMeta, useDiscover } from 'teleport/Discover/useDiscover'; import { AwsOidcDeployEc2InstanceConnectEndpointRequest, - SecurityGroup, integrationService, + SecurityGroup, } from 'teleport/services/integrations'; import { DiscoverEvent, DiscoverEventStatus, } from 'teleport/services/userEvent'; -import { NodeMeta, useDiscover } from 'teleport/Discover/useDiscover'; -import { - ActionButtons, - ButtonBlueText, - Header, - SecurityGroupPicker, -} from 'teleport/Discover/Shared'; import { CreateEc2IceDialog } from './CreateEc2IceDialog'; diff --git a/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2IceDialog.tsx b/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2IceDialog.tsx index d325d99b3b123..a912b64239b62 100644 --- a/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2IceDialog.tsx +++ b/web/packages/teleport/src/Discover/Server/CreateEc2Ice/CreateEc2IceDialog.tsx @@ -16,37 +16,35 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; + import { - Text, - Flex, AnimatedProgressBar, + Box, ButtonPrimary, + Flex, Link, - Box, Mark, + Text, } from 'design'; -import * as Icons from 'design/Icon'; import Dialog, { DialogContent } from 'design/DialogConfirmation'; - -import { getErrMessage } from 'shared/utils/errorType'; - +import * as Icons from 'design/Icon'; import useAttempt, { Attempt } from 'shared/hooks/useAttemptNext'; +import { getErrMessage } from 'shared/utils/errorType'; import cfg from 'teleport/config'; -import useTeleport from 'teleport/useTeleport'; - +import { TextIcon } from 'teleport/Discover/Shared'; +import { usePoll } from 'teleport/Discover/Shared/usePoll'; +import { NodeMeta, useDiscover } from 'teleport/Discover/useDiscover'; import { Ec2InstanceConnectEndpoint, integrationService, } from 'teleport/services/integrations'; -import { TextIcon } from 'teleport/Discover/Shared'; -import { NodeMeta, useDiscover } from 'teleport/Discover/useDiscover'; -import { usePoll } from 'teleport/Discover/Shared/usePoll'; import { DiscoverEvent, DiscoverEventStatus, } from 'teleport/services/userEvent'; +import useTeleport from 'teleport/useTeleport'; export function CreateEc2IceDialog({ nextStep, diff --git a/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigCreatedDialog.tsx b/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigCreatedDialog.tsx index 4146162067ad5..9e0ec562dddbd 100644 --- a/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigCreatedDialog.tsx +++ b/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigCreatedDialog.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { Text, Flex, ButtonPrimary, Box } from 'design'; -import * as Icons from 'design/Icon'; + +import { Box, ButtonPrimary, Flex, Text } from 'design'; import Dialog, { DialogContent } from 'design/DialogConfirmation'; +import * as Icons from 'design/Icon'; export function DiscoveryConfigCreatedDialog({ toNextStep, diff --git a/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.story.tsx b/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.story.tsx index bc4a4db243854..95d1489ca2c8e 100644 --- a/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.story.tsx +++ b/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.story.tsx @@ -16,29 +16,30 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React, { useEffect } from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; + import { Info } from 'design/Alert'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; +import { ServerLocation } from 'teleport/Discover/SelectResource'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; -import { ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverDiscoveryConfigMethod, DiscoverEventResource, } from 'teleport/services/userEvent'; -import { ServerLocation } from 'teleport/Discover/SelectResource'; import { DiscoveryConfigSsm } from './DiscoveryConfigSsm'; diff --git a/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.tsx b/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.tsx index f4e9ceb9cc55e..0f7d18e864a91 100644 --- a/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.tsx +++ b/web/packages/teleport/src/Discover/Server/DiscoveryConfigSsm/DiscoveryConfigSsm.tsx @@ -16,47 +16,45 @@ * along with this program. If not, see . */ -import React, { useState, useRef } from 'react'; +import React, { useRef, useState } from 'react'; +import styled from 'styled-components'; + import { Box, + ButtonSecondary, Link as ExternalLink, - Text, Flex, - ButtonSecondary, Mark, + Text, } from 'design'; -import styled from 'styled-components'; import { Danger, Info } from 'design/Alert'; +import FieldInput from 'shared/components/FieldInput'; import TextEditor from 'shared/components/TextEditor'; +import { TextSelectCopyMulti } from 'shared/components/TextSelectCopy'; import { ToolTipInfo } from 'shared/components/ToolTip'; -import FieldInput from 'shared/components/FieldInput'; -import { Rule } from 'shared/components/Validation/rules'; import Validation, { Validator } from 'shared/components/Validation'; +import { Rule } from 'shared/components/Validation/rules'; import { makeEmptyAttempt, useAsync } from 'shared/hooks/useAsync'; -import { TextSelectCopyMulti } from 'shared/components/TextSelectCopy'; import cfg from 'teleport/config'; -import { useDiscover } from 'teleport/Discover/useDiscover'; -import { Regions } from 'teleport/services/integrations'; import { AwsRegionSelector } from 'teleport/Discover/Shared/AwsRegionSelector'; -import JoinTokenService, { JoinToken } from 'teleport/services/joinToken'; - +import { useDiscover } from 'teleport/Discover/useDiscover'; import { - DISCOVERY_GROUP_CLOUD, createDiscoveryConfig, + DISCOVERY_GROUP_CLOUD, InstallParamEnrollMode, } from 'teleport/services/discovery'; +import { Regions } from 'teleport/services/integrations'; import { splitAwsIamArn } from 'teleport/services/integrations/aws'; -import useStickyClusterId from 'teleport/useStickyClusterId'; +import JoinTokenService, { JoinToken } from 'teleport/services/joinToken'; import { DiscoverEvent, DiscoverEventStatus, } from 'teleport/services/userEvent'; +import useStickyClusterId from 'teleport/useStickyClusterId'; import { ActionButtons, Header, StyledBox } from '../../Shared'; - import { SingleEc2InstanceInstallation } from '../Shared'; - import { DiscoveryConfigCreatedDialog } from './DiscoveryConfigCreatedDialog'; const IAM_POLICY_NAME = 'EC2DiscoverWithSSM'; diff --git a/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.story.tsx b/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.story.tsx index ff621886485e3..bf833f3193248 100644 --- a/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.story.tsx +++ b/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.story.tsx @@ -19,13 +19,12 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { Context as TeleportContext, ContextProvider } from 'teleport'; +import { ContextProvider, Context as TeleportContext } from 'teleport'; import cfg from 'teleport/config'; -import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; +import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { userContext } from 'teleport/Main/fixtures'; -import { ResourceKind } from 'teleport/Discover/Shared'; - import { UserContextProvider } from 'teleport/User'; import DownloadScript from './DownloadScript'; diff --git a/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.tsx b/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.tsx index f334860f3c019..b67c4ad3e8949 100644 --- a/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.tsx +++ b/web/packages/teleport/src/Discover/Server/DownloadScript/DownloadScript.tsx @@ -18,39 +18,34 @@ import React, { Suspense, useEffect, useState } from 'react'; -import { Box, Indicator, Text, Mark } from 'design'; +import { Box, Indicator, Mark, Text } from 'design'; import * as Icons from 'design/Icon'; -import cfg from 'teleport/config'; import { CatchError } from 'teleport/components/CatchError'; -import { - clearCachedJoinTokenResult, - useJoinTokenSuspender, -} from 'teleport/Discover/Shared/useJoinTokenSuspender'; -import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; -import { JoinToken } from 'teleport/services/joinToken'; - import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; - +import cfg from 'teleport/config'; import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; - import { HintBox, SuccessBox, WaitingInfo, } from 'teleport/Discover/Shared/HintBox'; - -import { AgentStepProps } from '../../types'; +import { usePingTeleport } from 'teleport/Discover/Shared/PingTeleportContext'; +import { + clearCachedJoinTokenResult, + useJoinTokenSuspender, +} from 'teleport/Discover/Shared/useJoinTokenSuspender'; +import { JoinToken } from 'teleport/services/joinToken'; +import type { Node } from 'teleport/services/nodes'; import { ActionButtons, - HeaderSubtitle, Header, + HeaderSubtitle, ResourceKind, TextIcon, } from '../../Shared'; - -import type { Node } from 'teleport/services/nodes'; +import { AgentStepProps } from '../../types'; const SHOW_HINT_TIMEOUT = 1000 * 60 * 5; // 5 minutes diff --git a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/Ec2InstanceList.tsx b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/Ec2InstanceList.tsx index 6e5550c875d8f..95a68794cfc3e 100644 --- a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/Ec2InstanceList.tsx +++ b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/Ec2InstanceList.tsx @@ -17,16 +17,17 @@ */ import React from 'react'; + import { Text } from 'design'; import Table from 'design/DataTable'; import { FetchStatus } from 'design/DataTable/types'; import { Attempt } from 'shared/hooks/useAttemptNext'; import { - RadioCell, DisableableCell as Cell, - Labels, labelMatcher, + Labels, + RadioCell, } from 'teleport/Discover/Shared'; import { CheckedEc2Instance } from './EnrollEc2Instance'; diff --git a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.story.tsx b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.story.tsx index 71aed7b0563d8..850493340d28a 100644 --- a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.story.tsx +++ b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.story.tsx @@ -16,20 +16,20 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React, { useEffect } from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; import { Info } from 'design/Alert'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { Ec2InstanceConnectEndpoint, IntegrationKind, diff --git a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.test.tsx b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.test.tsx index ef24148144715..e986a6a9e5c07 100644 --- a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.test.tsx +++ b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.test.tsx @@ -18,39 +18,39 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import { + act, + fireEvent, render, screen, - fireEvent, - act, userEvent, } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; -import { - Ec2InstanceConnectEndpoint, - IntegrationKind, - IntegrationStatusCode, - integrationService, -} from 'teleport/services/integrations'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import cfg from 'teleport/config'; -import TeleportContext from 'teleport/teleportContext'; import { DiscoverContextState, DiscoverProvider, NodeMeta, } from 'teleport/Discover/useDiscover'; import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import * as discoveryApi from 'teleport/services/discovery/discovery'; +import { DEFAULT_DISCOVERY_GROUP_NON_CLOUD } from 'teleport/services/discovery/discovery'; +import { + Ec2InstanceConnectEndpoint, + IntegrationKind, + integrationService, + IntegrationStatusCode, +} from 'teleport/services/integrations'; import { Node } from 'teleport/services/nodes'; - import { DiscoverEvent, DiscoverEventStatus, userEventService, } from 'teleport/services/userEvent'; -import * as discoveryApi from 'teleport/services/discovery/discovery'; -import { DEFAULT_DISCOVERY_GROUP_NON_CLOUD } from 'teleport/services/discovery/discovery'; +import TeleportContext from 'teleport/teleportContext'; import { EnrollEc2Instance } from './EnrollEc2Instance'; diff --git a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.tsx b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.tsx index 3e982d9d63c27..94df30bcb7c10 100644 --- a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.tsx +++ b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/EnrollEc2Instance.tsx @@ -17,50 +17,47 @@ */ import React, { useState } from 'react'; -import { Box, Link as ExternalLink, Text, Toggle } from 'design'; import { Link as InternalLink } from 'react-router-dom'; import styled from 'styled-components'; -import { FetchStatus } from 'design/DataTable/types'; -import useAttempt from 'shared/hooks/useAttemptNext'; + +import { Box, Link as ExternalLink, Text, Toggle } from 'design'; import { Danger } from 'design/Alert'; import { OutlineInfo } from 'design/Alert/Alert'; +import { FetchStatus } from 'design/DataTable/types'; import { Info } from 'design/Icon'; - -import { getErrMessage } from 'shared/utils/errorType'; import { ToolTipInfo } from 'shared/components/ToolTip'; +import useAttempt from 'shared/hooks/useAttemptNext'; +import { getErrMessage } from 'shared/utils/errorType'; -import useTeleport from 'teleport/useTeleport'; import cfg from 'teleport/config'; +import { ConfigureIamPerms } from 'teleport/Discover/Shared/Aws/ConfigureIamPerms'; +import { + getAttemptsOneOfErrorMsg, + isIamPermError, +} from 'teleport/Discover/Shared/Aws/error'; +import { AwsRegionSelector } from 'teleport/Discover/Shared/AwsRegionSelector'; +import { ConfigureDiscoveryServiceDirections } from 'teleport/Discover/Shared/ConfigureDiscoveryService'; import { NodeMeta, useDiscover } from 'teleport/Discover/useDiscover'; +import { + createDiscoveryConfig, + DEFAULT_DISCOVERY_GROUP_NON_CLOUD, + DISCOVERY_GROUP_CLOUD, + DiscoveryConfig, +} from 'teleport/services/discovery'; import { Ec2InstanceConnectEndpoint, - Regions, integrationService, + Regions, } from 'teleport/services/integrations'; -import { AwsRegionSelector } from 'teleport/Discover/Shared/AwsRegionSelector'; import { Node } from 'teleport/services/nodes'; - import { DiscoverEvent, DiscoverEventStatus, } from 'teleport/services/userEvent'; -import { - DISCOVERY_GROUP_CLOUD, - DEFAULT_DISCOVERY_GROUP_NON_CLOUD, - DiscoveryConfig, - createDiscoveryConfig, -} from 'teleport/services/discovery'; -import { - getAttemptsOneOfErrorMsg, - isIamPermError, -} from 'teleport/Discover/Shared/Aws/error'; -import { ConfigureIamPerms } from 'teleport/Discover/Shared/Aws/ConfigureIamPerms'; -import { ConfigureDiscoveryServiceDirections } from 'teleport/Discover/Shared/ConfigureDiscoveryService'; +import useTeleport from 'teleport/useTeleport'; import { ActionButtons, Header } from '../../Shared'; - import { CreateEc2IceDialog } from '../CreateEc2Ice/CreateEc2IceDialog'; - import { Ec2InstanceList } from './Ec2InstanceList'; import { NoEc2IceRequiredDialog } from './NoEc2IceRequiredDialog'; diff --git a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/NoEc2IceRequiredDialog.tsx b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/NoEc2IceRequiredDialog.tsx index cc032085b09fa..355a88e98db85 100644 --- a/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/NoEc2IceRequiredDialog.tsx +++ b/web/packages/teleport/src/Discover/Server/EnrollEc2Instance/NoEc2IceRequiredDialog.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { Text, Flex, ButtonPrimary, Mark } from 'design'; -import * as Icons from 'design/Icon'; + +import { ButtonPrimary, Flex, Mark, Text } from 'design'; import Dialog, { DialogContent } from 'design/DialogConfirmation'; +import * as Icons from 'design/Icon'; import { NodeMeta, useDiscover } from 'teleport/Discover/useDiscover'; diff --git a/web/packages/teleport/src/Discover/Server/ServerWrapper.tsx b/web/packages/teleport/src/Discover/Server/ServerWrapper.tsx index 626226ef6a357..d6cf564b12b12 100644 --- a/web/packages/teleport/src/Discover/Server/ServerWrapper.tsx +++ b/web/packages/teleport/src/Discover/Server/ServerWrapper.tsx @@ -19,7 +19,6 @@ import React, { useEffect } from 'react'; import { PingTeleportProvider } from 'teleport/Discover/Shared/PingTeleportContext'; - import { clearCachedJoinTokenResult } from 'teleport/Discover/Shared/useJoinTokenSuspender'; import { ResourceKind } from '../Shared'; diff --git a/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.story.tsx b/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.story.tsx index 8715a2aacfed9..91e3b67540593 100644 --- a/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.story.tsx +++ b/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.story.tsx @@ -19,12 +19,13 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initSelectedOptionsHelper } from 'teleport/Discover/Shared/SetupAccess'; +import { + initSelectedOptionsHelper, + type State, +} from 'teleport/Discover/Shared/SetupAccess'; import { SetupAccess } from './SetupAccess'; -import type { State } from 'teleport/Discover/Shared/SetupAccess'; - export default { title: 'Teleport/Discover/Server/SetupAccess', }; diff --git a/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.tsx b/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.tsx index 6bca0db3f84ca..ba2822c7fdb80 100644 --- a/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.tsx +++ b/web/packages/teleport/src/Discover/Server/SetupAccess/SetupAccess.tsx @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; + import { Box, Text } from 'design'; import { - SelectCreatable, Option, + SelectCreatable, } from 'teleport/Discover/Shared/SelectCreatable'; import { - useUserTraits, SetupAccessWrapper, + useUserTraits, + type State, } from 'teleport/Discover/Shared/SetupAccess'; -import type { State } from 'teleport/Discover/Shared/SetupAccess'; - export default function Container() { const state = useUserTraits(); return ; diff --git a/web/packages/teleport/src/Discover/Server/SetupAccess/index.ts b/web/packages/teleport/src/Discover/Server/SetupAccess/index.ts index 9dff28d2505a0..dff3646fb943b 100644 --- a/web/packages/teleport/src/Discover/Server/SetupAccess/index.ts +++ b/web/packages/teleport/src/Discover/Server/SetupAccess/index.ts @@ -17,4 +17,5 @@ */ import SetupAccess from './SetupAccess'; + export { SetupAccess }; diff --git a/web/packages/teleport/src/Discover/Server/Shared.tsx b/web/packages/teleport/src/Discover/Server/Shared.tsx index 3fd81bc2dbc73..5bbe55637f2ac 100644 --- a/web/packages/teleport/src/Discover/Server/Shared.tsx +++ b/web/packages/teleport/src/Discover/Server/Shared.tsx @@ -18,8 +18,9 @@ import React from 'react'; import { Link as InternalLink } from 'react-router-dom'; -import { OutlineInfo } from 'design/Alert/Alert'; + import { Box, Mark } from 'design'; +import { OutlineInfo } from 'design/Alert/Alert'; import cfg from 'teleport/config'; diff --git a/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.story.tsx b/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.story.tsx index 2a79a3530e7f4..012fcba687699 100644 --- a/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.story.tsx +++ b/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.story.tsx @@ -21,12 +21,12 @@ import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { nodes } from 'teleport/Nodes/fixtures'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import { nodes } from 'teleport/Nodes/fixtures'; import { TestConnection } from './TestConnection'; diff --git a/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx index de96396e8c9b5..59a0bffc0d8e0 100644 --- a/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx @@ -17,29 +17,27 @@ */ import React, { useState } from 'react'; -import { ButtonSecondary, Text, Box, LabelInput } from 'design'; -import Select from 'shared/components/Select'; -import cfg from 'teleport/config'; +import { Box, ButtonSecondary, LabelInput, Text } from 'design'; +import Select, { type Option } from 'shared/components/Select'; + import ReAuthenticate from 'teleport/components/ReAuthenticate'; -import { openNewTab } from 'teleport/lib/util'; +import cfg from 'teleport/config'; import { - useConnectionDiagnostic, - Header, ActionButtons, - HeaderSubtitle, ConnectionDiagnosticResult, + Header, + HeaderSubtitle, StyledBox, + useConnectionDiagnostic, } from 'teleport/Discover/Shared'; -import { sortNodeLogins } from 'teleport/services/nodes'; - +import { openNewTab } from 'teleport/lib/util'; import { MfaChallengeScope } from 'teleport/services/auth/auth'; +import type { MfaAuthnResponse } from 'teleport/services/mfa'; +import { sortNodeLogins } from 'teleport/services/nodes'; -import { NodeMeta } from '../../useDiscover'; - -import type { Option } from 'shared/components/Select'; import type { AgentStepProps } from '../../types'; -import type { MfaAuthnResponse } from 'teleport/services/mfa'; +import { NodeMeta } from '../../useDiscover'; export function TestConnection(props: AgentStepProps) { const { diff --git a/web/packages/teleport/src/Discover/Server/index.tsx b/web/packages/teleport/src/Discover/Server/index.tsx index cff927f6df652..3568671d5b194 100644 --- a/web/packages/teleport/src/Discover/Server/index.tsx +++ b/web/packages/teleport/src/Discover/Server/index.tsx @@ -18,25 +18,23 @@ import React from 'react'; +import cfg from 'teleport/config'; import { ResourceViewConfig } from 'teleport/Discover/flow'; import { DownloadScript } from 'teleport/Discover/Server/DownloadScript'; import { SetupAccess } from 'teleport/Discover/Server/SetupAccess'; import { TestConnection } from 'teleport/Discover/Server/TestConnection'; -import { AwsAccount, ResourceKind, Finished } from 'teleport/Discover/Shared'; +import { AwsAccount, Finished, ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverDiscoveryConfigMethod, DiscoverEvent, } from 'teleport/services/userEvent'; -import cfg from 'teleport/config'; import { ResourceSpec, ServerLocation } from '../SelectResource'; import { ConfigureDiscoveryService } from '../Shared/ConfigureDiscoveryService'; - -import { EnrollEc2Instance } from './EnrollEc2Instance/EnrollEc2Instance'; import { CreateEc2Ice } from './CreateEc2Ice/CreateEc2Ice'; - -import { ServerWrapper } from './ServerWrapper'; import { DiscoveryConfigSsm } from './DiscoveryConfigSsm/DiscoveryConfigSsm'; +import { EnrollEc2Instance } from './EnrollEc2Instance/EnrollEc2Instance'; +import { ServerWrapper } from './ServerWrapper'; export const ServerResource: ResourceViewConfig = { kind: ResourceKind.Server, diff --git a/web/packages/teleport/src/Discover/Shared/ActionButtons.tsx b/web/packages/teleport/src/Discover/Shared/ActionButtons.tsx index f9a4352593375..d2c641e81fac5 100644 --- a/web/packages/teleport/src/Discover/Shared/ActionButtons.tsx +++ b/web/packages/teleport/src/Discover/Shared/ActionButtons.tsx @@ -17,6 +17,7 @@ */ import React, { PropsWithChildren } from 'react'; + import { Box, ButtonPrimary, ButtonSecondary, ButtonText } from 'design'; export const ActionButtons = ({ diff --git a/web/packages/teleport/src/Discover/Shared/Aws/ConfigureIamPerms.tsx b/web/packages/teleport/src/Discover/Shared/Aws/ConfigureIamPerms.tsx index a6a6a059088b6..109e0e4e0a0ab 100644 --- a/web/packages/teleport/src/Discover/Shared/Aws/ConfigureIamPerms.tsx +++ b/web/packages/teleport/src/Discover/Shared/Aws/ConfigureIamPerms.tsx @@ -18,15 +18,16 @@ import React from 'react'; import styled from 'styled-components'; -import { Flex, Link, Text, Box } from 'design'; -import { assertUnreachable } from 'shared/utils/assertUnreachable'; + +import { Box, Flex, Link, Text } from 'design'; import TextEditor from 'shared/components/TextEditor'; import { ToolTipInfo } from 'shared/components/ToolTip'; +import { assertUnreachable } from 'shared/utils/assertUnreachable'; -import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; -import { Regions } from 'teleport/services/integrations'; import cfg from 'teleport/config'; +import { CommandBox } from 'teleport/Discover/Shared/CommandBox'; +import { Regions } from 'teleport/services/integrations'; import { splitAwsIamArn } from 'teleport/services/integrations/aws'; type AwsResourceKind = 'rds' | 'ec2' | 'eks'; diff --git a/web/packages/teleport/src/Discover/Shared/Aws/DisableableCell.tsx b/web/packages/teleport/src/Discover/Shared/Aws/DisableableCell.tsx index 927669077757e..9c6e18b244cb4 100644 --- a/web/packages/teleport/src/Discover/Shared/Aws/DisableableCell.tsx +++ b/web/packages/teleport/src/Discover/Shared/Aws/DisableableCell.tsx @@ -17,6 +17,7 @@ */ import React, { PropsWithChildren } from 'react'; + import { Cell } from 'design/DataTable'; export const DisableableCell: React.FC< diff --git a/web/packages/teleport/src/Discover/Shared/Aws/StatusCell.tsx b/web/packages/teleport/src/Discover/Shared/Aws/StatusCell.tsx index 403217d2cd00a..485278d73c235 100644 --- a/web/packages/teleport/src/Discover/Shared/Aws/StatusCell.tsx +++ b/web/packages/teleport/src/Discover/Shared/Aws/StatusCell.tsx @@ -16,12 +16,13 @@ * along with this program. If not, see . */ -import { Flex } from 'design'; import React from 'react'; +import { Flex } from 'design'; + import { DisableableCell as Cell } from 'teleport/Discover/Shared'; -import { StatusLight, ItemStatus } from '../StatusLight'; +import { ItemStatus, StatusLight } from '../StatusLight'; export const StatusCell = ({ status, diff --git a/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.story.tsx b/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.story.tsx index db6bb1d4dd1af..17c909fd6fbb5 100644 --- a/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.story.tsx +++ b/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.story.tsx @@ -16,19 +16,18 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; - import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; import { AwsAccount } from './AwsAccount'; diff --git a/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.test.tsx b/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.test.tsx index 34d5a5928d47b..ba2aae6ff4dbc 100644 --- a/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.test.tsx +++ b/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.test.tsx @@ -18,33 +18,32 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { render, screen, fireEvent } from 'design/utils/testing'; + +import { fireEvent, render, screen } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; -import { - IntegrationKind, - IntegrationStatusCode, - integrationService, -} from 'teleport/services/integrations'; -import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; import cfg from 'teleport/config'; -import TeleportContext from 'teleport/teleportContext'; +import { app } from 'teleport/Discover/AwsMangementConsole/fixtures'; +import { ResourceSpec } from 'teleport/Discover/SelectResource'; import { DiscoverContextState, DiscoverProvider, } from 'teleport/Discover/useDiscover'; import { FeaturesContextProvider } from 'teleport/FeaturesContext'; - +import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; +import { + IntegrationKind, + integrationService, + IntegrationStatusCode, +} from 'teleport/services/integrations'; +import ResourceService from 'teleport/services/resources'; import { DiscoverEventResource, userEventService, } from 'teleport/services/userEvent'; -import ResourceService from 'teleport/services/resources'; -import { app } from 'teleport/Discover/AwsMangementConsole/fixtures'; -import { ResourceSpec } from 'teleport/Discover/SelectResource'; +import TeleportContext from 'teleport/teleportContext'; import { ResourceKind } from '../ResourceKind'; - import { AwsAccount } from './AwsAccount'; beforeEach(() => { diff --git a/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.tsx b/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.tsx index cec4eb59cdcb9..645436094823f 100644 --- a/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.tsx +++ b/web/packages/teleport/src/Discover/Shared/AwsAccount/AwsAccount.tsx @@ -16,47 +16,47 @@ * along with this program. If not, see . */ -import React, { useEffect, useState, useCallback } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; + import { + Alert, Box, - ButtonText, - Text, ButtonPrimary, - Indicator, - Alert, + ButtonText, Flex, + Indicator, + Text, } from 'design'; import FieldSelect from 'shared/components/FieldSelect'; -import { useAsync } from 'shared/hooks/useAsync'; import { Option as BaseOption } from 'shared/components/Select'; +import TextEditor from 'shared/components/TextEditor'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; -import TextEditor from 'shared/components/TextEditor'; +import { useAsync } from 'shared/hooks/useAsync'; -import { App } from 'teleport/services/apps'; import cfg from 'teleport/config'; +import { + integrationAndAppRW, + integrationRWE, + integrationRWEAndDbCU, + integrationRWEAndNodeRWE, +} from 'teleport/Discover/yamlTemplates'; +import { App } from 'teleport/services/apps'; import { Integration, IntegrationKind, integrationService, } from 'teleport/services/integrations'; -import { - integrationRWE, - integrationRWEAndNodeRWE, - integrationRWEAndDbCU, - integrationAndAppRW, -} from 'teleport/Discover/yamlTemplates'; -import useTeleport from 'teleport/useTeleport'; import ResourceService from 'teleport/services/resources'; +import useTeleport from 'teleport/useTeleport'; import { ActionButtons, - HeaderSubtitle, Header, + HeaderSubtitle, ResourceKind, } from '../../Shared'; - import { DiscoverUrlLocationState, useDiscover } from '../../useDiscover'; type Option = BaseOption; diff --git a/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.story.tsx b/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.story.tsx index 6c5dbdee81510..3a57684b3ea19 100644 --- a/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.story.tsx +++ b/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.story.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Text } from 'design'; import { AwsRegionSelector } from './AwsRegionSelector'; diff --git a/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.tsx b/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.tsx index abcc8b2ca1cee..2fb97253241f2 100644 --- a/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.tsx +++ b/web/packages/teleport/src/Discover/Shared/AwsRegionSelector/AwsRegionSelector.tsx @@ -17,9 +17,10 @@ */ import React, { useState } from 'react'; -import { Box, Flex, ButtonSecondary, LabelInput } from 'design'; -import Select, { Option } from 'shared/components/Select'; + +import { Box, ButtonSecondary, Flex, LabelInput } from 'design'; import { Refresh as RefreshIcon } from 'design/Icon'; +import Select, { Option } from 'shared/components/Select'; import { awsRegionMap, Regions } from 'teleport/services/integrations'; diff --git a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.story.tsx b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.story.tsx index 4e672f1b58b8d..c9efb17b07605 100644 --- a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.story.tsx +++ b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.story.tsx @@ -16,28 +16,29 @@ * along with this program. If not, see . */ -import React from 'react'; import { rest } from 'msw'; +import React from 'react'; import { MemoryRouter } from 'react-router'; + import { Info } from 'design/Alert'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { createTeleportContext } from 'teleport/mocks/contexts'; +import { ServerLocation } from 'teleport/Discover/SelectResource'; +import { ResourceKind } from 'teleport/Discover/Shared'; import { - DiscoverProvider, DiscoverContextState, + DiscoverProvider, } from 'teleport/Discover/useDiscover'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { IntegrationKind, IntegrationStatusCode, } from 'teleport/services/integrations'; -import { ResourceKind } from 'teleport/Discover/Shared'; import { DiscoverDiscoveryConfigMethod, DiscoverEventResource, } from 'teleport/services/userEvent'; -import { ServerLocation } from 'teleport/Discover/SelectResource'; import { ConfigureDiscoveryService as Comp } from './ConfigureDiscoveryService'; diff --git a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.tsx b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.tsx index 72aaf398dd154..a09f2ea495539 100644 --- a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.tsx +++ b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryService.tsx @@ -18,25 +18,24 @@ import React, { useState } from 'react'; import { Link as InternalLink } from 'react-router-dom'; -import { Box, Text, Mark } from 'design'; + +import { Box, Mark, Text } from 'design'; import { OutlineInfo } from 'design/Alert/Alert'; import useAttempt from 'shared/hooks/useAttemptNext'; import { getErrMessage } from 'shared/utils/errorType'; +import cfg from 'teleport/config'; import { useDiscover } from 'teleport/Discover/useDiscover'; -import useTeleport from 'teleport/useTeleport'; - import { - DEFAULT_DISCOVERY_GROUP_NON_CLOUD, createDiscoveryConfig, + DEFAULT_DISCOVERY_GROUP_NON_CLOUD, } from 'teleport/services/discovery'; -import cfg from 'teleport/config'; +import useTeleport from 'teleport/useTeleport'; import { ActionButtons, Header, ResourceKind } from '../../Shared'; import { InfoIcon } from '../InfoIcon'; - -import { CreatedDiscoveryConfigDialog } from './CreatedDiscoveryConfigDialog'; import { ConfigureDiscoveryServiceDirections } from './ConfigureDiscoveryServiceDirections'; +import { CreatedDiscoveryConfigDialog } from './CreatedDiscoveryConfigDialog'; export function ConfigureDiscoveryService({ withCreateConfig = false, diff --git a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryServiceDirections.tsx b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryServiceDirections.tsx index e3e7086b28dcc..d8280b337d176 100644 --- a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryServiceDirections.tsx +++ b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/ConfigureDiscoveryServiceDirections.tsx @@ -15,15 +15,14 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { Box, Flex, Input, Text, Mark } from 'design'; +import React from 'react'; import styled from 'styled-components'; +import { Box, Flex, Input, Mark, Text } from 'design'; import { ToolTipInfo } from 'shared/components/ToolTip'; -import React from 'react'; - -import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; import { Tabs } from 'teleport/components/Tabs'; +import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; const discoveryGroupToolTip = `Discovery group name is used to group discovered resources into different sets. \ This parameter is used to prevent Discovery Agents watching different sets of cloud resources from \ diff --git a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/CreatedDiscoveryConfigDialog.tsx b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/CreatedDiscoveryConfigDialog.tsx index ee7bf1db8e2d0..993b9c85ba1a2 100644 --- a/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/CreatedDiscoveryConfigDialog.tsx +++ b/web/packages/teleport/src/Discover/Shared/ConfigureDiscoveryService/CreatedDiscoveryConfigDialog.tsx @@ -17,17 +17,17 @@ */ import React from 'react'; + import { - Text, - Flex, AnimatedProgressBar, ButtonPrimary, ButtonSecondary, + Flex, Mark, + Text, } from 'design'; -import * as Icons from 'design/Icon'; import Dialog, { DialogContent } from 'design/DialogConfirmation'; - +import * as Icons from 'design/Icon'; import type { Attempt } from 'shared/hooks/useAttemptNext'; export type CreatedDiscoveryConfigDialog = { diff --git a/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.story.tsx b/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.story.tsx index 5a2e8563b3191..60207de97b28b 100644 --- a/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.story.tsx +++ b/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.story.tsx @@ -18,11 +18,13 @@ import React from 'react'; -import { ConnectionDiagnosticResult } from './ConnectionDiagnosticResult'; - -import type { Props } from './ConnectionDiagnosticResult'; import type { ConnectionDiagnosticTrace } from 'teleport/services/agents'; +import { + ConnectionDiagnosticResult, + type Props, +} from './ConnectionDiagnosticResult'; + export default { title: 'Teleport/Discover/Shared/ConnectionDiagnostic', }; diff --git a/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.tsx b/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.tsx index 0b71372a33c4e..07f604f2ca13f 100644 --- a/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.tsx +++ b/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/ConnectionDiagnosticResult.tsx @@ -18,16 +18,16 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { ButtonSecondary, Text, Box, Flex, ButtonText, Mark } from 'design'; + +import { Box, ButtonSecondary, ButtonText, Flex, Mark, Text } from 'design'; import * as Icons from 'design/Icon'; +import type { Attempt } from 'shared/hooks/useAttemptNext'; import { YamlReader } from 'teleport/Discover/Shared/SetupAccess/AccessInfo'; +import type { ConnectionDiagnostic } from 'teleport/services/agents'; import { StyledBox, TextIcon } from '..'; -import type { Attempt } from 'shared/hooks/useAttemptNext'; -import type { ConnectionDiagnostic } from 'teleport/services/agents'; - export function ConnectionDiagnosticResult({ attempt, diagnosis, diff --git a/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/useConnectionDiagnostic.ts b/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/useConnectionDiagnostic.ts index ddedd3ffb7a42..dbcf0a43aabc5 100644 --- a/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/useConnectionDiagnostic.ts +++ b/web/packages/teleport/src/Discover/Shared/ConnectionDiagnostic/useConnectionDiagnostic.ts @@ -17,21 +17,23 @@ */ import { useState } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; -import useTeleport from 'teleport/useTeleport'; +import { + getDatabaseProtocol, + type ResourceSpec, +} from 'teleport/Discover/SelectResource'; import { useDiscover } from 'teleport/Discover/useDiscover'; -import { DiscoverEventStatus } from 'teleport/services/userEvent'; -import auth from 'teleport/services/auth/auth'; -import { getDatabaseProtocol } from 'teleport/Discover/SelectResource'; -import { agentService } from 'teleport/services/agents'; - -import type { - ConnectionDiagnostic, - ConnectionDiagnosticRequest, +import { + agentService, + type ConnectionDiagnostic, + type ConnectionDiagnosticRequest, } from 'teleport/services/agents'; +import auth from 'teleport/services/auth/auth'; import type { MfaAuthnResponse } from 'teleport/services/mfa'; -import type { ResourceSpec } from 'teleport/Discover/SelectResource'; +import { DiscoverEventStatus } from 'teleport/services/userEvent'; +import useTeleport from 'teleport/useTeleport'; export function useConnectionDiagnostic() { const ctx = useTeleport(); diff --git a/web/packages/teleport/src/Discover/Shared/CustomInputFieldForAsterisks.tsx b/web/packages/teleport/src/Discover/Shared/CustomInputFieldForAsterisks.tsx index c2c77402c1e8a..ce4191fb99971 100644 --- a/web/packages/teleport/src/Discover/Shared/CustomInputFieldForAsterisks.tsx +++ b/web/packages/teleport/src/Discover/Shared/CustomInputFieldForAsterisks.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; + import FieldInput from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import { Option } from 'shared/components/Select'; +import { requiredField } from 'shared/components/Validation/rules'; import { capitalizeFirstLetter } from 'shared/utils/text'; import { WILD_CARD } from './const'; diff --git a/web/packages/teleport/src/Discover/Shared/Finished/Finished.story.tsx b/web/packages/teleport/src/Discover/Shared/Finished/Finished.story.tsx index 0c0229cf1b4a7..4138540c1094c 100644 --- a/web/packages/teleport/src/Discover/Shared/Finished/Finished.story.tsx +++ b/web/packages/teleport/src/Discover/Shared/Finished/Finished.story.tsx @@ -18,9 +18,8 @@ import React from 'react'; -import { Finished as Component } from './Finished'; - import type { AgentStepProps } from '../../types'; +import { Finished as Component } from './Finished'; export default { title: 'Teleport/Discover/Shared', diff --git a/web/packages/teleport/src/Discover/Shared/Finished/Finished.tsx b/web/packages/teleport/src/Discover/Shared/Finished/Finished.tsx index 7611a45f43f68..2b47ebff53682 100644 --- a/web/packages/teleport/src/Discover/Shared/Finished/Finished.tsx +++ b/web/packages/teleport/src/Discover/Shared/Finished/Finished.tsx @@ -18,14 +18,14 @@ import React from 'react'; import styled from 'styled-components'; -import { ButtonPrimary, Text, Flex, ButtonSecondary, Image } from 'design'; + +import { ButtonPrimary, ButtonSecondary, Flex, Image, Text } from 'design'; import cfg from 'teleport/config'; import history from 'teleport/services/history'; -import celebratePamPng from './celebrate-pam.png'; - import type { AgentStepProps } from '../../types'; +import celebratePamPng from './celebrate-pam.png'; export function Finished(props: AgentStepProps) { let title = 'Resource Successfully Added'; diff --git a/web/packages/teleport/src/Discover/Shared/Header.tsx b/web/packages/teleport/src/Discover/Shared/Header.tsx index bea8e4e550d73..fc8a98abd6dfa 100644 --- a/web/packages/teleport/src/Discover/Shared/Header.tsx +++ b/web/packages/teleport/src/Discover/Shared/Header.tsx @@ -18,8 +18,8 @@ import React, { PropsWithChildren } from 'react'; +import { ButtonIcon, Flex, Text } from 'design'; import { ArrowBack } from 'design/Icon'; -import { Text, ButtonIcon, Flex } from 'design'; export const Header: React.FC> = ({ children }) => ( diff --git a/web/packages/teleport/src/Discover/Shared/HintBox.tsx b/web/packages/teleport/src/Discover/Shared/HintBox.tsx index cd860611b9ce7..1ab47154c8e51 100644 --- a/web/packages/teleport/src/Discover/Shared/HintBox.tsx +++ b/web/packages/teleport/src/Discover/Shared/HintBox.tsx @@ -20,7 +20,6 @@ import React from 'react'; import styled from 'styled-components'; import { Box, Flex, Text } from 'design'; - import * as Icons from 'design/Icon'; import { TextIcon } from 'teleport/Discover/Shared/Text'; diff --git a/web/packages/teleport/src/Discover/Shared/InfoIcon.tsx b/web/packages/teleport/src/Discover/Shared/InfoIcon.tsx index bdec4998f8f64..3b0e108ca8c6b 100644 --- a/web/packages/teleport/src/Discover/Shared/InfoIcon.tsx +++ b/web/packages/teleport/src/Discover/Shared/InfoIcon.tsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Info } from 'design/Icon'; export const InfoIcon = styled(Info)` diff --git a/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.story.tsx b/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.story.tsx index e855cd3cdb6e1..726ba6b3a84e3 100644 --- a/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.story.tsx +++ b/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.story.tsx @@ -20,7 +20,7 @@ import React, { useState } from 'react'; import Validation from 'shared/components/Validation'; -import { LabelsCreater, DiscoverLabel } from './LabelsCreater'; +import { DiscoverLabel, LabelsCreater } from './LabelsCreater'; export default { title: 'Teleport/Discover/Shared/LabelsCreator', diff --git a/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.tsx b/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.tsx index 399c346438ce3..8a7ae3701e597 100644 --- a/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.tsx +++ b/web/packages/teleport/src/Discover/Shared/LabelsCreater/LabelsCreater.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { Box, Flex, ButtonIcon, Text } from 'design'; + +import { Box, ButtonIcon, Flex, Text } from 'design'; import * as Icons from 'design/Icon'; +import { ButtonTextWithAddIcon } from 'shared/components/ButtonTextWithAddIcon'; import FieldInput from 'shared/components/FieldInput'; import { useValidation, Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; -import { ButtonTextWithAddIcon } from 'shared/components/ButtonTextWithAddIcon'; import { ResourceLabel } from 'teleport/services/agents'; diff --git a/web/packages/teleport/src/Discover/Shared/PingTeleportContext.tsx b/web/packages/teleport/src/Discover/Shared/PingTeleportContext.tsx index bd837052f70fa..167b98efdd89d 100644 --- a/web/packages/teleport/src/Discover/Shared/PingTeleportContext.tsx +++ b/web/packages/teleport/src/Discover/Shared/PingTeleportContext.tsx @@ -19,12 +19,12 @@ import React, { useCallback, useContext, useEffect, useState } from 'react'; import { useTeleport } from 'teleport'; +import { ResourceKind } from 'teleport/Discover/Shared/ResourceKind'; import { usePoll } from 'teleport/Discover/Shared/usePoll'; import { INTERNAL_RESOURCE_ID_LABEL_KEY, JoinToken, } from 'teleport/services/joinToken'; -import { ResourceKind } from 'teleport/Discover/Shared/ResourceKind'; interface PingTeleportContextState { active: boolean; diff --git a/web/packages/teleport/src/Discover/Shared/SecurityGroupPicker/SecurityGroupPicker.tsx b/web/packages/teleport/src/Discover/Shared/SecurityGroupPicker/SecurityGroupPicker.tsx index d5749551ca417..3d3bc192f230b 100644 --- a/web/packages/teleport/src/Discover/Shared/SecurityGroupPicker/SecurityGroupPicker.tsx +++ b/web/packages/teleport/src/Discover/Shared/SecurityGroupPicker/SecurityGroupPicker.tsx @@ -19,16 +19,17 @@ import React, { useState } from 'react'; import { Flex, Link } from 'design'; -import Table, { Cell } from 'design/DataTable'; import { Danger } from 'design/Alert'; import { CheckboxInput } from 'design/Checkbox'; +import Table, { Cell } from 'design/DataTable'; import { FetchStatus } from 'design/DataTable/types'; import { ToolTipInfo } from 'shared/components/ToolTip'; - import { Attempt } from 'shared/hooks/useAttemptNext'; -import { SecurityGroup } from 'teleport/services/integrations'; -import { SecurityGroupRule } from 'teleport/services/integrations'; +import { + SecurityGroup, + SecurityGroupRule, +} from 'teleport/services/integrations'; import { SecurityGroupRulesDialog } from './SecurityGroupRulesDialog'; diff --git a/web/packages/teleport/src/Discover/Shared/SelectCreatable/SelectCreatable.tsx b/web/packages/teleport/src/Discover/Shared/SelectCreatable/SelectCreatable.tsx index 5dba2dbabbddb..7dd1f65592167 100644 --- a/web/packages/teleport/src/Discover/Shared/SelectCreatable/SelectCreatable.tsx +++ b/web/packages/teleport/src/Discover/Shared/SelectCreatable/SelectCreatable.tsx @@ -17,8 +17,9 @@ */ import React from 'react'; -import { useTheme } from 'styled-components'; import ReactSelectCreatable from 'react-select/creatable'; +import { useTheme } from 'styled-components'; + import { Cross } from 'design/Icon'; export const styles = theme => ({ diff --git a/web/packages/teleport/src/Discover/Shared/SetupAccess/AccessInfo.tsx b/web/packages/teleport/src/Discover/Shared/SetupAccess/AccessInfo.tsx index 077471ad4b8e3..30bb669bd9f2a 100644 --- a/web/packages/teleport/src/Discover/Shared/SetupAccess/AccessInfo.tsx +++ b/web/packages/teleport/src/Discover/Shared/SetupAccess/AccessInfo.tsx @@ -17,19 +17,20 @@ */ import React from 'react'; + import { Flex, Text } from 'design'; import TextEditor from 'shared/components/TextEditor'; import { - kubeAccessRW, - kubeAccessRO, - nodeAccessRO, - nodeAccessRW, + awsAppAccessRO, + awsAppAccessRW, connDiagRW, dbAccessRO, dbAccessRW, - awsAppAccessRO, - awsAppAccessRW, + kubeAccessRO, + kubeAccessRW, + nodeAccessRO, + nodeAccessRW, } from '../../yamlTemplates'; export function AccessInfo({ accessKind, traitKind, traitDesc }: Props) { diff --git a/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.story.tsx b/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.story.tsx index 9a8649cce9281..e3e818a2aa2e5 100644 --- a/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.story.tsx +++ b/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.story.tsx @@ -19,9 +19,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { SetupAccessWrapper } from './SetupAccessWrapper'; - -import type { Props } from './SetupAccessWrapper'; +import { SetupAccessWrapper, type Props } from './SetupAccessWrapper'; export default { title: 'Teleport/Discover/Shared/SetupAccessWrapper', diff --git a/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx b/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx index b222aecfdb3ec..73baae8500d81 100644 --- a/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx +++ b/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx @@ -18,19 +18,18 @@ import React from 'react'; import styled from 'styled-components'; -import { Text, Box, Indicator, Flex } from 'design'; + +import { Box, Flex, Indicator, Text } from 'design'; import * as Icons from 'design/Icon'; import { - Header, - HeaderSubtitle, ActionButtons, ButtonBlueText, + Header, + HeaderSubtitle, } from 'teleport/Discover/Shared'; -import { AccessInfo } from './AccessInfo'; - -import type { TraitKind } from './AccessInfo'; +import { AccessInfo, type TraitKind } from './AccessInfo'; import type { State } from './useUserTraits'; export type Props = { diff --git a/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.test.tsx b/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.test.tsx index cf86ed8fa96b1..5a29f51748a4e 100644 --- a/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.test.tsx +++ b/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.test.tsx @@ -16,37 +16,36 @@ * along with this program. If not, see . */ +import { act, renderHook, waitFor } from '@testing-library/react'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { renderHook, act, waitFor } from '@testing-library/react'; + import { AwsRole } from 'shared/services/apps'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; -import { DiscoverProvider } from 'teleport/Discover/useDiscover'; import cfg from 'teleport/config'; -import { userEventService } from 'teleport/services/userEvent'; +import { app } from 'teleport/Discover/AwsMangementConsole/fixtures'; import { defaultDiscoverContext, defaultResourceSpec, } from 'teleport/Discover/Fixtures/fixtures'; -import TeleportContext from 'teleport/teleportContext'; -import { app } from 'teleport/Discover/AwsMangementConsole/fixtures'; +import { + DiscoverProvider, + type AppMeta, + type DbMeta, + type DiscoverContextState, + type KubeMeta, + type NodeMeta, +} from 'teleport/Discover/useDiscover'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { ExcludeUserField } from 'teleport/services/user'; +import { userEventService } from 'teleport/services/userEvent'; +import TeleportContext from 'teleport/teleportContext'; import { ResourceKind } from '../ResourceKind'; - import { useUserTraits } from './useUserTraits'; -import type { - AppMeta, - DbMeta, - DiscoverContextState, - KubeMeta, - NodeMeta, -} from 'teleport/Discover/useDiscover'; - describe('onProceed correctly deduplicates, removes static traits, updates meta, and calls updateUser', () => { const teleCtx = createTeleportContext(); jest.spyOn(teleCtx.userService, 'fetchUser').mockResolvedValue(getMockUser()); diff --git a/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.ts b/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.ts index 8687a64c1d7a1..a9b99149db7c6 100644 --- a/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.ts +++ b/web/packages/teleport/src/Discover/Shared/SetupAccess/useUserTraits.ts @@ -16,29 +16,29 @@ * along with this program. If not, see . */ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; -import { arrayStrDiff } from 'teleport/lib/util'; -import useTeleport from 'teleport/useTeleport'; import { Option } from 'teleport/Discover/Shared/SelectCreatable'; -import { useDiscover } from 'teleport/Discover/useDiscover'; +import { + useDiscover, + type AppMeta, + type DbMeta, + type KubeMeta, + type NodeMeta, +} from 'teleport/Discover/useDiscover'; +import { arrayStrDiff } from 'teleport/lib/util'; import { splitAwsIamArn } from 'teleport/services/integrations/aws'; import { ExcludeUserField, type User, type UserTraits, } from 'teleport/services/user'; +import useTeleport from 'teleport/useTeleport'; import { ResourceKind } from '../ResourceKind'; -import type { - AppMeta, - DbMeta, - KubeMeta, - NodeMeta, -} from 'teleport/Discover/useDiscover'; - // useUserTraits handles: // - retrieving the latest user (for the dynamic traits) from the backend // - extracting traits into static traits (role-defined) and dynamic traits (user-defined) diff --git a/web/packages/teleport/src/Discover/Shared/StatusLight.tsx b/web/packages/teleport/src/Discover/Shared/StatusLight.tsx index c8737207d028b..6a5565899ca56 100644 --- a/web/packages/teleport/src/Discover/Shared/StatusLight.tsx +++ b/web/packages/teleport/src/Discover/Shared/StatusLight.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -import { Box } from 'design'; import styled from 'styled-components'; +import { Box } from 'design'; + export enum ItemStatus { Success, Warning, diff --git a/web/packages/teleport/src/Discover/Shared/StepBox.tsx b/web/packages/teleport/src/Discover/Shared/StepBox.tsx index d06a7135dade1..8775d0f0616a4 100644 --- a/web/packages/teleport/src/Discover/Shared/StepBox.tsx +++ b/web/packages/teleport/src/Discover/Shared/StepBox.tsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Box } from 'design'; export const StepBox = styled(Box)` diff --git a/web/packages/teleport/src/Discover/Shared/StyledBox.ts b/web/packages/teleport/src/Discover/Shared/StyledBox.ts index 185c5f9432e7f..8b047efde9459 100644 --- a/web/packages/teleport/src/Discover/Shared/StyledBox.ts +++ b/web/packages/teleport/src/Discover/Shared/StyledBox.ts @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Box } from 'design'; export const StyledBox = styled(Box).attrs({ diff --git a/web/packages/teleport/src/Discover/Shared/SubnetIdPicker/SubnetIdPicker.tsx b/web/packages/teleport/src/Discover/Shared/SubnetIdPicker/SubnetIdPicker.tsx index 625a34e5c810f..fd06c649dfdb2 100644 --- a/web/packages/teleport/src/Discover/Shared/SubnetIdPicker/SubnetIdPicker.tsx +++ b/web/packages/teleport/src/Discover/Shared/SubnetIdPicker/SubnetIdPicker.tsx @@ -18,13 +18,12 @@ import React from 'react'; -import { Flex, Link, ButtonIcon } from 'design'; -import Table, { Cell } from 'design/DataTable'; +import { ButtonIcon, Flex, Link } from 'design'; import { Danger } from 'design/Alert'; import { CheckboxInput } from 'design/Checkbox'; +import Table, { Cell } from 'design/DataTable'; import { FetchStatus } from 'design/DataTable/types'; import { NewTab } from 'design/Icon'; - import { Attempt } from 'shared/hooks/useAttemptNext'; import { Regions, Subnet } from 'teleport/services/integrations'; diff --git a/web/packages/teleport/src/Discover/Shared/Text.tsx b/web/packages/teleport/src/Discover/Shared/Text.tsx index 5179fa431e72f..d8f67f539c432 100644 --- a/web/packages/teleport/src/Discover/Shared/Text.tsx +++ b/web/packages/teleport/src/Discover/Shared/Text.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { Box, Text } from 'design'; - import styled from 'styled-components'; +import { Box, Text } from 'design'; + export const TextIcon = styled(Text)` display: flex; diff --git a/web/packages/teleport/src/Discover/Shared/useJoinTokenSuspender.ts b/web/packages/teleport/src/Discover/Shared/useJoinTokenSuspender.ts index b310c1e330858..18e7f9e3f007c 100644 --- a/web/packages/teleport/src/Discover/Shared/useJoinTokenSuspender.ts +++ b/web/packages/teleport/src/Discover/Shared/useJoinTokenSuspender.ts @@ -19,17 +19,15 @@ import { useEffect, useState } from 'react'; import { useTeleport } from 'teleport'; - import { ResourceKind, resourceKindToJoinRole, } from 'teleport/Discover/Shared/ResourceKind'; - -import { useDiscover } from '../useDiscover'; - import type { ResourceLabel } from 'teleport/services/agents'; import type { JoinMethod, JoinToken } from 'teleport/services/joinToken'; +import { useDiscover } from '../useDiscover'; + interface SuspendResult { promise?: Promise; response?: JoinToken; diff --git a/web/packages/teleport/src/Discover/flow.tsx b/web/packages/teleport/src/Discover/flow.tsx index 8840f59306faa..83b429c5148f8 100644 --- a/web/packages/teleport/src/Discover/flow.tsx +++ b/web/packages/teleport/src/Discover/flow.tsx @@ -18,10 +18,10 @@ import React from 'react'; +import { BaseView } from 'teleport/components/Wizard/flow'; import { ResourceKind } from 'teleport/Discover/Shared'; import { AgentStepComponent } from 'teleport/Discover/types'; import { DiscoverEvent } from 'teleport/services/userEvent'; -import { BaseView } from 'teleport/components/Wizard/flow'; import { ResourceSpec } from './SelectResource'; diff --git a/web/packages/teleport/src/Discover/resourceViewConfigs.ts b/web/packages/teleport/src/Discover/resourceViewConfigs.ts index 68a5b0ec3b3bb..fb5d5013c2696 100644 --- a/web/packages/teleport/src/Discover/resourceViewConfigs.ts +++ b/web/packages/teleport/src/Discover/resourceViewConfigs.ts @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { ServerResource } from 'teleport/Discover/Server'; import { AwsMangementConsole } from 'teleport/Discover/AwsMangementConsole'; +import { ConnectMyComputerResource } from 'teleport/Discover/ConnectMyComputer'; import { DatabaseResource } from 'teleport/Discover/Database'; import { KubernetesResource } from 'teleport/Discover/Kubernetes'; -import { ConnectMyComputerResource } from 'teleport/Discover/ConnectMyComputer'; +import { ServerResource } from 'teleport/Discover/Server'; import { ResourceViewConfig } from './flow'; diff --git a/web/packages/teleport/src/Discover/types.ts b/web/packages/teleport/src/Discover/types.ts index 5ac40920671d0..c155edb9963b8 100644 --- a/web/packages/teleport/src/Discover/types.ts +++ b/web/packages/teleport/src/Discover/types.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { State } from './useDiscover'; import { ResourceViewConfig } from './flow'; +import { State } from './useDiscover'; export type AgentStepProps = { // agentMeta describes fields specific to an agent kind. diff --git a/web/packages/teleport/src/Discover/useDiscover.test.tsx b/web/packages/teleport/src/Discover/useDiscover.test.tsx index 5a933dcdfcfea..8a5be3dd4ed2e 100644 --- a/web/packages/teleport/src/Discover/useDiscover.test.tsx +++ b/web/packages/teleport/src/Discover/useDiscover.test.tsx @@ -16,12 +16,15 @@ * along with this program. If not, see . */ +import { act, renderHook } from '@testing-library/react'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { renderHook, act } from '@testing-library/react'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport'; +import cfg from 'teleport/config'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { createTeleportContext } from 'teleport/mocks/contexts'; +import api from 'teleport/services/api'; import { DiscoverEvent, DiscoverEventResource, @@ -30,12 +33,9 @@ import { DiscoverServiceDeployType, userEventService, } from 'teleport/services/userEvent'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; -import api from 'teleport/services/api'; -import cfg from 'teleport/config'; -import { useDiscover, DiscoverProvider } from './useDiscover'; import { SERVERS } from './SelectResource/resources'; +import { DiscoverProvider, useDiscover } from './useDiscover'; describe('emitting events', () => { const ctx = createTeleportContext(); diff --git a/web/packages/teleport/src/Discover/useDiscover.tsx b/web/packages/teleport/src/Discover/useDiscover.tsx index 61e493aa3b44f..2b353eb0d4f3d 100644 --- a/web/packages/teleport/src/Discover/useDiscover.tsx +++ b/web/packages/teleport/src/Discover/useDiscover.tsx @@ -16,49 +16,47 @@ * along with this program. If not, see . */ -import React, { useContext, useState, useEffect, useCallback } from 'react'; +import React, { useCallback, useContext, useEffect, useState } from 'react'; import { useHistory, useLocation } from 'react-router'; -import { - DiscoverEventStatus, - DiscoverEventStepStatus, - DiscoverEvent, - DiscoverEventResource, - userEventService, - DiscoverServiceDeployMethod, - DiscoverServiceDeploy, - DiscoverServiceDeployType, - DiscoverDiscoveryConfigMethod, -} from 'teleport/services/userEvent'; -import cfg from 'teleport/config'; -import { DiscoveryConfig } from 'teleport/services/discovery'; import { addIndexToViews, findViewAtIndex, } from 'teleport/components/Wizard/flow'; - -import { ResourceViewConfig, View } from './flow'; -import { viewConfigs } from './resourceViewConfigs'; -import { EViewConfigs } from './types'; -import { ServiceDeployMethod } from './Database/common'; - -import type { Node } from 'teleport/services/nodes'; +import cfg from 'teleport/config'; +import type { ResourceLabel } from 'teleport/services/agents'; import type { App } from 'teleport/services/apps'; -import type { Kube } from 'teleport/services/kube'; import type { Database } from 'teleport/services/databases'; -import type { ResourceLabel } from 'teleport/services/agents'; -import type { ResourceSpec } from './SelectResource'; +import { DiscoveryConfig } from 'teleport/services/discovery'; import type { AwsRdsDatabase, Ec2InstanceConnectEndpoint, Integration, Regions, } from 'teleport/services/integrations'; - +import type { Kube } from 'teleport/services/kube'; +import type { Node } from 'teleport/services/nodes'; import type { SamlGcpWorkforce, SamlIdpServiceProvider, } from 'teleport/services/samlidp/types'; +import { + DiscoverDiscoveryConfigMethod, + DiscoverEvent, + DiscoverEventResource, + DiscoverEventStatus, + DiscoverEventStepStatus, + DiscoverServiceDeploy, + DiscoverServiceDeployMethod, + DiscoverServiceDeployType, + userEventService, +} from 'teleport/services/userEvent'; + +import { ServiceDeployMethod } from './Database/common'; +import { ResourceViewConfig, View } from './flow'; +import { viewConfigs } from './resourceViewConfigs'; +import type { ResourceSpec } from './SelectResource'; +import { EViewConfigs } from './types'; export interface DiscoverContextState { agentMeta: AgentMeta; diff --git a/web/packages/teleport/src/Discover/yamlTemplates/index.ts b/web/packages/teleport/src/Discover/yamlTemplates/index.ts index d354ccc7aada0..26b11e9117b98 100644 --- a/web/packages/teleport/src/Discover/yamlTemplates/index.ts +++ b/web/packages/teleport/src/Discover/yamlTemplates/index.ts @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -import nodeAccessRO from './nodeAccessRO.yaml?raw'; -import nodeAccessRW from './nodeAccessRW.yaml?raw'; +import awsAppAccessRO from './awsAppAccessRO.yaml?raw'; +import awsAppAccessRW from './awsAppAccessRW.yaml?raw'; import connDiagRW from './connDiagRW.yaml?raw'; -import kubeAccessRW from './kubeAccessRW.yaml?raw'; -import kubeAccessRO from './kubeAccessRO.yaml?raw'; -import dbAccessRW from './dbAccessRW.yaml?raw'; import dbAccessRO from './dbAccessRO.yaml?raw'; +import dbAccessRW from './dbAccessRW.yaml?raw'; import dbCU from './dbCU.yaml?raw'; +import integrationAndAppRW from './integrationAndAppRW.yaml?raw'; import integrationRWE from './integrationRWE.yaml?raw'; import integrationRWEAndDbCU from './integrationRWEAndDbCU.yaml?raw'; import integrationRWEAndNodeRWE from './integrationRWEAndNodeRWE.yaml?raw'; -import integrationAndAppRW from './integrationAndAppRW.yaml?raw'; -import awsAppAccessRW from './awsAppAccessRW.yaml?raw'; -import awsAppAccessRO from './awsAppAccessRO.yaml?raw'; +import kubeAccessRO from './kubeAccessRO.yaml?raw'; +import kubeAccessRW from './kubeAccessRW.yaml?raw'; +import nodeAccessRO from './nodeAccessRO.yaml?raw'; +import nodeAccessRW from './nodeAccessRW.yaml?raw'; export { nodeAccessRO, diff --git a/web/packages/teleport/src/HeadlessRequest/Cards.tsx b/web/packages/teleport/src/HeadlessRequest/Cards.tsx index 23db1c56a1eb7..daf0090623004 100644 --- a/web/packages/teleport/src/HeadlessRequest/Cards.tsx +++ b/web/packages/teleport/src/HeadlessRequest/Cards.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see . */ +import React from 'react'; + import { Card, CardSuccess, Text } from 'design'; import { CircleStop } from 'design/Icon'; -import React from 'react'; export function CardDenied({ title, children }) { return ( diff --git a/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.test.tsx b/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.test.tsx index 774d096be5a1a..a73b5ccf9c126 100644 --- a/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.test.tsx +++ b/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.test.tsx @@ -16,13 +16,14 @@ * along with this program. If not, see . */ -import { render, screen } from 'design/utils/testing'; +import { createMemoryHistory } from 'history'; import React from 'react'; import { Route, Router } from 'react-router'; -import { createMemoryHistory } from 'history'; -import { HeadlessRequest } from 'teleport/HeadlessRequest/HeadlessRequest'; +import { render, screen } from 'design/utils/testing'; + import cfg from 'teleport/config'; +import { HeadlessRequest } from 'teleport/HeadlessRequest/HeadlessRequest'; import auth from 'teleport/services/auth'; test('ip address should be visible', async () => { diff --git a/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.tsx b/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.tsx index c0adeae9b5ad4..dd26221efb348 100644 --- a/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.tsx +++ b/web/packages/teleport/src/HeadlessRequest/HeadlessRequest.tsx @@ -19,13 +19,13 @@ import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Spinner } from 'design/Icon'; import { Box, Flex, rotate360 } from 'design'; +import { Spinner } from 'design/Icon'; -import auth from 'teleport/services/auth'; -import { useParams } from 'teleport/components/Router'; import HeadlessRequestDialog from 'teleport/components/HeadlessRequestDialog/HeadlessRequestDialog'; +import { useParams } from 'teleport/components/Router'; import { CardAccept, CardDenied } from 'teleport/HeadlessRequest/Cards'; +import auth from 'teleport/services/auth'; export function HeadlessRequest() { const { requestId } = useParams<{ requestId: string }>(); diff --git a/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.test.tsx b/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.test.tsx index de6a7829423e2..611e6adf7ee7b 100644 --- a/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.test.tsx +++ b/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.test.tsx @@ -15,18 +15,19 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { useEffect } from 'react'; -import { render, screen, fireEvent, waitFor } from 'design/utils/testing'; import userEvent from '@testing-library/user-event'; +import { useEffect } from 'react'; import { MemoryRouter } from 'react-router'; +import { fireEvent, render, screen, waitFor } from 'design/utils/testing'; + +import cfg from 'teleport/config'; import { Integration, IntegrationKind, integrationService, IntegrationStatusCode, } from 'teleport/services/integrations'; -import cfg from 'teleport/config'; import { EditAwsOidcIntegrationDialog } from './EditAwsOidcIntegrationDialog'; import { useIntegrationOperation } from './Operations'; diff --git a/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.tsx b/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.tsx index 214310f517572..52a606f7c2b09 100644 --- a/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.tsx +++ b/web/packages/teleport/src/Integrations/EditAwsOidcIntegrationDialog.tsx @@ -18,36 +18,36 @@ import React, { useState } from 'react'; import styled from 'styled-components'; + import { - ButtonSecondary, - ButtonPrimary, - ButtonBorder, Alert, - Text, Box, + ButtonBorder, + ButtonPrimary, + ButtonSecondary, Link, + Text, } from 'design'; +import { OutlineInfo, OutlineWarn } from 'design/Alert/Alert'; +import { CheckboxInput } from 'design/Checkbox'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/DialogConfirmation'; -import { OutlineInfo, OutlineWarn } from 'design/Alert/Alert'; import FieldInput from 'shared/components/FieldInput'; +import { TextSelectCopyMulti } from 'shared/components/TextSelectCopy'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredRoleArn } from 'shared/components/Validation/rules'; -import { CheckboxInput } from 'design/Checkbox'; -import { TextSelectCopyMulti } from 'shared/components/TextSelectCopy'; import { useAsync } from 'shared/hooks/useAsync'; -import { Integration } from 'teleport/services/integrations'; - import cfg from 'teleport/config'; +import { Integration } from 'teleport/services/integrations'; import { splitAwsIamArn } from 'teleport/services/integrations/aws'; -import { EditableIntegrationFields } from './Operations/useIntegrationOperation'; import { S3BucketConfiguration } from './Enroll/AwsOidc/S3BucketConfiguration'; +import { EditableIntegrationFields } from './Operations/useIntegrationOperation'; type Props = { close(): void; diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.test.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.test.tsx index 652dace061eb6..8b378241c0324 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.test.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.test.tsx @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +import { MemoryRouter } from 'react-router'; + import { fireEvent, render, @@ -23,12 +25,10 @@ import { userEvent, waitFor, } from 'design/utils/testing'; -import { MemoryRouter } from 'react-router'; - -import { userEventService } from 'teleport/services/userEvent'; -import { integrationService } from 'teleport/services/integrations'; import { ApiError } from 'teleport/services/api/parseError'; +import { integrationService } from 'teleport/services/integrations'; +import { userEventService } from 'teleport/services/userEvent'; import { AwsOidc } from './AwsOidc'; diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx index c7e9a9be07a43..4a82346efef57 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx @@ -17,38 +17,38 @@ */ import React, { useEffect, useState } from 'react'; -import { Link as InternalRouteLink } from 'react-router-dom'; import { useLocation } from 'react-router'; +import { Link as InternalRouteLink } from 'react-router-dom'; import styled from 'styled-components'; -import { Box, ButtonSecondary, Text, Link, Flex, ButtonPrimary } from 'design'; + +import { Box, ButtonPrimary, ButtonSecondary, Flex, Link, Text } from 'design'; import * as Icons from 'design/Icon'; import FieldInput from 'shared/components/FieldInput'; -import { requiredIamRoleName } from 'shared/components/Validation/rules'; import Validation, { Validator } from 'shared/components/Validation'; +import { requiredIamRoleName } from 'shared/components/Validation/rules'; import useAttempt from 'shared/hooks/useAttemptNext'; -import { - IntegrationEnrollEvent, - IntegrationEnrollEventData, - IntegrationEnrollKind, - userEventService, -} from 'teleport/services/userEvent'; +import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; +import cfg from 'teleport/config'; import { Header } from 'teleport/Discover/Shared'; import { AWS_RESOURCE_GROUPS_TAG_EDITOR_LINK } from 'teleport/Discover/Shared/const'; import { DiscoverUrlLocationState } from 'teleport/Discover/useDiscover'; -import { TextSelectCopyMulti } from 'teleport/components/TextSelectCopy'; -import useStickyClusterId from 'teleport/useStickyClusterId'; - +import { ApiError } from 'teleport/services/api/parseError'; import { Integration, IntegrationKind, integrationService, } from 'teleport/services/integrations'; -import cfg from 'teleport/config'; -import { ApiError } from 'teleport/services/api/parseError'; +import { + IntegrationEnrollEvent, + IntegrationEnrollEventData, + IntegrationEnrollKind, + userEventService, +} from 'teleport/services/userEvent'; +import useStickyClusterId from 'teleport/useStickyClusterId'; -import { FinishDialog } from './FinishDialog'; import { ConfigureAwsOidcSummary } from './ConfigureAwsOidcSummary'; +import { FinishDialog } from './FinishDialog'; export function AwsOidc() { const [integrationName, setIntegrationName] = useState(''); diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/ConfigureAwsOidcSummary.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/ConfigureAwsOidcSummary.tsx index aecd67c00d114..759a981d01762 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/ConfigureAwsOidcSummary.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/ConfigureAwsOidcSummary.tsx @@ -18,7 +18,8 @@ import React from 'react'; import styled from 'styled-components'; -import { Flex, Box, H3, Text } from 'design'; + +import { Box, Flex, H3, Text } from 'design'; import TextEditor from 'shared/components/TextEditor'; import { ToolTipInfo } from 'shared/components/ToolTip'; diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/FinishDialog.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/FinishDialog.tsx index b1fafdb9fde07..5fe4d0d699e6b 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/FinishDialog.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/FinishDialog.tsx @@ -16,21 +16,22 @@ * along with this program. If not, see . */ -import React from 'react'; import { Location } from 'history'; +import React from 'react'; import { useLocation } from 'react-router'; import { Link } from 'react-router-dom'; -import { CircleCheck } from 'design/Icon'; -import { ButtonPrimary, ButtonSecondary, Text, Flex } from 'design'; + +import { ButtonPrimary, ButtonSecondary, Flex, Text } from 'design'; import Dialog, { - DialogHeader, DialogContent, DialogFooter, + DialogHeader, } from 'design/Dialog'; +import { CircleCheck } from 'design/Icon'; import cfg from 'teleport/config'; -import { Integration } from 'teleport/services/integrations'; import { DiscoverUrlLocationState } from 'teleport/Discover/useDiscover'; +import { Integration } from 'teleport/services/integrations'; export function FinishDialog({ integration }: { integration: Integration }) { const location = useLocation(); diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/S3BucketConfiguration.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/S3BucketConfiguration.tsx index a225196d65dfc..0095f06b1a061 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/S3BucketConfiguration.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/S3BucketConfiguration.tsx @@ -17,7 +17,8 @@ */ import React from 'react'; -import { Text, Flex } from 'design'; + +import { Flex, Text } from 'design'; import FieldInput from 'shared/components/FieldInput'; import { ToolTipInfo } from 'shared/components/ToolTip'; diff --git a/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.story.tsx b/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.story.tsx index 5964e459ff8e4..d351d6ad87b3a 100644 --- a/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.story.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.story.tsx @@ -20,10 +20,8 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; - -import { createTeleportContext } from 'teleport/mocks/contexts'; - import cfg from 'teleport/config'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { IntegrationEnroll } from './IntegrationEnroll'; diff --git a/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.tsx b/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.tsx index b8b37ac37636d..115d85443854b 100644 --- a/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/IntegrationEnroll.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Flex } from 'design'; import { @@ -24,13 +25,13 @@ import { FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import cfg from 'teleport/config'; import { Route, Switch } from 'teleport/components/Router'; +import cfg from 'teleport/config'; -import { MachineIDIntegrationSection } from './MachineIDIntegrationSection'; -import { IntegrationTiles } from './IntegrationTiles'; import { NoCodeIntegrationDescription } from './common'; import { getRoutesToEnrollIntegrations } from './IntegrationRoute'; +import { IntegrationTiles } from './IntegrationTiles'; +import { MachineIDIntegrationSection } from './MachineIDIntegrationSection'; export function IntegrationEnroll() { return ( diff --git a/web/packages/teleport/src/Integrations/Enroll/IntegrationRoute.tsx b/web/packages/teleport/src/Integrations/Enroll/IntegrationRoute.tsx index 347e226794abe..750410ca993e9 100644 --- a/web/packages/teleport/src/Integrations/Enroll/IntegrationRoute.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/IntegrationRoute.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import cfg from 'teleport/config'; import { Route } from 'teleport/components/Router'; +import cfg from 'teleport/config'; import { IntegrationKind } from 'teleport/services/integrations'; import { AwsOidc } from './AwsOidc'; diff --git a/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.test.tsx b/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.test.tsx index 73c55b0b06eb9..b1eff21ab0fdc 100644 --- a/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.test.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.test.tsx @@ -18,6 +18,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import { render, screen, userEvent } from 'design/utils/testing'; import cfg from 'teleport/config'; diff --git a/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.tsx b/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.tsx index 6ada1cdf83dc7..4eb6d7dad5c92 100644 --- a/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/IntegrationTiles.tsx @@ -18,17 +18,17 @@ import React from 'react'; import { Link } from 'react-router-dom'; -import { Text, Box, ResourceIcon } from 'design'; -import cfg from 'teleport/config'; +import { Box, ResourceIcon, Text } from 'design'; + +import { ToolTipBadge } from 'teleport/components/ToolTipBadge'; import { BadgeTitle, ToolTipNoPermBadge, } from 'teleport/components/ToolTipNoPermBadge'; +import cfg from 'teleport/config'; import { IntegrationKind } from 'teleport/services/integrations'; -import { ToolTipBadge } from 'teleport/components/ToolTipBadge'; - import { IntegrationTile } from './common'; export function IntegrationTiles({ diff --git a/web/packages/teleport/src/Integrations/Enroll/common.tsx b/web/packages/teleport/src/Integrations/Enroll/common.tsx index d103ee896ec59..468c5138d55ee 100644 --- a/web/packages/teleport/src/Integrations/Enroll/common.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/common.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { Box, Flex, Text } from 'design'; import styled from 'styled-components'; +import { Box, Flex, Text } from 'design'; + export const IntegrationTile = styled(Flex)<{ disabled?: boolean; $exists?: boolean; diff --git a/web/packages/teleport/src/Integrations/IntegrationList.tsx b/web/packages/teleport/src/Integrations/IntegrationList.tsx index 26a0e376af26f..08f16f4c20818 100644 --- a/web/packages/teleport/src/Integrations/IntegrationList.tsx +++ b/web/packages/teleport/src/Integrations/IntegrationList.tsx @@ -17,26 +17,26 @@ */ import React from 'react'; -import styled from 'styled-components'; import { useHistory } from 'react-router'; import { Link as InternalRouteLink } from 'react-router-dom'; +import styled from 'styled-components'; import { Box, Flex } from 'design'; import Table, { Cell } from 'design/DataTable'; +import { ResourceIcon } from 'design/ResourceIcon'; import { MenuButton, MenuItem } from 'shared/components/MenuAction'; import { ToolTipInfo } from 'shared/components/ToolTip'; -import { ResourceIcon } from 'design/ResourceIcon'; +import cfg from 'teleport/config'; import { + ExternalAuditStorageIntegration, getStatusCodeDescription, getStatusCodeTitle, Integration, - IntegrationStatusCode, IntegrationKind, + IntegrationStatusCode, Plugin, - ExternalAuditStorageIntegration, } from 'teleport/services/integrations'; -import cfg from 'teleport/config'; import { ExternalAuditStorageOpType } from './Operations/useIntegrationOperation'; diff --git a/web/packages/teleport/src/Integrations/Integrations.story.tsx b/web/packages/teleport/src/Integrations/Integrations.story.tsx index 4778031667ccb..4e35c0154c7a6 100644 --- a/web/packages/teleport/src/Integrations/Integrations.story.tsx +++ b/web/packages/teleport/src/Integrations/Integrations.story.tsx @@ -24,10 +24,10 @@ import { IntegrationStatusCode, } from 'teleport/services/integrations'; +import { EditAwsOidcIntegrationDialog } from './EditAwsOidcIntegrationDialog'; +import { integrations, plugins } from './fixtures'; import { IntegrationList } from './IntegrationList'; import { DeleteIntegrationDialog } from './RemoveIntegrationDialog'; -import { EditAwsOidcIntegrationDialog } from './EditAwsOidcIntegrationDialog'; -import { plugins, integrations } from './fixtures'; export default { title: 'Teleport/Integrations', diff --git a/web/packages/teleport/src/Integrations/Integrations.tsx b/web/packages/teleport/src/Integrations/Integrations.tsx index 619bb791a0acc..cd92b99e11bbb 100644 --- a/web/packages/teleport/src/Integrations/Integrations.tsx +++ b/web/packages/teleport/src/Integrations/Integrations.tsx @@ -16,23 +16,25 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; + +import { Alert, Box, Indicator } from 'design'; import useAttempt from 'shared/hooks/useAttemptNext'; -import { Indicator, Box, Alert } from 'design'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; +import { + integrationService, + type Integration, +} from 'teleport/services/integrations'; import useTeleport from 'teleport/useTeleport'; -import { integrationService } from 'teleport/services/integrations'; -import { IntegrationsAddButton } from './IntegrationsAddButton'; import { IntegrationList } from './IntegrationList'; -import { useIntegrationOperation, IntegrationOperations } from './Operations'; - -import type { Integration } from 'teleport/services/integrations'; +import { IntegrationsAddButton } from './IntegrationsAddButton'; +import { IntegrationOperations, useIntegrationOperation } from './Operations'; import type { EditableIntegrationFields } from './Operations/useIntegrationOperation'; export function Integrations() { diff --git a/web/packages/teleport/src/Integrations/IntegrationsAddButton.test.tsx b/web/packages/teleport/src/Integrations/IntegrationsAddButton.test.tsx index 6021f79e52a96..72421c822bc28 100644 --- a/web/packages/teleport/src/Integrations/IntegrationsAddButton.test.tsx +++ b/web/packages/teleport/src/Integrations/IntegrationsAddButton.test.tsx @@ -17,6 +17,7 @@ */ import { MemoryRouter } from 'react-router'; + import { render, screen } from 'design/utils/testing'; import { IntegrationsAddButton } from './IntegrationsAddButton'; diff --git a/web/packages/teleport/src/Integrations/IntegrationsAddButton.tsx b/web/packages/teleport/src/Integrations/IntegrationsAddButton.tsx index 443df9285c0bc..12aa1c12065d6 100644 --- a/web/packages/teleport/src/Integrations/IntegrationsAddButton.tsx +++ b/web/packages/teleport/src/Integrations/IntegrationsAddButton.tsx @@ -18,9 +18,10 @@ import React from 'react'; import { Link } from 'react-router-dom'; + import { Button } from 'design'; -import { HoverTooltip } from 'shared/components/ToolTip'; import { MissingPermissionsTooltip } from 'shared/components/MissingPermissionsTooltip'; +import { HoverTooltip } from 'shared/components/ToolTip'; import cfg from 'teleport/config'; diff --git a/web/packages/teleport/src/Integrations/Operations/IntegrationOperations.tsx b/web/packages/teleport/src/Integrations/Operations/IntegrationOperations.tsx index 9960ff2d3358d..c799a64a8f16c 100644 --- a/web/packages/teleport/src/Integrations/Operations/IntegrationOperations.tsx +++ b/web/packages/teleport/src/Integrations/Operations/IntegrationOperations.tsx @@ -20,12 +20,11 @@ import React from 'react'; import { Integration } from 'teleport/services/integrations'; -import { DeleteIntegrationDialog } from '../RemoveIntegrationDialog'; import { EditAwsOidcIntegrationDialog } from '../EditAwsOidcIntegrationDialog'; - +import { DeleteIntegrationDialog } from '../RemoveIntegrationDialog'; import { - OperationType, EditableIntegrationFields, + OperationType, } from './useIntegrationOperation'; type Props = { diff --git a/web/packages/teleport/src/Integrations/Operations/useIntegrationOperation.ts b/web/packages/teleport/src/Integrations/Operations/useIntegrationOperation.ts index 252ad4ba65683..e8c19f4fe5dd2 100644 --- a/web/packages/teleport/src/Integrations/Operations/useIntegrationOperation.ts +++ b/web/packages/teleport/src/Integrations/Operations/useIntegrationOperation.ts @@ -21,11 +21,11 @@ import { useState } from 'react'; import { IntegrationKind, integrationService, + type Integration, + type Plugin, } from 'teleport/services/integrations'; import useStickyClusterId from 'teleport/useStickyClusterId'; -import type { Integration, Plugin } from 'teleport/services/integrations'; - export function useIntegrationOperation() { const { clusterId } = useStickyClusterId(); diff --git a/web/packages/teleport/src/Integrations/RemoveIntegrationDialog.tsx b/web/packages/teleport/src/Integrations/RemoveIntegrationDialog.tsx index 1a3b25f21ffa2..a2fd03c62e089 100644 --- a/web/packages/teleport/src/Integrations/RemoveIntegrationDialog.tsx +++ b/web/packages/teleport/src/Integrations/RemoveIntegrationDialog.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { ButtonSecondary, ButtonWarning, Text, Alert } from 'design'; + +import { Alert, ButtonSecondary, ButtonWarning, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/DialogConfirmation'; import useAttempt from 'shared/hooks/useAttemptNext'; diff --git a/web/packages/teleport/src/Integrations/fixtures.ts b/web/packages/teleport/src/Integrations/fixtures.ts index 83a33648a6532..6eea91258efd0 100644 --- a/web/packages/teleport/src/Integrations/fixtures.ts +++ b/web/packages/teleport/src/Integrations/fixtures.ts @@ -19,12 +19,9 @@ import { IntegrationKind, IntegrationStatusCode, -} from 'teleport/services/integrations'; - -import type { - Plugin, - Integration, - ExternalAuditStorage, + type ExternalAuditStorage, + type Integration, + type Plugin, } from 'teleport/services/integrations'; export const plugins: Plugin[] = [ diff --git a/web/packages/teleport/src/JoinTokens/JoinTokenForms.tsx b/web/packages/teleport/src/JoinTokens/JoinTokenForms.tsx index e511ded3df6bf..552dbd1d997b5 100644 --- a/web/packages/teleport/src/JoinTokens/JoinTokenForms.tsx +++ b/web/packages/teleport/src/JoinTokens/JoinTokenForms.tsx @@ -17,11 +17,12 @@ */ import React from 'react'; -import { Flex, Text, ButtonIcon, ButtonText } from 'design'; + +import { ButtonIcon, ButtonText, Flex, Text } from 'design'; import { Plus, Trash } from 'design/Icon'; -import { requiredField } from 'shared/components/Validation/rules'; import FieldInput from 'shared/components/FieldInput'; import { FieldSelectCreatable } from 'shared/components/FieldSelect'; +import { requiredField } from 'shared/components/Validation/rules'; import { NewJoinTokenState, OptionGCP, RuleBox } from './UpsertJoinTokenDialog'; diff --git a/web/packages/teleport/src/JoinTokens/JoinTokens.story.tsx b/web/packages/teleport/src/JoinTokens/JoinTokens.story.tsx index 3dfdea17ab491..eab1adc0cc791 100644 --- a/web/packages/teleport/src/JoinTokens/JoinTokens.story.tsx +++ b/web/packages/teleport/src/JoinTokens/JoinTokens.story.tsx @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import React from 'react'; -import { MemoryRouter } from 'react-router'; import { rest } from 'msw'; import { initialize, mswLoader } from 'msw-storybook-addon'; +import React from 'react'; +import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; import cfg from 'teleport/config'; -import { JoinToken } from 'teleport/services/joinToken'; import { createTeleportContext } from 'teleport/mocks/contexts'; +import { JoinToken } from 'teleport/services/joinToken'; import { JoinTokens } from './JoinTokens'; diff --git a/web/packages/teleport/src/JoinTokens/JoinTokens.test.tsx b/web/packages/teleport/src/JoinTokens/JoinTokens.test.tsx index 8a14145e8303a..b1f4510ff1ad2 100644 --- a/web/packages/teleport/src/JoinTokens/JoinTokens.test.tsx +++ b/web/packages/teleport/src/JoinTokens/JoinTokens.test.tsx @@ -15,12 +15,13 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { render, screen, fireEvent } from 'design/utils/testing'; -import userEvent from '@testing-library/user-event'; import { within } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; + +import { fireEvent, render, screen } from 'design/utils/testing'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import makeJoinToken from 'teleport/services/joinToken/makeJoinToken'; import { JoinTokens } from './JoinTokens'; diff --git a/web/packages/teleport/src/JoinTokens/JoinTokens.tsx b/web/packages/teleport/src/JoinTokens/JoinTokens.tsx index a7b2d7893645b..4586f01544e4d 100644 --- a/web/packages/teleport/src/JoinTokens/JoinTokens.tsx +++ b/web/packages/teleport/src/JoinTokens/JoinTokens.tsx @@ -16,46 +16,46 @@ * along with this program. If not, see . */ -import styled from 'styled-components'; +import { addHours, isAfter } from 'date-fns'; import { useEffect, useState } from 'react'; -import { isAfter, addHours } from 'date-fns'; +import styled from 'styled-components'; + import { + Alert, Box, - Text, + Button, + ButtonSecondary, + ButtonWarning, Flex, Indicator, Label, - Alert, Link, MenuItem, - ButtonWarning, - ButtonSecondary, - Button, + Text, } from 'design'; import Table, { Cell } from 'design/DataTable'; -import { Warning } from 'design/Icon'; import Dialog, { DialogContent, DialogFooter, DialogHeader, DialogTitle, } from 'design/Dialog'; +import { Warning } from 'design/Icon'; import { MenuButton } from 'shared/components/MenuAction'; -import { Attempt, useAsync } from 'shared/hooks/useAsync'; import { HoverTooltip } from 'shared/components/ToolTip'; import { CopyButton } from 'shared/components/UnifiedResources/shared/CopyButton'; +import { Attempt, useAsync } from 'shared/hooks/useAsync'; import { useTeleport } from 'teleport'; -import useResources from 'teleport/components/useResources'; - import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import { JoinToken } from 'teleport/services/joinToken'; -import { Resource, KindJoinToken } from 'teleport/services/resources'; import ResourceEditor from 'teleport/components/ResourceEditor'; +import useResources from 'teleport/components/useResources'; +import { JoinToken } from 'teleport/services/joinToken'; +import { KindJoinToken, Resource } from 'teleport/services/resources'; import { UpsertJoinTokenDialog } from './UpsertJoinTokenDialog'; diff --git a/web/packages/teleport/src/JoinTokens/UpsertJoinTokenDialog.tsx b/web/packages/teleport/src/JoinTokens/UpsertJoinTokenDialog.tsx index ffa07787cfaba..b05e68d858991 100644 --- a/web/packages/teleport/src/JoinTokens/UpsertJoinTokenDialog.tsx +++ b/web/packages/teleport/src/JoinTokens/UpsertJoinTokenDialog.tsx @@ -17,25 +17,25 @@ */ import { useState } from 'react'; +import styled from 'styled-components'; import { - Flex, - Text, + Alert, Box, ButtonIcon, - ButtonText, ButtonPrimary, ButtonSecondary, - Alert, + ButtonText, + Flex, + Text, } from 'design'; -import styled from 'styled-components'; -import { HoverTooltip } from 'shared/components/ToolTip'; import { Cross } from 'design/Icon'; -import Validation from 'shared/components/Validation'; import FieldInput from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import { FieldSelect } from 'shared/components/FieldSelect'; import { Option } from 'shared/components/Select'; +import { HoverTooltip } from 'shared/components/ToolTip'; +import Validation from 'shared/components/Validation'; +import { requiredField } from 'shared/components/Validation/rules'; import { useAsync } from 'shared/hooks/useAsync'; import { useTeleport } from 'teleport'; diff --git a/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.story.test.tsx b/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.story.test.tsx index 737e071b59f3b..5505ba3c80153 100644 --- a/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.story.test.tsx +++ b/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.story.test.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; -import { Local, Sso, LocalWithRequestId } from './ConnectDialog.story'; +import { Local, LocalWithRequestId, Sso } from './ConnectDialog.story'; test('kube connect dialogue local', () => { const { baseElement } = render(); diff --git a/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.tsx b/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.tsx index 44e0a1fdddecb..b1989fe6ec8e5 100644 --- a/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.tsx +++ b/web/packages/teleport/src/Kubes/ConnectDialog/ConnectDialog.tsx @@ -17,18 +17,19 @@ */ import React from 'react'; + +import { Box, ButtonPrimary, ButtonSecondary, Flex, Text } from 'design'; import Dialog, { + DialogContent, DialogFooter, DialogHeader, DialogTitle, - DialogContent, } from 'design/Dialog'; -import { Text, Box, ButtonSecondary, ButtonPrimary, Flex } from 'design'; -import { generateTshLoginCommand, openNewTab } from 'teleport/lib/util'; -import { AuthType } from 'teleport/services/user'; import TextSelectCopy from 'teleport/components/TextSelectCopy'; import cfg from 'teleport/config'; +import { generateTshLoginCommand, openNewTab } from 'teleport/lib/util'; +import { AuthType } from 'teleport/services/user'; function ConnectDialog(props: Props) { const { diff --git a/web/packages/teleport/src/Kubes/ConnectDialog/index.ts b/web/packages/teleport/src/Kubes/ConnectDialog/index.ts index 36057e0d81bec..739fa3d5ba5a6 100644 --- a/web/packages/teleport/src/Kubes/ConnectDialog/index.ts +++ b/web/packages/teleport/src/Kubes/ConnectDialog/index.ts @@ -17,4 +17,5 @@ */ import ConnectDialog from './ConnectDialog'; + export default ConnectDialog; diff --git a/web/packages/teleport/src/LocksV2/Locks/DeleteLockDialogue.tsx b/web/packages/teleport/src/LocksV2/Locks/DeleteLockDialogue.tsx index 2f87a33e80355..73788797bb101 100644 --- a/web/packages/teleport/src/LocksV2/Locks/DeleteLockDialogue.tsx +++ b/web/packages/teleport/src/LocksV2/Locks/DeleteLockDialogue.tsx @@ -17,15 +17,16 @@ */ import React from 'react'; -import { ButtonSecondary, ButtonWarning, Text, Flex } from 'design'; + +import { ButtonSecondary, ButtonWarning, Flex, Text } from 'design'; import { Danger } from 'design/Alert'; -import useAttempt from 'shared/hooks/useAttemptNext'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/DialogConfirmation'; +import useAttempt from 'shared/hooks/useAttemptNext'; import { Lock } from 'teleport/services/locks'; diff --git a/web/packages/teleport/src/LocksV2/Locks/Locks.test.tsx b/web/packages/teleport/src/LocksV2/Locks/Locks.test.tsx index 6dd1a13c796ab..5ead55fb92c94 100644 --- a/web/packages/teleport/src/LocksV2/Locks/Locks.test.tsx +++ b/web/packages/teleport/src/LocksV2/Locks/Locks.test.tsx @@ -16,15 +16,16 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { setupServer } from 'msw/node'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { setupServer } from 'msw/node'; -import { rest } from 'msw'; -import { render, fireEvent, screen } from 'design/utils/testing'; + +import { fireEvent, render, screen } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; -import { createTeleportContext } from 'teleport/mocks/contexts'; import cfg from 'teleport/config'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { Locks } from './Locks'; diff --git a/web/packages/teleport/src/LocksV2/Locks/Locks.tsx b/web/packages/teleport/src/LocksV2/Locks/Locks.tsx index 698357d759acb..6d56af3577127 100644 --- a/web/packages/teleport/src/LocksV2/Locks/Locks.tsx +++ b/web/packages/teleport/src/LocksV2/Locks/Locks.tsx @@ -16,28 +16,26 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; -import { useLocation, useHistory } from 'react-router'; import { formatRelative } from 'date-fns'; -import { Danger } from 'design/Alert'; +import React, { useEffect, useState } from 'react'; +import { useHistory, useLocation } from 'react-router'; -import Table, { Cell } from 'design/DataTable'; import { ButtonPrimary, Label as Pill } from 'design'; +import { Danger } from 'design/Alert'; +import Table, { Cell } from 'design/DataTable'; import useAttempt from 'shared/hooks/useAttemptNext'; -import cfg from 'teleport/config'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; import { NavLink } from 'teleport/components/Router'; +import cfg from 'teleport/config'; +import { Lock, lockService, LockTarget } from 'teleport/services/locks'; import useTeleport from 'teleport/useTeleport'; -import { lockService, Lock, LockTarget } from 'teleport/services/locks'; - import { TrashButton } from '../common'; - import { DeleteLockDialogue } from './DeleteLockDialogue'; export function Locks() { diff --git a/web/packages/teleport/src/LocksV2/NewLock/LockCheckout/LockCheckout.tsx b/web/packages/teleport/src/LocksV2/NewLock/LockCheckout/LockCheckout.tsx index fc599ad48699e..26f821319af50 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/LockCheckout/LockCheckout.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/LockCheckout/LockCheckout.tsx @@ -16,28 +16,30 @@ * along with this program. If not, see . */ -import React, { useState, useRef, useEffect } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { Link } from 'react-router-dom'; +import type { TransitionStatus } from 'react-transition-group'; import styled from 'styled-components'; + import { + Alert, Box, - Flex, - ButtonText, ButtonPrimary, + ButtonText, + Flex, Image, - Text, - Alert, Input, + Text, } from 'design'; -import { ArrowBack } from 'design/Icon'; import Table, { Cell } from 'design/DataTable'; +import { ArrowBack } from 'design/Icon'; import useAttempt from 'shared/hooks/useAttemptNext'; import { pluralize } from 'shared/utils/text'; +import shieldCheck from 'teleport/assets/shield-check.png'; import cfg from 'teleport/config'; -import { lockService } from 'teleport/services/locks'; import { TrashButton } from 'teleport/LocksV2/common'; -import shieldCheck from 'teleport/assets/shield-check.png'; +import { lockService } from 'teleport/services/locks'; import { LockResource, @@ -46,8 +48,6 @@ import { ToggleSelectResourceFn, } from '../common'; -import type { TransitionStatus } from 'react-transition-group'; - type Props = { onClose(): void; selectedResources: LockResourceMap; diff --git a/web/packages/teleport/src/LocksV2/NewLock/NewLock.tsx b/web/packages/teleport/src/LocksV2/NewLock/NewLock.tsx index 10aeb0b936080..cbbe8e71947ad 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/NewLock.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/NewLock.tsx @@ -20,38 +20,39 @@ import React, { useState } from 'react'; import { Prompt } from 'react-router'; import { Link } from 'react-router-dom'; import { Transition } from 'react-transition-group'; -import { Box, Flex, ButtonSecondary, Text, ButtonPrimary } from 'design'; + +import { Box, ButtonPrimary, ButtonSecondary, Flex, Text } from 'design'; +import { ArrowBack } from 'design/Icon'; import Select from 'shared/components/Select'; import useAttempt from 'shared/hooks/useAttemptNext'; -import { ArrowBack } from 'design/Icon'; +import ErrorMessage from 'teleport/components/AgentErrorMessage'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import ErrorMessage from 'teleport/components/AgentErrorMessage'; import cfg from 'teleport/config'; -import { LockCheckout } from './LockCheckout/LockCheckout'; import { - SimpleList, - SimpleListOpts, -} from './ResourceList/SimpleList/SimpleList'; -import { ServerSideSupportedList } from './ResourceList/ServerSideSupportedList/ServerSideSupportedList'; -import { Logins } from './ResourceList/Logins'; + baseResourceKindOpts, + CommonListProps, + getEmptyResourceMap, + LockResource, + LockResourceMap, + LockResourceOption, +} from './common'; +import { LockCheckout } from './LockCheckout/LockCheckout'; import { HybridList, HybridListOpts, } from './ResourceList/HybridList/HybridList'; +import { Logins } from './ResourceList/Logins'; +import { ServerSideSupportedList } from './ResourceList/ServerSideSupportedList/ServerSideSupportedList'; import { - CommonListProps, - LockResourceMap, - LockResourceOption, - getEmptyResourceMap, - baseResourceKindOpts, - LockResource, -} from './common'; + SimpleList, + SimpleListOpts, +} from './ResourceList/SimpleList/SimpleList'; const PAGE_SIZE = 10; diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/HybridList/HybridList.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/HybridList/HybridList.tsx index 3becc4a34c714..899cf71945b0a 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/HybridList/HybridList.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/HybridList/HybridList.tsx @@ -16,13 +16,14 @@ * along with this program. If not, see . */ -import React, { useState, useEffect, useMemo } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; + import { FetchStatus } from 'design/DataTable/types'; import { UrlResourcesParams } from 'teleport/config'; -import { TableWrapper, HybridListProps } from '../common'; import { CommonListProps, LockResourceKind } from '../../common'; +import { HybridListProps, TableWrapper } from '../common'; export type HybridListOpts = { getFetchFn( diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/Logins.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/Logins.tsx index e6560db5c56c7..e30befa1275db 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/Logins.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/Logins.tsx @@ -17,10 +17,11 @@ */ import React, { useState } from 'react'; -import Table from 'design/DataTable'; + import { Box, ButtonSecondary, Flex, Input, Text } from 'design'; +import Table from 'design/DataTable'; -import { renderActionCell, LoginsProps } from './common'; +import { LoginsProps, renderActionCell } from './common'; export function Logins(props: LoginsProps) { const [loginInput, setLoginInput] = useState(''); diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Desktops.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Desktops.tsx index 198f8b80dbaee..d9fcde81fdf03 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Desktops.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Desktops.tsx @@ -17,11 +17,12 @@ */ import React from 'react'; + import { ClickableLabelCell } from 'design/DataTable'; import { Desktop } from 'teleport/services/desktops'; -import { ServerSideListProps, StyledTable, renderActionCell } from '../common'; +import { renderActionCell, ServerSideListProps, StyledTable } from '../common'; export function Desktops(props: ServerSideListProps & { desktops: Desktop[] }) { const { diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Nodes.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Nodes.tsx index 0bc5d8e32296d..e695896f95bf2 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Nodes.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Nodes.tsx @@ -17,11 +17,12 @@ */ import React from 'react'; + import { Cell, ClickableLabelCell } from 'design/DataTable'; import { Node } from 'teleport/services/nodes'; -import { ServerSideListProps, StyledTable, renderActionCell } from '../common'; +import { renderActionCell, ServerSideListProps, StyledTable } from '../common'; export function Nodes(props: ServerSideListProps & { nodes: Node[] }) { const { diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Roles.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Roles.tsx index a709af747dabe..ccabd445d58b5 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Roles.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/Roles.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import Table from 'design/DataTable'; import { RoleResource } from 'teleport/services/resources'; diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/ServerSideSupportedList.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/ServerSideSupportedList.tsx index e7e6848b18e4d..5e148958ed246 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/ServerSideSupportedList.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/ServerSideSupportedList/ServerSideSupportedList.tsx @@ -16,38 +16,35 @@ * along with this program. If not, see . */ -import React, { useState, useEffect, useMemo } from 'react'; -import { SortType } from 'design/DataTable/types'; +import React, { useEffect, useMemo, useState } from 'react'; + import { Flex } from 'design'; -import { StyledPanel } from 'design/DataTable/StyledTable'; -import { SearchPanel } from 'shared/components/Search'; import { StyledArrowBtn } from 'design/DataTable/Pager/StyledPager'; +import { StyledPanel } from 'design/DataTable/StyledTable'; +import { SortType } from 'design/DataTable/types'; import { CircleArrowLeft, CircleArrowRight } from 'design/Icon'; - +import { SearchPanel } from 'shared/components/Search'; import { makeAdvancedSearchQueryForLabel } from 'shared/utils/advancedSearchLabelQuery'; -import { Desktop } from 'teleport/services/desktops'; -import { Node } from 'teleport/services/nodes'; import { useServerSidePagination } from 'teleport/components/hooks'; -import useTeleport from 'teleport/useTeleport'; import cfg, { UrlResourcesParams } from 'teleport/config'; -import Ctx from 'teleport/teleportContext'; - +import type { + ResourceFilter, + ResourceLabel, + ResourcesResponse, +} from 'teleport/services/agents'; +import { Desktop } from 'teleport/services/desktops'; +import { Node } from 'teleport/services/nodes'; import { RoleResource } from 'teleport/services/resources'; +import Ctx from 'teleport/teleportContext'; +import useTeleport from 'teleport/useTeleport'; -import { TableWrapper, ServerSideListProps } from '../common'; import { CommonListProps, LockResourceKind } from '../../common'; - -import { Nodes } from './Nodes'; +import { ServerSideListProps, TableWrapper } from '../common'; import { Desktops } from './Desktops'; +import { Nodes } from './Nodes'; import { Roles } from './Roles'; -import type { - ResourceLabel, - ResourceFilter, - ResourcesResponse, -} from 'teleport/services/agents'; - export function ServerSideSupportedList(props: CommonListProps) { const ctx = useTeleport(); diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/MfaDevices.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/MfaDevices.tsx index 6156c528787b7..4a9aab06aaca5 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/MfaDevices.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/MfaDevices.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Text } from 'design'; import Table, { Cell } from 'design/DataTable'; import { dateMatcher } from 'design/utils/match'; diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/SimpleList.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/SimpleList.tsx index 3b4fe0586cd7a..c293c75e5c937 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/SimpleList.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/SimpleList.tsx @@ -16,17 +16,16 @@ * along with this program. If not, see . */ -import React, { useState, useEffect, useMemo } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; -import useTeleport from 'teleport/useTeleport'; -import { User } from 'teleport/services/user'; import { MfaDevice } from 'teleport/services/mfa'; +import { User } from 'teleport/services/user'; +import useTeleport from 'teleport/useTeleport'; -import { TableWrapper, SimpleListProps } from '../common'; import { CommonListProps, LockResourceKind } from '../../common'; - -import Users from './Users'; +import { SimpleListProps, TableWrapper } from '../common'; import { MfaDevices } from './MfaDevices'; +import Users from './Users'; export type SimpleListOpts = { getFetchFn( diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/Users.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/Users.tsx index e8f1aff3a122c..7aabe695f2992 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/Users.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/SimpleList/Users.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import Table, { Cell, LabelCell } from 'design/DataTable'; import { User } from 'teleport/services/user'; diff --git a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/common.tsx b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/common.tsx index 817958341ca84..7501b8ea70043 100644 --- a/web/packages/teleport/src/LocksV2/NewLock/ResourceList/common.tsx +++ b/web/packages/teleport/src/LocksV2/NewLock/ResourceList/common.tsx @@ -18,7 +18,8 @@ import React from 'react'; import styled from 'styled-components'; -import { Box, ButtonPrimary, ButtonBorder } from 'design'; + +import { Box, ButtonBorder, ButtonPrimary } from 'design'; import Table, { Cell } from 'design/DataTable'; import { CustomSort, diff --git a/web/packages/teleport/src/LocksV2/common.tsx b/web/packages/teleport/src/LocksV2/common.tsx index b95a1ccd040f3..68b0a77522a68 100644 --- a/web/packages/teleport/src/LocksV2/common.tsx +++ b/web/packages/teleport/src/LocksV2/common.tsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Trash } from 'design/Icon'; export const TrashButton = styled(Trash)` diff --git a/web/packages/teleport/src/Login/Login.story.tsx b/web/packages/teleport/src/Login/Login.story.tsx index d12362b3f3f31..5e5ca1d8325e2 100644 --- a/web/packages/teleport/src/Login/Login.story.tsx +++ b/web/packages/teleport/src/Login/Login.story.tsx @@ -17,17 +17,15 @@ */ import React, { useEffect } from 'react'; - import { MemoryRouter } from 'react-router'; import { Route } from 'teleport/components/Router'; - import cfg from 'teleport/config'; +import { LoginComponent as Login } from './Login'; +import { LoginFailedComponent as LoginFailed } from './LoginFailed'; import { LoginSuccess } from './LoginSuccess'; import { LoginTerminalRedirect } from './LoginTerminalRedirect'; -import { LoginFailedComponent as LoginFailed } from './LoginFailed'; -import { LoginComponent as Login } from './Login'; import { State } from './useLogin'; const defaultEdition = cfg.edition; diff --git a/web/packages/teleport/src/Login/Login.test.tsx b/web/packages/teleport/src/Login/Login.test.tsx index 964b4ba04b32f..ac5af29894efe 100644 --- a/web/packages/teleport/src/Login/Login.test.tsx +++ b/web/packages/teleport/src/Login/Login.test.tsx @@ -16,14 +16,15 @@ * along with this program. If not, see . */ -import React from 'react'; import { userEvent, UserEvent } from '@testing-library/user-event'; +import React from 'react'; import selectEvent from 'react-select-event'; -import { render, fireEvent, screen, waitFor } from 'design/utils/testing'; +import { fireEvent, render, screen, waitFor } from 'design/utils/testing'; + +import cfg from 'teleport/config'; import auth from 'teleport/services/auth/auth'; import history from 'teleport/services/history'; -import cfg from 'teleport/config'; import { Login } from './Login'; diff --git a/web/packages/teleport/src/Login/Login.tsx b/web/packages/teleport/src/Login/Login.tsx index 3b64d42671373..a2671fa74b476 100644 --- a/web/packages/teleport/src/Login/Login.tsx +++ b/web/packages/teleport/src/Login/Login.tsx @@ -19,15 +19,15 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { Box, Text, Link, Flex, ButtonPrimary } from 'design'; +import { Box, ButtonPrimary, Flex, Link, Text } from 'design'; import { StyledCheckbox } from 'design/Checkbox'; import FormLogin from 'teleport/components/FormLogin'; import { LogoHero } from 'teleport/components/LogoHero'; import cfg from 'teleport/config'; -import useLogin, { State } from './useLogin'; import Motd from './Motd'; +import useLogin, { State } from './useLogin'; export function Login() { const state = useLogin(); diff --git a/web/packages/teleport/src/Login/LoginClose.tsx b/web/packages/teleport/src/Login/LoginClose.tsx index 4680a6507b9cf..2d56ff8ab8839 100644 --- a/web/packages/teleport/src/Login/LoginClose.tsx +++ b/web/packages/teleport/src/Login/LoginClose.tsx @@ -17,6 +17,7 @@ */ import React, { useEffect } from 'react'; + import { Card } from 'design'; export function LoginClose() { diff --git a/web/packages/teleport/src/Login/LoginFailed.test.tsx b/web/packages/teleport/src/Login/LoginFailed.test.tsx index 387b86aa6ec2f..158ff58208a18 100644 --- a/web/packages/teleport/src/Login/LoginFailed.test.tsx +++ b/web/packages/teleport/src/Login/LoginFailed.test.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; -import { FailedDefault, FailedCustom } from './Login.story'; +import { FailedCustom, FailedDefault } from './Login.story'; test('default error message', () => { const { container } = render(); diff --git a/web/packages/teleport/src/Login/LoginFailed.tsx b/web/packages/teleport/src/Login/LoginFailed.tsx index 2c17cfaf84c68..aea2f35835fe8 100644 --- a/web/packages/teleport/src/Login/LoginFailed.tsx +++ b/web/packages/teleport/src/Login/LoginFailed.tsx @@ -17,10 +17,11 @@ */ import React from 'react'; + import { LoginFailed as CardFailed } from 'design/CardError'; -import { Route, Switch } from 'teleport/components/Router'; import { LogoHero } from 'teleport/components/LogoHero'; +import { Route, Switch } from 'teleport/components/Router'; import cfg from 'teleport/config'; export function LoginFailed() { diff --git a/web/packages/teleport/src/Login/LoginSuccess.test.tsx b/web/packages/teleport/src/Login/LoginSuccess.test.tsx index 3c9fb3650b7eb..a873b2fb7e9e3 100644 --- a/web/packages/teleport/src/Login/LoginSuccess.test.tsx +++ b/web/packages/teleport/src/Login/LoginSuccess.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; import { LoginSuccess } from './LoginSuccess'; diff --git a/web/packages/teleport/src/Login/LoginSuccess.tsx b/web/packages/teleport/src/Login/LoginSuccess.tsx index 0258ff9f8ab68..ce54b2c3d9c6a 100644 --- a/web/packages/teleport/src/Login/LoginSuccess.tsx +++ b/web/packages/teleport/src/Login/LoginSuccess.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { CardSuccessLogin } from 'design'; import { LogoHero } from 'teleport/components/LogoHero'; diff --git a/web/packages/teleport/src/Login/LoginTerminalRedirect.test.tsx b/web/packages/teleport/src/Login/LoginTerminalRedirect.test.tsx index b918537ebe740..d067c36a8dd09 100644 --- a/web/packages/teleport/src/Login/LoginTerminalRedirect.test.tsx +++ b/web/packages/teleport/src/Login/LoginTerminalRedirect.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; import { TerminalRedirect } from './Login.story'; diff --git a/web/packages/teleport/src/Login/LoginTerminalRedirect.tsx b/web/packages/teleport/src/Login/LoginTerminalRedirect.tsx index cc6f03f204aa0..40c3f3282a4a9 100644 --- a/web/packages/teleport/src/Login/LoginTerminalRedirect.tsx +++ b/web/packages/teleport/src/Login/LoginTerminalRedirect.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { CardTerminalLogin } from 'design/CardTerminal'; import { LogoHero } from 'teleport/components/LogoHero'; diff --git a/web/packages/teleport/src/Login/Motd/Motd.tsx b/web/packages/teleport/src/Login/Motd/Motd.tsx index 9729bd724c50c..2d354a780fdab 100644 --- a/web/packages/teleport/src/Login/Motd/Motd.tsx +++ b/web/packages/teleport/src/Login/Motd/Motd.tsx @@ -19,7 +19,7 @@ import React from 'react'; import styled from 'styled-components'; -import { Card, Box, Text, ButtonPrimary } from 'design'; +import { Box, ButtonPrimary, Card, Text } from 'design'; export function Motd({ message, onClick }: Props) { return ( diff --git a/web/packages/teleport/src/Login/useLogin.ts b/web/packages/teleport/src/Login/useLogin.ts index 8a36d5aba3e8e..e9de6ea143da7 100644 --- a/web/packages/teleport/src/Login/useLogin.ts +++ b/web/packages/teleport/src/Login/useLogin.ts @@ -16,16 +16,17 @@ * along with this program. If not, see . */ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; + +import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; import { useAttempt } from 'shared/hooks'; import { AuthProvider } from 'shared/services'; -import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; -import session from 'teleport/services/websession'; -import history from 'teleport/services/history'; import cfg from 'teleport/config'; import auth, { UserCredentials } from 'teleport/services/auth'; +import history from 'teleport/services/history'; import { storageService } from 'teleport/services/storageService'; +import session from 'teleport/services/websession'; export default function useLogin() { const [attempt, attemptActions] = useAttempt({ isProcessing: false }); diff --git a/web/packages/teleport/src/Main/LayoutContext.tsx b/web/packages/teleport/src/Main/LayoutContext.tsx index df15cc7548ff2..cd50a536bc7da 100644 --- a/web/packages/teleport/src/Main/LayoutContext.tsx +++ b/web/packages/teleport/src/Main/LayoutContext.tsx @@ -20,9 +20,9 @@ import React, { createContext, PropsWithChildren, useContext, - useState, useEffect, useRef, + useState, } from 'react'; interface LayoutContextValue { diff --git a/web/packages/teleport/src/Main/Main.story.tsx b/web/packages/teleport/src/Main/Main.story.tsx index 7bb5456942f58..374830f7ffff9 100644 --- a/web/packages/teleport/src/Main/Main.story.tsx +++ b/web/packages/teleport/src/Main/Main.story.tsx @@ -16,23 +16,22 @@ * along with this program. If not, see . */ -import React from 'react'; import { createMemoryHistory } from 'history'; +import React from 'react'; import { Router } from 'react-router'; -import { Flex } from 'design'; -import { ContextProvider, Context } from 'teleport'; -import { getOSSFeatures } from 'teleport/features'; +import { Flex } from 'design'; -import { clusters } from 'teleport/Clusters/fixtures'; -import { nodes } from 'teleport/Nodes/fixtures'; -import { events } from 'teleport/Audit/fixtures'; -import { sessions } from 'teleport/Sessions/fixtures'; +import { Context, ContextProvider } from 'teleport'; import { apps } from 'teleport/Apps/fixtures'; +import { events } from 'teleport/Audit/fixtures'; +import { clusters } from 'teleport/Clusters/fixtures'; import { databases } from 'teleport/Databases/fixtures'; - -import { kubes } from 'teleport/Kubes/fixtures'; import { desktops } from 'teleport/Desktops/fixtures'; +import { getOSSFeatures } from 'teleport/features'; +import { kubes } from 'teleport/Kubes/fixtures'; +import { nodes } from 'teleport/Nodes/fixtures'; +import { sessions } from 'teleport/Sessions/fixtures'; import { userContext } from './fixtures'; import { Main } from './Main'; diff --git a/web/packages/teleport/src/Main/Main.test.tsx b/web/packages/teleport/src/Main/Main.test.tsx index 3ee64f990a3cf..3e0a23a0660bc 100644 --- a/web/packages/teleport/src/Main/Main.test.tsx +++ b/web/packages/teleport/src/Main/Main.test.tsx @@ -18,23 +18,24 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import { render, screen } from 'design/utils/testing'; -import { getOSSFeatures } from 'teleport/features'; import { Context, ContextProvider } from 'teleport'; +import { apps } from 'teleport/Apps/fixtures'; import { events } from 'teleport/Audit/fixtures'; import { clusters } from 'teleport/Clusters/fixtures'; -import { nodes } from 'teleport/Nodes/fixtures'; -import { sessions } from 'teleport/Sessions/fixtures'; -import { apps } from 'teleport/Apps/fixtures'; -import { kubes } from 'teleport/Kubes/fixtures'; import { databases } from 'teleport/Databases/fixtures'; import { desktops } from 'teleport/Desktops/fixtures'; +import { getOSSFeatures } from 'teleport/features'; +import { kubes } from 'teleport/Kubes/fixtures'; import { userContext } from 'teleport/Main/fixtures'; import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; -import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; -import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; +import { nodes } from 'teleport/Nodes/fixtures'; +import { sessions } from 'teleport/Sessions/fixtures'; import TeleportContext from 'teleport/teleportContext'; +import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; +import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; import { Main, MainProps } from './Main'; diff --git a/web/packages/teleport/src/Main/Main.tsx b/web/packages/teleport/src/Main/Main.tsx index 7545080a0757f..4d017c83e99bd 100644 --- a/web/packages/teleport/src/Main/Main.tsx +++ b/web/packages/teleport/src/Main/Main.tsx @@ -26,42 +26,39 @@ import React, { useMemo, useState, } from 'react'; +import { matchPath, useHistory } from 'react-router'; import styled from 'styled-components'; + import { Box, Indicator } from 'design'; import { Failed } from 'design/CardError'; - -import useAttempt from 'shared/hooks/useAttemptNext'; - -import { matchPath, useHistory } from 'react-router'; - import Dialog from 'design/Dialog'; import { sharedStyles } from 'design/theme/themes/sharedStyles'; +import useAttempt from 'shared/hooks/useAttemptNext'; -import { Redirect, Route, Switch } from 'teleport/components/Router'; -import { CatchError } from 'teleport/components/CatchError'; -import cfg from 'teleport/config'; -import useTeleport from 'teleport/useTeleport'; -import { TopBar } from 'teleport/TopBar'; import { BannerList } from 'teleport/components/BannerList'; -import { storageService } from 'teleport/services/storageService'; -import { ClusterAlert, LINK_LABEL } from 'teleport/services/alerts/alerts'; +import type { BannerType } from 'teleport/components/BannerList/BannerList'; import { useAlerts } from 'teleport/components/BannerList/useAlerts'; +import { CatchError } from 'teleport/components/CatchError'; +import { Redirect, Route, Switch } from 'teleport/components/Router'; +import cfg from 'teleport/config'; import { FeaturesContextProvider, useFeatures } from 'teleport/FeaturesContext'; +import { NavigationCategory } from 'teleport/Navigation/categories'; import { getFirstRouteForCategory, Navigation, } from 'teleport/Navigation/Navigation'; -import { NavigationCategory } from 'teleport/Navigation/categories'; +import { ClusterAlert, LINK_LABEL } from 'teleport/services/alerts/alerts'; +import { storageService } from 'teleport/services/storageService'; +import { TopBar } from 'teleport/TopBar'; import { TopBarProps } from 'teleport/TopBar/TopBar'; +import type { LockedFeatures, TeleportFeature } from 'teleport/types'; import { useUser } from 'teleport/User/UserContext'; +import useTeleport from 'teleport/useTeleport'; import { QuestionnaireProps } from 'teleport/Welcome/NewCredentials'; import { MainContainer } from './MainContainer'; import { OnboardDiscover } from './OnboardDiscover'; -import type { BannerType } from 'teleport/components/BannerList/BannerList'; -import type { LockedFeatures, TeleportFeature } from 'teleport/types'; - export interface MainProps { initialAlerts?: ClusterAlert[]; customBanners?: ReactNode[]; diff --git a/web/packages/teleport/src/Main/OnboardDiscover/OnboardDiscover.tsx b/web/packages/teleport/src/Main/OnboardDiscover/OnboardDiscover.tsx index 9380520fb4d24..5f671a8b76954 100644 --- a/web/packages/teleport/src/Main/OnboardDiscover/OnboardDiscover.tsx +++ b/web/packages/teleport/src/Main/OnboardDiscover/OnboardDiscover.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { ButtonPrimary, ButtonText, Image, Text } from 'design'; import Dialog, { DialogContent, @@ -24,8 +25,8 @@ import Dialog, { DialogHeader, } from 'design/Dialog'; -import { CaptureEvent } from 'teleport/services/userEvent/types'; import { userEventService } from 'teleport/services/userEvent'; +import { CaptureEvent } from 'teleport/services/userEvent/types'; import resourcesPng from './resources.png'; diff --git a/web/packages/teleport/src/Navigation/Navigation.tsx b/web/packages/teleport/src/Navigation/Navigation.tsx index 1b645f39768e9..722a7ff885684 100644 --- a/web/packages/teleport/src/Navigation/Navigation.tsx +++ b/web/packages/teleport/src/Navigation/Navigation.tsx @@ -16,22 +16,21 @@ * along with this program. If not, see . */ +import type * as history from 'history'; import React, { useState } from 'react'; +import { matchPath, useHistory, useLocation } from 'react-router'; import styled from 'styled-components'; -import { matchPath, useLocation, useHistory } from 'react-router'; -import { Box, Text, Flex } from 'design'; + +import { Box, Flex, Text } from 'design'; import { Info } from 'design/Icon'; import cfg from 'teleport/config'; +import { useFeatures } from 'teleport/FeaturesContext'; import { NAVIGATION_CATEGORIES, NavigationCategory, } from 'teleport/Navigation/categories'; -import { useFeatures } from 'teleport/FeaturesContext'; import { NavigationCategoryContainer } from 'teleport/Navigation/NavigationCategoryContainer'; - -import type * as history from 'history'; - import type { TeleportFeature } from 'teleport/types'; const NavigationContainer = styled.div` diff --git a/web/packages/teleport/src/Navigation/NavigationCategoryContainer.tsx b/web/packages/teleport/src/Navigation/NavigationCategoryContainer.tsx index 983d14f36c1e3..d25142f5b44ab 100644 --- a/web/packages/teleport/src/Navigation/NavigationCategoryContainer.tsx +++ b/web/packages/teleport/src/Navigation/NavigationCategoryContainer.tsx @@ -19,14 +19,14 @@ import React from 'react'; import styled from 'styled-components'; +import { useFeatures } from 'teleport/FeaturesContext'; import { MANAGEMENT_NAVIGATION_SECTIONS, NavigationCategory, } from 'teleport/Navigation/categories'; -import { useFeatures } from 'teleport/FeaturesContext'; +import { NavigationItemSize } from 'teleport/Navigation/common'; import { NavigationItem } from 'teleport/Navigation/NavigationItem'; import { NavigationSection } from 'teleport/Navigation/NavigationSection'; -import { NavigationItemSize } from 'teleport/Navigation/common'; interface NavigationCategoryProps { category: NavigationCategory; diff --git a/web/packages/teleport/src/Navigation/NavigationDropdown.tsx b/web/packages/teleport/src/Navigation/NavigationDropdown.tsx index ff71f33503d15..1fc7aab8df544 100644 --- a/web/packages/teleport/src/Navigation/NavigationDropdown.tsx +++ b/web/packages/teleport/src/Navigation/NavigationDropdown.tsx @@ -16,27 +16,22 @@ * along with this program. If not, see . */ +import type { Location } from 'history'; import React, { useCallback, useEffect, useRef, useState } from 'react'; -import styled from 'styled-components'; - -import { NavLink } from 'react-router-dom'; - import { matchPath, useHistory } from 'react-router'; +import { NavLink } from 'react-router-dom'; +import styled from 'styled-components'; import { ChevronRight } from 'design/Icon'; +import { useTeleport } from 'teleport'; +import { useFeatures } from 'teleport/FeaturesContext'; import { commonNavigationItemStyles, LinkContent, NavigationItemSize, } from 'teleport/Navigation/common'; -import { useFeatures } from 'teleport/FeaturesContext'; import { getIcon } from 'teleport/Navigation/utils'; - -import { useTeleport } from 'teleport'; - -import type { Location } from 'history'; - import type { TeleportFeature } from 'teleport/types'; interface NavigationDropdownProps { diff --git a/web/packages/teleport/src/Navigation/NavigationItem.test.tsx b/web/packages/teleport/src/Navigation/NavigationItem.test.tsx index 6f812da3eba84..d695ff7ab49c2 100644 --- a/web/packages/teleport/src/Navigation/NavigationItem.test.tsx +++ b/web/packages/teleport/src/Navigation/NavigationItem.test.tsx @@ -16,27 +16,22 @@ * along with this program. If not, see . */ +import { act } from '@testing-library/react'; +import { createMemoryHistory, MemoryHistory } from 'history'; import React from 'react'; - -import { render, screen } from 'design/utils/testing'; - -import { Server } from 'design/Icon'; - import { generatePath, Router } from 'react-router'; -import { createMemoryHistory, MemoryHistory } from 'history'; - -import { act } from '@testing-library/react'; - -import TeleportContextProvider from 'teleport/TeleportContextProvider'; -import TeleportContext from 'teleport/teleportContext'; +import { Server } from 'design/Icon'; +import { render, screen } from 'design/utils/testing'; -import { TeleportFeature, NavTitle } from 'teleport/types'; import { NavigationCategory } from 'teleport/Navigation/categories'; -import { NavigationItem } from 'teleport/Navigation/NavigationItem'; import { NavigationItemSize } from 'teleport/Navigation/common'; -import { makeUserContext } from 'teleport/services/user'; +import { NavigationItem } from 'teleport/Navigation/NavigationItem'; import { LocalNotificationKind } from 'teleport/services/notifications'; +import { makeUserContext } from 'teleport/services/user'; +import TeleportContext from 'teleport/teleportContext'; +import TeleportContextProvider from 'teleport/TeleportContextProvider'; +import { NavTitle, TeleportFeature } from 'teleport/types'; class MockUserFeature implements TeleportFeature { category = NavigationCategory.Resources; diff --git a/web/packages/teleport/src/Navigation/NavigationItem.tsx b/web/packages/teleport/src/Navigation/NavigationItem.tsx index 139e404960cb7..e275bf2bd042c 100644 --- a/web/packages/teleport/src/Navigation/NavigationItem.tsx +++ b/web/packages/teleport/src/Navigation/NavigationItem.tsx @@ -17,30 +17,28 @@ */ import React, { useCallback, useMemo } from 'react'; -import styled, { css, keyframes } from 'styled-components'; - import { NavLink, useLocation } from 'react-router-dom'; +import styled, { css, keyframes } from 'styled-components'; import { ArrowSquareOut } from 'design/Icon'; -import { getIcon } from 'teleport/Navigation/utils'; -import { NavigationDropdown } from 'teleport/Navigation/NavigationDropdown'; +import { useTeleport } from 'teleport'; import { commonNavigationItemStyles, LinkContent, NavigationItemSize, } from 'teleport/Navigation/common'; -import useStickyClusterId from 'teleport/useStickyClusterId'; -import { storageService } from 'teleport/services/storageService'; +import { NavigationDropdown } from 'teleport/Navigation/NavigationDropdown'; +import { getIcon } from 'teleport/Navigation/utils'; import { LocalNotificationKind } from 'teleport/services/notifications'; -import { useTeleport } from 'teleport'; - -import { NavTitle, RecommendationStatus } from 'teleport/types'; - -import type { - TeleportFeature, - TeleportFeatureNavigationItem, +import { storageService } from 'teleport/services/storageService'; +import { + NavTitle, + RecommendationStatus, + type TeleportFeature, + type TeleportFeatureNavigationItem, } from 'teleport/types'; +import useStickyClusterId from 'teleport/useStickyClusterId'; interface NavigationItemProps { feature: TeleportFeature; diff --git a/web/packages/teleport/src/Navigation/NavigationSection.tsx b/web/packages/teleport/src/Navigation/NavigationSection.tsx index 62e96f0878c9c..f15338c4249ab 100644 --- a/web/packages/teleport/src/Navigation/NavigationSection.tsx +++ b/web/packages/teleport/src/Navigation/NavigationSection.tsx @@ -19,9 +19,8 @@ import React from 'react'; import styled from 'styled-components'; -import { NavigationItem } from 'teleport/Navigation/NavigationItem'; import { NavigationItemSize } from 'teleport/Navigation/common'; - +import { NavigationItem } from 'teleport/Navigation/NavigationItem'; import type { TeleportFeature } from 'teleport/types'; interface NavigationSectionProps { diff --git a/web/packages/teleport/src/Navigation/utils.tsx b/web/packages/teleport/src/Navigation/utils.tsx index f45abf8c1d9c1..bc379fc4222b4 100644 --- a/web/packages/teleport/src/Navigation/utils.tsx +++ b/web/packages/teleport/src/Navigation/utils.tsx @@ -23,7 +23,6 @@ import { NavigationItemSize, SmallIcon, } from 'teleport/Navigation/common'; - import type { TeleportFeature } from 'teleport/types'; export function getIcon(feature: TeleportFeature, size: NavigationItemSize) { diff --git a/web/packages/teleport/src/Notifications/Notification.story.tsx b/web/packages/teleport/src/Notifications/Notification.story.tsx index 39f0b0fcc8f74..4dcd06c341381 100644 --- a/web/packages/teleport/src/Notifications/Notification.story.tsx +++ b/web/packages/teleport/src/Notifications/Notification.story.tsx @@ -16,26 +16,25 @@ * along with this program. If not, see . */ +import { subDays, subHours, subMinutes, subSeconds } from 'date-fns'; +import { rest } from 'msw'; +import { initialize, mswLoader } from 'msw-storybook-addon'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { subSeconds, subMinutes, subHours, subDays } from 'date-fns'; -import { initialize, mswLoader } from 'msw-storybook-addon'; -import { rest } from 'msw'; import { Flex } from 'design'; +import cfg from 'teleport/config'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { NotificationSubKind, UpsertNotificationStateRequest, } from 'teleport/services/notifications'; -import { createTeleportContext } from 'teleport/mocks/contexts'; -import cfg from 'teleport/config'; import { ContextProvider } from '..'; - +import { notifications as mockNotifications } from './fixtures'; import { Notification } from './Notification'; import { Notifications as NotificationsListComponent } from './Notifications'; -import { notifications as mockNotifications } from './fixtures'; export default { title: 'Teleport/Notifications', diff --git a/web/packages/teleport/src/Notifications/Notification.tsx b/web/packages/teleport/src/Notifications/Notification.tsx index 98c69d6afb8f2..201631a237f27 100644 --- a/web/packages/teleport/src/Notifications/Notification.tsx +++ b/web/packages/teleport/src/Notifications/Notification.tsx @@ -16,37 +16,32 @@ * along with this program. If not, see . */ +import { formatDistanceToNowStrict } from 'date-fns'; import React, { useState } from 'react'; import styled from 'styled-components'; -import { formatDistanceToNowStrict } from 'date-fns'; -import * as Icons from 'design/Icon'; - -import Text from 'design/Text'; import { ButtonSecondary } from 'design/Button'; - -import { MenuIcon, MenuItem } from 'shared/components/MenuAction'; -import { IGNORE_CLICK_CLASSNAME } from 'shared/hooks/useRefClickOutside/useRefClickOutside'; import Dialog, { DialogContent, DialogFooter, DialogHeader, DialogTitle, } from 'design/Dialog'; +import * as Icons from 'design/Icon'; +import Text from 'design/Text'; import { Theme } from 'design/theme/themes/types'; - +import { MenuIcon, MenuItem } from 'shared/components/MenuAction'; import { useAsync } from 'shared/hooks/useAsync'; +import { IGNORE_CLICK_CLASSNAME } from 'shared/hooks/useRefClickOutside/useRefClickOutside'; +import history from 'teleport/services/history'; import { - Notification as NotificationType, NotificationState, + Notification as NotificationType, } from 'teleport/services/notifications'; -import history from 'teleport/services/history'; - import useStickyClusterId from 'teleport/useStickyClusterId'; import { useTeleport } from '..'; - import { NotificationContent } from './notificationContentFactory'; import { View } from './Notifications'; diff --git a/web/packages/teleport/src/Notifications/Notifications.test.tsx b/web/packages/teleport/src/Notifications/Notifications.test.tsx index 35f4dbb778ca4..ddb4d33914e4b 100644 --- a/web/packages/teleport/src/Notifications/Notifications.test.tsx +++ b/web/packages/teleport/src/Notifications/Notifications.test.tsx @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -import React from 'react'; import { subMinutes, subSeconds } from 'date-fns'; import { createMemoryHistory } from 'history'; +import React from 'react'; import { Router } from 'react-router'; -import { render, screen } from 'design/utils/testing'; -import { createTeleportContext } from 'teleport/mocks/contexts'; -import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; +import { render, screen } from 'design/utils/testing'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; import { getOSSFeatures } from 'teleport/features'; -import TeleportContextProvider from 'teleport/TeleportContextProvider'; -import TeleportContext from 'teleport/teleportContext'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { NotificationSubKind } from 'teleport/services/notifications'; +import TeleportContext from 'teleport/teleportContext'; +import TeleportContextProvider from 'teleport/TeleportContextProvider'; import { Notifications } from './Notifications'; diff --git a/web/packages/teleport/src/Notifications/Notifications.tsx b/web/packages/teleport/src/Notifications/Notifications.tsx index d8838606afb1f..9a00b064f7ea3 100644 --- a/web/packages/teleport/src/Notifications/Notifications.tsx +++ b/web/packages/teleport/src/Notifications/Notifications.tsx @@ -16,40 +16,35 @@ * along with this program. If not, see . */ -import { useState, useMemo, useEffect, useCallback } from 'react'; -import { isBefore, isAfter, formatDistanceToNowStrict } from 'date-fns'; +import { formatDistanceToNowStrict, isAfter, isBefore } from 'date-fns'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { Alert, Box, Flex, Indicator, Text } from 'design'; -import { Notification as NotificationIcon, BellRinging } from 'design/Icon'; -import Logger from 'shared/libs/logger'; -import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; +import { Alert, Box, Flex, Indicator, Text } from 'design'; +import { BellRinging, Notification as NotificationIcon } from 'design/Icon'; import { HoverTooltip } from 'shared/components/ToolTip'; - import { useInfiniteScroll, useKeyBasedPagination, } from 'shared/hooks/useInfiniteScroll'; +import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; import { IGNORE_CLICK_CLASSNAME } from 'shared/hooks/useRefClickOutside/useRefClickOutside'; - +import Logger from 'shared/libs/logger'; import { useStore } from 'shared/libs/stores'; import { useTeleport } from 'teleport'; -import useStickyClusterId from 'teleport/useStickyClusterId'; import { Dropdown } from 'teleport/components/Dropdown'; - -import { ButtonIconContainer } from 'teleport/TopBar/Shared'; - import { LocalNotificationGroupedKind, LocalNotificationKind, Notification as NotificationType, } from 'teleport/services/notifications'; - import { Notification as AccessListNotification, LocalNotificationStates, } from 'teleport/stores/storeNotifications'; +import { ButtonIconContainer } from 'teleport/TopBar/Shared'; +import useStickyClusterId from 'teleport/useStickyClusterId'; import { Notification } from './Notification'; diff --git a/web/packages/teleport/src/Notifications/fixtures.ts b/web/packages/teleport/src/Notifications/fixtures.ts index f64483f4bc086..798230906a402 100644 --- a/web/packages/teleport/src/Notifications/fixtures.ts +++ b/web/packages/teleport/src/Notifications/fixtures.ts @@ -16,10 +16,12 @@ * along with this program. If not, see . */ -import { subSeconds, subMinutes, subHours, subMonths } from 'date-fns'; +import { subHours, subMinutes, subMonths, subSeconds } from 'date-fns'; -import { NotificationSubKind } from 'teleport/services/notifications'; -import { Notification } from 'teleport/services/notifications'; +import { + Notification, + NotificationSubKind, +} from 'teleport/services/notifications'; export const notifications: Notification[] = [ { diff --git a/web/packages/teleport/src/Notifications/notificationContentFactory.tsx b/web/packages/teleport/src/Notifications/notificationContentFactory.tsx index 6b453357acd90..1cbcf04235641 100644 --- a/web/packages/teleport/src/Notifications/notificationContentFactory.tsx +++ b/web/packages/teleport/src/Notifications/notificationContentFactory.tsx @@ -16,13 +16,14 @@ * along with this program. If not, see . */ +import React from 'react'; + import * as Icons from 'design/Icon'; import { IconProps } from 'design/Icon/Icon'; -import React from 'react'; import { - Notification as NotificationType, NotificationSubKind, + Notification as NotificationType, } from 'teleport/services/notifications'; import { Label } from 'teleport/types'; diff --git a/web/packages/teleport/src/Player/ActionBar/ActionBar.tsx b/web/packages/teleport/src/Player/ActionBar/ActionBar.tsx index 042c5390a73b0..7be8480e4f43e 100644 --- a/web/packages/teleport/src/Player/ActionBar/ActionBar.tsx +++ b/web/packages/teleport/src/Player/ActionBar/ActionBar.tsx @@ -18,9 +18,10 @@ import React from 'react'; import { NavLink } from 'react-router-dom'; -import { Flex, ButtonPrimary } from 'design'; -import { MenuIcon, MenuItem, MenuItemIcon } from 'shared/components/MenuAction'; + +import { ButtonPrimary, Flex } from 'design'; import * as Icons from 'design/Icon'; +import { MenuIcon, MenuItem, MenuItemIcon } from 'shared/components/MenuAction'; import cfg from 'teleport/config'; diff --git a/web/packages/teleport/src/Player/ActionBar/index.ts b/web/packages/teleport/src/Player/ActionBar/index.ts index 68780db3589b9..9d87648f34b85 100644 --- a/web/packages/teleport/src/Player/ActionBar/index.ts +++ b/web/packages/teleport/src/Player/ActionBar/index.ts @@ -17,4 +17,5 @@ */ import ActionBar from './ActionBar'; + export default ActionBar; diff --git a/web/packages/teleport/src/Player/DesktopPlayer.tsx b/web/packages/teleport/src/Player/DesktopPlayer.tsx index a0bace9583951..33ff9b1f91f43 100644 --- a/web/packages/teleport/src/Player/DesktopPlayer.tsx +++ b/web/packages/teleport/src/Player/DesktopPlayer.tsx @@ -16,21 +16,21 @@ * along with this program. If not, see . */ -import React, { useState, useMemo, useCallback, useEffect } from 'react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { Indicator, Box, Alert, Flex } from 'design'; +import { Alert, Box, Flex, Indicator } from 'design'; + +import TdpClientCanvas from 'teleport/components/TdpClientCanvas'; import cfg from 'teleport/config'; -import { StatusEnum, formatDisplayTime } from 'teleport/lib/player'; +import { formatDisplayTime, StatusEnum } from 'teleport/lib/player'; import { PlayerClient, TdpClient } from 'teleport/lib/tdp'; +import type { BitmapFrame } from 'teleport/lib/tdp/client'; +import type { ClientScreenSpec, PngFrame } from 'teleport/lib/tdp/codec'; import { getHostName } from 'teleport/services/api'; -import TdpClientCanvas from 'teleport/components/TdpClientCanvas'; import ProgressBar from './ProgressBar'; -import type { PngFrame, ClientScreenSpec } from 'teleport/lib/tdp/codec'; -import type { BitmapFrame } from 'teleport/lib/tdp/client'; - const reload = () => window.location.reload(); const handleContextMenu = () => true; const PROGRESS_BAR_ID = 'progressBarDesktop'; diff --git a/web/packages/teleport/src/Player/Player.story.tsx b/web/packages/teleport/src/Player/Player.story.tsx index 0675d066d0a84..9eb7db91e58c5 100644 --- a/web/packages/teleport/src/Player/Player.story.tsx +++ b/web/packages/teleport/src/Player/Player.story.tsx @@ -16,13 +16,12 @@ * along with this program. If not, see . */ +import { createMemoryHistory } from 'history'; import React from 'react'; import { Flex } from 'design'; -import { createMemoryHistory } from 'history'; - -import { Router, Route } from 'teleport/components/Router'; +import { Route, Router } from 'teleport/components/Router'; import { Player } from './Player'; diff --git a/web/packages/teleport/src/Player/Player.tsx b/web/packages/teleport/src/Player/Player.tsx index 97730444a92dd..9b7694d9e23f5 100644 --- a/web/packages/teleport/src/Player/Player.tsx +++ b/web/packages/teleport/src/Player/Player.tsx @@ -17,26 +17,23 @@ */ import React, { useCallback, useEffect } from 'react'; - import styled from 'styled-components'; -import { Flex, Box, Indicator } from 'design'; +import { Box, Flex, Indicator } from 'design'; import { Danger } from 'design/Alert'; - import { makeSuccessAttempt, useAsync } from 'shared/hooks/useAsync'; -import { useParams, useLocation } from 'teleport/components/Router'; -import session from 'teleport/services/websession'; +import { useLocation, useParams } from 'teleport/components/Router'; import { UrlPlayerParams } from 'teleport/config'; import { getUrlParameter } from 'teleport/services/history'; import { RecordingType } from 'teleport/services/recordings'; - +import session from 'teleport/services/websession'; import useTeleport from 'teleport/useTeleport'; import ActionBar from './ActionBar'; import { DesktopPlayer } from './DesktopPlayer'; -import SshPlayer from './SshPlayer'; import Tabs, { TabItem } from './PlayerTabs'; +import SshPlayer from './SshPlayer'; const validRecordingTypes = ['ssh', 'k8s', 'desktop', 'database']; diff --git a/web/packages/teleport/src/Player/PlayerTabs/PlayerTabs.tsx b/web/packages/teleport/src/Player/PlayerTabs/PlayerTabs.tsx index cee27949cb4b1..c8038688b17f9 100644 --- a/web/packages/teleport/src/Player/PlayerTabs/PlayerTabs.tsx +++ b/web/packages/teleport/src/Player/PlayerTabs/PlayerTabs.tsx @@ -18,8 +18,9 @@ import React from 'react'; import styled from 'styled-components'; + +import { Box, Flex } from 'design'; import { typography } from 'design/system'; -import { Flex, Box } from 'design'; const Tabs = props => { return ( diff --git a/web/packages/teleport/src/Player/PlayerTabs/index.ts b/web/packages/teleport/src/Player/PlayerTabs/index.ts index 6032eb2aae681..a19c1efcd57d7 100644 --- a/web/packages/teleport/src/Player/PlayerTabs/index.ts +++ b/web/packages/teleport/src/Player/PlayerTabs/index.ts @@ -17,6 +17,7 @@ */ import Tabs, { TabItem } from './PlayerTabs'; + export { TabItem }; export default Tabs; diff --git a/web/packages/teleport/src/Player/ProgressBar/Slider/Slider.jsx b/web/packages/teleport/src/Player/ProgressBar/Slider/Slider.jsx index 567ad5f69a13a..a73ce656f855a 100644 --- a/web/packages/teleport/src/Player/ProgressBar/Slider/Slider.jsx +++ b/web/packages/teleport/src/Player/ProgressBar/Slider/Slider.jsx @@ -23,9 +23,9 @@ THE SOFTWARE. */ -import React from 'react'; -import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import React from 'react'; /** * To prevent text selection while dragging. diff --git a/web/packages/teleport/src/Player/ProgressBar/Slider/index.js b/web/packages/teleport/src/Player/ProgressBar/Slider/index.js index ff665088461dc..3e04f8db1478a 100644 --- a/web/packages/teleport/src/Player/ProgressBar/Slider/index.js +++ b/web/packages/teleport/src/Player/ProgressBar/Slider/index.js @@ -17,4 +17,5 @@ */ import Slider from './Slider'; + export default Slider; diff --git a/web/packages/teleport/src/Player/SshPlayer.tsx b/web/packages/teleport/src/Player/SshPlayer.tsx index ce70754ec6f68..f6d66872d9266 100644 --- a/web/packages/teleport/src/Player/SshPlayer.tsx +++ b/web/packages/teleport/src/Player/SshPlayer.tsx @@ -18,12 +18,13 @@ import React from 'react'; import styled from 'styled-components'; -import { Indicator, Flex, Box } from 'design'; + +import { Box, Flex, Indicator } from 'design'; import { Danger } from 'design/Alert'; import cfg from 'teleport/config'; -import TtyPlayer from 'teleport/lib/term/ttyPlayer'; import { formatDisplayTime, StatusEnum } from 'teleport/lib/player'; +import TtyPlayer from 'teleport/lib/term/ttyPlayer'; import { getAccessToken, getHostName } from 'teleport/services/api'; import ProgressBar from './ProgressBar'; diff --git a/web/packages/teleport/src/Player/Xterm/Xterm.tsx b/web/packages/teleport/src/Player/Xterm/Xterm.tsx index a5e8ad37dbeac..451e636934fcd 100644 --- a/web/packages/teleport/src/Player/Xterm/Xterm.tsx +++ b/web/packages/teleport/src/Player/Xterm/Xterm.tsx @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -import React, { useEffect, useCallback, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import styled, { useTheme } from 'styled-components'; import { getPlatformType } from 'design/platform'; -import styled, { useTheme } from 'styled-components'; import { TerminalSearch } from 'shared/components/TerminalSearch'; +import StyledXterm from 'teleport/Console/StyledXterm'; +import { TermEvent } from 'teleport/lib/term/enums'; import Terminal from 'teleport/lib/term/terminal'; import Tty from 'teleport/lib/term/tty'; -import { TermEvent } from 'teleport/lib/term/enums'; -import StyledXterm from 'teleport/Console/StyledXterm'; export default function Xterm({ tty }: { tty: Tty }) { const refContainer = useRef(); diff --git a/web/packages/teleport/src/Recordings/Recordings.story.tsx b/web/packages/teleport/src/Recordings/Recordings.story.tsx index d8d110ef84416..8bc597f835b74 100644 --- a/web/packages/teleport/src/Recordings/Recordings.story.tsx +++ b/web/packages/teleport/src/Recordings/Recordings.story.tsx @@ -16,12 +16,11 @@ * along with this program. If not, see . */ +import { createMemoryHistory } from 'history'; import React from 'react'; import { Router } from 'react-router'; -import { createMemoryHistory } from 'history'; import { Context, ContextProvider } from 'teleport'; - import { makeRecording } from 'teleport/services/recordings/makeRecording'; import { RecordingsContainer as Recordings } from './Recordings'; diff --git a/web/packages/teleport/src/Recordings/Recordings.tsx b/web/packages/teleport/src/Recordings/Recordings.tsx index d937f8bd708ac..22ba1292b9fb3 100644 --- a/web/packages/teleport/src/Recordings/Recordings.tsx +++ b/web/packages/teleport/src/Recordings/Recordings.tsx @@ -18,10 +18,11 @@ import React, { useState } from 'react'; +import { Box, Indicator } from 'design'; import { Danger } from 'design/Alert'; -import { Indicator, Box } from 'design'; import { ClusterDropdown } from 'shared/components/ClusterDropdown/ClusterDropdown'; +import { ExternalAuditStorageCta } from '@gravitational/teleport/src/components/ExternalAuditStorageCta'; import RangePicker from 'teleport/components/EventRangePicker'; import { FeatureBox, @@ -30,10 +31,7 @@ import { } from 'teleport/components/Layout'; import useTeleport from 'teleport/useTeleport'; -import { ExternalAuditStorageCta } from '@gravitational/teleport/src/components/ExternalAuditStorageCta'; - import RecordingsList from './RecordingsList'; - import useRecordings, { State } from './useRecordings'; export function RecordingsContainer() { diff --git a/web/packages/teleport/src/Recordings/RecordingsList.tsx b/web/packages/teleport/src/Recordings/RecordingsList.tsx index bd50abd4bdfa3..d5eaf262e6b69 100644 --- a/web/packages/teleport/src/Recordings/RecordingsList.tsx +++ b/web/packages/teleport/src/Recordings/RecordingsList.tsx @@ -17,11 +17,11 @@ */ import React from 'react'; + import { ButtonBorder } from 'design'; import Table, { Cell, TextCell } from 'design/DataTable'; -import { dateTimeMatcher } from 'design/utils/match'; - import * as Icons from 'design/Icon'; +import { dateTimeMatcher } from 'design/utils/match'; import cfg from 'teleport/config'; import { Recording, RecordingType } from 'teleport/services/recordings'; diff --git a/web/packages/teleport/src/Recordings/useRecordings.ts b/web/packages/teleport/src/Recordings/useRecordings.ts index 687781e88bf3f..46e49ca63bb60 100644 --- a/web/packages/teleport/src/Recordings/useRecordings.ts +++ b/web/packages/teleport/src/Recordings/useRecordings.ts @@ -16,16 +16,17 @@ * along with this program. If not, see . */ -import { useState, useEffect, useMemo } from 'react'; +import { useEffect, useMemo, useState } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; -import Ctx from 'teleport/teleportContext'; -import useStickyClusterId from 'teleport/useStickyClusterId'; import { - getRangeOptions, EventRange, + getRangeOptions, } from 'teleport/components/EventRangePicker'; import { Recording } from 'teleport/services/recordings'; +import Ctx from 'teleport/teleportContext'; +import useStickyClusterId from 'teleport/useStickyClusterId'; export default function useRecordings(ctx: Ctx) { const { clusterId } = useStickyClusterId(); diff --git a/web/packages/teleport/src/Roles/DeleteRole/DeleteRole.tsx b/web/packages/teleport/src/Roles/DeleteRole/DeleteRole.tsx index cb0c63016d488..dc73d41ec1159 100644 --- a/web/packages/teleport/src/Roles/DeleteRole/DeleteRole.tsx +++ b/web/packages/teleport/src/Roles/DeleteRole/DeleteRole.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { ButtonSecondary, ButtonWarning, Text, Alert } from 'design'; + +import { Alert, ButtonSecondary, ButtonWarning, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/DialogConfirmation'; import useAttempt from 'shared/hooks/useAttemptNext'; diff --git a/web/packages/teleport/src/Roles/DeleteRole/index.ts b/web/packages/teleport/src/Roles/DeleteRole/index.ts index 083b4807949fb..56d6a40423a05 100644 --- a/web/packages/teleport/src/Roles/DeleteRole/index.ts +++ b/web/packages/teleport/src/Roles/DeleteRole/index.ts @@ -17,4 +17,5 @@ */ import DeleteRole from './DeleteRole'; + export default DeleteRole; diff --git a/web/packages/teleport/src/Roles/RoleList/RoleList.tsx b/web/packages/teleport/src/Roles/RoleList/RoleList.tsx index 5641442e43d78..0bff31387f739 100644 --- a/web/packages/teleport/src/Roles/RoleList/RoleList.tsx +++ b/web/packages/teleport/src/Roles/RoleList/RoleList.tsx @@ -17,9 +17,9 @@ */ import React from 'react'; + import Table, { Cell } from 'design/DataTable'; import { MenuButton, MenuItem } from 'shared/components/MenuAction'; - import { SearchPanel } from 'shared/components/Search'; import { SeversidePagination } from 'teleport/components/hooks/useServersidePagination'; diff --git a/web/packages/teleport/src/Roles/Roles.test.tsx b/web/packages/teleport/src/Roles/Roles.test.tsx index 9d13b7a6604f3..d3996a9d3377b 100644 --- a/web/packages/teleport/src/Roles/Roles.test.tsx +++ b/web/packages/teleport/src/Roles/Roles.test.tsx @@ -17,7 +17,8 @@ */ import { MemoryRouter } from 'react-router'; -import { render, screen, fireEvent, waitFor } from 'design/utils/testing'; + +import { fireEvent, render, screen, waitFor } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; import { createTeleportContext } from 'teleport/mocks/contexts'; diff --git a/web/packages/teleport/src/Roles/Roles.tsx b/web/packages/teleport/src/Roles/Roles.tsx index 9fe994908d0d0..5c260ba70dca5 100644 --- a/web/packages/teleport/src/Roles/Roles.tsx +++ b/web/packages/teleport/src/Roles/Roles.tsx @@ -19,9 +19,10 @@ import React, { useEffect, useState } from 'react'; import { Alert, Box, ButtonPrimary, Flex, Link, Text } from 'design'; -import { HoverTooltip } from 'shared/components/ToolTip'; import { MissingPermissionsTooltip } from 'shared/components/MissingPermissionsTooltip'; +import { HoverTooltip } from 'shared/components/ToolTip'; +import { useServerSidePagination } from 'teleport/components/hooks'; import { FeatureBox, FeatureHeader, @@ -29,16 +30,13 @@ import { } from 'teleport/components/Layout'; import ResourceEditor from 'teleport/components/ResourceEditor'; import useResources from 'teleport/components/useResources'; -import useTeleport from 'teleport/useTeleport'; import { CaptureEvent, userEventService } from 'teleport/services/userEvent'; +import useTeleport from 'teleport/useTeleport'; -import { useServerSidePagination } from 'teleport/components/hooks'; - -import { RoleList } from './RoleList'; import DeleteRole from './DeleteRole'; -import { useRoles, State } from './useRoles'; - +import { RoleList } from './RoleList'; import templates from './templates'; +import { State, useRoles } from './useRoles'; export function RolesContainer() { const ctx = useTeleport(); diff --git a/web/packages/teleport/src/Roles/useRoles.ts b/web/packages/teleport/src/Roles/useRoles.ts index 9290cea4913eb..7e1d98e71a962 100644 --- a/web/packages/teleport/src/Roles/useRoles.ts +++ b/web/packages/teleport/src/Roles/useRoles.ts @@ -16,9 +16,8 @@ * along with this program. If not, see . */ -import TeleportContext from 'teleport/teleportContext'; - import type { UrlListRolesParams } from 'teleport/config'; +import TeleportContext from 'teleport/teleportContext'; export function useRoles(ctx: TeleportContext) { const rolesAcl = ctx.storeUser.getRoleAccess(); diff --git a/web/packages/teleport/src/SamlApplications/useSamlAppActions.tsx b/web/packages/teleport/src/SamlApplications/useSamlAppActions.tsx index 929f4ff149e78..5a4026f376f8c 100644 --- a/web/packages/teleport/src/SamlApplications/useSamlAppActions.tsx +++ b/web/packages/teleport/src/SamlApplications/useSamlAppActions.tsx @@ -17,12 +17,12 @@ */ import React, { createContext, useContext } from 'react'; + import { Attempt } from 'shared/hooks/useAsync'; +import type { ResourceSpec } from 'teleport/Discover/SelectResource/types'; import { SamlMeta } from 'teleport/Discover/useDiscover'; - import type { SamlAppToDelete } from 'teleport/services/samlidp/types'; -import type { ResourceSpec } from 'teleport/Discover/SelectResource/types'; import type { Access } from 'teleport/services/user'; /** diff --git a/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.test.tsx b/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.test.tsx index c9eddc827e38f..f3b751fe0b15a 100644 --- a/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.test.tsx +++ b/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.test.tsx @@ -17,10 +17,10 @@ */ import React from 'react'; + import { fireEvent, render, screen } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; - import { createTeleportContext } from 'teleport/mocks/contexts'; import { SessionJoinBtn } from './SessionJoinBtn'; diff --git a/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.tsx b/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.tsx index 636529efcf567..b3dc0f9905a71 100644 --- a/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.tsx +++ b/web/packages/teleport/src/Sessions/SessionList/SessionJoinBtn.tsx @@ -21,9 +21,9 @@ import React, { useState } from 'react'; import { Box, ButtonBorder, Flex, Menu, MenuItem, Text } from 'design'; import { ChevronDown, Warning } from 'design/Icon'; +import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; import cfg from 'teleport/config'; import { ParticipantMode } from 'teleport/services/session'; -import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; import { CtaEvent } from 'teleport/services/userEvent'; export const SessionJoinBtn = ({ diff --git a/web/packages/teleport/src/Sessions/SessionList/SessionList.tsx b/web/packages/teleport/src/Sessions/SessionList/SessionList.tsx index de7055f94417d..477ac9d54b52f 100644 --- a/web/packages/teleport/src/Sessions/SessionList/SessionList.tsx +++ b/web/packages/teleport/src/Sessions/SessionList/SessionList.tsx @@ -16,11 +16,12 @@ * along with this program. If not, see . */ -import Table, { Cell } from 'design/DataTable'; -import * as Icons from 'design/Icon'; import React from 'react'; import styled from 'styled-components'; +import Table, { Cell } from 'design/DataTable'; +import * as Icons from 'design/Icon'; + import { Participant, Session, SessionKind } from 'teleport/services/session'; import { SessionJoinBtn } from './SessionJoinBtn'; diff --git a/web/packages/teleport/src/Sessions/SessionList/index.ts b/web/packages/teleport/src/Sessions/SessionList/index.ts index d9db5f0f53103..9eb026c8b3b1a 100644 --- a/web/packages/teleport/src/Sessions/SessionList/index.ts +++ b/web/packages/teleport/src/Sessions/SessionList/index.ts @@ -17,4 +17,5 @@ */ import SessionList from './SessionList'; + export default SessionList; diff --git a/web/packages/teleport/src/Sessions/Sessions.story.test.tsx b/web/packages/teleport/src/Sessions/Sessions.story.test.tsx index 0487ef2abb799..2df82a0b833b8 100644 --- a/web/packages/teleport/src/Sessions/Sessions.story.test.tsx +++ b/web/packages/teleport/src/Sessions/Sessions.story.test.tsx @@ -23,8 +23,8 @@ import { render } from 'design/utils/testing'; import cfg from 'teleport/config'; import { - Loaded, ActiveSessionsCTA, + Loaded, ModeratedSessionsCTA, } from './Sessions.story'; diff --git a/web/packages/teleport/src/Sessions/Sessions.story.tsx b/web/packages/teleport/src/Sessions/Sessions.story.tsx index 23c4bc3d0053d..e4ac0053e4f7f 100644 --- a/web/packages/teleport/src/Sessions/Sessions.story.tsx +++ b/web/packages/teleport/src/Sessions/Sessions.story.tsx @@ -20,12 +20,11 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; - import { createTeleportContext } from 'teleport/mocks/contexts'; import useSessions from 'teleport/Sessions/useSessions'; -import { Sessions } from './Sessions'; import { sessions } from './fixtures'; +import { Sessions } from './Sessions'; export default { title: 'Teleport/ActiveSessions', diff --git a/web/packages/teleport/src/Sessions/Sessions.tsx b/web/packages/teleport/src/Sessions/Sessions.tsx index 7f846b4061231..b08a195690bdb 100644 --- a/web/packages/teleport/src/Sessions/Sessions.tsx +++ b/web/packages/teleport/src/Sessions/Sessions.tsx @@ -17,19 +17,20 @@ */ import React, { useState } from 'react'; + import { Box, Indicator } from 'design'; import { Danger } from 'design/Alert'; import { ClusterDropdown } from 'shared/components/ClusterDropdown/ClusterDropdown'; +import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import useTeleport from 'teleport/useTeleport'; -import useStickerClusterId from 'teleport/useStickyClusterId'; -import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; import { CtaEvent } from 'teleport/services/userEvent'; +import useStickerClusterId from 'teleport/useStickyClusterId'; +import useTeleport from 'teleport/useTeleport'; import SessionList from './SessionList'; import useSessions from './useSessions'; diff --git a/web/packages/teleport/src/Sessions/useSessions.ts b/web/packages/teleport/src/Sessions/useSessions.ts index 15c647ccad097..6cfade918c409 100644 --- a/web/packages/teleport/src/Sessions/useSessions.ts +++ b/web/packages/teleport/src/Sessions/useSessions.ts @@ -16,15 +16,14 @@ * along with this program. If not, see . */ +import { context, trace } from '@opentelemetry/api'; import { useEffect, useState } from 'react'; -import { useAttempt } from 'shared/hooks'; -import { context, trace } from '@opentelemetry/api'; +import { useAttempt } from 'shared/hooks'; +import cfg from 'teleport/config'; import { Session } from 'teleport/services/session'; - import Ctx from 'teleport/teleportContext'; -import cfg from 'teleport/config'; const tracer = trace.getTracer('userSessions'); diff --git a/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.story.tsx b/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.story.tsx index 7fd3b2e2c026e..26b38b4951bca 100644 --- a/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.story.tsx +++ b/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.story.tsx @@ -16,9 +16,9 @@ * along with this program. If not, see . */ +import { createMemoryHistory } from 'history'; import React from 'react'; import { Router } from 'react-router'; -import { createMemoryHistory } from 'history'; import { SingleLogoutFailed } from './SingleLogoutFailed'; diff --git a/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.tsx b/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.tsx index b7c6c576fa409..2c09da8d567b6 100644 --- a/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.tsx +++ b/web/packages/teleport/src/SingleLogoutFailed/SingleLogoutFailed.tsx @@ -18,6 +18,7 @@ import React from 'react'; import { useLocation } from 'react-router'; + import { LogoutFailed } from 'design/CardError'; import { LogoHero } from 'teleport/components/LogoHero'; diff --git a/web/packages/teleport/src/Support/Support.story.test.tsx b/web/packages/teleport/src/Support/Support.story.test.tsx index 3ea53548a37b7..6de8fbc4b7f3d 100644 --- a/web/packages/teleport/src/Support/Support.story.test.tsx +++ b/web/packages/teleport/src/Support/Support.story.test.tsx @@ -24,11 +24,11 @@ import { render } from 'design/utils/testing'; import cfg from 'teleport/config'; import { - SupportOSS, - SupportOSSWithCTA, SupportCloud, SupportEnterprise, SupportEnterpriseWithCTA, + SupportOSS, + SupportOSSWithCTA, } from './Support.story'; test('support OSS', () => { diff --git a/web/packages/teleport/src/Support/Support.story.tsx b/web/packages/teleport/src/Support/Support.story.tsx index a5de9cc15ec0e..9b33d20dab524 100644 --- a/web/packages/teleport/src/Support/Support.story.tsx +++ b/web/packages/teleport/src/Support/Support.story.tsx @@ -20,9 +20,8 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { ContextProvider } from 'teleport'; - -import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContentMinWidth } from 'teleport/Main/Main'; +import { createTeleportContext } from 'teleport/mocks/contexts'; import { Props, Support } from './Support'; diff --git a/web/packages/teleport/src/Support/Support.tsx b/web/packages/teleport/src/Support/Support.tsx index be4f8c7fd8615..dacd007131daf 100644 --- a/web/packages/teleport/src/Support/Support.tsx +++ b/web/packages/teleport/src/Support/Support.tsx @@ -18,22 +18,22 @@ import React from 'react'; import { Link } from 'react-router-dom'; +import styled from 'styled-components'; + import { Box, Flex, H2, H3, Text } from 'design'; import * as Icons from 'design/Icon'; import { MultiRowBox, Row } from 'design/MultiRowBox'; -import styled from 'styled-components'; - +import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; import { FeatureBox, FeatureHeader, FeatureHeaderTitle, } from 'teleport/components/Layout'; -import useTeleport from 'teleport/useTeleport'; import cfg from 'teleport/config'; -import { ButtonLockedFeature } from 'teleport/components/ButtonLockedFeature'; -import { CtaEvent } from 'teleport/services/userEvent'; import { useNoMinWidth } from 'teleport/Main'; +import { CtaEvent } from 'teleport/services/userEvent'; +import useTeleport from 'teleport/useTeleport'; export function SupportContainer({ children }: { children?: React.ReactNode }) { const ctx = useTeleport(); diff --git a/web/packages/teleport/src/Teleport.tsx b/web/packages/teleport/src/Teleport.tsx index 83158e8e70062..6a1fbb3c68524 100644 --- a/web/packages/teleport/src/Teleport.tsx +++ b/web/packages/teleport/src/Teleport.tsx @@ -16,40 +16,35 @@ * along with this program. If not, see . */ +import type { History } from 'history'; import React, { Suspense, useEffect } from 'react'; + import ThemeProvider, { updateFavicon } from 'design/ThemeProvider'; -import { Route, Router, Switch } from 'teleport/components/Router'; -import { CatchError } from 'teleport/components/CatchError'; import Authenticated from 'teleport/components/Authenticated'; - +import { CatchError } from 'teleport/components/CatchError'; +import { Route, Router, Switch } from 'teleport/components/Router'; import { getOSSFeatures } from 'teleport/features'; - import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; import { UserContextProvider } from 'teleport/User'; import { NewCredentials } from 'teleport/Welcome/NewCredentials'; -import TeleportContextProvider from './TeleportContextProvider'; -import TeleportContext from './teleportContext'; -import cfg from './config'; import { AppLauncher } from './AppLauncher'; -import { LoginFailedComponent as LoginFailed } from './Login/LoginFailed'; -import { LoginSuccess } from './Login/LoginSuccess'; -import { LoginTerminalRedirect } from './Login/LoginTerminalRedirect'; -import { LoginClose } from './Login/LoginClose'; -import { Login } from './Login'; -import { Welcome } from './Welcome'; -import { SingleLogoutFailed } from './SingleLogoutFailed'; - +import cfg from './config'; import { ConsoleWithContext as Console } from './Console'; -import { Player } from './Player'; import { DesktopSessionContainer as DesktopSession } from './DesktopSession'; - import { HeadlessRequest } from './HeadlessRequest'; - +import { Login } from './Login'; +import { LoginClose } from './Login/LoginClose'; +import { LoginFailedComponent as LoginFailed } from './Login/LoginFailed'; +import { LoginSuccess } from './Login/LoginSuccess'; +import { LoginTerminalRedirect } from './Login/LoginTerminalRedirect'; import { Main } from './Main'; - -import type { History } from 'history'; +import { Player } from './Player'; +import { SingleLogoutFailed } from './SingleLogoutFailed'; +import TeleportContext from './teleportContext'; +import TeleportContextProvider from './TeleportContextProvider'; +import { Welcome } from './Welcome'; const Teleport: React.FC = props => { const { ctx, history } = props; diff --git a/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.story.tsx b/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.story.tsx index 78f15199d1ba9..463aeebad4c23 100644 --- a/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.story.tsx +++ b/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.story.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Flex } from 'design'; import ClusterSelector from './ClusterSelector'; diff --git a/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.tsx b/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.tsx index 21827d2813ae1..0ecda9b5bcd97 100644 --- a/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.tsx +++ b/web/packages/teleport/src/TopBar/ClusterSelector/ClusterSelector.tsx @@ -19,6 +19,7 @@ import React from 'react'; import { components } from 'react-select'; import styled from 'styled-components'; + import { Box, Flex, Text } from 'design'; import { SelectAsync } from 'shared/components/Select'; diff --git a/web/packages/teleport/src/TopBar/ClusterSelector/index.ts b/web/packages/teleport/src/TopBar/ClusterSelector/index.ts index 64b0d10663aa4..28daa8b80a9fb 100644 --- a/web/packages/teleport/src/TopBar/ClusterSelector/index.ts +++ b/web/packages/teleport/src/TopBar/ClusterSelector/index.ts @@ -17,4 +17,5 @@ */ import ClusterSelector from './ClusterSelector'; + export default ClusterSelector; diff --git a/web/packages/teleport/src/TopBar/DeviceTrustIcon.tsx b/web/packages/teleport/src/TopBar/DeviceTrustIcon.tsx index c888896d5fb5c..4c0a25de81c9d 100644 --- a/web/packages/teleport/src/TopBar/DeviceTrustIcon.tsx +++ b/web/packages/teleport/src/TopBar/DeviceTrustIcon.tsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Flex } from 'design'; import { ShieldCheck, ShieldWarning } from 'design/Icon'; import { IconProps } from 'design/Icon/Icon'; diff --git a/web/packages/teleport/src/TopBar/DeviceTrustStatus.tsx b/web/packages/teleport/src/TopBar/DeviceTrustStatus.tsx index 30bceb079f10b..a16834e65ad6c 100644 --- a/web/packages/teleport/src/TopBar/DeviceTrustStatus.tsx +++ b/web/packages/teleport/src/TopBar/DeviceTrustStatus.tsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Flex, Text } from 'design'; import session from 'teleport/services/websession'; diff --git a/web/packages/teleport/src/TopBar/TopBar.story.tsx b/web/packages/teleport/src/TopBar/TopBar.story.tsx index 18c633db54f03..fd5270d952265 100644 --- a/web/packages/teleport/src/TopBar/TopBar.story.tsx +++ b/web/packages/teleport/src/TopBar/TopBar.story.tsx @@ -16,17 +16,17 @@ * along with this program. If not, see . */ +import { createMemoryHistory } from 'history'; import React from 'react'; import { Router } from 'react-router'; -import { createMemoryHistory } from 'history'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; import { getOSSFeatures } from 'teleport/features'; -import TeleportContext from 'teleport/teleportContext'; -import { makeUserContext } from 'teleport/services/user'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; import { LocalNotificationKind } from 'teleport/services/notifications'; +import { makeUserContext } from 'teleport/services/user'; +import TeleportContext from 'teleport/teleportContext'; import TeleportContextProvider from 'teleport/TeleportContextProvider'; -import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; import { TopBar } from './TopBar'; diff --git a/web/packages/teleport/src/TopBar/TopBar.test.tsx b/web/packages/teleport/src/TopBar/TopBar.test.tsx index 862a89b6bc4e6..6913dfc06bcd0 100644 --- a/web/packages/teleport/src/TopBar/TopBar.test.tsx +++ b/web/packages/teleport/src/TopBar/TopBar.test.tsx @@ -16,29 +16,28 @@ * along with this program. If not, see . */ -import React from 'react'; import { act } from '@testing-library/react'; -import { subSeconds, subMinutes } from 'date-fns'; -import { render, screen, userEvent } from 'design/utils/testing'; -import { Router } from 'react-router'; +import { subMinutes, subSeconds } from 'date-fns'; import { createMemoryHistory } from 'history'; import { mockIntersectionObserver } from 'jsdom-testing-mocks'; +import React from 'react'; +import { Router } from 'react-router'; -import session from 'teleport/services/websession'; -import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; -import TeleportContextProvider from 'teleport/TeleportContextProvider'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { render, screen, userEvent } from 'design/utils/testing'; + +import { clusters } from 'teleport/Clusters/fixtures'; import { getOSSFeatures } from 'teleport/features'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; +import { NotificationSubKind } from 'teleport/services/notifications'; +import { makeUserContext } from 'teleport/services/user'; +import session from 'teleport/services/websession'; import TeleportContext, { disabledFeatureFlags, } from 'teleport/teleportContext'; -import { makeUserContext } from 'teleport/services/user'; -import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; +import TeleportContextProvider from 'teleport/TeleportContextProvider'; import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; - -import { clusters } from 'teleport/Clusters/fixtures'; - -import { NotificationSubKind } from 'teleport/services/notifications'; +import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; import { TopBar } from './TopBar'; diff --git a/web/packages/teleport/src/TopBar/TopBar.tsx b/web/packages/teleport/src/TopBar/TopBar.tsx index 20c828f7c5510..8441a7603d953 100644 --- a/web/packages/teleport/src/TopBar/TopBar.tsx +++ b/web/packages/teleport/src/TopBar/TopBar.tsx @@ -16,32 +16,31 @@ * along with this program. If not, see . */ -import React, { useEffect, useCallback, useState } from 'react'; -import styled, { useTheme } from 'styled-components'; +import type * as history from 'history'; +import React, { useCallback, useEffect, useState } from 'react'; +import { matchPath, useHistory } from 'react-router'; import { Link } from 'react-router-dom'; +import styled, { useTheme } from 'styled-components'; + import { Flex, Image, Text, TopNav } from 'design'; -import { matchPath, useHistory } from 'react-router'; -import { Theme } from 'design/theme/themes/types'; import { ArrowLeft, Download, Server, SlidersVertical } from 'design/Icon'; +import { Theme } from 'design/theme/themes/types'; import { HoverTooltip } from 'shared/components/ToolTip'; -import useTeleport from 'teleport/useTeleport'; +import { logos } from 'teleport/components/LogoHero/LogoHero'; import { UserMenuNav } from 'teleport/components/UserMenuNav'; -import { useFeatures } from 'teleport/FeaturesContext'; -import { NavigationCategory } from 'teleport/Navigation/categories'; -import useStickyClusterId from 'teleport/useStickyClusterId'; import cfg from 'teleport/config'; -import { TeleportFeature } from 'teleport/types'; +import { useFeatures } from 'teleport/FeaturesContext'; import { useLayout } from 'teleport/Main/LayoutContext'; +import { NavigationCategory } from 'teleport/Navigation/categories'; import { getFirstRouteForCategory } from 'teleport/Navigation/Navigation'; -import { logos } from 'teleport/components/LogoHero/LogoHero'; - import { Notifications } from 'teleport/Notifications'; +import { TeleportFeature } from 'teleport/types'; +import useStickyClusterId from 'teleport/useStickyClusterId'; +import useTeleport from 'teleport/useTeleport'; import { ButtonIconContainer } from './Shared'; -import type * as history from 'history'; - function getCategoryForRoute( features: TeleportFeature[], route: history.Location | Location diff --git a/web/packages/teleport/src/TrustedClusters/DeleteTrust/DeleteTrust.tsx b/web/packages/teleport/src/TrustedClusters/DeleteTrust/DeleteTrust.tsx index bef46e326bd61..4fd0197635094 100644 --- a/web/packages/teleport/src/TrustedClusters/DeleteTrust/DeleteTrust.tsx +++ b/web/packages/teleport/src/TrustedClusters/DeleteTrust/DeleteTrust.tsx @@ -17,15 +17,16 @@ */ import React from 'react'; + import { ButtonSecondary, ButtonWarning, Text } from 'design'; import * as Alerts from 'design/Alert'; -import useAttempt from 'shared/hooks/useAttemptNext'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/DialogConfirmation'; +import useAttempt from 'shared/hooks/useAttemptNext'; export default function DeleteTrustedClusterDialog(props: Props) { const { name, onClose, onDelete } = props; diff --git a/web/packages/teleport/src/TrustedClusters/DeleteTrust/index.ts b/web/packages/teleport/src/TrustedClusters/DeleteTrust/index.ts index 9c699d70cf36e..7423062b702d7 100644 --- a/web/packages/teleport/src/TrustedClusters/DeleteTrust/index.ts +++ b/web/packages/teleport/src/TrustedClusters/DeleteTrust/index.ts @@ -17,4 +17,5 @@ */ import DeleteTrust from './DeleteTrust'; + export default DeleteTrust; diff --git a/web/packages/teleport/src/TrustedClusters/TrustedClusters.tsx b/web/packages/teleport/src/TrustedClusters/TrustedClusters.tsx index 4073b3f6298f6..baa10c1a225be 100644 --- a/web/packages/teleport/src/TrustedClusters/TrustedClusters.tsx +++ b/web/packages/teleport/src/TrustedClusters/TrustedClusters.tsx @@ -17,8 +17,9 @@ */ import React from 'react'; + +import { Box, ButtonPrimary, Flex, Indicator, Link, Text } from 'design'; import { Danger } from 'design/Alert'; -import { Indicator, Text, Box, Flex, ButtonPrimary, Link } from 'design'; import Card from 'design/Card'; import Image from 'design/Image'; @@ -28,14 +29,13 @@ import { FeatureHeaderTitle, } from 'teleport/components/Layout'; import ResourceEditor from 'teleport/components/ResourceEditor'; - import useResources from 'teleport/components/useResources'; +import { emptyPng } from './assets'; import DeleteTrust from './DeleteTrust'; import templates from './templates'; import TrustedList from './TrustedList'; import useTrustedClusters from './useTrustedClusters'; -import { emptyPng } from './assets'; export default function TrustedClusters() { const { items, canCreate, remove, save, attempt } = useTrustedClusters(); diff --git a/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedList.tsx b/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedList.tsx index a42c27c0d99e3..3ea2caf1a0565 100644 --- a/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedList.tsx +++ b/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedList.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Flex } from 'design'; import TrustedListItem from './TrustedListItem'; diff --git a/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedListItem.tsx b/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedListItem.tsx index d17b4cd967a12..9ba9a5b8a4acd 100644 --- a/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedListItem.tsx +++ b/web/packages/teleport/src/TrustedClusters/TrustedList/TrustedListItem.tsx @@ -17,7 +17,8 @@ */ import React from 'react'; -import { Text, Flex, ButtonPrimary } from 'design'; + +import { ButtonPrimary, Flex, Text } from 'design'; import * as Icons from 'design/Icon'; import { MenuIcon, MenuItem } from 'shared/components/MenuAction'; diff --git a/web/packages/teleport/src/TrustedClusters/TrustedList/index.ts b/web/packages/teleport/src/TrustedClusters/TrustedList/index.ts index f50cbed6ddc11..c0c6e499a1a83 100644 --- a/web/packages/teleport/src/TrustedClusters/TrustedList/index.ts +++ b/web/packages/teleport/src/TrustedClusters/TrustedList/index.ts @@ -17,4 +17,5 @@ */ import TrustedList from './TrustedList'; + export default TrustedList; diff --git a/web/packages/teleport/src/TrustedClusters/assets.js b/web/packages/teleport/src/TrustedClusters/assets.js index d12d94fd97f34..1f60a17c5df11 100644 --- a/web/packages/teleport/src/TrustedClusters/assets.js +++ b/web/packages/teleport/src/TrustedClusters/assets.js @@ -1,2 +1,3 @@ import emptyPng from './empty.png'; + export { emptyPng }; diff --git a/web/packages/teleport/src/TrustedClusters/index.ts b/web/packages/teleport/src/TrustedClusters/index.ts index 524131c67109d..869d57cdc9a5d 100644 --- a/web/packages/teleport/src/TrustedClusters/index.ts +++ b/web/packages/teleport/src/TrustedClusters/index.ts @@ -17,4 +17,5 @@ */ import TrustedClusters from './TrustedClusters'; + export { TrustedClusters }; diff --git a/web/packages/teleport/src/UnifiedResources/ResourceActionButton.tsx b/web/packages/teleport/src/UnifiedResources/ResourceActionButton.tsx index 05fcfe3de05ce..7325b02f03b4a 100644 --- a/web/packages/teleport/src/UnifiedResources/ResourceActionButton.tsx +++ b/web/packages/teleport/src/UnifiedResources/ResourceActionButton.tsx @@ -17,27 +17,27 @@ */ import React, { useState } from 'react'; + import { ButtonBorder, ButtonWithMenu, MenuItem } from 'design'; -import { LoginItem, MenuLogin } from 'shared/components/MenuLogin'; import { AwsLaunchButton } from 'shared/components/AwsLaunchButton'; +import { LoginItem, MenuLogin } from 'shared/components/MenuLogin'; -import { UnifiedResource } from 'teleport/services/agents'; import cfg from 'teleport/config'; -import useTeleport from 'teleport/useTeleport'; -import { Database } from 'teleport/services/databases'; -import { openNewTab } from 'teleport/lib/util'; -import { Kube } from 'teleport/services/kube'; -import { Desktop } from 'teleport/services/desktops'; import DbConnectDialog from 'teleport/Databases/ConnectDialog'; +import type { ResourceSpec } from 'teleport/Discover/SelectResource/types'; +import { ResourceKind } from 'teleport/Discover/Shared'; import KubeConnectDialog from 'teleport/Kubes/ConnectDialog'; -import useStickyClusterId from 'teleport/useStickyClusterId'; -import { Node, sortNodeLogins } from 'teleport/services/nodes'; +import { openNewTab } from 'teleport/lib/util'; +import { useSamlAppAction } from 'teleport/SamlApplications/useSamlAppActions'; +import { UnifiedResource } from 'teleport/services/agents'; import { App } from 'teleport/services/apps'; -import { ResourceKind } from 'teleport/Discover/Shared'; +import { Database } from 'teleport/services/databases'; +import { Desktop } from 'teleport/services/desktops'; +import { Kube } from 'teleport/services/kube'; +import { Node, sortNodeLogins } from 'teleport/services/nodes'; import { DiscoverEventResource } from 'teleport/services/userEvent'; -import { useSamlAppAction } from 'teleport/SamlApplications/useSamlAppActions'; - -import type { ResourceSpec } from 'teleport/Discover/SelectResource/types'; +import useStickyClusterId from 'teleport/useStickyClusterId'; +import useTeleport from 'teleport/useTeleport'; type Props = { resource: UnifiedResource; diff --git a/web/packages/teleport/src/UnifiedResources/UnifiedResources.tsx b/web/packages/teleport/src/UnifiedResources/UnifiedResources.tsx index 61f8569b09c42..9a0541b69cd48 100644 --- a/web/packages/teleport/src/UnifiedResources/UnifiedResources.tsx +++ b/web/packages/teleport/src/UnifiedResources/UnifiedResources.tsx @@ -16,44 +16,43 @@ * along with this program. If not, see . */ -import React, { useCallback, useState, useMemo } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; + import { Flex } from 'design'; import { Danger } from 'design/Alert'; - +import { DefaultTab } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; +import { ClusterDropdown } from 'shared/components/ClusterDropdown/ClusterDropdown'; import { - FilterKind, - UnifiedResources as SharedUnifiedResources, - useUnifiedResourcesFetch, - UnifiedResourcesPinning, BulkAction, + FilterKind, IncludedResourceMode, ResourceAvailabilityFilter, + UnifiedResources as SharedUnifiedResources, + UnifiedResourcesPinning, + useUnifiedResourcesFetch, } from 'shared/components/UnifiedResources'; -import { ClusterDropdown } from 'shared/components/ClusterDropdown/ClusterDropdown'; - -import { DefaultTab } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; -import useStickyClusterId from 'teleport/useStickyClusterId'; -import { useUser } from 'teleport/User/UserContext'; import { useTeleport } from 'teleport'; +import AgentButtonAdd from 'teleport/components/AgentButtonAdd'; +import Empty, { EmptyStateInfo } from 'teleport/components/Empty'; import { useUrlFiltering } from 'teleport/components/hooks'; +import { encodeUrlQueryParams } from 'teleport/components/hooks/useUrlFiltering'; import { + FeatureBox, FeatureHeader, FeatureHeaderTitle, - FeatureBox, } from 'teleport/components/Layout'; -import { useNoMinWidth } from 'teleport/Main'; -import AgentButtonAdd from 'teleport/components/AgentButtonAdd'; +import { ServersideSearchPanel } from 'teleport/components/ServersideSearchPanel'; import { SearchResource } from 'teleport/Discover/SelectResource'; -import { encodeUrlQueryParams } from 'teleport/components/hooks/useUrlFiltering'; -import Empty, { EmptyStateInfo } from 'teleport/components/Empty'; -import { FeatureFlags } from 'teleport/types'; -import { UnifiedResource } from 'teleport/services/agents'; +import { useNoMinWidth } from 'teleport/Main'; import { - useSamlAppAction, SamlAppActionProvider, + useSamlAppAction, } from 'teleport/SamlApplications/useSamlAppActions'; -import { ServersideSearchPanel } from 'teleport/components/ServersideSearchPanel'; +import { UnifiedResource } from 'teleport/services/agents'; +import { FeatureFlags } from 'teleport/types'; +import { useUser } from 'teleport/User/UserContext'; +import useStickyClusterId from 'teleport/useStickyClusterId'; import { ResourceActionButton } from './ResourceActionButton'; diff --git a/web/packages/teleport/src/User/UserContext.test.tsx b/web/packages/teleport/src/User/UserContext.test.tsx index 055b665f7dd26..40ffa316a9414 100644 --- a/web/packages/teleport/src/User/UserContext.test.tsx +++ b/web/packages/teleport/src/User/UserContext.test.tsx @@ -16,24 +16,20 @@ * along with this program. If not, see . */ -import React from 'react'; - -import { setupServer } from 'msw/node'; +import { render, screen } from '@testing-library/react'; import { rest } from 'msw'; +import { setupServer } from 'msw/node'; +import React from 'react'; import { MemoryRouter } from 'react-router'; -import { render, screen } from '@testing-library/react'; - import '@testing-library/jest-dom'; import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; import cfg from 'teleport/config'; - +import { KeysEnum } from 'teleport/services/storageService'; import { UserContextProvider } from 'teleport/User'; - import { useUser } from 'teleport/User/UserContext'; -import { KeysEnum } from 'teleport/services/storageService'; function ThemeName() { const { preferences } = useUser(); diff --git a/web/packages/teleport/src/User/UserContext.tsx b/web/packages/teleport/src/User/UserContext.tsx index 66fc27d5b7580..a519fa8b525c1 100644 --- a/web/packages/teleport/src/User/UserContext.tsx +++ b/web/packages/teleport/src/User/UserContext.tsx @@ -26,21 +26,15 @@ import React, { useState, } from 'react'; -import useAttempt from 'shared/hooks/useAttemptNext'; - import { Indicator } from 'design'; - -import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; - import { ClusterUserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/cluster_preferences_pb'; +import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; +import useAttempt from 'shared/hooks/useAttemptNext'; -import { StyledIndicator } from 'teleport/Main'; - -import * as service from 'teleport/services/userPreferences'; import cfg from 'teleport/config'; - +import { StyledIndicator } from 'teleport/Main'; import { KeysEnum, storageService } from 'teleport/services/storageService'; - +import * as service from 'teleport/services/userPreferences'; import { makeDefaultUserPreferences } from 'teleport/services/userPreferences/userPreferences'; export interface UserContextValue { diff --git a/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.test.tsx b/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.test.tsx index 0a89e6c79f344..b0736f8e81c50 100644 --- a/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.test.tsx +++ b/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.test.tsx @@ -17,18 +17,15 @@ */ import React from 'react'; -import { fireEvent, render, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import Validation from 'shared/components/Validation'; import { AllUserTraits } from 'teleport/services/user'; -import { TraitsEditor, emptyTrait } from './TraitsEditor'; - +import { emptyTrait, TraitsEditor, type TraitsOption } from './TraitsEditor'; import { traitsToTraitsOption } from './useDialog'; -import type { TraitsOption } from './TraitsEditor'; - test('Available traits are rendered', async () => { const setConfiguredTraits = jest.fn(); const userTraits: AllUserTraits = { diff --git a/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.tsx b/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.tsx index f99771b3181e0..870d29e12b2bf 100644 --- a/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.tsx +++ b/web/packages/teleport/src/Users/UserAddEdit/TraitsEditor.tsx @@ -17,11 +17,12 @@ */ import React, { Dispatch, SetStateAction } from 'react'; -import { ButtonBorder, Box, Flex, Text, ButtonIcon } from 'design'; + +import { Box, ButtonBorder, ButtonIcon, Flex, Text } from 'design'; import { Add, Trash } from 'design/Icon'; import { FieldSelectCreatable } from 'shared/components/FieldSelect'; import { Option } from 'shared/components/Select'; -import { requiredField, requiredAll } from 'shared/components/Validation/rules'; +import { requiredAll, requiredField } from 'shared/components/Validation/rules'; import { Attempt } from 'shared/hooks/useAttemptNext'; /** diff --git a/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.story.tsx b/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.story.tsx index c029c2e6dc4a0..6e2fda6f3ac57 100644 --- a/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.story.tsx +++ b/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.story.tsx @@ -20,9 +20,8 @@ import React, { useState } from 'react'; import { AllUserTraits } from 'teleport/services/user'; -import { UserAddEdit } from './UserAddEdit'; - import type { TraitsOption } from './TraitsEditor'; +import { UserAddEdit } from './UserAddEdit'; export default { title: 'Teleport/Users/UserAddEdit', diff --git a/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.tsx b/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.tsx index 841179f954ebd..5563fc3836857 100644 --- a/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.tsx +++ b/web/packages/teleport/src/Users/UserAddEdit/UserAddEdit.tsx @@ -17,23 +17,23 @@ */ import React from 'react'; -import { ButtonPrimary, ButtonSecondary, Alert, Box } from 'design'; + +import { Alert, Box, ButtonPrimary, ButtonSecondary } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; -import Validation from 'shared/components/Validation'; import FieldInput from 'shared/components/FieldInput'; import { FieldSelectAsync } from 'shared/components/FieldSelect'; import { Option } from 'shared/components/Select'; +import Validation from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; import UserTokenLink from './../UserTokenLink'; -import useDialog, { Props } from './useDialog'; - import { TraitsEditor } from './TraitsEditor'; +import useDialog, { Props } from './useDialog'; export default function Container(props: Props) { const dialog = useDialog(props); diff --git a/web/packages/teleport/src/Users/UserAddEdit/useDialog.tsx b/web/packages/teleport/src/Users/UserAddEdit/useDialog.tsx index acfe3451b6fe0..94a578c8fbbbb 100644 --- a/web/packages/teleport/src/Users/UserAddEdit/useDialog.tsx +++ b/web/packages/teleport/src/Users/UserAddEdit/useDialog.tsx @@ -17,10 +17,11 @@ */ import { useState } from 'react'; -import { useAttemptNext } from 'shared/hooks'; + import { Option } from 'shared/components/Select'; +import { useAttemptNext } from 'shared/hooks'; -import { ResetToken, User, AllUserTraits } from 'teleport/services/user'; +import { AllUserTraits, ResetToken, User } from 'teleport/services/user'; import type { TraitsOption } from './TraitsEditor'; diff --git a/web/packages/teleport/src/Users/UserDelete/UserDelete.tsx b/web/packages/teleport/src/Users/UserDelete/UserDelete.tsx index 06064f9be0941..b62c574f9f8d1 100644 --- a/web/packages/teleport/src/Users/UserDelete/UserDelete.tsx +++ b/web/packages/teleport/src/Users/UserDelete/UserDelete.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { ButtonWarning, ButtonSecondary, Text, Alert } from 'design'; + +import { Alert, ButtonSecondary, ButtonWarning, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; import { useAttemptNext } from 'shared/hooks'; diff --git a/web/packages/teleport/src/Users/UserDelete/index.ts b/web/packages/teleport/src/Users/UserDelete/index.ts index bcb3537481291..a63006e0d839c 100644 --- a/web/packages/teleport/src/Users/UserDelete/index.ts +++ b/web/packages/teleport/src/Users/UserDelete/index.ts @@ -17,4 +17,5 @@ */ import UserDelete from './UserDelete'; + export default UserDelete; diff --git a/web/packages/teleport/src/Users/UserList/UserList.tsx b/web/packages/teleport/src/Users/UserList/UserList.tsx index 6a626f119500b..751b4fd994973 100644 --- a/web/packages/teleport/src/Users/UserList/UserList.tsx +++ b/web/packages/teleport/src/Users/UserList/UserList.tsx @@ -17,11 +17,12 @@ */ import React from 'react'; + import { Cell, LabelCell } from 'design/DataTable'; import { MenuButton, MenuItem } from 'shared/components/MenuAction'; -import { Access, User, UserOrigin } from 'teleport/services/user'; import { ClientSearcheableTableWithQueryParamSupport } from 'teleport/components/ClientSearcheableTableWithQueryParamSupport'; +import { Access, User, UserOrigin } from 'teleport/services/user'; export default function UserList({ users = [], diff --git a/web/packages/teleport/src/Users/UserReset/UserReset.story.test.tsx b/web/packages/teleport/src/Users/UserReset/UserReset.story.test.tsx index 781dc7ea078ee..e2aa574ca26b5 100644 --- a/web/packages/teleport/src/Users/UserReset/UserReset.story.test.tsx +++ b/web/packages/teleport/src/Users/UserReset/UserReset.story.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/teleport/src/Users/UserReset/UserReset.tsx b/web/packages/teleport/src/Users/UserReset/UserReset.tsx index 3fd92fe58fe6b..3125e36a04824 100644 --- a/web/packages/teleport/src/Users/UserReset/UserReset.tsx +++ b/web/packages/teleport/src/Users/UserReset/UserReset.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { ButtonPrimary, ButtonSecondary, Text, Alert } from 'design'; + +import { Alert, ButtonPrimary, ButtonSecondary, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; import { useAttemptNext } from 'shared/hooks'; diff --git a/web/packages/teleport/src/Users/UserTokenLink/UserTokenLink.tsx b/web/packages/teleport/src/Users/UserTokenLink/UserTokenLink.tsx index e3777fecd2cfd..e69d0ed0599f7 100644 --- a/web/packages/teleport/src/Users/UserTokenLink/UserTokenLink.tsx +++ b/web/packages/teleport/src/Users/UserTokenLink/UserTokenLink.tsx @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -import React from 'react'; import { formatDistanceStrict } from 'date-fns'; +import React from 'react'; import { ButtonSecondary, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; import TextSelectCopy from 'teleport/components/TextSelectCopy'; -import { ResetToken } from 'teleport/services/user'; import cfg from 'teleport/config'; +import { ResetToken } from 'teleport/services/user'; export default function UserTokenLink({ token, diff --git a/web/packages/teleport/src/Users/Users.test.tsx b/web/packages/teleport/src/Users/Users.test.tsx index c2916695e22f2..515ed57345035 100644 --- a/web/packages/teleport/src/Users/Users.test.tsx +++ b/web/packages/teleport/src/Users/Users.test.tsx @@ -18,7 +18,8 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { render, screen, userEvent, fireEvent } from 'design/utils/testing'; + +import { fireEvent, render, screen, userEvent } from 'design/utils/testing'; import { ContextProvider } from 'teleport'; import { createTeleportContext } from 'teleport/mocks/contexts'; diff --git a/web/packages/teleport/src/Users/Users.tsx b/web/packages/teleport/src/Users/Users.tsx index a31fcc19fae76..2c4d2cd3a020b 100644 --- a/web/packages/teleport/src/Users/Users.tsx +++ b/web/packages/teleport/src/Users/Users.tsx @@ -17,15 +17,16 @@ */ import React from 'react'; + import { - Indicator, - Box, - Text, Alert, + Box, + ButtonIcon, ButtonPrimary, - Link, Flex, - ButtonIcon, + Indicator, + Link, + Text, } from 'design'; import { Cross } from 'design/Icon'; import { HoverTooltip } from 'shared/components/ToolTip'; @@ -36,9 +37,9 @@ import { FeatureHeaderTitle, } from 'teleport/components/Layout'; -import UserList from './UserList'; import UserAddEdit from './UserAddEdit'; import UserDelete from './UserDelete'; +import UserList from './UserList'; import UserReset from './UserReset'; import useUsers, { State, UsersContainerProps } from './useUsers'; diff --git a/web/packages/teleport/src/Users/useUsers.ts b/web/packages/teleport/src/Users/useUsers.ts index 3197a226a9001..fe6bdba9e3ffb 100644 --- a/web/packages/teleport/src/Users/useUsers.ts +++ b/web/packages/teleport/src/Users/useUsers.ts @@ -17,13 +17,14 @@ */ import { ReactElement, useEffect, useState } from 'react'; + import { useAttempt } from 'shared/hooks'; -import { ExcludeUserField, User } from 'teleport/services/user'; -import useTeleport from 'teleport/useTeleport'; import cfg from 'teleport/config'; -import { storageService } from 'teleport/services/storageService'; import auth from 'teleport/services/auth/auth'; +import { storageService } from 'teleport/services/storageService'; +import { ExcludeUserField, User } from 'teleport/services/user'; +import useTeleport from 'teleport/useTeleport'; export default function useUsers({ InviteCollaborators, diff --git a/web/packages/teleport/src/Welcome/CardWelcome.tsx b/web/packages/teleport/src/Welcome/CardWelcome.tsx index 20d94c7d308bf..b2c8f069fa82c 100644 --- a/web/packages/teleport/src/Welcome/CardWelcome.tsx +++ b/web/packages/teleport/src/Welcome/CardWelcome.tsx @@ -17,8 +17,8 @@ */ import React from 'react'; -import { ButtonPrimary, Text } from 'design'; +import { ButtonPrimary, Text } from 'design'; import { OnboardCard } from 'design/Onboard/OnboardCard'; export function CardWelcome({ title, subTitle, btnText, onClick }: Props) { diff --git a/web/packages/teleport/src/Welcome/NewCredentials/Expired.tsx b/web/packages/teleport/src/Welcome/NewCredentials/Expired.tsx index a72a8ec1c641f..8ef69251bec90 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/Expired.tsx +++ b/web/packages/teleport/src/Welcome/NewCredentials/Expired.tsx @@ -18,8 +18,8 @@ import React from 'react'; import styled from 'styled-components'; -import { Text } from 'design'; +import { Text } from 'design'; import { OnboardCard } from 'design/Onboard/OnboardCard'; export function Expired({ resetMode = false }) { diff --git a/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.story.test.tsx b/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.story.test.tsx index 83174d926120b..12f5ffb8cb764 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.story.test.tsx +++ b/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.story.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; import * as story from './NewCredentials.story'; diff --git a/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.test.tsx b/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.test.tsx index 6712d9fdda004..ed5694b46fbe7 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.test.tsx +++ b/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.test.tsx @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -import { Attempt } from 'shared/hooks/useAttemptNext'; +import React from 'react'; import { render, screen } from 'design/utils/testing'; -import React from 'react'; +import { Attempt } from 'shared/hooks/useAttemptNext'; import { RecoveryCodes, ResetToken } from 'teleport/services/auth'; -import { NewCredentialsProps } from 'teleport/Welcome/NewCredentials/types'; -import { NewCredentials } from 'teleport/Welcome/NewCredentials/NewCredentials'; -import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; +import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; +import { NewCredentials } from 'teleport/Welcome/NewCredentials/NewCredentials'; +import { NewCredentialsProps } from 'teleport/Welcome/NewCredentials/types'; const attempt: Attempt = { status: '' }; const failedAttempt: Attempt = { status: 'failed' }; diff --git a/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.tsx b/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.tsx index dcc4337aab5ea..fcc0d7cc2fbe1 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.tsx +++ b/web/packages/teleport/src/Welcome/NewCredentials/NewCredentials.tsx @@ -17,22 +17,19 @@ */ import React, { useState } from 'react'; -import { NewFlow, StepSlider } from 'design/StepSlider'; - -import { OnboardCard } from 'design/Onboard/OnboardCard'; import { Box } from 'design'; +import { OnboardCard } from 'design/Onboard/OnboardCard'; +import { NewFlow, StepSlider } from 'design/StepSlider'; import OSSRecoveryCodes from 'teleport/components/RecoveryCodes'; import cfg from 'teleport/config'; - import { loginFlows } from 'teleport/Welcome/NewCredentials/constants'; import useToken from '../useToken'; - import { Expired } from './Expired'; -import { LoginFlow, NewCredentialsProps } from './types'; import { RegisterSuccess } from './Success'; +import { LoginFlow, NewCredentialsProps } from './types'; /** * diff --git a/web/packages/teleport/src/Welcome/NewCredentials/NewPassword.tsx b/web/packages/teleport/src/Welcome/NewCredentials/NewPassword.tsx index ea1990c3d2a73..d7e3f7f5e7309 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/NewPassword.tsx +++ b/web/packages/teleport/src/Welcome/NewCredentials/NewPassword.tsx @@ -17,8 +17,10 @@ */ import React, { useState } from 'react'; + import { Box, ButtonPrimary, ButtonText, Text } from 'design'; import { Danger } from 'design/Alert'; +import { OnboardCard } from 'design/Onboard/OnboardCard'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { @@ -27,8 +29,6 @@ import { } from 'shared/components/Validation/rules'; import { useRefAutoFocus } from 'shared/hooks'; -import { OnboardCard } from 'design/Onboard/OnboardCard'; - import { SliderProps, UseTokenState } from './types'; export function NewPassword(props: Props) { diff --git a/web/packages/teleport/src/Welcome/NewCredentials/NewPasswordlessDevice.tsx b/web/packages/teleport/src/Welcome/NewCredentials/NewPasswordlessDevice.tsx index 3b6b30db51248..f80e70e68aed4 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/NewPasswordlessDevice.tsx +++ b/web/packages/teleport/src/Welcome/NewCredentials/NewPasswordlessDevice.tsx @@ -17,15 +17,15 @@ */ import React, { useState } from 'react'; -import { Text, Box, ButtonPrimary, ButtonText } from 'design'; + +import { Box, ButtonPrimary, ButtonText, Text } from 'design'; import { Danger } from 'design/Alert'; +import { OnboardCard } from 'design/Onboard/OnboardCard'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; import { useRefAutoFocus } from 'shared/hooks'; -import { OnboardCard } from 'design/Onboard/OnboardCard'; - import { PasskeyBlurb } from 'teleport/components/Passkeys/PasskeyBlurb'; import { SliderProps, UseTokenState } from './types'; diff --git a/web/packages/teleport/src/Welcome/NewCredentials/Success.tsx b/web/packages/teleport/src/Welcome/NewCredentials/Success.tsx index 03e3ec7832c5c..84b465449cf12 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/Success.tsx +++ b/web/packages/teleport/src/Welcome/NewCredentials/Success.tsx @@ -17,12 +17,12 @@ */ import React from 'react'; -import { ButtonPrimary, Flex, Image, Text } from 'design'; +import { ButtonPrimary, Flex, Image, Text } from 'design'; import { OnboardCard } from 'design/Onboard/OnboardCard'; -import { CaptureEvent, userEventService } from 'teleport/services/userEvent'; import shieldCheck from 'teleport/assets/shield-check.png'; +import { CaptureEvent, userEventService } from 'teleport/services/userEvent'; import { RegisterSuccessProps } from './types'; diff --git a/web/packages/teleport/src/Welcome/NewCredentials/constants.ts b/web/packages/teleport/src/Welcome/NewCredentials/constants.ts index 24d099b174de1..009a8ca893fbb 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/constants.ts +++ b/web/packages/teleport/src/Welcome/NewCredentials/constants.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { NewPassword } from 'teleport/Welcome/NewCredentials/NewPassword'; import { NewMfaDevice } from 'teleport/Welcome/NewCredentials/NewMfaDevice'; +import { NewPassword } from 'teleport/Welcome/NewCredentials/NewPassword'; import { NewPasswordlessDevice } from 'teleport/Welcome/NewCredentials/NewPasswordlessDevice'; export const loginFlows = { diff --git a/web/packages/teleport/src/Welcome/NewCredentials/types.ts b/web/packages/teleport/src/Welcome/NewCredentials/types.ts index 410480c318183..0411ee04acb71 100644 --- a/web/packages/teleport/src/Welcome/NewCredentials/types.ts +++ b/web/packages/teleport/src/Welcome/NewCredentials/types.ts @@ -16,16 +16,14 @@ * along with this program. If not, see . */ -import { Attempt } from 'shared/hooks/useAttemptNext'; - -import { Auth2faType, PrimaryAuthType } from 'shared/services'; +import { ReactElement } from 'react'; import { NewFlow, StepComponentProps } from 'design/StepSlider'; +import { Attempt } from 'shared/hooks/useAttemptNext'; +import { Auth2faType, PrimaryAuthType } from 'shared/services'; -import { ReactElement } from 'react'; - -import { DeviceUsage, RecoveryCodes, ResetToken } from 'teleport/services/auth'; import { RecoveryCodesProps } from 'teleport/components/RecoveryCodes'; +import { DeviceUsage, RecoveryCodes, ResetToken } from 'teleport/services/auth'; export type UseTokenState = { auth2faType: Auth2faType; diff --git a/web/packages/teleport/src/Welcome/Welcome.story.tsx b/web/packages/teleport/src/Welcome/Welcome.story.tsx index b565fef0f0d23..6a9b0f9eda058 100644 --- a/web/packages/teleport/src/Welcome/Welcome.story.tsx +++ b/web/packages/teleport/src/Welcome/Welcome.story.tsx @@ -23,8 +23,8 @@ import { WelcomeWrapper } from 'design/Onboard/WelcomeWrapper'; import { NewCredentials } from 'teleport/Welcome/NewCredentials'; -import { Welcome } from './Welcome'; import { CardWelcome } from './CardWelcome'; +import { Welcome } from './Welcome'; export default { title: 'Teleport/Welcome' }; diff --git a/web/packages/teleport/src/Welcome/Welcome.test.tsx b/web/packages/teleport/src/Welcome/Welcome.test.tsx index cae693c2d3479..ac75b0ce98511 100644 --- a/web/packages/teleport/src/Welcome/Welcome.test.tsx +++ b/web/packages/teleport/src/Welcome/Welcome.test.tsx @@ -16,20 +16,18 @@ * along with this program. If not, see . */ -import { MemoryRouter, Route, Router } from 'react-router'; +import { act } from '@testing-library/react'; +import { userEvent, UserEvent } from '@testing-library/user-event'; import { createMemoryHistory } from 'history'; +import { MemoryRouter, Route, Router } from 'react-router'; + import { fireEvent, render, screen, waitFor } from 'design/utils/testing'; import { Logger } from 'shared/libs/logger'; -import { act } from '@testing-library/react'; -import { userEvent, UserEvent } from '@testing-library/user-event'; - import cfg from 'teleport/config'; -import history from 'teleport/services/history'; import auth from 'teleport/services/auth'; - +import history from 'teleport/services/history'; import { userEventService } from 'teleport/services/userEvent'; - import { NewCredentials } from 'teleport/Welcome/NewCredentials'; import { Welcome } from './Welcome'; diff --git a/web/packages/teleport/src/Welcome/Welcome.tsx b/web/packages/teleport/src/Welcome/Welcome.tsx index 27415c73c225a..a84d9ce724b64 100644 --- a/web/packages/teleport/src/Welcome/Welcome.tsx +++ b/web/packages/teleport/src/Welcome/Welcome.tsx @@ -23,15 +23,15 @@ import { WelcomeWrapper } from 'design/Onboard/WelcomeWrapper'; import { Route, Switch, - useParams, useLocation, + useParams, } from 'teleport/components/Router'; -import history from 'teleport/services/history'; import cfg from 'teleport/config'; +import history from 'teleport/services/history'; import { NewCredentialsContainerProps } from 'teleport/Welcome/NewCredentials'; -import { CLOUD_INVITE_URL_PARAM } from './const'; import { CardWelcome } from './CardWelcome'; +import { CLOUD_INVITE_URL_PARAM } from './const'; type WelcomeProps = { NewCredentials: (props: NewCredentialsContainerProps) => JSX.Element; diff --git a/web/packages/teleport/src/Welcome/useToken.ts b/web/packages/teleport/src/Welcome/useToken.ts index cacf87ef2596d..bf2bf13db5524 100644 --- a/web/packages/teleport/src/Welcome/useToken.ts +++ b/web/packages/teleport/src/Welcome/useToken.ts @@ -17,10 +17,10 @@ */ import { useEffect, useState } from 'react'; + import useAttempt from 'shared/hooks/useAttemptNext'; import cfg from 'teleport/config'; -import history from 'teleport/services/history'; import auth, { ChangedUserAuthn, DeviceUsage, @@ -29,6 +29,7 @@ import auth, { ResetPasswordWithWebauthnReqWithEvent, ResetToken, } from 'teleport/services/auth'; +import history from 'teleport/services/history'; import { UseTokenState } from 'teleport/Welcome/NewCredentials/types'; export default function useToken(tokenId: string): UseTokenState { diff --git a/web/packages/teleport/src/boot.tsx b/web/packages/teleport/src/boot.tsx index 8192e2a2d9965..aed96111f2479 100644 --- a/web/packages/teleport/src/boot.tsx +++ b/web/packages/teleport/src/boot.tsx @@ -17,16 +17,15 @@ */ import React from 'react'; - import { createRoot } from 'react-dom/client'; import history from 'teleport/services/history'; import 'teleport/lib/polyfillRandomUuid'; +import cfg from './config'; import Teleport from './Teleport'; import TeleportContext from './teleportContext'; -import cfg from './config'; // apply configuration received from the server cfg.init(window['GRV_CONFIG']); diff --git a/web/packages/teleport/src/components/AgentButtonAdd/AgentButtonAdd.story.test.tsx b/web/packages/teleport/src/components/AgentButtonAdd/AgentButtonAdd.story.test.tsx index 5ab2baad2f679..06bf3a87bbd21 100644 --- a/web/packages/teleport/src/components/AgentButtonAdd/AgentButtonAdd.story.test.tsx +++ b/web/packages/teleport/src/components/AgentButtonAdd/AgentButtonAdd.story.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; import { diff --git a/web/packages/teleport/src/components/AgentErrorMessage/AgentErrorMessage.tsx b/web/packages/teleport/src/components/AgentErrorMessage/AgentErrorMessage.tsx index 66fadddf24cd6..78f06c62f0305 100644 --- a/web/packages/teleport/src/components/AgentErrorMessage/AgentErrorMessage.tsx +++ b/web/packages/teleport/src/components/AgentErrorMessage/AgentErrorMessage.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Link } from 'design'; import { Danger } from 'design/Alert'; diff --git a/web/packages/teleport/src/components/AjaxPoller/index.js b/web/packages/teleport/src/components/AjaxPoller/index.js index 9b03e88a3ee79..a3ecb1c428c9e 100644 --- a/web/packages/teleport/src/components/AjaxPoller/index.js +++ b/web/packages/teleport/src/components/AjaxPoller/index.js @@ -17,4 +17,5 @@ */ import AjaxPoller from './AjaxPoller'; + export default AjaxPoller; diff --git a/web/packages/teleport/src/components/Authenticated/Authenticated.test.tsx b/web/packages/teleport/src/components/Authenticated/Authenticated.test.tsx index cd7da84c6cf6d..649b9a8ec01f1 100644 --- a/web/packages/teleport/src/components/Authenticated/Authenticated.test.tsx +++ b/web/packages/teleport/src/components/Authenticated/Authenticated.test.tsx @@ -20,10 +20,10 @@ import React from 'react'; import { render, screen, waitFor } from 'design/utils/testing'; -import session from 'teleport/services/websession'; -import { ApiError } from 'teleport/services/api/parseError'; import api from 'teleport/services/api'; +import { ApiError } from 'teleport/services/api/parseError'; import history from 'teleport/services/history'; +import session from 'teleport/services/websession'; import Authenticated from './Authenticated'; diff --git a/web/packages/teleport/src/components/Authenticated/Authenticated.tsx b/web/packages/teleport/src/components/Authenticated/Authenticated.tsx index 532111b2cb087..affc9051efe01 100644 --- a/web/packages/teleport/src/components/Authenticated/Authenticated.tsx +++ b/web/packages/teleport/src/components/Authenticated/Authenticated.tsx @@ -17,17 +17,18 @@ */ import React, { PropsWithChildren, useEffect } from 'react'; -import { throttle } from 'shared/utils/highbar'; -import Logger from 'shared/libs/logger'; -import useAttempt from 'shared/hooks/useAttemptNext'; -import { getErrMessage } from 'shared/utils/errorType'; + import { Box, Indicator } from 'design'; import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; +import useAttempt from 'shared/hooks/useAttemptNext'; +import Logger from 'shared/libs/logger'; +import { getErrMessage } from 'shared/utils/errorType'; +import { throttle } from 'shared/utils/highbar'; -import session from 'teleport/services/websession'; -import { storageService } from 'teleport/services/storageService'; -import { ApiError } from 'teleport/services/api/parseError'; import { StyledIndicator } from 'teleport/Main'; +import { ApiError } from 'teleport/services/api/parseError'; +import { storageService } from 'teleport/services/storageService'; +import session from 'teleport/services/websession'; import { ErrorDialog } from './ErrorDialogue'; diff --git a/web/packages/teleport/src/components/Authenticated/ErrorDialogue.tsx b/web/packages/teleport/src/components/Authenticated/ErrorDialogue.tsx index 4119abee0d7be..b3a4fc222213b 100644 --- a/web/packages/teleport/src/components/Authenticated/ErrorDialogue.tsx +++ b/web/packages/teleport/src/components/Authenticated/ErrorDialogue.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { Text, Alert, ButtonSecondary } from 'design'; + +import { Alert, ButtonSecondary, Text } from 'design'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; import history from 'teleport/services/history'; diff --git a/web/packages/teleport/src/components/Authenticated/index.ts b/web/packages/teleport/src/components/Authenticated/index.ts index a6cce6f7f9837..fe17ca64f81f3 100644 --- a/web/packages/teleport/src/components/Authenticated/index.ts +++ b/web/packages/teleport/src/components/Authenticated/index.ts @@ -17,4 +17,5 @@ */ import Authenticated from './Authenticated'; + export default Authenticated; diff --git a/web/packages/teleport/src/components/AuthnDialog/AuthnDialog.tsx b/web/packages/teleport/src/components/AuthnDialog/AuthnDialog.tsx index a8b5cd532a1bf..2eca25ca16450 100644 --- a/web/packages/teleport/src/components/AuthnDialog/AuthnDialog.tsx +++ b/web/packages/teleport/src/components/AuthnDialog/AuthnDialog.tsx @@ -17,14 +17,15 @@ */ import React from 'react'; + +import { ButtonPrimary, ButtonSecondary, Text } from 'design'; +import { Danger } from 'design/Alert'; import Dialog, { + DialogContent, DialogFooter, DialogHeader, DialogTitle, - DialogContent, } from 'design/Dialog'; -import { Danger } from 'design/Alert'; -import { Text, ButtonPrimary, ButtonSecondary } from 'design'; export default function AuthnDialog({ onContinue, diff --git a/web/packages/teleport/src/components/AuthnDialog/index.ts b/web/packages/teleport/src/components/AuthnDialog/index.ts index 991acdad6b2b9..063dce1ebdfd3 100644 --- a/web/packages/teleport/src/components/AuthnDialog/index.ts +++ b/web/packages/teleport/src/components/AuthnDialog/index.ts @@ -17,4 +17,5 @@ */ import AuthnDialog from './AuthnDialog'; + export default AuthnDialog; diff --git a/web/packages/teleport/src/components/BannerList/Banner.test.tsx b/web/packages/teleport/src/components/BannerList/Banner.test.tsx index 9e735ca30ac14..87ef58d11cff4 100644 --- a/web/packages/teleport/src/components/BannerList/Banner.test.tsx +++ b/web/packages/teleport/src/components/BannerList/Banner.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { fireEvent, render, screen } from 'design/utils/testing'; import { Banner } from './Banner'; diff --git a/web/packages/teleport/src/components/BannerList/Banner.tsx b/web/packages/teleport/src/components/BannerList/Banner.tsx index 3ebc8f9e53d6a..6b7e3d23c7ffa 100644 --- a/web/packages/teleport/src/components/BannerList/Banner.tsx +++ b/web/packages/teleport/src/components/BannerList/Banner.tsx @@ -22,8 +22,8 @@ import styled from 'styled-components'; import { Box, Flex, Link, Text } from 'design'; import { Cross, Info, Warning } from 'design/Icon'; -import { CaptureEvent } from 'teleport/services/userEvent/types'; import { userEventService } from 'teleport/services/userEvent'; +import { CaptureEvent } from 'teleport/services/userEvent/types'; export type Severity = 'info' | 'warning' | 'danger'; diff --git a/web/packages/teleport/src/components/BannerList/BannerList.test.tsx b/web/packages/teleport/src/components/BannerList/BannerList.test.tsx index a8fb75460cf99..324978a8a6160 100644 --- a/web/packages/teleport/src/components/BannerList/BannerList.test.tsx +++ b/web/packages/teleport/src/components/BannerList/BannerList.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { fireEvent, screen, @@ -25,9 +26,7 @@ import { import { LayoutContextProvider } from 'teleport/Main/LayoutContext'; -import { BannerList } from './BannerList'; - -import type { BannerType } from './BannerList'; +import { BannerList, type BannerType } from './BannerList'; function render(banner: React.ReactNode) { return testingRender({banner}); diff --git a/web/packages/teleport/src/components/BannerList/BannerList.tsx b/web/packages/teleport/src/components/BannerList/BannerList.tsx index 075b52192a3d9..f6886fff26572 100644 --- a/web/packages/teleport/src/components/BannerList/BannerList.tsx +++ b/web/packages/teleport/src/components/BannerList/BannerList.tsx @@ -16,14 +16,11 @@ * along with this program. If not, see . */ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState, type ReactNode } from 'react'; import { Box } from 'design'; -import { Banner } from './Banner'; - -import type { Severity } from './Banner'; -import type { ReactNode } from 'react'; +import { Banner, type Severity } from './Banner'; export const BannerList = ({ banners = [], diff --git a/web/packages/teleport/src/components/BannerList/useAlerts.test.tsx b/web/packages/teleport/src/components/BannerList/useAlerts.test.tsx index 3fd919f60ee6f..cd68dc5dea626 100644 --- a/web/packages/teleport/src/components/BannerList/useAlerts.test.tsx +++ b/web/packages/teleport/src/components/BannerList/useAlerts.test.tsx @@ -19,7 +19,6 @@ import { renderHook, waitFor } from '@testing-library/react'; import cfg from 'teleport/config'; - // Imports to be mocked import { fetchClusterAlerts } from 'teleport/services/alerts'; // eslint-disable-line import useStickyClusterId from 'teleport/useStickyClusterId'; // eslint-disable-line diff --git a/web/packages/teleport/src/components/BannerList/useAlerts.tsx b/web/packages/teleport/src/components/BannerList/useAlerts.tsx index 1ea11253e36d1..e9f0397c66bc4 100644 --- a/web/packages/teleport/src/components/BannerList/useAlerts.tsx +++ b/web/packages/teleport/src/components/BannerList/useAlerts.tsx @@ -16,15 +16,17 @@ * along with this program. If not, see . */ -import { useState, useEffect } from 'react'; -import Logger from 'shared/libs/logger'; +import { useEffect, useState } from 'react'; -import { alertNames, fetchClusterAlerts } from 'teleport/services/alerts'; -import useStickyClusterId from 'teleport/useStickyClusterId'; +import Logger from 'shared/libs/logger'; import cfg from 'teleport/config'; - -import type { ClusterAlert } from 'teleport/services/alerts'; +import { + alertNames, + fetchClusterAlerts, + type ClusterAlert, +} from 'teleport/services/alerts'; +import useStickyClusterId from 'teleport/useStickyClusterId'; const logger = Logger.create('ClusterAlerts'); diff --git a/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.test.tsx b/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.test.tsx index e1aae4aaca04b..8578adc6fd2c0 100644 --- a/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.test.tsx +++ b/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.test.tsx @@ -17,14 +17,13 @@ */ import React from 'react'; + import { render, screen, userEvent } from 'design/utils/testing'; import cfg from 'teleport/config'; - -import TeleportContextProvider from 'teleport/TeleportContextProvider'; import { createTeleportContext } from 'teleport/mocks/contexts'; - import { CtaEvent, userEventService } from 'teleport/services/userEvent'; +import TeleportContextProvider from 'teleport/TeleportContextProvider'; import { ButtonLockedFeature } from './ButtonLockedFeature'; diff --git a/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.tsx b/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.tsx index 54137445f009e..d92d8d3374efc 100644 --- a/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.tsx +++ b/web/packages/teleport/src/components/ButtonLockedFeature/ButtonLockedFeature.tsx @@ -18,13 +18,13 @@ import React from 'react'; import styled from 'styled-components'; + import { ButtonPrimary, Link } from 'design'; -import { Unlock } from 'design/Icon'; import Flex from 'design/Flex'; +import { Unlock } from 'design/Icon'; import cfg from 'teleport/config'; import { getSalesURL } from 'teleport/services/sales'; - import { CtaEvent, userEventService } from 'teleport/services/userEvent'; import useTeleport from 'teleport/useTeleport'; diff --git a/web/packages/teleport/src/components/CardEmpty/CardEmpty.jsx b/web/packages/teleport/src/components/CardEmpty/CardEmpty.jsx index 357a77e69ec45..29c71f98c60d3 100644 --- a/web/packages/teleport/src/components/CardEmpty/CardEmpty.jsx +++ b/web/packages/teleport/src/components/CardEmpty/CardEmpty.jsx @@ -17,7 +17,8 @@ */ import React from 'react'; -import { Text, Box } from 'design'; + +import { Box, Text } from 'design'; export default function CardEmpty(props) { const { title, children, ...styles } = props; diff --git a/web/packages/teleport/src/components/CardEmpty/index.js b/web/packages/teleport/src/components/CardEmpty/index.js index a4a99e3b35a56..022491472de54 100644 --- a/web/packages/teleport/src/components/CardEmpty/index.js +++ b/web/packages/teleport/src/components/CardEmpty/index.js @@ -17,4 +17,5 @@ */ import CardEmpty from './CardEmpty'; + export default CardEmpty; diff --git a/web/packages/teleport/src/components/CatchError/CatchError.tsx b/web/packages/teleport/src/components/CatchError/CatchError.tsx index e6c748f6b2b82..7e392bad92189 100644 --- a/web/packages/teleport/src/components/CatchError/CatchError.tsx +++ b/web/packages/teleport/src/components/CatchError/CatchError.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Failed } from 'design/CardError'; import Logger from 'shared/libs/logger'; diff --git a/web/packages/teleport/src/components/ClientSearcheableTableWithQueryParamSupport/ClientSearcheableTableWithQueryParamSupport.tsx b/web/packages/teleport/src/components/ClientSearcheableTableWithQueryParamSupport/ClientSearcheableTableWithQueryParamSupport.tsx index c71b6c56464a8..a48526048cbe7 100644 --- a/web/packages/teleport/src/components/ClientSearcheableTableWithQueryParamSupport/ClientSearcheableTableWithQueryParamSupport.tsx +++ b/web/packages/teleport/src/components/ClientSearcheableTableWithQueryParamSupport/ClientSearcheableTableWithQueryParamSupport.tsx @@ -18,8 +18,8 @@ import { useHistory, useLocation } from 'react-router'; -import { TableProps } from 'design/DataTable/types'; import Table from 'design/DataTable'; +import { TableProps } from 'design/DataTable/types'; import { decodeUrlQueryParam, diff --git a/web/packages/teleport/src/components/DayPicker/Shared.tsx b/web/packages/teleport/src/components/DayPicker/Shared.tsx index 398d74f2ade92..ad13739fc7b78 100644 --- a/web/packages/teleport/src/components/DayPicker/Shared.tsx +++ b/web/packages/teleport/src/components/DayPicker/Shared.tsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Flex } from 'design'; export const StyledDateRange = styled(Flex)` diff --git a/web/packages/teleport/src/components/DownloadLinks/DownloadLinks.tsx b/web/packages/teleport/src/components/DownloadLinks/DownloadLinks.tsx index f978966eaef0d..badfe2b50750b 100644 --- a/web/packages/teleport/src/components/DownloadLinks/DownloadLinks.tsx +++ b/web/packages/teleport/src/components/DownloadLinks/DownloadLinks.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Box, Link } from 'design'; import getDownloadLink from 'teleport/services/links'; diff --git a/web/packages/teleport/src/components/DownloadLinks/index.ts b/web/packages/teleport/src/components/DownloadLinks/index.ts index 38763f36faadf..395ae933723ac 100644 --- a/web/packages/teleport/src/components/DownloadLinks/index.ts +++ b/web/packages/teleport/src/components/DownloadLinks/index.ts @@ -17,4 +17,5 @@ */ import DownloadLinks from './DownloadLinks'; + export default DownloadLinks; diff --git a/web/packages/teleport/src/components/Empty/Empty.test.tsx b/web/packages/teleport/src/components/Empty/Empty.test.tsx index 3e21afe2c03d1..b9d06d2b84060 100644 --- a/web/packages/teleport/src/components/Empty/Empty.test.tsx +++ b/web/packages/teleport/src/components/Empty/Empty.test.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { render, screen } from 'design/utils/testing'; import { MemoryRouter } from 'react-router'; +import { render, screen } from 'design/utils/testing'; + import Empty, { Props } from './Empty'; test('empty state for enterprise or oss, with create perms', async () => { diff --git a/web/packages/teleport/src/components/Empty/Empty.tsx b/web/packages/teleport/src/components/Empty/Empty.tsx index 2503ddf296b29..27fef0d8f8c78 100644 --- a/web/packages/teleport/src/components/Empty/Empty.tsx +++ b/web/packages/teleport/src/components/Empty/Empty.tsx @@ -20,12 +20,12 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { - Text, Box, - Flex, - ButtonPrimary, ButtonBorder, + ButtonPrimary, + Flex, ResourceIcon, + Text, } from 'design'; import cfg from 'teleport/config'; diff --git a/web/packages/teleport/src/components/EventRangePicker/Custom/Custom.tsx b/web/packages/teleport/src/components/EventRangePicker/Custom/Custom.tsx index 9b7e26383805f..d37970587c8c8 100644 --- a/web/packages/teleport/src/components/EventRangePicker/Custom/Custom.tsx +++ b/web/packages/teleport/src/components/EventRangePicker/Custom/Custom.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -import React, { useState, forwardRef } from 'react'; -import { isAfter, endOfDay, startOfDay, isSameDay } from 'date-fns'; -import { DayPicker, addToRange, DateRange } from 'react-day-picker'; +import { endOfDay, isAfter, isSameDay, startOfDay } from 'date-fns'; +import React, { forwardRef, useState } from 'react'; +import { addToRange, DateRange, DayPicker } from 'react-day-picker'; + import 'react-day-picker/dist/style.css'; import { StyledDateRange } from 'teleport/components/DayPicker/Shared'; diff --git a/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.story.tsx b/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.story.tsx index 32491f2c1daf7..34fbf05fa6a45 100644 --- a/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.story.tsx +++ b/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.story.tsx @@ -18,9 +18,8 @@ import React, { useState } from 'react'; -import RangePicker from './EventRangePicker'; - import { EventRange, getRangeOptions } from '.'; +import RangePicker from './EventRangePicker'; export default { title: 'Teleport/RangePicker', diff --git a/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.tsx b/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.tsx index 1351ebeade56e..86f189e42907b 100644 --- a/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.tsx +++ b/web/packages/teleport/src/components/EventRangePicker/EventRangePicker.tsx @@ -18,13 +18,14 @@ import React, { useState } from 'react'; import { components } from 'react-select'; + import 'react-day-picker/dist/style.css'; -import { Text, Box } from 'design'; -import Dialog from 'design/DialogConfirmation'; -import { displayDate } from 'shared/services/loc'; -import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; +import { Box, Text } from 'design'; +import Dialog from 'design/DialogConfirmation'; import Select, { Option } from 'shared/components/Select'; +import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; +import { displayDate } from 'shared/services/loc'; import { State } from 'teleport/Audit/useAuditEvents'; diff --git a/web/packages/teleport/src/components/EventRangePicker/utils.ts b/web/packages/teleport/src/components/EventRangePicker/utils.ts index 49a194ca977be..1b4c8d200db15 100644 --- a/web/packages/teleport/src/components/EventRangePicker/utils.ts +++ b/web/packages/teleport/src/components/EventRangePicker/utils.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { startOfDay, endOfDay, subDays } from 'date-fns'; +import { endOfDay, startOfDay, subDays } from 'date-fns'; export function getRangeOptions(): EventRange[] { return [ diff --git a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx index 2a6055ce46aa3..9360d809b021f 100644 --- a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx +++ b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx @@ -18,14 +18,13 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; -import { render, screen } from 'design/utils/testing'; -import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; +import { render, screen } from 'design/utils/testing'; -import { ContextProvider } from 'teleport/index'; -import cfg from 'teleport/config'; import { clusters } from 'teleport/Clusters/fixtures'; - +import cfg from 'teleport/config'; +import { ContextProvider } from 'teleport/index'; +import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; import { storageService } from 'teleport/services/storageService'; import { ExternalAuditStorageCta } from './ExternalAuditStorageCta'; diff --git a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx index c8bd62b70cb80..a3c13df9c10c8 100644 --- a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx +++ b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx @@ -16,24 +16,22 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; + import Box from 'design/Box'; -import * as Icons from 'design/Icon'; import { ButtonPrimary, ButtonSecondary } from 'design/Button'; import Flex from 'design/Flex'; +import * as Icons from 'design/Icon'; import Text from 'design/Text'; - import { HoverTooltip } from 'shared/components/ToolTip'; import cfg from 'teleport/config'; import { IntegrationKind } from 'teleport/services/integrations'; -import useTeleport from 'teleport/useTeleport'; - -import { CtaEvent } from 'teleport/services/userEvent'; - import { storageService } from 'teleport/services/storageService'; +import { CtaEvent } from 'teleport/services/userEvent'; +import useTeleport from 'teleport/useTeleport'; import { ButtonLockedFeature } from '../ButtonLockedFeature'; diff --git a/web/packages/teleport/src/components/FormLogin/FormLogin.test.tsx b/web/packages/teleport/src/components/FormLogin/FormLogin.test.tsx index 1e7810e1c0af8..cd584ae01029d 100644 --- a/web/packages/teleport/src/components/FormLogin/FormLogin.test.tsx +++ b/web/packages/teleport/src/components/FormLogin/FormLogin.test.tsx @@ -18,7 +18,7 @@ import React from 'react'; -import { render, fireEvent, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import history from 'teleport/services/history'; diff --git a/web/packages/teleport/src/components/FormLogin/FormLogin.tsx b/web/packages/teleport/src/components/FormLogin/FormLogin.tsx index 976892c3ee67c..60348f8c01240 100644 --- a/web/packages/teleport/src/components/FormLogin/FormLogin.tsx +++ b/web/packages/teleport/src/components/FormLogin/FormLogin.tsx @@ -16,42 +16,42 @@ * along with this program. If not, see . */ -import React, { useState, useMemo } from 'react'; +import React, { useMemo, useState } from 'react'; import styled from 'styled-components'; + import { - Card, - Text, - Flex, + Box, + Button, ButtonLink, ButtonPrimary, - Box, - ButtonText, ButtonSecondary, - Button, + ButtonText, + Card, + Flex, + Text, } from 'design'; import * as Alerts from 'design/Alert'; -import { - AuthProvider, - Auth2faType, - PreferredMfaType, - PrimaryAuthType, -} from 'shared/services'; -import { useAttempt, useRefAutoFocus } from 'shared/hooks'; -import Validation, { Validator } from 'shared/components/Validation'; +import { StepComponentProps, StepSlider } from 'design/StepSlider'; import FieldInput from 'shared/components/FieldInput'; import FieldSelect from 'shared/components/FieldSelect'; +import Validation, { Validator } from 'shared/components/Validation'; import { - requiredToken, requiredField, + requiredToken, } from 'shared/components/Validation/rules'; +import { useAttempt, useRefAutoFocus } from 'shared/hooks'; +import { + Auth2faType, + AuthProvider, + PreferredMfaType, + PrimaryAuthType, +} from 'shared/services'; import createMfaOptions, { MfaOption } from 'shared/utils/createMfaOptions'; -import { StepSlider, StepComponentProps } from 'design/StepSlider'; import { UserCredentials } from 'teleport/services/auth'; import history from 'teleport/services/history'; import { PasskeyIcons } from '../Passkeys'; - import SSOButtonList from './SsoButtons'; const allAuthTypes: PrimaryAuthType[] = ['passwordless', 'sso', 'local']; diff --git a/web/packages/teleport/src/components/FormLogin/SsoButtons.tsx b/web/packages/teleport/src/components/FormLogin/SsoButtons.tsx index 252bc1fd98490..5267e5ff6fa06 100644 --- a/web/packages/teleport/src/components/FormLogin/SsoButtons.tsx +++ b/web/packages/teleport/src/components/FormLogin/SsoButtons.tsx @@ -17,6 +17,7 @@ */ import React, { forwardRef } from 'react'; + import { Flex, Text } from 'design'; import ButtonSso, { guessProviderType } from 'shared/components/ButtonSso'; import { AuthProvider } from 'shared/services'; diff --git a/web/packages/teleport/src/components/FormLogin/index.ts b/web/packages/teleport/src/components/FormLogin/index.ts index 447367bd552b9..0466b1cc850fd 100644 --- a/web/packages/teleport/src/components/FormLogin/index.ts +++ b/web/packages/teleport/src/components/FormLogin/index.ts @@ -17,4 +17,5 @@ */ import FormLogin from './FormLogin'; + export default FormLogin; diff --git a/web/packages/teleport/src/components/HeadlessRequestDialog/HeadlessRequestDialog.tsx b/web/packages/teleport/src/components/HeadlessRequestDialog/HeadlessRequestDialog.tsx index bc7654c8afb1e..3f2c60fe89601 100644 --- a/web/packages/teleport/src/components/HeadlessRequestDialog/HeadlessRequestDialog.tsx +++ b/web/packages/teleport/src/components/HeadlessRequestDialog/HeadlessRequestDialog.tsx @@ -17,14 +17,15 @@ */ import React from 'react'; + +import { ButtonPrimary, ButtonSecondary, Text } from 'design'; +import { Danger } from 'design/Alert'; import Dialog, { DialogContent, DialogFooter, DialogHeader, DialogTitle, } from 'design/Dialog'; -import { Danger } from 'design/Alert'; -import { ButtonPrimary, ButtonSecondary, Text } from 'design'; export default function HeadlessRequestDialog({ ipAddress, diff --git a/web/packages/teleport/src/components/InputSearch/InputSearch.jsx b/web/packages/teleport/src/components/InputSearch/InputSearch.jsx index 295d899e10ddc..ec0c16e44dbfc 100644 --- a/web/packages/teleport/src/components/InputSearch/InputSearch.jsx +++ b/web/packages/teleport/src/components/InputSearch/InputSearch.jsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { debounce } from 'shared/utils/highbar'; import styled from 'styled-components'; -import { height, space, color } from 'design/system'; + +import { color, height, space } from 'design/system'; +import { debounce } from 'shared/utils/highbar'; class InputSearch extends React.Component { constructor(props) { diff --git a/web/packages/teleport/src/components/InputSearch/index.js b/web/packages/teleport/src/components/InputSearch/index.js index 521558aa44671..cb450973c47f7 100644 --- a/web/packages/teleport/src/components/InputSearch/index.js +++ b/web/packages/teleport/src/components/InputSearch/index.js @@ -17,4 +17,5 @@ */ import InputSearch from './InputSearch'; + export default InputSearch; diff --git a/web/packages/teleport/src/components/LabelSelector/LabelSelector.test.tsx b/web/packages/teleport/src/components/LabelSelector/LabelSelector.test.tsx index 572b451884e7c..7b6f0c98fccb1 100644 --- a/web/packages/teleport/src/components/LabelSelector/LabelSelector.test.tsx +++ b/web/packages/teleport/src/components/LabelSelector/LabelSelector.test.tsx @@ -18,7 +18,7 @@ import React from 'react'; -import { render, screen, fireEvent } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { LabelSelector } from './LabelSelector'; diff --git a/web/packages/teleport/src/components/LabelSelector/LabelSelector.tsx b/web/packages/teleport/src/components/LabelSelector/LabelSelector.tsx index af3299f8efa75..1af85981d5255 100644 --- a/web/packages/teleport/src/components/LabelSelector/LabelSelector.tsx +++ b/web/packages/teleport/src/components/LabelSelector/LabelSelector.tsx @@ -19,9 +19,8 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; -import { Box, Flex, Pill, Popover, Link, Text } from 'design'; +import { Box, Flex, Link, Pill, Popover, Text } from 'design'; import { Info, Warning } from 'design/Icon'; - import { useClickOutside } from 'shared/hooks/useClickOutside'; import { useEscape } from 'shared/hooks/useEscape'; diff --git a/web/packages/teleport/src/components/LabelsInput/LabelsInput.story.tsx b/web/packages/teleport/src/components/LabelsInput/LabelsInput.story.tsx index c0e5f0af893f7..301c2a199b8e0 100644 --- a/web/packages/teleport/src/components/LabelsInput/LabelsInput.story.tsx +++ b/web/packages/teleport/src/components/LabelsInput/LabelsInput.story.tsx @@ -17,10 +17,11 @@ */ import React, { useState } from 'react'; -import Validation from 'shared/components/Validation'; + import { ButtonSecondary } from 'design/Button'; +import Validation from 'shared/components/Validation'; -import { LabelsInput, Label } from './LabelsInput'; +import { Label, LabelsInput } from './LabelsInput'; export default { title: 'Teleport/LabelsInput', diff --git a/web/packages/teleport/src/components/LabelsInput/LabelsInput.test.tsx b/web/packages/teleport/src/components/LabelsInput/LabelsInput.test.tsx index eaee3b29c7ea6..c2c6bb768ff6a 100644 --- a/web/packages/teleport/src/components/LabelsInput/LabelsInput.test.tsx +++ b/web/packages/teleport/src/components/LabelsInput/LabelsInput.test.tsx @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -import { render, fireEvent, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { - Default, + AtLeastOneRequired, Custom, + Default, Disabled, - AtLeastOneRequired, } from './LabelsInput.story'; test('defaults, with empty labels', async () => { diff --git a/web/packages/teleport/src/components/LabelsInput/LabelsInput.tsx b/web/packages/teleport/src/components/LabelsInput/LabelsInput.tsx index e0b5129d91416..21f19f3684e3b 100644 --- a/web/packages/teleport/src/components/LabelsInput/LabelsInput.tsx +++ b/web/packages/teleport/src/components/LabelsInput/LabelsInput.tsx @@ -17,11 +17,12 @@ */ import styled from 'styled-components'; -import { Flex, Box, ButtonSecondary, ButtonIcon } from 'design'; + +import { Box, ButtonIcon, ButtonSecondary, Flex } from 'design'; +import * as Icons from 'design/Icon'; import FieldInput from 'shared/components/FieldInput'; -import { Validator, useValidation } from 'shared/components/Validation'; +import { useValidation, Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; -import * as Icons from 'design/Icon'; export type Label = { name: string; diff --git a/web/packages/teleport/src/components/Layout/Layout.jsx b/web/packages/teleport/src/components/Layout/Layout.jsx index 8ee24d8d7fa1a..cd8056e75c4c0 100644 --- a/web/packages/teleport/src/components/Layout/Layout.jsx +++ b/web/packages/teleport/src/components/Layout/Layout.jsx @@ -17,6 +17,7 @@ */ import styled from 'styled-components'; + import { Flex, Text } from 'design'; /** diff --git a/web/packages/teleport/src/components/LogoHero/LogoHero.tsx b/web/packages/teleport/src/components/LogoHero/LogoHero.tsx index 711d549fe05e9..8db770e004243 100644 --- a/web/packages/teleport/src/components/LogoHero/LogoHero.tsx +++ b/web/packages/teleport/src/components/LogoHero/LogoHero.tsx @@ -18,13 +18,14 @@ import React from 'react'; import { useTheme } from 'styled-components'; -import Image from 'design/Image'; -import AGPLLogoLight from 'design/assets/images/agpl-light.svg'; + import AGPLLogoDark from 'design/assets/images/agpl-dark.svg'; -import CommunityLogoLight from 'design/assets/images/community-light.svg'; +import AGPLLogoLight from 'design/assets/images/agpl-light.svg'; import CommunityLogoDark from 'design/assets/images/community-dark.svg'; -import EnterpriseLogoLight from 'design/assets/images/enterprise-light.svg'; +import CommunityLogoLight from 'design/assets/images/community-light.svg'; import EnterpriseLogoDark from 'design/assets/images/enterprise-dark.svg'; +import EnterpriseLogoLight from 'design/assets/images/enterprise-light.svg'; +import Image from 'design/Image'; import cfg, { TeleportEdition } from 'teleport/config'; diff --git a/web/packages/teleport/src/components/MfaDeviceList/MfaDeviceList.tsx b/web/packages/teleport/src/components/MfaDeviceList/MfaDeviceList.tsx index 52721a5eb6a55..8b595cec281e1 100644 --- a/web/packages/teleport/src/components/MfaDeviceList/MfaDeviceList.tsx +++ b/web/packages/teleport/src/components/MfaDeviceList/MfaDeviceList.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { ButtonBorder, Text } from 'design'; import Table, { Cell } from 'design/DataTable'; import { dateMatcher } from 'design/utils/match'; diff --git a/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/RemoveDialog.tsx b/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/RemoveDialog.tsx index 035fbf5e07c63..fbac591534a9c 100644 --- a/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/RemoveDialog.tsx +++ b/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/RemoveDialog.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { ButtonSecondary, ButtonWarning, Text } from 'design'; import { Danger } from 'design/Alert'; import Dialog, { DialogContent, DialogFooter } from 'design/DialogConfirmation'; diff --git a/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/index.ts b/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/index.ts index a35a82d9279d9..3009cb11320f1 100644 --- a/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/index.ts +++ b/web/packages/teleport/src/components/MfaDeviceList/RemoveDialog/index.ts @@ -17,4 +17,5 @@ */ import RemoveDialog from './RemoveDialog'; + export default RemoveDialog; diff --git a/web/packages/teleport/src/components/NewMfaDeviceForm/NewMfaDeviceForm.tsx b/web/packages/teleport/src/components/NewMfaDeviceForm/NewMfaDeviceForm.tsx index 5c8a5a9cd5bac..6117afdba63cf 100644 --- a/web/packages/teleport/src/components/NewMfaDeviceForm/NewMfaDeviceForm.tsx +++ b/web/packages/teleport/src/components/NewMfaDeviceForm/NewMfaDeviceForm.tsx @@ -17,21 +17,20 @@ */ import React, { useState } from 'react'; + import { Box, ButtonPrimary, Flex, Image, Text } from 'design'; import { Danger } from 'design/Alert'; import { ArrowBack } from 'design/Icon'; +import { OnboardCard } from 'design/Onboard/OnboardCard'; import { RadioGroup } from 'design/RadioGroup'; +import { StepHeader } from 'design/StepSlider'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; -import createMfaOptions from 'shared/utils/createMfaOptions'; import { useRefAutoFocus } from 'shared/hooks'; -import { Auth2faType } from 'shared/services'; -import { OnboardCard } from 'design/Onboard/OnboardCard'; - import { Attempt } from 'shared/hooks/useAttemptNext'; - -import { StepHeader } from 'design/StepSlider'; +import { Auth2faType } from 'shared/services'; +import createMfaOptions from 'shared/utils/createMfaOptions'; import { PasskeyIcons } from 'teleport/components/Passkeys'; diff --git a/web/packages/teleport/src/components/NodeList/NodeList.tsx b/web/packages/teleport/src/components/NodeList/NodeList.tsx index e8ca7d809d0d2..a64292cf38a59 100644 --- a/web/packages/teleport/src/components/NodeList/NodeList.tsx +++ b/web/packages/teleport/src/components/NodeList/NodeList.tsx @@ -17,15 +17,15 @@ */ import React from 'react'; + import Table, { Cell, ClickableLabelCell } from 'design/DataTable'; import { FetchStatus, SortType } from 'design/DataTable/types'; import { LoginItem, MenuLogin } from 'shared/components/MenuLogin'; -import { Node } from 'teleport/services/nodes'; -import { ResourceLabel, ResourceFilter } from 'teleport/services/agents'; -import { ServersideSearchPanelWithPageIndicator } from 'teleport/components/ServersideSearchPanel'; - import type { PageIndicators } from 'teleport/components/hooks/useServersidePagination'; +import { ServersideSearchPanelWithPageIndicator } from 'teleport/components/ServersideSearchPanel'; +import { ResourceFilter, ResourceLabel } from 'teleport/services/agents'; +import { Node } from 'teleport/services/nodes'; function NodeList(props: Props) { const { diff --git a/web/packages/teleport/src/components/NodeList/index.ts b/web/packages/teleport/src/components/NodeList/index.ts index e333bd3a6608e..0a39e5f744e8e 100644 --- a/web/packages/teleport/src/components/NodeList/index.ts +++ b/web/packages/teleport/src/components/NodeList/index.ts @@ -17,4 +17,5 @@ */ import NodeList from './NodeList'; + export default NodeList; diff --git a/web/packages/teleport/src/components/Passkeys/PasskeyBlurb.tsx b/web/packages/teleport/src/components/Passkeys/PasskeyBlurb.tsx index 73058170e9269..c9eaaef109130 100644 --- a/web/packages/teleport/src/components/Passkeys/PasskeyBlurb.tsx +++ b/web/packages/teleport/src/components/Passkeys/PasskeyBlurb.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -import Box from 'design/Box'; import React from 'react'; +import Box from 'design/Box'; + import { PasskeyIcons } from 'teleport/components/Passkeys'; export function PasskeyBlurb() { diff --git a/web/packages/teleport/src/components/Passkeys/PasskeyIcons.tsx b/web/packages/teleport/src/components/Passkeys/PasskeyIcons.tsx index fd98a28205c98..8d54fdb3fa9c7 100644 --- a/web/packages/teleport/src/components/Passkeys/PasskeyIcons.tsx +++ b/web/packages/teleport/src/components/Passkeys/PasskeyIcons.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import * as Icon from 'design/Icon'; export function PasskeyIcons() { diff --git a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.test.tsx b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.test.tsx index 23180f66b28a1..2e0b3898f64f9 100644 --- a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.test.tsx +++ b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.test.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; + import { render, screen } from 'design/utils/testing'; -import { Loaded, Failed } from './ReAuthenticate.story'; +import { Failed, Loaded } from './ReAuthenticate.story'; test('render re-authentication dialog', () => { render(); diff --git a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx index 088bedae810a2..b49a84be470fb 100644 --- a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx +++ b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import { State } from './useReAuthenticate'; import { ReAuthenticate } from './ReAuthenticate'; +import { State } from './useReAuthenticate'; export default { title: 'Teleport/ReAuthenticate', diff --git a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.tsx b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.tsx index e6d363d94c8cd..5a112cc35b546 100644 --- a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.tsx +++ b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.tsx @@ -17,21 +17,22 @@ */ import React, { useState } from 'react'; -import { Flex, Box, Text, ButtonPrimary, ButtonSecondary } from 'design'; + +import { Box, ButtonPrimary, ButtonSecondary, Flex, Text } from 'design'; +import { Danger } from 'design/Alert'; import Dialog, { - DialogHeader, - DialogTitle, DialogContent, DialogFooter, + DialogHeader, + DialogTitle, } from 'design/Dialog'; -import { Danger } from 'design/Alert'; -import Validation from 'shared/components/Validation'; -import { requiredToken } from 'shared/components/Validation/rules'; import FieldInput from 'shared/components/FieldInput'; import FieldSelect from 'shared/components/FieldSelect'; +import Validation from 'shared/components/Validation'; +import { requiredToken } from 'shared/components/Validation/rules'; import createMfaOptions, { MfaOption } from 'shared/utils/createMfaOptions'; -import useReAuthenticate, { State, Props } from './useReAuthenticate'; +import useReAuthenticate, { Props, State } from './useReAuthenticate'; export default function Container(props: Props) { const state = useReAuthenticate(props); diff --git a/web/packages/teleport/src/components/ReAuthenticate/useReAuthenticate.ts b/web/packages/teleport/src/components/ReAuthenticate/useReAuthenticate.ts index 3e60ee586c2dc..5fc0b5bee114d 100644 --- a/web/packages/teleport/src/components/ReAuthenticate/useReAuthenticate.ts +++ b/web/packages/teleport/src/components/ReAuthenticate/useReAuthenticate.ts @@ -21,7 +21,6 @@ import useAttempt from 'shared/hooks/useAttemptNext'; import cfg from 'teleport/config'; import auth from 'teleport/services/auth'; import { MfaChallengeScope } from 'teleport/services/auth/auth'; - import type { MfaAuthnResponse } from 'teleport/services/mfa'; // useReAuthenticate will have different "submit" behaviors depending on: diff --git a/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.story.test.tsx b/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.story.test.tsx index 9ddcd1b7769c4..ecd3473a476d7 100644 --- a/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.story.test.tsx +++ b/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.story.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render } from 'design/utils/testing'; import { FromInvite, FromReset } from './RecoveryCodes.story'; diff --git a/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.tsx b/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.tsx index 729d684242c09..2933d8ab7401f 100644 --- a/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.tsx +++ b/web/packages/teleport/src/components/RecoveryCodes/RecoveryCodes.tsx @@ -18,6 +18,7 @@ import React, { useRef } from 'react'; import styled from 'styled-components'; + import { Box, ButtonPrimary, Card, Flex, Text } from 'design'; import { copyToClipboard } from 'design/utils/copyToClipboard'; import selectElementContent from 'design/utils/selectElementContent'; diff --git a/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.jsx b/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.jsx index fb5b5822bd37f..95a45372adb2a 100644 --- a/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.jsx +++ b/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.jsx @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -import React from 'react'; import PropTypes from 'prop-types'; -import Dialog, { DialogHeader, DialogTitle } from 'design/Dialog'; +import React from 'react'; + import { Box, ButtonBorder, @@ -28,8 +28,9 @@ import { LabelInput, Text, } from 'design'; -import TextEditor from 'shared/components/TextEditor'; import * as Alerts from 'design/Alert'; +import Dialog, { DialogHeader, DialogTitle } from 'design/Dialog'; +import TextEditor from 'shared/components/TextEditor'; import { useAttempt, useState } from 'shared/hooks'; import { CaptureEvent, userEventService } from 'teleport/services/userEvent'; diff --git a/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.story.js b/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.story.js index 17eb4eb1a5d78..1df4c6d402d09 100644 --- a/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.story.js +++ b/web/packages/teleport/src/components/ResourceEditor/ResourceEditor.story.js @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { storiesOf } from '@storybook/react'; +import React from 'react'; import ResourceEditor from './ResourceEditor'; diff --git a/web/packages/teleport/src/components/Router/Router.jsx b/web/packages/teleport/src/components/Router/Router.jsx index f124f79ae26fc..3ff7702a62f8e 100644 --- a/web/packages/teleport/src/components/Router/Router.jsx +++ b/web/packages/teleport/src/components/Router/Router.jsx @@ -18,13 +18,14 @@ import React from 'react'; import { - useRouteMatch, - useParams, + Router, useLocation, + useParams, + useRouteMatch, withRouter, - Router, } from 'react-router'; import * as RouterDOM from 'react-router-dom'; + import { NotFound } from 'design/CardError'; const NoMatch = () => ( diff --git a/web/packages/teleport/src/components/Router/index.js b/web/packages/teleport/src/components/Router/index.js index 7a54ca3dae209..b6100c95d298a 100644 --- a/web/packages/teleport/src/components/Router/index.js +++ b/web/packages/teleport/src/components/Router/index.js @@ -17,15 +17,15 @@ */ import { - useRouteMatch, - useParams, - useLocation, - withRouter, - Redirect, - Router, NavLink, + Redirect, Route, + Router, Switch, + useLocation, + useParams, + useRouteMatch, + withRouter, } from './Router'; export { diff --git a/web/packages/teleport/src/components/SelectFilters/Pager.tsx b/web/packages/teleport/src/components/SelectFilters/Pager.tsx index 4c25192485bd2..f4b51bd98cd7c 100644 --- a/web/packages/teleport/src/components/SelectFilters/Pager.tsx +++ b/web/packages/teleport/src/components/SelectFilters/Pager.tsx @@ -18,8 +18,9 @@ import React from 'react'; import styled from 'styled-components'; + +import { Flex, Text } from 'design'; import { CircleArrowLeft, CircleArrowRight } from 'design/Icon'; -import { Text, Flex } from 'design'; export default function Pager({ startFrom = 0, diff --git a/web/packages/teleport/src/components/SelectFilters/SelectFilters.tsx b/web/packages/teleport/src/components/SelectFilters/SelectFilters.tsx index b36080679ece7..6debf887b5ebb 100644 --- a/web/packages/teleport/src/components/SelectFilters/SelectFilters.tsx +++ b/web/packages/teleport/src/components/SelectFilters/SelectFilters.tsx @@ -16,21 +16,22 @@ * along with this program. If not, see . */ -import React, { useState, useRef, useEffect, useMemo } from 'react'; -import styled from 'styled-components'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; import { components } from 'react-select'; -import { Flex, Text, ButtonBorder, ButtonIcon, Box } from 'design'; -import { Cross, Add } from 'design/Icon'; +import styled from 'styled-components'; + +import { Box, ButtonBorder, ButtonIcon, Flex, Text } from 'design'; +import { Add, Cross } from 'design/Icon'; import Select, { - Option as BaseOption, ActionMeta, + Option as BaseOption, } from 'shared/components/Select'; import { makeLabelTag } from 'teleport/components/formatters'; import { Filter } from 'teleport/types'; -import usePages from './usePages'; import Pager from './Pager'; +import usePages from './usePages'; export default function SelectFilters({ applyFilters, diff --git a/web/packages/teleport/src/components/SelectFilters/index.ts b/web/packages/teleport/src/components/SelectFilters/index.ts index 71b7671631d85..a7898f1037387 100644 --- a/web/packages/teleport/src/components/SelectFilters/index.ts +++ b/web/packages/teleport/src/components/SelectFilters/index.ts @@ -17,4 +17,5 @@ */ import SelectFilters from './SelectFilters'; + export default SelectFilters; diff --git a/web/packages/teleport/src/components/ServersideSearchPanel/SearchInput.tsx b/web/packages/teleport/src/components/ServersideSearchPanel/SearchInput.tsx index 737d2d821d772..bf8e28adb5ee1 100644 --- a/web/packages/teleport/src/components/ServersideSearchPanel/SearchInput.tsx +++ b/web/packages/teleport/src/components/ServersideSearchPanel/SearchInput.tsx @@ -20,12 +20,12 @@ import React, { SetStateAction } from 'react'; import styled from 'styled-components'; import { + color, + ColorProps, height, HeightProps, space, SpaceProps, - color, - ColorProps, } from 'design/system'; // Taken from design.dataTable.InputSearch; will be modified later. diff --git a/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanel.tsx b/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanel.tsx index 01ece4cb6e1f5..487447cf6e7ca 100644 --- a/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanel.tsx +++ b/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanel.tsx @@ -17,13 +17,13 @@ */ import React from 'react'; -import { Flex } from 'design'; +import { Flex } from 'design'; import { AdvancedSearchToggle } from 'shared/components/AdvancedSearchToggle'; import useServersideSearchPanel, { - SearchPanelState, HookProps, + SearchPanelState, } from 'teleport/components/ServersideSearchPanel/useServerSideSearchPanel'; import { SearchInput } from './SearchInput'; diff --git a/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanelWithPageIndicator.tsx b/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanelWithPageIndicator.tsx index be9ef01c15363..8804cc90f63f2 100644 --- a/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanelWithPageIndicator.tsx +++ b/web/packages/teleport/src/components/ServersideSearchPanel/ServersideSearchPanelWithPageIndicator.tsx @@ -17,15 +17,16 @@ */ import React from 'react'; + import { Flex } from 'design'; import { PageIndicatorText } from 'design/DataTable/Pager/PageIndicatorText'; import { PageIndicators } from 'teleport/components/hooks/useServersidePagination'; +import { SearchPanel } from './ServersideSearchPanel'; import useServersideSearchPanel, { HookProps, } from './useServerSideSearchPanel'; -import { SearchPanel } from './ServersideSearchPanel'; interface ComponentProps { pageIndicators: PageIndicators; diff --git a/web/packages/teleport/src/components/ServersideSearchPanel/useServerSideSearchPanel.ts b/web/packages/teleport/src/components/ServersideSearchPanel/useServerSideSearchPanel.ts index d2ed418da3e9a..a4fdbfafef885 100644 --- a/web/packages/teleport/src/components/ServersideSearchPanel/useServerSideSearchPanel.ts +++ b/web/packages/teleport/src/components/ServersideSearchPanel/useServerSideSearchPanel.ts @@ -18,12 +18,11 @@ import { useEffect, useState } from 'react'; -import { ResourceFilter } from 'teleport/services/agents'; - import { decodeUrlQueryParam, encodeUrlQueryParams, } from 'teleport/components/hooks/useUrlFiltering'; +import { ResourceFilter } from 'teleport/services/agents'; export default function useServersideSearchPanel({ pathname, diff --git a/web/packages/teleport/src/components/TabIcon/TabIcon.tsx b/web/packages/teleport/src/components/TabIcon/TabIcon.tsx index 484f20f9324f3..c4209a319b249 100644 --- a/web/packages/teleport/src/components/TabIcon/TabIcon.tsx +++ b/web/packages/teleport/src/components/TabIcon/TabIcon.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Text } from 'design'; export default function TabIcon({ Icon, ...props }: Props) { diff --git a/web/packages/teleport/src/components/TabIcon/index.ts b/web/packages/teleport/src/components/TabIcon/index.ts index c237a5aba599b..fd16d4020b275 100644 --- a/web/packages/teleport/src/components/TabIcon/index.ts +++ b/web/packages/teleport/src/components/TabIcon/index.ts @@ -17,4 +17,5 @@ */ import TabIcon from './TabIcon'; + export { TabIcon }; diff --git a/web/packages/teleport/src/components/Tabs/Tabs.story.tsx b/web/packages/teleport/src/components/Tabs/Tabs.story.tsx index 9e6710104f817..659926d9031f1 100644 --- a/web/packages/teleport/src/components/Tabs/Tabs.story.tsx +++ b/web/packages/teleport/src/components/Tabs/Tabs.story.tsx @@ -19,7 +19,6 @@ import React from 'react'; import { TextSelectCopyMulti } from '../TextSelectCopy'; - import { Tabs } from './Tabs'; export default { diff --git a/web/packages/teleport/src/components/Tabs/Tabs.test.tsx b/web/packages/teleport/src/components/Tabs/Tabs.test.tsx index ea2d0ea482d09..a43cb333fe7a9 100644 --- a/web/packages/teleport/src/components/Tabs/Tabs.test.tsx +++ b/web/packages/teleport/src/components/Tabs/Tabs.test.tsx @@ -18,7 +18,7 @@ import React from 'react'; -import { render, screen, fireEvent } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { Tabs } from './Tabs'; diff --git a/web/packages/teleport/src/components/Tabs/Tabs.tsx b/web/packages/teleport/src/components/Tabs/Tabs.tsx index e491b55399dbd..d7e2615af3c99 100644 --- a/web/packages/teleport/src/components/Tabs/Tabs.tsx +++ b/web/packages/teleport/src/components/Tabs/Tabs.tsx @@ -17,6 +17,7 @@ */ import React, { useState } from 'react'; + import { Box, Flex } from 'design'; export function Tabs({ tabs }: Props) { diff --git a/web/packages/teleport/src/components/Tabs/index.ts b/web/packages/teleport/src/components/Tabs/index.ts index 3befa5c83c008..dea580671ac29 100644 --- a/web/packages/teleport/src/components/Tabs/index.ts +++ b/web/packages/teleport/src/components/Tabs/index.ts @@ -17,4 +17,5 @@ */ import { Tabs } from './Tabs'; + export { Tabs }; diff --git a/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx b/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx index b1f5e11b08ccc..ed4c65b8b57d0 100644 --- a/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx +++ b/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx @@ -16,17 +16,16 @@ * along with this program. If not, see . */ -import React, { memo, useEffect, useRef } from 'react'; +import React, { memo, useEffect, useRef, type CSSProperties } from 'react'; + import { DebouncedFunc } from 'shared/utils/highbar'; -import { TdpClientEvent, TdpClient } from 'teleport/lib/tdp'; +import { TdpClient, TdpClientEvent } from 'teleport/lib/tdp'; import { BitmapFrame } from 'teleport/lib/tdp/client'; - -import type { CSSProperties } from 'react'; import type { - PngFrame, ClientScreenSpec, ClipboardData, + PngFrame, } from 'teleport/lib/tdp/codec'; function TdpClientCanvas(props: Props) { diff --git a/web/packages/teleport/src/components/TextSelectCopy/index.ts b/web/packages/teleport/src/components/TextSelectCopy/index.ts index b105bde1b7f59..5f929726aae16 100644 --- a/web/packages/teleport/src/components/TextSelectCopy/index.ts +++ b/web/packages/teleport/src/components/TextSelectCopy/index.ts @@ -20,6 +20,7 @@ import { TextSelectCopy, TextSelectCopyMulti, } from 'shared/components/TextSelectCopy'; + /** * @deprecated Import from `shared/TextSelectCopy`. */ diff --git a/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.story.tsx b/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.story.tsx index 4af3f5f6cada7..f7a2c33c61b5f 100644 --- a/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.story.tsx +++ b/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.story.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Box } from 'design'; import { ToolTipBadge } from './ToolTipBadge'; diff --git a/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.tsx b/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.tsx index 2ef0e48af83f2..a908bba0dfe99 100644 --- a/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.tsx +++ b/web/packages/teleport/src/components/ToolTipBadge/ToolTipBadge.tsx @@ -18,7 +18,8 @@ import React, { PropsWithChildren, useState } from 'react'; import styled from 'styled-components'; -import { Popover, Box } from 'design'; + +import { Box, Popover } from 'design'; type Props = { borderRadius?: number; diff --git a/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx b/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx index 9017ffceb05c5..ae210980e3b85 100644 --- a/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx +++ b/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx @@ -18,9 +18,10 @@ import React from 'react'; import styled from 'styled-components'; + import { Box } from 'design'; -import { ToolTipNoPermBadge, BadgeTitle } from './ToolTipNoPermBadge'; +import { BadgeTitle, ToolTipNoPermBadge } from './ToolTipNoPermBadge'; export default { title: 'Teleport/ToolTip', diff --git a/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.test.tsx b/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.test.tsx index 7dcd85dfd505b..8c9ac74de5df9 100644 --- a/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.test.tsx +++ b/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.test.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { render, screen, userEvent } from 'design/utils/testing'; import { BadgeTitle, ToolTipNoPermBadge } from './ToolTipNoPermBadge'; diff --git a/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.story.tsx b/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.story.tsx index 1bac561e8764b..6f2abfaf3ce72 100644 --- a/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.story.tsx +++ b/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.story.tsx @@ -18,13 +18,14 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; + import * as Icons from 'design/Icon'; -import TeleportContextProvider from 'teleport/TeleportContextProvider'; -import TeleportContext from 'teleport/teleportContext'; -import { makeUserContext } from 'teleport/services/user'; -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; import { getOSSFeatures } from 'teleport/features'; +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; +import { makeUserContext } from 'teleport/services/user'; +import TeleportContext from 'teleport/teleportContext'; +import TeleportContextProvider from 'teleport/TeleportContextProvider'; import { UserMenuNav } from './UserMenuNav'; diff --git a/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.test.tsx b/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.test.tsx index 601f651a24bb6..4f43c775b1c03 100644 --- a/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.test.tsx +++ b/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.test.tsx @@ -16,32 +16,26 @@ * along with this program. If not, see . */ +import { rest } from 'msw'; +import { setupServer } from 'msw/node'; import React from 'react'; import { MemoryRouter } from 'react-router'; -import { setupServer } from 'msw/node'; -import { rest } from 'msw'; - import { - render as testingRender, - screen, fireEvent, + screen, + render as testingRender, } from 'design/utils/testing'; - import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; import cfg from 'teleport/config'; - -import { FeaturesContextProvider } from 'teleport/FeaturesContext'; import { getOSSFeatures } from 'teleport/features'; - -import TeleportContextProvider from 'teleport/TeleportContextProvider'; -import TeleportContext from 'teleport/teleportContext'; - +import { FeaturesContextProvider } from 'teleport/FeaturesContext'; import { makeUserContext } from 'teleport/services/user'; - -import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; +import TeleportContext from 'teleport/teleportContext'; +import TeleportContextProvider from 'teleport/TeleportContextProvider'; import { makeTestUserContext } from 'teleport/User/testHelpers/makeTestUserContext'; +import { mockUserContextProviderWith } from 'teleport/User/testHelpers/mockUserContextWith'; import { UserMenuNav } from './UserMenuNav'; diff --git a/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.tsx b/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.tsx index a8fe8274fd4bf..32c12db6c3b0f 100644 --- a/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.tsx +++ b/web/packages/teleport/src/components/UserMenuNav/UserMenuNav.tsx @@ -16,33 +16,31 @@ * along with this program. If not, see . */ -import { useState, useRef } from 'react'; +import { useRef, useState } from 'react'; import styled, { useTheme } from 'styled-components'; -import { Moon, Sun, ChevronDown, Logout as LogoutIcon } from 'design/Icon'; -import { Text, Box } from 'design'; -import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; +import { Box, Text } from 'design'; +import { ChevronDown, Logout as LogoutIcon, Moon, Sun } from 'design/Icon'; import { getCurrentTheme, getNextTheme } from 'design/ThemeProvider'; - import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; +import { useRefClickOutside } from 'shared/hooks/useRefClickOutside'; -import { focusOutsideTarget } from 'teleport/lib/util/eventTarget'; - -import session from 'teleport/services/websession'; -import { useFeatures } from 'teleport/FeaturesContext'; import { useTeleport } from 'teleport'; -import { useUser } from 'teleport/User/UserContext'; import { Dropdown, + DropdownDivider, DropdownItem, DropdownItemButton, - DropdownItemLink, DropdownItemIcon, - DropdownDivider, - STARTING_TRANSITION_DELAY, + DropdownItemLink, INCREMENT_TRANSITION_DELAY, + STARTING_TRANSITION_DELAY, } from 'teleport/components/Dropdown'; +import { useFeatures } from 'teleport/FeaturesContext'; +import { focusOutsideTarget } from 'teleport/lib/util/eventTarget'; +import session from 'teleport/services/websession'; import { DeviceTrustStatus } from 'teleport/TopBar/DeviceTrustStatus'; +import { useUser } from 'teleport/User/UserContext'; interface UserMenuNavProps { username: string; diff --git a/web/packages/teleport/src/components/Wizard/Navigation/Bullet.tsx b/web/packages/teleport/src/components/Wizard/Navigation/Bullet.tsx index 31f2166456b67..2f6176d1adcc1 100644 --- a/web/packages/teleport/src/components/Wizard/Navigation/Bullet.tsx +++ b/web/packages/teleport/src/components/Wizard/Navigation/Bullet.tsx @@ -16,10 +16,11 @@ * along with this program. If not, see . */ -import Flex from 'design/Flex'; import React from 'react'; import styled from 'styled-components'; +import Flex from 'design/Flex'; + export type Props = { isDone?: boolean; isActive?: boolean; diff --git a/web/packages/teleport/src/components/Wizard/Navigation/Navigation.story.tsx b/web/packages/teleport/src/components/Wizard/Navigation/Navigation.story.tsx index be358abfa6dc8..09da41f766470 100644 --- a/web/packages/teleport/src/components/Wizard/Navigation/Navigation.story.tsx +++ b/web/packages/teleport/src/components/Wizard/Navigation/Navigation.story.tsx @@ -17,10 +17,10 @@ */ import React from 'react'; + import { Box } from 'design'; import { addIndexToViews } from '../flow'; - import { Navigation } from './Navigation'; export default { diff --git a/web/packages/teleport/src/components/Wizard/Navigation/Navigation.test.tsx b/web/packages/teleport/src/components/Wizard/Navigation/Navigation.test.tsx index cc9c307e041c8..8e3a78ddf7af7 100644 --- a/web/packages/teleport/src/components/Wizard/Navigation/Navigation.test.tsx +++ b/web/packages/teleport/src/components/Wizard/Navigation/Navigation.test.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { render, screen } from 'design/utils/testing'; import { Navigation } from './Navigation'; diff --git a/web/packages/teleport/src/components/Wizard/Navigation/Navigation.tsx b/web/packages/teleport/src/components/Wizard/Navigation/Navigation.tsx index 01fad8c7aec9c..dc5f11246d93e 100644 --- a/web/packages/teleport/src/components/Wizard/Navigation/Navigation.tsx +++ b/web/packages/teleport/src/components/Wizard/Navigation/Navigation.tsx @@ -21,9 +21,8 @@ import React from 'react'; import { Flex } from 'design'; import { BaseView } from '../flow'; - -import { StepTitle, StepsContainer } from './Shared'; import { Bullet } from './Bullet'; +import { StepsContainer, StepTitle } from './Shared'; import { StepList } from './StepList'; export type StepIcon = { diff --git a/web/packages/teleport/src/components/Wizard/Navigation/StepItem.tsx b/web/packages/teleport/src/components/Wizard/Navigation/StepItem.tsx index 4236d85471209..43ba8f727d75f 100644 --- a/web/packages/teleport/src/components/Wizard/Navigation/StepItem.tsx +++ b/web/packages/teleport/src/components/Wizard/Navigation/StepItem.tsx @@ -19,13 +19,12 @@ import React from 'react'; import { - StepTitle, StepsContainer, + StepTitle, } from 'teleport/components/Wizard/Navigation'; import { Bullet } from 'teleport/components/Wizard/Navigation/Bullet'; import { BaseView } from '../flow'; - import { StepList } from './StepList'; export function StepItem(props: { diff --git a/web/packages/teleport/src/components/Wizard/Navigation/StepList.tsx b/web/packages/teleport/src/components/Wizard/Navigation/StepList.tsx index e4dec58e714d8..f58e81e82c35a 100644 --- a/web/packages/teleport/src/components/Wizard/Navigation/StepList.tsx +++ b/web/packages/teleport/src/components/Wizard/Navigation/StepList.tsx @@ -19,7 +19,6 @@ import React from 'react'; import { BaseView } from '../flow'; - import { StepItem } from './StepItem'; interface StepListProps { diff --git a/web/packages/teleport/src/components/Wizard/flow.test.tsx b/web/packages/teleport/src/components/Wizard/flow.test.tsx index b89b884007d71..374ca2239546b 100644 --- a/web/packages/teleport/src/components/Wizard/flow.test.tsx +++ b/web/packages/teleport/src/components/Wizard/flow.test.tsx @@ -17,10 +17,11 @@ */ import React from 'react'; + import { render, screen } from 'design/utils/testing'; -import { Navigation } from './Navigation'; import { addIndexToViews, computeViewChildrenSize } from './flow'; +import { Navigation } from './Navigation'; test('computeViewChildrenSize', async () => { const nestedViews = [ diff --git a/web/packages/teleport/src/components/hooks/useServersidePagination.ts b/web/packages/teleport/src/components/hooks/useServersidePagination.ts index 6524095bb0f0d..ae05efe0bfe72 100644 --- a/web/packages/teleport/src/components/hooks/useServersidePagination.ts +++ b/web/packages/teleport/src/components/hooks/useServersidePagination.ts @@ -16,12 +16,13 @@ * along with this program. If not, see . */ -import { useState, Dispatch, SetStateAction } from 'react'; +import { Dispatch, SetStateAction, useState } from 'react'; + import { FetchStatus, Page } from 'design/DataTable/types'; import useAttempt, { Attempt } from 'shared/hooks/useAttemptNext'; -import { ResourcesResponse, ResourceFilter } from 'teleport/services/agents'; import { UrlResourcesParams } from 'teleport/config'; +import { ResourceFilter, ResourcesResponse } from 'teleport/services/agents'; export function useServerSidePagination({ fetchFunc, diff --git a/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.test.tsx b/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.test.tsx index 45646cb0d5ac8..2944e4c1450b9 100644 --- a/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.test.tsx +++ b/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.test.tsx @@ -16,11 +16,12 @@ * along with this program. If not, see . */ +import { createMemoryHistory } from 'history'; import React from 'react'; import { Router } from 'react-router'; -import { createMemoryHistory } from 'history'; -import renderHook from 'design/utils/renderHook'; + import { SortType } from 'design/DataTable/types'; +import renderHook from 'design/utils/renderHook'; import { useUrlFiltering } from './useUrlFiltering'; diff --git a/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.ts b/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.ts index 374a50d317acf..09af184a67448 100644 --- a/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.ts +++ b/web/packages/teleport/src/components/hooks/useUrlFiltering/useUrlFiltering.ts @@ -18,12 +18,12 @@ import { useState } from 'react'; import { useLocation } from 'react-router'; -import { SortType } from 'design/DataTable/types'; +import { SortType } from 'design/DataTable/types'; import { makeAdvancedSearchQueryForLabel } from 'shared/utils/advancedSearchLabelQuery'; -import history from 'teleport/services/history'; import { ResourceFilter, ResourceLabel } from 'teleport/services/agents'; +import history from 'teleport/services/history'; import { encodeUrlQueryParams } from './encodeUrlQueryParams'; diff --git a/web/packages/teleport/src/components/useResources.ts b/web/packages/teleport/src/components/useResources.ts index a29ed1e70fbbd..3d97092753b76 100644 --- a/web/packages/teleport/src/components/useResources.ts +++ b/web/packages/teleport/src/components/useResources.ts @@ -18,7 +18,7 @@ import { useState } from 'shared/hooks'; -import { Resource, Kind } from 'teleport/services/resources'; +import { Kind, Resource } from 'teleport/services/resources'; export default function useResources( resources: Resource[], diff --git a/web/packages/teleport/src/config.test.ts b/web/packages/teleport/src/config.test.ts index 168f543ef2af2..b80c5dbc3ca07 100644 --- a/web/packages/teleport/src/config.test.ts +++ b/web/packages/teleport/src/config.test.ts @@ -17,9 +17,9 @@ */ import cfg, { - UrlDeployServiceIamConfigureScriptParams, - UrlAwsOidcConfigureIdp, UrlAwsConfigureIamScriptParams, + UrlAwsOidcConfigureIdp, + UrlDeployServiceIamConfigureScriptParams, } from './config'; test('getDeployServiceIamConfigureScriptPath formatting', async () => { diff --git a/web/packages/teleport/src/config.ts b/web/packages/teleport/src/config.ts index 2069775f8053e..4078ab39aed95 100644 --- a/web/packages/teleport/src/config.ts +++ b/web/packages/teleport/src/config.ts @@ -19,9 +19,6 @@ import { generatePath } from 'react-router'; import { IncludedResourceMode } from 'shared/components/UnifiedResources'; - -import { mergeDeep } from 'shared/utils/highbar'; - import { Auth2faType, AuthProvider, @@ -29,19 +26,19 @@ import { PreferredMfaType, PrimaryAuthType, } from 'shared/services'; - -import { KubeResourceKind } from 'teleport/services/kube/types'; - -import { defaultEntitlements } from './entitlement'; -import generateResourcePath from './generateResourcePath'; +import { mergeDeep } from 'shared/utils/highbar'; import type { SortType } from 'teleport/services/agents'; -import type { RecordingType } from 'teleport/services/recordings'; import type { WebauthnAssertionResponse } from 'teleport/services/auth'; import type { PluginKind, Regions } from 'teleport/services/integrations'; +import { KubeResourceKind } from 'teleport/services/kube/types'; +import type { RecordingType } from 'teleport/services/recordings'; import type { ParticipantMode } from 'teleport/services/session'; import type { YamlSupportedResourceKind } from 'teleport/services/yaml/types'; +import { defaultEntitlements } from './entitlement'; +import generateResourcePath from './generateResourcePath'; + const cfg = { /** @deprecated Use cfg.edition instead. */ isEnterprise: false, diff --git a/web/packages/teleport/src/features.tsx b/web/packages/teleport/src/features.tsx index 9be8abb044c9e..6e9e1b7f64198 100644 --- a/web/packages/teleport/src/features.tsx +++ b/web/packages/teleport/src/features.tsx @@ -39,38 +39,34 @@ import { Users as UsersIcon, } from 'design/Icon'; +import { IntegrationEnroll } from '@gravitational/teleport/src/Integrations/Enroll'; import cfg from 'teleport/config'; - import { ManagementSection, NavigationCategory, } from 'teleport/Navigation/categories'; -import { IntegrationEnroll } from '@gravitational/teleport/src/Integrations/Enroll'; -import { NavTitle } from './types'; - -import { AuditContainer as Audit } from './Audit'; -import { SessionsContainer as Sessions } from './Sessions'; -import { UnifiedResources } from './UnifiedResources'; +import { LockedAccessRequests } from './AccessRequests'; import { AccountPage } from './Account'; -import { Support } from './Support'; +import { AuditContainer as Audit } from './Audit'; +import { AuthConnectorsContainer as AuthConnectors } from './AuthConnectors'; +import { Bots } from './Bots'; +import { AddBots } from './Bots/Add'; import { Clusters } from './Clusters'; -import { TrustedClusters } from './TrustedClusters'; -import { Users } from './Users'; -import { RolesContainer as Roles } from './Roles'; import { DeviceTrustLocked } from './DeviceTrust'; -import { RecordingsContainer as Recordings } from './Recordings'; -import { AuthConnectorsContainer as AuthConnectors } from './AuthConnectors'; -import { Locks } from './LocksV2/Locks'; -import { NewLockView } from './LocksV2/NewLock'; import { Discover } from './Discover'; -import { LockedAccessRequests } from './AccessRequests'; import { Integrations } from './Integrations'; -import { Bots } from './Bots'; -import { AddBots } from './Bots/Add'; import { JoinTokens } from './JoinTokens/JoinTokens'; - -import type { FeatureFlags, TeleportFeature } from './types'; +import { Locks } from './LocksV2/Locks'; +import { NewLockView } from './LocksV2/NewLock'; +import { RecordingsContainer as Recordings } from './Recordings'; +import { RolesContainer as Roles } from './Roles'; +import { SessionsContainer as Sessions } from './Sessions'; +import { Support } from './Support'; +import { TrustedClusters } from './TrustedClusters'; +import { NavTitle, type FeatureFlags, type TeleportFeature } from './types'; +import { UnifiedResources } from './UnifiedResources'; +import { Users } from './Users'; class AccessRequests implements TeleportFeature { category = NavigationCategory.Resources; diff --git a/web/packages/teleport/src/lib/global.d.ts b/web/packages/teleport/src/lib/global.d.ts index fb615435471cd..266adb9341a8e 100644 --- a/web/packages/teleport/src/lib/global.d.ts +++ b/web/packages/teleport/src/lib/global.d.ts @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -import { rest } from 'msw'; - -import type { SetupWorkerApi } from 'msw'; +import { rest, type SetupWorkerApi } from 'msw'; // Gives us access to vite's import.meta import 'vite/client'; diff --git a/web/packages/teleport/src/lib/tdp/client.ts b/web/packages/teleport/src/lib/tdp/client.ts index a415932b5e45c..72e6fe19f9790 100644 --- a/web/packages/teleport/src/lib/tdp/client.ts +++ b/web/packages/teleport/src/lib/tdp/client.ts @@ -19,46 +19,42 @@ import Logger from 'shared/libs/logger'; import init, { - init_wasm_log, FastPathProcessor, + init_wasm_log, } from 'teleport/ironrdp/pkg/ironrdp'; - -import { WebsocketCloseCode, TermEvent } from 'teleport/lib/term/enums'; -import { EventEmitterWebAuthnSender } from 'teleport/lib/EventEmitterWebAuthnSender'; import { AuthenticatedWebSocket } from 'teleport/lib/AuthenticatedWebSocket'; +import { EventEmitterWebAuthnSender } from 'teleport/lib/EventEmitterWebAuthnSender'; +import { TermEvent, WebsocketCloseCode } from 'teleport/lib/term/enums'; +import type { WebauthnAssertionResponse } from 'teleport/services/auth'; import Codec, { - MessageType, FileType, - SharedDirectoryErrCode, + MessageType, Severity, + SharedDirectoryErrCode, + type ButtonState, + type ClientScreenSpec, + type ClipboardData, + type FileSystemObject, + type MouseButton, + type PngFrame, + type ScrollAxis, + type SharedDirectoryCreateResponse, + type SharedDirectoryDeleteResponse, + type SharedDirectoryInfoResponse, + type SharedDirectoryListResponse, + type SharedDirectoryMoveResponse, + type SharedDirectoryReadResponse, + type SharedDirectoryTruncateResponse, + type SharedDirectoryWriteResponse, + type SyncKeys, } from './codec'; import { PathDoesNotExistError, SharedDirectoryManager, + type FileOrDirInfo, } from './sharedDirectoryManager'; -import type { FileOrDirInfo } from './sharedDirectoryManager'; -import type { - MouseButton, - ButtonState, - ScrollAxis, - ClientScreenSpec, - PngFrame, - ClipboardData, - SharedDirectoryInfoResponse, - SharedDirectoryListResponse, - SharedDirectoryMoveResponse, - SharedDirectoryReadResponse, - SharedDirectoryWriteResponse, - SharedDirectoryCreateResponse, - SharedDirectoryDeleteResponse, - FileSystemObject, - SyncKeys, - SharedDirectoryTruncateResponse, -} from './codec'; -import type { WebauthnAssertionResponse } from 'teleport/services/auth'; - export enum TdpClientEvent { TDP_CLIENT_SCREEN_SPEC = 'tdp client screen spec', TDP_PNG_FRAME = 'tdp png frame', diff --git a/web/packages/teleport/src/lib/tdp/codec.test.ts b/web/packages/teleport/src/lib/tdp/codec.test.ts index 02ef687b3caee..fc81e09693618 100644 --- a/web/packages/teleport/src/lib/tdp/codec.test.ts +++ b/web/packages/teleport/src/lib/tdp/codec.test.ts @@ -17,8 +17,8 @@ */ import Codec, { - MessageType, ButtonState, + MessageType, MouseButton, ScrollAxis, } from './codec'; diff --git a/web/packages/teleport/src/lib/tdp/index.ts b/web/packages/teleport/src/lib/tdp/index.ts index 2d1f6ef0f85b6..e3e4a7071d637 100644 --- a/web/packages/teleport/src/lib/tdp/index.ts +++ b/web/packages/teleport/src/lib/tdp/index.ts @@ -17,7 +17,7 @@ */ import TdpClient, { TdpClientEvent } from './client'; -import { PlayerClient } from './playerClient'; import { ButtonState, ScrollAxis } from './codec'; +import { PlayerClient } from './playerClient'; export { TdpClient, TdpClientEvent, PlayerClient, ButtonState, ScrollAxis }; diff --git a/web/packages/teleport/src/lib/tdp/playerClient.ts b/web/packages/teleport/src/lib/tdp/playerClient.ts index 9adb15ef10038..ebd23974b7ae2 100644 --- a/web/packages/teleport/src/lib/tdp/playerClient.ts +++ b/web/packages/teleport/src/lib/tdp/playerClient.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { throttle } from 'shared/utils/highbar'; import { base64ToArrayBuffer } from 'shared/utils/base64'; +import { throttle } from 'shared/utils/highbar'; import { StatusEnum } from 'teleport/lib/player'; diff --git a/web/packages/teleport/src/lib/term/terminal.ts b/web/packages/teleport/src/lib/term/terminal.ts index 535283b33db5a..49a59519d6b5a 100644 --- a/web/packages/teleport/src/lib/term/terminal.ts +++ b/web/packages/teleport/src/lib/term/terminal.ts @@ -17,26 +17,26 @@ */ import '@xterm/xterm/css/xterm.css'; -import { ITheme, Terminal } from '@xterm/xterm'; + +import { CanvasAddon } from '@xterm/addon-canvas'; import { FitAddon } from '@xterm/addon-fit'; import { ImageAddon } from '@xterm/addon-image'; +import { WebLinksAddon } from '@xterm/addon-web-links'; +import { WebglAddon } from '@xterm/addon-webgl'; +import { ITheme, Terminal } from '@xterm/xterm'; + import { SearchAddon, TerminalSearcher, } from 'shared/components/TerminalSearch'; -import { WebglAddon } from '@xterm/addon-webgl'; -import { WebLinksAddon } from '@xterm/addon-web-links'; -import { CanvasAddon } from '@xterm/addon-canvas'; -import { debounce, isInteger } from 'shared/utils/highbar'; import Logger from 'shared/libs/logger'; +import { debounce, isInteger, type DebouncedFunc } from 'shared/utils/highbar'; import cfg from 'teleport/config'; import { TermEvent } from './enums'; import Tty from './tty'; -import type { DebouncedFunc } from 'shared/utils/highbar'; - const logger = Logger.create('lib/term/terminal'); const DISCONNECT_TXT = 'disconnected'; const WINDOW_RESIZE_DEBOUNCE_DELAY = 200; diff --git a/web/packages/teleport/src/lib/term/tty.ts b/web/packages/teleport/src/lib/term/tty.ts index 6bd9014234323..8b3833f714e7b 100644 --- a/web/packages/teleport/src/lib/term/tty.ts +++ b/web/packages/teleport/src/lib/term/tty.ts @@ -18,12 +18,12 @@ import Logger from 'shared/libs/logger'; +import { AuthenticatedWebSocket } from 'teleport/lib/AuthenticatedWebSocket'; import { EventEmitterWebAuthnSender } from 'teleport/lib/EventEmitterWebAuthnSender'; import { WebauthnAssertionResponse } from 'teleport/services/auth'; -import { AuthenticatedWebSocket } from 'teleport/lib/AuthenticatedWebSocket'; import { EventType, TermEvent, WebsocketCloseCode } from './enums'; -import { Protobuf, MessageTypeEnum } from './protobuf'; +import { MessageTypeEnum, Protobuf } from './protobuf'; const logger = Logger.create('Tty'); diff --git a/web/packages/teleport/src/lib/term/ttyPlayer.js b/web/packages/teleport/src/lib/term/ttyPlayer.js index 87153d6ade295..3d3629f54e95c 100644 --- a/web/packages/teleport/src/lib/term/ttyPlayer.js +++ b/web/packages/teleport/src/lib/term/ttyPlayer.js @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -import { throttle } from 'shared/utils/highbar'; import Logger from 'shared/libs/logger'; +import { throttle } from 'shared/utils/highbar'; import { StatusEnum } from 'teleport/lib/player'; -import Tty from './tty'; import { TermEvent, WebsocketCloseCode } from './enums'; +import Tty from './tty'; const logger = Logger.create('TtyPlayer'); diff --git a/web/packages/teleport/src/lib/term/ttyPlayer.test.js b/web/packages/teleport/src/lib/term/ttyPlayer.test.js index 0b5b3edf4d18a..2d2434523c890 100644 --- a/web/packages/teleport/src/lib/term/ttyPlayer.test.js +++ b/web/packages/teleport/src/lib/term/ttyPlayer.test.js @@ -20,8 +20,8 @@ import '@gravitational/shared/libs/polyfillFinally'; import WS from 'jest-websocket-mock'; -import { TermEvent } from 'teleport/lib/term/enums'; import { StatusEnum } from 'teleport/lib/player'; +import { TermEvent } from 'teleport/lib/term/enums'; import TtyPlayer from './ttyPlayer'; diff --git a/web/packages/teleport/src/lib/useWebAuthn.ts b/web/packages/teleport/src/lib/useWebAuthn.ts index 730065299ceed..07be505cedf96 100644 --- a/web/packages/teleport/src/lib/useWebAuthn.ts +++ b/web/packages/teleport/src/lib/useWebAuthn.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { useState, useEffect, Dispatch, SetStateAction } from 'react'; +import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { EventEmitterWebAuthnSender } from 'teleport/lib/EventEmitterWebAuthnSender'; import { TermEvent } from 'teleport/lib/term/enums'; diff --git a/web/packages/teleport/src/lib/util.test.ts b/web/packages/teleport/src/lib/util.test.ts index 338a32b41d4ee..8e85a268f655f 100644 --- a/web/packages/teleport/src/lib/util.test.ts +++ b/web/packages/teleport/src/lib/util.test.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { generateTshLoginCommand, arrayStrDiff, compareByString } from './util'; +import { arrayStrDiff, compareByString, generateTshLoginCommand } from './util'; let windowSpy; diff --git a/web/packages/teleport/src/mocks/contexts.ts b/web/packages/teleport/src/mocks/contexts.ts index 45586517515aa..6478d1f35652d 100644 --- a/web/packages/teleport/src/mocks/contexts.ts +++ b/web/packages/teleport/src/mocks/contexts.ts @@ -16,10 +16,9 @@ * along with this program. If not, see . */ -import makeUserContext from 'teleport/services/user/makeUserContext'; import { Context as TeleportContext } from 'teleport'; import { makeAcl } from 'teleport/services/user/makeAcl'; - +import makeUserContext from 'teleport/services/user/makeUserContext'; import type { Access, Acl } from 'teleport/services/user/types'; export const noAccess: Access = { diff --git a/web/packages/teleport/src/services/agents/agents.test.ts b/web/packages/teleport/src/services/agents/agents.test.ts index ce18a6b497d40..f33a8f93b173f 100644 --- a/web/packages/teleport/src/services/agents/agents.test.ts +++ b/web/packages/teleport/src/services/agents/agents.test.ts @@ -16,12 +16,11 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { agentService } from './agents'; import { makeLabelMapOfStrArrs } from './make'; - import type { ConnectionDiagnosticRequest } from './types'; test('createConnectionDiagnostic request', () => { diff --git a/web/packages/teleport/src/services/agents/agents.ts b/web/packages/teleport/src/services/agents/agents.ts index b0813b365e72b..2d01c644faf28 100644 --- a/web/packages/teleport/src/services/agents/agents.ts +++ b/web/packages/teleport/src/services/agents/agents.ts @@ -18,11 +18,10 @@ import { platformToGOOS } from 'design/platform'; -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { makeConnectionDiagnostic } from './make'; - import type { ConnectionDiagnostic, ConnectionDiagnosticRequest, diff --git a/web/packages/teleport/src/services/agents/types.ts b/web/packages/teleport/src/services/agents/types.ts index 8fc4f6807c500..6a0a5af5a6ce0 100644 --- a/web/packages/teleport/src/services/agents/types.ts +++ b/web/packages/teleport/src/services/agents/types.ts @@ -16,18 +16,17 @@ * along with this program. If not, see . */ +import type { Platform } from 'design/platform'; import { IncludedResourceMode } from 'shared/components/UnifiedResources'; import { App } from 'teleport/services/apps'; import { Database } from 'teleport/services/databases'; -import { Node } from 'teleport/services/nodes'; -import { Kube } from 'teleport/services/kube'; import { Desktop } from 'teleport/services/desktops'; - -import { UserGroup } from '../userGroups'; +import { Kube } from 'teleport/services/kube'; +import { Node } from 'teleport/services/nodes'; import type { MfaAuthnResponse } from '../mfa'; -import type { Platform } from 'design/platform'; +import { UserGroup } from '../userGroups'; export type UnifiedResource = | App diff --git a/web/packages/teleport/src/services/alerts/alerts.tsx b/web/packages/teleport/src/services/alerts/alerts.tsx index 5dc6cf52658ea..47a288200f608 100644 --- a/web/packages/teleport/src/services/alerts/alerts.tsx +++ b/web/packages/teleport/src/services/alerts/alerts.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; export const LINK_LABEL = 'teleport.internal/link'; diff --git a/web/packages/teleport/src/services/api/api.test.ts b/web/packages/teleport/src/services/api/api.test.ts index ec5787bb56451..5cb8840d6948b 100644 --- a/web/packages/teleport/src/services/api/api.test.ts +++ b/web/packages/teleport/src/services/api/api.test.ts @@ -17,10 +17,10 @@ */ import api, { - MFA_HEADER, defaultRequestOptions, getAuthHeaders, isRoleNotFoundError, + MFA_HEADER, } from './api'; describe('api.fetch', () => { diff --git a/web/packages/teleport/src/services/api/api.ts b/web/packages/teleport/src/services/api/api.ts index 6c2d18587f844..f1d466908859a 100644 --- a/web/packages/teleport/src/services/api/api.ts +++ b/web/packages/teleport/src/services/api/api.ts @@ -17,12 +17,12 @@ */ import 'whatwg-fetch'; + import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; import websession from 'teleport/services/websession'; -import { storageService } from '../storageService'; import { WebauthnAssertionResponse } from '../auth'; - +import { storageService } from '../storageService'; import parseError, { ApiError } from './parseError'; export const MFA_HEADER = 'Teleport-Mfa-Response'; diff --git a/web/packages/teleport/src/services/api/index.js b/web/packages/teleport/src/services/api/index.js index 813b3e911af1f..864daa1517d9a 100644 --- a/web/packages/teleport/src/services/api/index.js +++ b/web/packages/teleport/src/services/api/index.js @@ -17,12 +17,13 @@ */ import api, { - getAuthHeaders, - getNoCacheHeaders, getAccessToken, + getAuthHeaders, getHostName, + getNoCacheHeaders, getXCSRFToken, } from './api'; + export default api; export { getAuthHeaders, diff --git a/web/packages/teleport/src/services/apps/apps.ts b/web/packages/teleport/src/services/apps/apps.ts index a301147f8730f..8181321475c16 100644 --- a/web/packages/teleport/src/services/apps/apps.ts +++ b/web/packages/teleport/src/services/apps/apps.ts @@ -16,10 +16,9 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg, { UrlAppParams, UrlResourcesParams } from 'teleport/config'; import { ResourcesResponse } from 'teleport/services/agents'; - +import api from 'teleport/services/api'; import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; import makeApp from './makeApps'; diff --git a/web/packages/teleport/src/services/apps/types.ts b/web/packages/teleport/src/services/apps/types.ts index d5c66f06d3074..28d2f425cb623 100644 --- a/web/packages/teleport/src/services/apps/types.ts +++ b/web/packages/teleport/src/services/apps/types.ts @@ -19,7 +19,6 @@ import { AwsRole } from 'shared/services/apps'; import { ResourceLabel } from 'teleport/services/agents'; - import type { SamlServiceProviderPreset } from 'teleport/services/samlidp/types'; export interface App { diff --git a/web/packages/teleport/src/services/audit/audit.ts b/web/packages/teleport/src/services/audit/audit.ts index aed9307d2263f..8f1cac3f1025d 100644 --- a/web/packages/teleport/src/services/audit/audit.ts +++ b/web/packages/teleport/src/services/audit/audit.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import makeEvent from './makeEvent'; import { EventQuery, EventResponse } from './types'; diff --git a/web/packages/teleport/src/services/audit/makeEvent.ts b/web/packages/teleport/src/services/audit/makeEvent.ts index d8a01bdc8f2da..c80c13dd41297 100644 --- a/web/packages/teleport/src/services/audit/makeEvent.ts +++ b/web/packages/teleport/src/services/audit/makeEvent.ts @@ -17,9 +17,10 @@ */ import { formatDistanceStrict } from 'date-fns'; + import { pluralize } from 'shared/utils/text'; -import { Event, RawEvent, Formatters, eventCodes, RawEvents } from './types'; +import { Event, eventCodes, Formatters, RawEvent, RawEvents } from './types'; const formatElasticsearchEvent: ( json: diff --git a/web/packages/teleport/src/services/auth/auth.test.ts b/web/packages/teleport/src/services/auth/auth.test.ts index bec482724f6e9..d2d2e3def1924 100644 --- a/web/packages/teleport/src/services/auth/auth.test.ts +++ b/web/packages/teleport/src/services/auth/auth.test.ts @@ -17,8 +17,8 @@ */ import cfg from 'teleport/config'; -import auth from 'teleport/services/auth'; import api from 'teleport/services/api'; +import auth from 'teleport/services/auth'; /* eslint-disable jest/no-conditional-expect */ diff --git a/web/packages/teleport/src/services/auth/auth.ts b/web/packages/teleport/src/services/auth/auth.ts index 4dec9b2ade0f0..8c04711c61785 100644 --- a/web/packages/teleport/src/services/auth/auth.ts +++ b/web/packages/teleport/src/services/auth/auth.ts @@ -16,13 +16,11 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { DeviceType } from 'teleport/services/mfa'; - import { CaptureEvent, userEventService } from 'teleport/services/userEvent'; -import makePasswordToken from './makePasswordToken'; import { makeChangedUserAuthn } from './make'; import { makeMfaAuthenticateChallenge, @@ -30,14 +28,15 @@ import { makeWebauthnAssertionResponse, makeWebauthnCreationResponse, } from './makeMfa'; +import makePasswordToken from './makePasswordToken'; import { - ResetPasswordReqWithEvent, - ResetPasswordWithWebauthnReqWithEvent, - UserCredentials, ChangePasswordReq, + CreateAuthenticateChallengeRequest, CreateNewHardwareDeviceRequest, DeviceUsage, - CreateAuthenticateChallengeRequest, + ResetPasswordReqWithEvent, + ResetPasswordWithWebauthnReqWithEvent, + UserCredentials, } from './types'; const auth = { diff --git a/web/packages/teleport/src/services/bot/bot.ts b/web/packages/teleport/src/services/bot/bot.ts index f203fd28fb9f3..c87b160355aaf 100644 --- a/web/packages/teleport/src/services/bot/bot.ts +++ b/web/packages/teleport/src/services/bot/bot.ts @@ -16,9 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; - +import api from 'teleport/services/api'; import { makeBot, toApiGitHubTokenSpec } from 'teleport/services/bot/consts'; import ResourceService, { RoleResource } from 'teleport/services/resources'; import { FeatureFlags } from 'teleport/types'; @@ -26,10 +25,10 @@ import { FeatureFlags } from 'teleport/types'; import { BotList, BotResponse, - FlatBot, - EditBotRequest, - CreateBotRequest, CreateBotJoinTokenRequest, + CreateBotRequest, + EditBotRequest, + FlatBot, } from './types'; export function createBot(config: CreateBotRequest): Promise { diff --git a/web/packages/teleport/src/services/clusters/clusters.ts b/web/packages/teleport/src/services/clusters/clusters.ts index a912a315433e0..e35110127c34a 100644 --- a/web/packages/teleport/src/services/clusters/clusters.ts +++ b/web/packages/teleport/src/services/clusters/clusters.ts @@ -16,12 +16,11 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; - -import { makeClusterInfo, makeClusterList } from './makeCluster'; +import api from 'teleport/services/api'; import { Cluster } from '.'; +import { makeClusterInfo, makeClusterList } from './makeCluster'; export default class ClustersService { clusters: Cluster[] = []; diff --git a/web/packages/teleport/src/services/databases/databases.ts b/web/packages/teleport/src/services/databases/databases.ts index 4fa028a5b2f5f..72649f7199c46 100644 --- a/web/packages/teleport/src/services/databases/databases.ts +++ b/web/packages/teleport/src/services/databases/databases.ts @@ -16,18 +16,17 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg, { UrlResourcesParams } from 'teleport/config'; import { ResourcesResponse } from 'teleport/services/agents'; +import api from 'teleport/services/api'; import { makeDatabase, makeDatabaseService } from './makeDatabase'; - import type { CreateDatabaseRequest, Database, - UpdateDatabaseRequest, DatabaseIamPolicyResponse, DatabaseServicesResponse, + UpdateDatabaseRequest, } from './types'; class DatabaseService { diff --git a/web/packages/teleport/src/services/desktops/desktops.ts b/web/packages/teleport/src/services/desktops/desktops.ts index 28ae88d04b3a4..45a7ae1c9fb4b 100644 --- a/web/packages/teleport/src/services/desktops/desktops.ts +++ b/web/packages/teleport/src/services/desktops/desktops.ts @@ -16,12 +16,11 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg, { UrlResourcesParams } from 'teleport/config'; import { ResourcesResponse } from 'teleport/services/agents'; +import api from 'teleport/services/api'; import { makeDesktop, makeDesktopService } from './makeDesktop'; - import type { Desktop, WindowsDesktopService } from './types'; class DesktopService { diff --git a/web/packages/teleport/src/services/discovery/discovery.ts b/web/packages/teleport/src/services/discovery/discovery.ts index bef90e31971c3..50aa5f412378d 100644 --- a/web/packages/teleport/src/services/discovery/discovery.ts +++ b/web/packages/teleport/src/services/discovery/discovery.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { AwsMatcher, DiscoveryConfig } from './types'; diff --git a/web/packages/teleport/src/services/history/history.ts b/web/packages/teleport/src/services/history/history.ts index 1789b54c90ec1..59c600eabe9e4 100644 --- a/web/packages/teleport/src/services/history/history.ts +++ b/web/packages/teleport/src/services/history/history.ts @@ -16,14 +16,11 @@ * along with this program. If not, see . */ -import { createBrowserHistory } from 'history'; - +import { createBrowserHistory, type History } from 'history'; import { matchPath } from 'react-router'; import cfg from 'teleport/config'; -import type { History } from 'history'; - let _inst: History = null; const history = { diff --git a/web/packages/teleport/src/services/history/index.ts b/web/packages/teleport/src/services/history/index.ts index 1e141127f8dfc..f54c53cf04bf0 100644 --- a/web/packages/teleport/src/services/history/index.ts +++ b/web/packages/teleport/src/services/history/index.ts @@ -17,5 +17,6 @@ */ import service, { getUrlParameter } from './history'; + export default service; export { getUrlParameter }; diff --git a/web/packages/teleport/src/services/integrations/integrations.test.ts b/web/packages/teleport/src/services/integrations/integrations.test.ts index ed9e65c7d9d2c..d565bb9927434 100644 --- a/web/packages/teleport/src/services/integrations/integrations.test.ts +++ b/web/packages/teleport/src/services/integrations/integrations.test.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { integrationService } from './integrations'; import { IntegrationStatusCode } from './types'; diff --git a/web/packages/teleport/src/services/integrations/integrations.ts b/web/packages/teleport/src/services/integrations/integrations.ts index 73d3b0baf9723..783bc7b0fdad3 100644 --- a/web/packages/teleport/src/services/integrations/integrations.ts +++ b/web/packages/teleport/src/services/integrations/integrations.ts @@ -16,49 +16,48 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; -import makeNode from '../nodes/makeNode'; -import auth from '../auth/auth'; import { App } from '../apps'; import makeApp from '../apps/makeApps'; - +import auth from '../auth/auth'; +import makeNode from '../nodes/makeNode'; import { - Integration, - IntegrationCreateRequest, - IntegrationUpdateRequest, - IntegrationStatusCode, - IntegrationListResponse, + AwsDatabaseVpcsResponse, + AwsOidcDeployDatabaseServicesRequest, + AwsOidcDeployServiceRequest, AwsOidcListDatabasesRequest, + AwsOidcPingRequest, + AwsOidcPingResponse, AwsRdsDatabase, - ListAwsRdsDatabaseResponse, - RdsEngineIdentifier, - AwsOidcDeployServiceRequest, - ListEc2InstancesRequest, - ListEc2InstancesResponse, - Ec2InstanceConnectEndpoint, - ListEc2InstanceConnectEndpointsRequest, - ListEc2InstanceConnectEndpointsResponse, - ListAwsSecurityGroupsRequest, - ListAwsSecurityGroupsResponse, DeployEc2InstanceConnectEndpointRequest, DeployEc2InstanceConnectEndpointResponse, - SecurityGroup, - SecurityGroupRule, - ListEksClustersResponse, - EnrollEksClustersResponse, + Ec2InstanceConnectEndpoint, EnrollEksClustersRequest, - ListEksClustersRequest, - AwsOidcDeployDatabaseServicesRequest, - Regions, + EnrollEksClustersResponse, + Integration, + IntegrationCreateRequest, + IntegrationListResponse, + IntegrationStatusCode, + IntegrationUpdateRequest, + ListAwsRdsDatabaseResponse, ListAwsRdsFromAllEnginesResponse, + ListAwsSecurityGroupsRequest, + ListAwsSecurityGroupsResponse, ListAwsSubnetsRequest, ListAwsSubnetsResponse, + ListEc2InstanceConnectEndpointsRequest, + ListEc2InstanceConnectEndpointsResponse, + ListEc2InstancesRequest, + ListEc2InstancesResponse, + ListEksClustersRequest, + ListEksClustersResponse, + RdsEngineIdentifier, + Regions, + SecurityGroup, + SecurityGroupRule, Subnet, - AwsDatabaseVpcsResponse, - AwsOidcPingResponse, - AwsOidcPingRequest, } from './types'; export const integrationService = { diff --git a/web/packages/teleport/src/services/joinToken/joinToken.test.ts b/web/packages/teleport/src/services/joinToken/joinToken.test.ts index 8b259db20f84a..1f941345c1006 100644 --- a/web/packages/teleport/src/services/joinToken/joinToken.test.ts +++ b/web/packages/teleport/src/services/joinToken/joinToken.test.ts @@ -16,11 +16,10 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import JoinTokenService from './joinToken'; - import type { JoinTokenRequest } from './types'; test('fetchJoinToken with an empty request properly sets defaults', () => { diff --git a/web/packages/teleport/src/services/joinToken/joinToken.ts b/web/packages/teleport/src/services/joinToken/joinToken.ts index 759ae40595cbb..fe564b4440dae 100644 --- a/web/packages/teleport/src/services/joinToken/joinToken.ts +++ b/web/packages/teleport/src/services/joinToken/joinToken.ts @@ -16,13 +16,12 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { makeLabelMapOfStrArrs } from '../agents/make'; - import makeJoinToken from './makeJoinToken'; -import { JoinToken, JoinRule, JoinTokenRequest } from './types'; +import { JoinRule, JoinToken, JoinTokenRequest } from './types'; const TeleportTokenNameHeader = 'X-Teleport-TokenName'; diff --git a/web/packages/teleport/src/services/joinToken/makeJoinToken.ts b/web/packages/teleport/src/services/joinToken/makeJoinToken.ts index 57a134dfe3588..92ab74bc6f53f 100644 --- a/web/packages/teleport/src/services/joinToken/makeJoinToken.ts +++ b/web/packages/teleport/src/services/joinToken/makeJoinToken.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { formatDistanceStrict, differenceInYears } from 'date-fns'; +import { differenceInYears, formatDistanceStrict } from 'date-fns'; import type { JoinToken } from './types'; diff --git a/web/packages/teleport/src/services/kube/kube.ts b/web/packages/teleport/src/services/kube/kube.ts index 82886438aba9c..737a10ed3cb21 100644 --- a/web/packages/teleport/src/services/kube/kube.ts +++ b/web/packages/teleport/src/services/kube/kube.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg, { UrlKubeResourcesParams, UrlResourcesParams, } from 'teleport/config'; import { ResourcesResponse } from 'teleport/services/agents'; +import api from 'teleport/services/api'; -import { Kube, KubeResourceResponse } from './types'; import { makeKube, makeKubeResource } from './makeKube'; +import { Kube, KubeResourceResponse } from './types'; class KubeService { fetchKubernetes( diff --git a/web/packages/teleport/src/services/kube/types.ts b/web/packages/teleport/src/services/kube/types.ts index 735dfd45b1459..db922c38f6127 100644 --- a/web/packages/teleport/src/services/kube/types.ts +++ b/web/packages/teleport/src/services/kube/types.ts @@ -17,6 +17,7 @@ */ import { ResourceLabel } from 'teleport/services/agents'; + export interface Kube { kind: 'kube_cluster'; name: string; diff --git a/web/packages/teleport/src/services/locks/locks.ts b/web/packages/teleport/src/services/locks/locks.ts index aac061091adfb..4dda74a631a4b 100644 --- a/web/packages/teleport/src/services/locks/locks.ts +++ b/web/packages/teleport/src/services/locks/locks.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { CreateLockRequest, Lock } from './types'; diff --git a/web/packages/teleport/src/services/mfa/mfa.ts b/web/packages/teleport/src/services/mfa/mfa.ts index 7d7838f0777a7..20a911232aefe 100644 --- a/web/packages/teleport/src/services/mfa/mfa.ts +++ b/web/packages/teleport/src/services/mfa/mfa.ts @@ -20,13 +20,13 @@ import cfg from 'teleport/config'; import api from 'teleport/services/api'; import auth, { makeWebauthnCreationResponse } from 'teleport/services/auth'; +import makeMfaDevice from './makeMfaDevice'; import { - MfaDevice, - AddNewTotpDeviceRequest, AddNewHardwareDeviceRequest, + AddNewTotpDeviceRequest, + MfaDevice, SaveNewHardwareDeviceRequest, } from './types'; -import makeMfaDevice from './makeMfaDevice'; class MfaService { fetchDevicesWithToken(tokenId: string): Promise { diff --git a/web/packages/teleport/src/services/nodes/makeNode.ts b/web/packages/teleport/src/services/nodes/makeNode.ts index 43c631e52240c..b53a3df092782 100644 --- a/web/packages/teleport/src/services/nodes/makeNode.ts +++ b/web/packages/teleport/src/services/nodes/makeNode.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { Node, AwsMetadata } from './types'; +import { AwsMetadata, Node } from './types'; export default function makeNode(json: any): Node { json = json ?? {}; diff --git a/web/packages/teleport/src/services/nodes/nodes.ts b/web/packages/teleport/src/services/nodes/nodes.ts index f5617b5c740c6..50bf21c2f55bf 100644 --- a/web/packages/teleport/src/services/nodes/nodes.ts +++ b/web/packages/teleport/src/services/nodes/nodes.ts @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg, { UrlResourcesParams } from 'teleport/config'; import { ResourcesResponse } from 'teleport/services/agents'; +import api from 'teleport/services/api'; -import { Node, CreateNodeRequest } from './types'; import makeNode from './makeNode'; +import { CreateNodeRequest, Node } from './types'; export default class NodeService { fetchNodes( diff --git a/web/packages/teleport/src/services/recordings/makeRecording.ts b/web/packages/teleport/src/services/recordings/makeRecording.ts index 9e1c89913d04b..6d0b67a279316 100644 --- a/web/packages/teleport/src/services/recordings/makeRecording.ts +++ b/web/packages/teleport/src/services/recordings/makeRecording.ts @@ -18,9 +18,8 @@ import { differenceInMilliseconds, formatDistanceStrict } from 'date-fns'; -import { eventCodes } from 'teleport/services/audit'; - import cfg from 'teleport/config'; +import { eventCodes } from 'teleport/services/audit'; import { Recording } from './types'; diff --git a/web/packages/teleport/src/services/recordings/recordings.ts b/web/packages/teleport/src/services/recordings/recordings.ts index ba71160aa1795..ff4779c334dd3 100644 --- a/web/packages/teleport/src/services/recordings/recordings.ts +++ b/web/packages/teleport/src/services/recordings/recordings.ts @@ -19,8 +19,8 @@ import cfg from 'teleport/config'; import api from 'teleport/services/api'; -import { RecordingsQuery, RecordingsResponse } from './types'; import { makeRecording } from './makeRecording'; +import { RecordingsQuery, RecordingsResponse } from './types'; export default class RecordingsService { maxFetchLimit = 5000; diff --git a/web/packages/teleport/src/services/resources/makeResource.ts b/web/packages/teleport/src/services/resources/makeResource.ts index 105284bf3d619..cd9984b581699 100644 --- a/web/packages/teleport/src/services/resources/makeResource.ts +++ b/web/packages/teleport/src/services/resources/makeResource.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { Resource, Kind } from './types'; +import { Kind, Resource } from './types'; export function makeResource(json: any): Resource { json = json || {}; diff --git a/web/packages/teleport/src/services/resources/resource.ts b/web/packages/teleport/src/services/resources/resource.ts index 406b131b16389..ff8a0f0c595b0 100644 --- a/web/packages/teleport/src/services/resources/resource.ts +++ b/web/packages/teleport/src/services/resources/resource.ts @@ -16,14 +16,12 @@ * along with this program. If not, see . */ +import cfg, { UrlListRolesParams, UrlResourcesParams } from 'teleport/config'; import api from 'teleport/services/api'; -import cfg, { UrlResourcesParams, UrlListRolesParams } from 'teleport/config'; - -import { UnifiedResource, ResourcesResponse } from '../agents'; - -import { makeUnifiedResource } from './makeUnifiedResource'; +import { ResourcesResponse, UnifiedResource } from '../agents'; import { makeResource, makeResourceList, RoleResource } from './'; +import { makeUnifiedResource } from './makeUnifiedResource'; class ResourceService { fetchTrustedClusters() { diff --git a/web/packages/teleport/src/services/session/makeSession.ts b/web/packages/teleport/src/services/session/makeSession.ts index 5191401f1bf96..685e590afac2f 100644 --- a/web/packages/teleport/src/services/session/makeSession.ts +++ b/web/packages/teleport/src/services/session/makeSession.ts @@ -18,7 +18,7 @@ import { formatDistanceStrict } from 'date-fns'; -import { Session, SessionKind, Participant } from './types'; +import { Participant, Session, SessionKind } from './types'; const nameField: { [kind in SessionKind]: string } = { ssh: 'server_hostname', diff --git a/web/packages/teleport/src/services/session/session.ts b/web/packages/teleport/src/services/session/session.ts index 8640e697eddae..7ce2a5ba0a049 100644 --- a/web/packages/teleport/src/services/session/session.ts +++ b/web/packages/teleport/src/services/session/session.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import makeSession, { makeParticipant } from './makeSession'; import { ParticipantList } from './types'; diff --git a/web/packages/teleport/src/services/storageService/storageService.ts b/web/packages/teleport/src/services/storageService/storageService.ts index 644543046f59d..c01957de2f682 100644 --- a/web/packages/teleport/src/services/storageService/storageService.ts +++ b/web/packages/teleport/src/services/storageService/storageService.ts @@ -16,27 +16,22 @@ * along with this program. If not, see . */ -import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; - -import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; - -import { OnboardUserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; - import { getPrefersDark } from 'design/ThemeProvider'; +import { OnboardUserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; +import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; +import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; -import { BearerToken } from 'teleport/services/websession'; import { OnboardDiscover } from 'teleport/services/user'; - import { BackendUserPreferences, convertBackendUserPreferences, isBackendUserPreferences, } from 'teleport/services/userPreferences/userPreferences'; +import { BearerToken } from 'teleport/services/websession'; +import type { RecommendFeature } from 'teleport/types'; import { CloudUserInvites, KeysEnum, LocalStorageSurvey } from './types'; -import type { RecommendFeature } from 'teleport/types'; - // This is an array of local storage `KeysEnum` that are kept when a user logs out const KEEP_LOCALSTORAGE_KEYS_ON_LOGOUT = [ KeysEnum.THEME, diff --git a/web/packages/teleport/src/services/user/index.ts b/web/packages/teleport/src/services/user/index.ts index 2dc403edb9219..9501adb11d88d 100644 --- a/web/packages/teleport/src/services/user/index.ts +++ b/web/packages/teleport/src/services/user/index.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -import service from './user'; import makeUser from './makeUser'; import makeUserContext from './makeUserContext'; +import service from './user'; export { makeUserContext, makeUser }; export * from './types'; diff --git a/web/packages/teleport/src/services/user/makeUserContext.ts b/web/packages/teleport/src/services/user/makeUserContext.ts index 9aab4e2c9602b..7e0598cd776f5 100644 --- a/web/packages/teleport/src/services/user/makeUserContext.ts +++ b/web/packages/teleport/src/services/user/makeUserContext.ts @@ -17,9 +17,8 @@ */ import { makeCluster } from '../clusters'; - import { makeAcl } from './makeAcl'; -import { UserContext, AccessCapabilities, PasswordState } from './types'; +import { AccessCapabilities, PasswordState, UserContext } from './types'; export default function makeUserContext(json: any): UserContext { json = json || {}; diff --git a/web/packages/teleport/src/services/user/user.test.ts b/web/packages/teleport/src/services/user/user.test.ts index 39153be22c668..d3e5e69e4557a 100644 --- a/web/packages/teleport/src/services/user/user.test.ts +++ b/web/packages/teleport/src/services/user/user.test.ts @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; -import user from './user'; import { makeTraits } from './makeUser'; import { Acl, ExcludeUserField, PasswordState, User } from './types'; +import user from './user'; test('undefined values in context response gives proper default values', async () => { const mockContext = { diff --git a/web/packages/teleport/src/services/user/user.ts b/web/packages/teleport/src/services/user/user.ts index 5584159528580..ce1c9328278ee 100644 --- a/web/packages/teleport/src/services/user/user.ts +++ b/web/packages/teleport/src/services/user/user.ts @@ -16,20 +16,19 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import session from 'teleport/services/websession'; import { WebauthnAssertionResponse } from '../auth'; - -import makeUserContext from './makeUserContext'; import { makeResetToken } from './makeResetToken'; import makeUser, { makeUsers } from './makeUser'; +import makeUserContext from './makeUserContext'; import { + ExcludeUserField, + ResetPasswordType, User, UserContext, - ResetPasswordType, - ExcludeUserField, } from './types'; const cache = { diff --git a/web/packages/teleport/src/services/userEvent/userEvent.ts b/web/packages/teleport/src/services/userEvent/userEvent.ts index c6ab80d54bcca..05e8118c4f95d 100644 --- a/web/packages/teleport/src/services/userEvent/userEvent.ts +++ b/web/packages/teleport/src/services/userEvent/userEvent.ts @@ -16,17 +16,17 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { - UserEvent, - PreUserEvent, - DiscoverEventRequest, - CtaEvent, CaptureEvent, - IntegrationEnrollEventRequest, + CtaEvent, + DiscoverEventRequest, FeatureRecommendationEvent, + IntegrationEnrollEventRequest, + PreUserEvent, + UserEvent, } from './types'; export const userEventService = { diff --git a/web/packages/teleport/src/services/userGroups/usergroups.ts b/web/packages/teleport/src/services/userGroups/usergroups.ts index 64486202ee38f..54fd4b3da16ea 100644 --- a/web/packages/teleport/src/services/userGroups/usergroups.ts +++ b/web/packages/teleport/src/services/userGroups/usergroups.ts @@ -16,12 +16,11 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg, { UrlResourcesParams } from 'teleport/config'; import { ResourcesResponse } from 'teleport/services/agents'; +import api from 'teleport/services/api'; import { makeUserGroup } from './makeUserGroup'; - import type { UserGroup } from './types'; class UserGroupService { diff --git a/web/packages/teleport/src/services/userPreferences/userPreferences.ts b/web/packages/teleport/src/services/userPreferences/userPreferences.ts index d19ef1d7af192..d9f789a30f8ec 100644 --- a/web/packages/teleport/src/services/userPreferences/userPreferences.ts +++ b/web/packages/teleport/src/services/userPreferences/userPreferences.ts @@ -16,24 +16,19 @@ * along with this program. If not, see . */ +import { getPrefersDark } from 'design/ThemeProvider'; +import { ClusterUserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/cluster_preferences_pb'; +import { OnboardUserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; +import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; import { + AvailableResourceMode, DefaultTab, LabelsViewMode, UnifiedResourcePreferences, ViewMode, - AvailableResourceMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; - import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpreferences_pb'; -import { ClusterUserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/cluster_preferences_pb'; - -import { Theme } from 'gen-proto-ts/teleport/userpreferences/v1/theme_pb'; - -import { OnboardUserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/onboard_pb'; - -import { getPrefersDark } from 'design/ThemeProvider'; - import cfg from 'teleport/config'; import api from 'teleport/services/api'; diff --git a/web/packages/teleport/src/services/websession/websession.ts b/web/packages/teleport/src/services/websession/websession.ts index 59f6217097385..f0e54c6841780 100644 --- a/web/packages/teleport/src/services/websession/websession.ts +++ b/web/packages/teleport/src/services/websession/websession.ts @@ -19,8 +19,8 @@ import Logger from 'shared/libs/logger'; import cfg from 'teleport/config'; -import history from 'teleport/services/history'; import api from 'teleport/services/api'; +import history from 'teleport/services/history'; import { KeysEnum, storageService } from 'teleport/services/storageService'; import makeBearerToken from './makeBearerToken'; diff --git a/web/packages/teleport/src/services/yaml/yaml.ts b/web/packages/teleport/src/services/yaml/yaml.ts index f94e6eb2c6c56..3a26ff3656531 100644 --- a/web/packages/teleport/src/services/yaml/yaml.ts +++ b/web/packages/teleport/src/services/yaml/yaml.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import api from 'teleport/services/api'; import cfg from 'teleport/config'; +import api from 'teleport/services/api'; import { YamlParseRequest, diff --git a/web/packages/teleport/src/stores/index.ts b/web/packages/teleport/src/stores/index.ts index b90d571c9a5a1..9f26e00f28ed8 100644 --- a/web/packages/teleport/src/stores/index.ts +++ b/web/packages/teleport/src/stores/index.ts @@ -17,7 +17,7 @@ */ import StoreNav, { defaultNavState } from './storeNav'; -import StoreUserContext from './storeUserContext'; import { StoreNotifications } from './storeNotifications'; +import StoreUserContext from './storeUserContext'; export { StoreNav, StoreUserContext, StoreNotifications, defaultNavState }; diff --git a/web/packages/teleport/src/stores/storeUserContext.ts b/web/packages/teleport/src/stores/storeUserContext.ts index c6fdb6839019e..b6ed1a2193c14 100644 --- a/web/packages/teleport/src/stores/storeUserContext.ts +++ b/web/packages/teleport/src/stores/storeUserContext.ts @@ -19,7 +19,6 @@ import { Store } from 'shared/libs/stores'; import cfg from 'teleport/config'; - import { UserContext } from 'teleport/services/user'; export default class StoreUserContext extends Store { diff --git a/web/packages/teleport/src/telemetry-boot.ts b/web/packages/teleport/src/telemetry-boot.ts index c94325f483026..201b70655f37b 100644 --- a/web/packages/teleport/src/telemetry-boot.ts +++ b/web/packages/teleport/src/telemetry-boot.ts @@ -16,25 +16,25 @@ * along with this program. If not, see . */ -import { Resource } from '@opentelemetry/resources'; -import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; -import { WebTracerProvider } from '@opentelemetry/sdk-trace-web'; -import { registerInstrumentations } from '@opentelemetry/instrumentation'; +import { ZoneContextManager } from '@opentelemetry/context-zone'; import { - ConsoleSpanExporter, - BatchSpanProcessor, -} from '@opentelemetry/sdk-trace-base'; + CompositePropagator, + W3CTraceContextPropagator, +} from '@opentelemetry/core'; import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'; +import { registerInstrumentations } from '@opentelemetry/instrumentation'; import { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load'; -import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request'; import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch'; -import { B3Propagator } from '@opentelemetry/propagator-b3'; import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction'; +import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request'; +import { B3Propagator } from '@opentelemetry/propagator-b3'; +import { Resource } from '@opentelemetry/resources'; import { - CompositePropagator, - W3CTraceContextPropagator, -} from '@opentelemetry/core'; -import { ZoneContextManager } from '@opentelemetry/context-zone'; + BatchSpanProcessor, + ConsoleSpanExporter, +} from '@opentelemetry/sdk-trace-base'; +import { WebTracerProvider } from '@opentelemetry/sdk-trace-web'; +import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; export function instantiateTelemetry() { registerInstrumentations({ diff --git a/web/packages/teleport/src/teleportContext.tsx b/web/packages/teleport/src/teleportContext.tsx index 44b39b1276ad4..ad4d8af34761d 100644 --- a/web/packages/teleport/src/teleportContext.tsx +++ b/web/packages/teleport/src/teleportContext.tsx @@ -20,26 +20,26 @@ import { UserPreferences } from 'gen-proto-ts/teleport/userpreferences/v1/userpr import cfg from 'teleport/config'; -import { StoreNav, StoreNotifications, StoreUserContext } from './stores'; -import * as types from './types'; -import AuditService from './services/audit'; -import RecordingsService from './services/recordings'; -import NodeService from './services/nodes'; -import sessionService from './services/session'; -import ResourceService from './services/resources'; -import userService from './services/user'; +import { notificationContentFactory } from './Notifications'; +import { agentService } from './services/agents'; import appService from './services/apps'; -import JoinTokenService from './services/joinToken'; -import KubeService from './services/kube'; +import AuditService from './services/audit'; +import ClustersService from './services/clusters/clusters'; import DatabaseService from './services/databases'; import desktopService from './services/desktops'; -import userGroupService from './services/userGroups'; +import JoinTokenService from './services/joinToken'; +import KubeService from './services/kube'; import MfaService from './services/mfa'; -import { agentService } from './services/agents'; -import { storageService } from './services/storageService'; -import ClustersService from './services/clusters/clusters'; +import NodeService from './services/nodes'; import { NotificationService } from './services/notifications'; -import { notificationContentFactory } from './Notifications'; +import RecordingsService from './services/recordings'; +import ResourceService from './services/resources'; +import sessionService from './services/session'; +import { storageService } from './services/storageService'; +import userService from './services/user'; +import userGroupService from './services/userGroups'; +import { StoreNav, StoreNotifications, StoreUserContext } from './stores'; +import * as types from './types'; class TeleportContext implements types.Context { // stores diff --git a/web/packages/teleport/src/useStickyClusterId.ts b/web/packages/teleport/src/useStickyClusterId.ts index b7d57d817a02c..d1cc6a3978bc9 100644 --- a/web/packages/teleport/src/useStickyClusterId.ts +++ b/web/packages/teleport/src/useStickyClusterId.ts @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { useRouteMatch } from 'react-router'; import { useRef } from 'react'; +import { useRouteMatch } from 'react-router'; -import { StickyCluster } from 'teleport/types'; import cfg from 'teleport/config'; +import { StickyCluster } from 'teleport/types'; // useStickyClusterId determines the current :clusterId in the URL. // When a route contains `:clusterId` it can refer to the root or the leaf cluster. diff --git a/web/packages/teleterm/electron.vite.config.mts b/web/packages/teleterm/electron.vite.config.mts index 926fc20b307cb..fbc6f5c840e8e 100644 --- a/web/packages/teleterm/electron.vite.config.mts +++ b/web/packages/teleterm/electron.vite.config.mts @@ -19,14 +19,13 @@ import path from 'node:path'; import { defineConfig, externalizeDepsPlugin, UserConfig } from 'electron-vite'; +import type { Plugin } from 'vite'; import { reactPlugin } from '@gravitational/build/vite/react.mjs'; import { tsconfigPathsPlugin } from '@gravitational/build/vite/tsconfigPaths.mjs'; import { getConnectCsp } from './csp'; -import type { Plugin } from 'vite'; - const rootDirectory = path.resolve(__dirname, '../../..'); const outputDirectory = path.resolve(__dirname, 'build', 'app'); diff --git a/web/packages/teleterm/src/agentCleanupDaemon/agentCleanupDaemon.test.ts b/web/packages/teleterm/src/agentCleanupDaemon/agentCleanupDaemon.test.ts index 4a9d7001a61f1..d62d6e602e64c 100644 --- a/web/packages/teleterm/src/agentCleanupDaemon/agentCleanupDaemon.test.ts +++ b/web/packages/teleterm/src/agentCleanupDaemon/agentCleanupDaemon.test.ts @@ -20,10 +20,10 @@ */ import childProcess from 'node:child_process'; -import path from 'node:path'; -import process from 'node:process'; import fs from 'node:fs/promises'; import { tmpdir } from 'node:os'; +import path from 'node:path'; +import process from 'node:process'; const stdio = 'pipe'; // Change to 'inherit' for easier debugging. diff --git a/web/packages/teleterm/src/deepLinks.ts b/web/packages/teleterm/src/deepLinks.ts index c11d12017c468..727dc85cf8a52 100644 --- a/web/packages/teleterm/src/deepLinks.ts +++ b/web/packages/teleterm/src/deepLinks.ts @@ -17,12 +17,13 @@ */ import * as whatwg from 'whatwg-url'; + import { + AuthenticateWebDeviceDeepURL, + ConnectMyComputerDeepURL, CUSTOM_PROTOCOL, - Path, DeepURL, - ConnectMyComputerDeepURL, - AuthenticateWebDeviceDeepURL, + Path, } from 'shared/deepLinks'; export type DeepLinkParseResult = diff --git a/web/packages/teleterm/src/helpers.ts b/web/packages/teleterm/src/helpers.ts index b952209937038..cd48760163d6e 100644 --- a/web/packages/teleterm/src/helpers.ts +++ b/web/packages/teleterm/src/helpers.ts @@ -18,14 +18,17 @@ // ExcludesFalse is a method that can be used instead of [].filter(Boolean) // this removes the false values from the array type -import { PaginatedResource } from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; -import { Server } from 'gen-proto-ts/teleport/lib/teleterm/v1/server_pb'; -import { Database } from 'gen-proto-ts/teleport/lib/teleterm/v1/database_pb'; import { App } from 'gen-proto-ts/teleport/lib/teleterm/v1/app_pb'; +import { Database } from 'gen-proto-ts/teleport/lib/teleterm/v1/database_pb'; import { Kube } from 'gen-proto-ts/teleport/lib/teleterm/v1/kube_pb'; - +import { Server } from 'gen-proto-ts/teleport/lib/teleterm/v1/server_pb'; +import { PaginatedResource } from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; import * as api from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; +import { + ReloginRequest, + SendNotificationRequest, +} from 'teleterm/services/tshdEvents'; import { PtyClientEvent, PtyEventData, @@ -35,10 +38,6 @@ import { PtyEventStartError, PtyServerEvent, } from 'teleterm/sharedProcess/api/protogen/ptyHostService_pb'; -import { - ReloginRequest, - SendNotificationRequest, -} from 'teleterm/services/tshdEvents'; export function resourceOneOfIsServer( resource: PaginatedResource['resource'] diff --git a/web/packages/teleterm/src/logger.ts b/web/packages/teleterm/src/logger.ts index a867a2bc20de1..e215653fa1304 100644 --- a/web/packages/teleterm/src/logger.ts +++ b/web/packages/teleterm/src/logger.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import * as types from 'teleterm/types'; import { LoggerService } from 'teleterm/services/logger/types'; +import * as types from 'teleterm/types'; export default class Logger { private static service: types.LoggerService; diff --git a/web/packages/teleterm/src/main.ts b/web/packages/teleterm/src/main.ts index 6d00ecf561786..7b0586265cb7c 100644 --- a/web/packages/teleterm/src/main.ts +++ b/web/packages/teleterm/src/main.ts @@ -20,25 +20,25 @@ import { spawn } from 'node:child_process'; import os from 'node:os'; import path from 'node:path'; -import { app, dialog, globalShortcut, shell, nativeTheme } from 'electron'; +import { app, dialog, globalShortcut, nativeTheme, shell } from 'electron'; import { CUSTOM_PROTOCOL } from 'shared/deepLinks'; +import { parseDeepLink } from 'teleterm/deepLinks'; +import Logger from 'teleterm/logger'; import MainProcess from 'teleterm/mainProcess'; -import { getRuntimeSettings } from 'teleterm/mainProcess/runtimeSettings'; import { enableWebHandlersProtection } from 'teleterm/mainProcess/protocolHandler'; -import { LoggerColor, createFileLoggerService } from 'teleterm/services/logger'; -import Logger from 'teleterm/logger'; -import * as types from 'teleterm/types'; +import { manageRootClusterProxyHostAllowList } from 'teleterm/mainProcess/rootClusterProxyHostAllowList'; +import { getRuntimeSettings } from 'teleterm/mainProcess/runtimeSettings'; +import { WindowsManager } from 'teleterm/mainProcess/windowsManager'; import { createConfigService, runConfigFileMigration, } from 'teleterm/services/config'; import { createFileStorage } from 'teleterm/services/fileStorage'; -import { WindowsManager } from 'teleterm/mainProcess/windowsManager'; -import { parseDeepLink } from 'teleterm/deepLinks'; +import { createFileLoggerService, LoggerColor } from 'teleterm/services/logger'; +import * as types from 'teleterm/types'; import { assertUnreachable } from 'teleterm/ui/utils'; -import { manageRootClusterProxyHostAllowList } from 'teleterm/mainProcess/rootClusterProxyHostAllowList'; if (!app.isPackaged) { // Sets app name and data directories to Electron. diff --git a/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.test.ts b/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.test.ts index 4e9475dde1e26..fe333275f7a0f 100644 --- a/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.test.ts +++ b/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.test.ts @@ -22,9 +22,9 @@ /* eslint jest/no-conditional-expect: 0 */ import childProcess from 'node:child_process'; -import { PassThrough } from 'node:stream'; import fs from 'node:fs'; import fsPromises from 'node:fs/promises'; +import { PassThrough } from 'node:stream'; import zlib from 'node:zlib'; import tarFs from 'tar-fs'; @@ -32,9 +32,7 @@ import tarFs from 'tar-fs'; import Logger, { NullService } from 'teleterm/logger'; import { makeRuntimeSettings } from '../fixtures/mocks'; - import { downloadAgent } from './agentDownloader'; - import type { IFileDownloader } from './fileDownloader'; jest.mock('node:child_process'); diff --git a/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.ts b/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.ts index 56c66c5822415..23d989669c004 100644 --- a/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.ts +++ b/web/packages/teleterm/src/mainProcess/agentDownloader/agentDownloader.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -import { pipeline } from 'node:stream/promises'; +import { execFile } from 'node:child_process'; import { createReadStream } from 'node:fs'; import fs from 'node:fs/promises'; import path from 'node:path'; -import { createUnzip } from 'node:zlib'; -import { execFile } from 'node:child_process'; +import { pipeline } from 'node:stream/promises'; import { promisify } from 'node:util'; +import { createUnzip } from 'node:zlib'; import { extract } from 'tar-fs'; @@ -31,7 +31,6 @@ import { compareSemVers } from 'shared/utils/semVer'; import Logger from 'teleterm/logger'; import { RuntimeSettings } from '../types'; - import type { IFileDownloader } from './fileDownloader'; const TELEPORT_CDN_ADDRESS = 'https://cdn.teleport.dev'; diff --git a/web/packages/teleterm/src/mainProcess/agentDownloader/fileDownloader.test.ts b/web/packages/teleterm/src/mainProcess/agentDownloader/fileDownloader.test.ts index 7f9af2d97c133..d743e0205c9f8 100644 --- a/web/packages/teleterm/src/mainProcess/agentDownloader/fileDownloader.test.ts +++ b/web/packages/teleterm/src/mainProcess/agentDownloader/fileDownloader.test.ts @@ -21,12 +21,12 @@ import EventEmitter from 'events'; +import type { BrowserWindow, DownloadItem } from 'electron'; + import Logger, { NullService } from 'teleterm/logger'; import { FileDownloader } from './fileDownloader'; -import type { DownloadItem, BrowserWindow } from 'electron'; - const DOWNLOAD_DIR = '/temp'; const FILE_NAME = 'teleport-v13.1.0-darwin-arm64-bin.tar.gz'; const URL = `https://cdn.teleport.dev/${FILE_NAME}`; diff --git a/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.test.ts b/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.test.ts index 56bffc9b50613..da7bcd984fb79 100644 --- a/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.test.ts +++ b/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.test.ts @@ -19,17 +19,16 @@ * along with this program. If not, see . */ -import path from 'node:path'; import childProcess, { ChildProcess } from 'node:child_process'; import fs from 'node:fs/promises'; import { tmpdir } from 'node:os'; +import path from 'node:path'; import Logger, { NullService } from 'teleterm/logger'; import { RootClusterUri } from 'teleterm/ui/uri'; import * as mocks from '../fixtures/mocks'; import { AgentProcessState, RuntimeSettings } from '../types'; - import { AgentRunner } from './agentRunner'; const makeRuntimeSettings = (settings?: Partial) => diff --git a/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.ts b/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.ts index 484634ac00b33..32fce2236c44e 100644 --- a/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.ts +++ b/web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.ts @@ -16,19 +16,19 @@ * along with this program. If not, see . */ -import { spawn, fork, ChildProcess } from 'node:child_process'; -import os from 'node:os'; +import { ChildProcess, fork, spawn } from 'node:child_process'; import fs from 'node:fs/promises'; +import os from 'node:os'; import stripAnsi from 'strip-ansi'; import Logger from 'teleterm/logger'; -import { RootClusterUri } from 'teleterm/ui/uri'; import { createFileLoggerService, LoggerColor } from 'teleterm/services/logger'; +import { RootClusterUri } from 'teleterm/ui/uri'; import { generateAgentConfigPaths } from '../createAgentConfigFile'; -import { AgentProcessState, RuntimeSettings } from '../types'; import { terminateWithTimeout } from '../terminateWithTimeout'; +import { AgentProcessState, RuntimeSettings } from '../types'; const MAX_STDERR_LINES = 10; diff --git a/web/packages/teleterm/src/mainProcess/contextMenus/tabContextMenu.ts b/web/packages/teleterm/src/mainProcess/contextMenus/tabContextMenu.ts index 09dc7dd17655a..7c045a451afa4 100644 --- a/web/packages/teleterm/src/mainProcess/contextMenus/tabContextMenu.ts +++ b/web/packages/teleterm/src/mainProcess/contextMenus/tabContextMenu.ts @@ -17,18 +17,18 @@ */ import { + dialog, ipcMain, ipcRenderer, Menu, MenuItemConstructorOptions, - dialog, } from 'electron'; +import { makeCustomShellFromPath, Shell } from 'teleterm/mainProcess/shell'; import { ConfigService } from 'teleterm/services/config'; -import { Shell, makeCustomShellFromPath } from 'teleterm/mainProcess/shell'; import { - Document, canDocChangeShell, + Document, } from 'teleterm/ui/services/workspacesService'; import { diff --git a/web/packages/teleterm/src/mainProcess/createAgentConfigFile.test.ts b/web/packages/teleterm/src/mainProcess/createAgentConfigFile.test.ts index 30ecda05521bc..07146249d4382 100644 --- a/web/packages/teleterm/src/mainProcess/createAgentConfigFile.test.ts +++ b/web/packages/teleterm/src/mainProcess/createAgentConfigFile.test.ts @@ -22,8 +22,8 @@ import childProcess from 'node:child_process'; import fs from 'node:fs/promises'; -import { RootClusterUri } from 'teleterm/ui/uri'; import { makeRuntimeSettings } from 'teleterm/mainProcess/fixtures/mocks'; +import { RootClusterUri } from 'teleterm/ui/uri'; import { createAgentConfigFile, diff --git a/web/packages/teleterm/src/mainProcess/createAgentConfigFile.ts b/web/packages/teleterm/src/mainProcess/createAgentConfigFile.ts index 4345563e3ee7f..92e010ae81db5 100644 --- a/web/packages/teleterm/src/mainProcess/createAgentConfigFile.ts +++ b/web/packages/teleterm/src/mainProcess/createAgentConfigFile.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import { promisify } from 'node:util'; import { execFile } from 'node:child_process'; import fs from 'node:fs/promises'; import path from 'node:path'; +import { promisify } from 'node:util'; import * as connectMyComputer from 'shared/connectMyComputer'; -import { RootClusterUri, routing } from 'teleterm/ui/uri'; import { RuntimeSettings } from 'teleterm/mainProcess/types'; +import { RootClusterUri, routing } from 'teleterm/ui/uri'; export interface CreateAgentConfigFileArgs { rootClusterUri: RootClusterUri; diff --git a/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts b/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts index 9b25a5c0f486b..ef06e2701c025 100644 --- a/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts +++ b/web/packages/teleterm/src/mainProcess/fixtures/mocks.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -import { RuntimeSettings, MainProcessClient } from 'teleterm/types'; -import { createMockFileStorage } from 'teleterm/services/fileStorage/fixtures/mocks'; +import { AgentProcessState } from 'teleterm/mainProcess/types'; // createConfigService has to be imported directly from configService.ts. // teleterm/services/config/index.ts reexports the config service client which depends on electron. // Importing electron breaks the fixtures if that's done from within storybook. import { createConfigService } from 'teleterm/services/config/configService'; -import { AgentProcessState } from 'teleterm/mainProcess/types'; +import { createMockFileStorage } from 'teleterm/services/fileStorage/fixtures/mocks'; +import { MainProcessClient, RuntimeSettings } from 'teleterm/types'; export class MockMainProcessClient implements MainProcessClient { configService: ReturnType; diff --git a/web/packages/teleterm/src/mainProcess/index.ts b/web/packages/teleterm/src/mainProcess/index.ts index c09f0d6d24e27..71ca95795fc76 100644 --- a/web/packages/teleterm/src/mainProcess/index.ts +++ b/web/packages/teleterm/src/mainProcess/index.ts @@ -17,4 +17,5 @@ */ import MainProcess from './mainProcess'; + export default MainProcess; diff --git a/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.test.ts b/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.test.ts index 698d0338337ab..6129e3b472222 100644 --- a/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.test.ts +++ b/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.test.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import fs from 'fs'; import crypto from 'crypto'; +import fs from 'fs'; import { loadInstallationId } from './loadInstallationId'; diff --git a/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.ts b/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.ts index 54f53db905afb..7273cca63b550 100644 --- a/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.ts +++ b/web/packages/teleterm/src/mainProcess/loadInstallationId/loadInstallationId.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import fs from 'fs'; import crypto from 'crypto'; +import fs from 'fs'; const UUID_V4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i; diff --git a/web/packages/teleterm/src/mainProcess/mainProcess.ts b/web/packages/teleterm/src/mainProcess/mainProcess.ts index 2987f4e5c7dc9..e006ab0004a2f 100644 --- a/web/packages/teleterm/src/mainProcess/mainProcess.ts +++ b/web/packages/teleterm/src/mainProcess/mainProcess.ts @@ -16,11 +16,13 @@ * along with this program. If not, see . */ -import { ChildProcess, fork, spawn, exec } from 'node:child_process'; -import path from 'node:path'; +import { ChildProcess, exec, fork, spawn } from 'node:child_process'; import fs from 'node:fs/promises'; +import path from 'node:path'; import { promisify } from 'node:util'; +import { ChannelCredentials } from '@grpc/grpc-js'; +import { GrpcTransport } from '@protobuf-ts/grpc-transport'; import { app, dialog, @@ -30,55 +32,51 @@ import { nativeTheme, shell, } from 'electron'; -import { ChannelCredentials } from '@grpc/grpc-js'; -import { GrpcTransport } from '@protobuf-ts/grpc-transport'; -import { FileStorage, RuntimeSettings } from 'teleterm/types'; -import { subscribeToFileStorageEvents } from 'teleterm/services/fileStorage'; -import { - LoggerColor, - KeepLastChunks, - createFileLoggerService, -} from 'teleterm/services/logger'; +import Logger from 'teleterm/logger'; +import { getAssetPath } from 'teleterm/mainProcess/runtimeSettings'; import { ChildProcessAddresses, MainProcessIpc, RendererIpc, TERMINATE_MESSAGE, } from 'teleterm/mainProcess/types'; -import { getAssetPath } from 'teleterm/mainProcess/runtimeSettings'; -import { RootClusterUri } from 'teleterm/ui/uri'; -import Logger from 'teleterm/logger'; -import * as grpcCreds from 'teleterm/services/grpcCredentials'; -import { createTshdClient, TshdClient } from 'teleterm/services/tshd'; -import { loggingInterceptor } from 'teleterm/services/tshd/interceptors'; -import { staticConfig } from 'teleterm/staticConfig'; import { TSH_AUTOUPDATE_ENV_VAR, TSH_AUTOUPDATE_OFF, } from 'teleterm/node/tshAutoupdate'; +import { subscribeToFileStorageEvents } from 'teleterm/services/fileStorage'; +import * as grpcCreds from 'teleterm/services/grpcCredentials'; +import { + createFileLoggerService, + KeepLastChunks, + LoggerColor, +} from 'teleterm/services/logger'; +import { createTshdClient, TshdClient } from 'teleterm/services/tshd'; +import { loggingInterceptor } from 'teleterm/services/tshd/interceptors'; +import { staticConfig } from 'teleterm/staticConfig'; +import { FileStorage, RuntimeSettings } from 'teleterm/types'; +import { RootClusterUri } from 'teleterm/ui/uri'; import { ConfigService, subscribeToConfigServiceEvents, } from '../services/config'; - -import { subscribeToTerminalContextMenuEvent } from './contextMenus/terminalContextMenu'; +import { downloadAgent, FileDownloader, verifyAgent } from './agentDownloader'; +import { AgentRunner } from './agentRunner'; import { subscribeToTabContextMenuEvent } from './contextMenus/tabContextMenu'; -import { resolveNetworkAddress, ResolveError } from './resolveNetworkAddress'; -import { WindowsManager } from './windowsManager'; -import { downloadAgent, verifyAgent, FileDownloader } from './agentDownloader'; +import { subscribeToTerminalContextMenuEvent } from './contextMenus/terminalContextMenu'; import { - getAgentsDir, createAgentConfigFile, + generateAgentConfigPaths, + getAgentsDir, isAgentConfigFileCreated, removeAgentDirectory, - generateAgentConfigPaths, + type CreateAgentConfigFileArgs, } from './createAgentConfigFile'; -import { AgentRunner } from './agentRunner'; +import { ResolveError, resolveNetworkAddress } from './resolveNetworkAddress'; import { terminateWithTimeout } from './terminateWithTimeout'; - -import type { CreateAgentConfigFileArgs } from './createAgentConfigFile'; +import { WindowsManager } from './windowsManager'; type Options = { settings: RuntimeSettings; diff --git a/web/packages/teleterm/src/mainProcess/mainProcessClient.ts b/web/packages/teleterm/src/mainProcess/mainProcessClient.ts index d70d05facbae6..5592128b215a2 100644 --- a/web/packages/teleterm/src/mainProcess/mainProcessClient.ts +++ b/web/packages/teleterm/src/mainProcess/mainProcessClient.ts @@ -18,19 +18,17 @@ import { ipcRenderer } from 'electron'; -import { createFileStorageClient } from 'teleterm/services/fileStorage'; import { CreateAgentConfigFileArgs } from 'teleterm/mainProcess/createAgentConfigFile'; +import { createFileStorageClient } from 'teleterm/services/fileStorage'; import { RootClusterUri } from 'teleterm/ui/uri'; import { createConfigServiceClient } from '../services/config'; - -import { openTerminalContextMenu } from './contextMenus/terminalContextMenu'; import { openTabContextMenu } from './contextMenus/tabContextMenu'; - +import { openTerminalContextMenu } from './contextMenus/terminalContextMenu'; import { - MainProcessClient, - ChildProcessAddresses, AgentProcessState, + ChildProcessAddresses, + MainProcessClient, MainProcessIpc, RendererIpc, WindowsManagerIpc, diff --git a/web/packages/teleterm/src/mainProcess/protocolHandler.ts b/web/packages/teleterm/src/mainProcess/protocolHandler.ts index 02b1611b6f02a..79526b8e0c52c 100644 --- a/web/packages/teleterm/src/mainProcess/protocolHandler.ts +++ b/web/packages/teleterm/src/mainProcess/protocolHandler.ts @@ -16,11 +16,11 @@ * along with this program. If not, see . */ +import fs from 'fs'; import { fileURLToPath } from 'node:url'; import * as path from 'path'; -import fs from 'fs'; -import { protocol, app } from 'electron'; +import { app, protocol } from 'electron'; import Logger from 'teleterm/logger'; diff --git a/web/packages/teleterm/src/mainProcess/rootClusterProxyHostAllowList.ts b/web/packages/teleterm/src/mainProcess/rootClusterProxyHostAllowList.ts index 979adc3b96545..273e5b6fe7cc9 100644 --- a/web/packages/teleterm/src/mainProcess/rootClusterProxyHostAllowList.ts +++ b/web/packages/teleterm/src/mainProcess/rootClusterProxyHostAllowList.ts @@ -20,12 +20,12 @@ import { ipcMain } from 'electron'; import { isAbortError } from 'shared/utils/abortError'; -import { proxyHostToBrowserProxyHost } from 'teleterm/services/tshd/cluster'; -import { TshdClient } from 'teleterm/services/tshd'; -import { Logger } from 'teleterm/types'; import { MainProcessIpc } from 'teleterm/mainProcess/types'; -import * as tshd from 'teleterm/services/tshd/types'; +import { TshdClient } from 'teleterm/services/tshd'; import { cloneAbortSignal } from 'teleterm/services/tshd/cloneableClient'; +import { proxyHostToBrowserProxyHost } from 'teleterm/services/tshd/cluster'; +import * as tshd from 'teleterm/services/tshd/types'; +import { Logger } from 'teleterm/types'; export type RootClusterProxyHostAllowList = Set; diff --git a/web/packages/teleterm/src/mainProcess/runtimeSettings.ts b/web/packages/teleterm/src/mainProcess/runtimeSettings.ts index 6b8540ee5ca4f..386dbd7869642 100644 --- a/web/packages/teleterm/src/mainProcess/runtimeSettings.ts +++ b/web/packages/teleterm/src/mainProcess/runtimeSettings.ts @@ -22,9 +22,9 @@ import path from 'path'; import { app } from 'electron'; -import { GrpcServerAddresses, RuntimeSettings } from './types'; import { loadInstallationId } from './loadInstallationId'; import { getAvailableShells, getDefaultShell } from './shell'; +import { GrpcServerAddresses, RuntimeSettings } from './types'; const { argv, env } = process; diff --git a/web/packages/teleterm/src/mainProcess/types.ts b/web/packages/teleterm/src/mainProcess/types.ts index d2aeed78b001a..cf6cb9ea56e80 100644 --- a/web/packages/teleterm/src/mainProcess/types.ts +++ b/web/packages/teleterm/src/mainProcess/types.ts @@ -16,15 +16,13 @@ * along with this program. If not, see . */ -import { CreateAgentConfigFileArgs } from 'teleterm/mainProcess/createAgentConfigFile'; import { DeepLinkParseResult } from 'teleterm/deepLinks'; -import { RootClusterUri } from 'teleterm/ui/uri'; - -import { Document } from 'teleterm/ui/services/workspacesService'; +import { CreateAgentConfigFileArgs } from 'teleterm/mainProcess/createAgentConfigFile'; import { FileStorage } from 'teleterm/services/fileStorage'; +import { Document } from 'teleterm/ui/services/workspacesService'; +import { RootClusterUri } from 'teleterm/ui/uri'; import { ConfigService } from '../services/config'; - import { Shell } from './shell'; export type RuntimeSettings = { diff --git a/web/packages/teleterm/src/mainProcess/windowsManager.ts b/web/packages/teleterm/src/mainProcess/windowsManager.ts index 513e31573400c..bce056b206815 100644 --- a/web/packages/teleterm/src/mainProcess/windowsManager.ts +++ b/web/packages/teleterm/src/mainProcess/windowsManager.ts @@ -22,22 +22,22 @@ import * as url from 'node:url'; import { app, BrowserWindow, + ipcMain, Menu, + nativeTheme, Rectangle, screen, - nativeTheme, - ipcMain, } from 'electron'; +import { DeepLinkParseResult } from 'teleterm/deepLinks'; import Logger from 'teleterm/logger'; -import { FileStorage } from 'teleterm/services/fileStorage'; import { RendererIpc, RuntimeSettings, WindowsManagerIpc, } from 'teleterm/mainProcess/types'; +import { FileStorage } from 'teleterm/services/fileStorage'; import { darkTheme, lightTheme } from 'teleterm/ui/ThemeProvider/theme'; -import { DeepLinkParseResult } from 'teleterm/deepLinks'; type WindowState = Rectangle; diff --git a/web/packages/teleterm/src/preload.ts b/web/packages/teleterm/src/preload.ts index 8faa6a267da26..95cb082291988 100644 --- a/web/packages/teleterm/src/preload.ts +++ b/web/packages/teleterm/src/preload.ts @@ -16,28 +16,28 @@ * along with this program. If not, see . */ -import { contextBridge, webUtils } from 'electron'; import { ChannelCredentials, ServerCredentials } from '@grpc/grpc-js'; import { GrpcTransport } from '@protobuf-ts/grpc-transport'; +import { contextBridge, webUtils } from 'electron'; -import { createTshdClient, createVnetClient } from 'teleterm/services/tshd'; -import { loggingInterceptor } from 'teleterm/services/tshd/interceptors'; -import createMainProcessClient from 'teleterm/mainProcess/mainProcessClient'; -import { createFileLoggerService } from 'teleterm/services/logger'; import Logger from 'teleterm/logger'; -import { createPtyService } from 'teleterm/services/pty/ptyService'; +import createMainProcessClient from 'teleterm/mainProcess/mainProcessClient'; import { - GrpcCertName, createClientCredentials, - createServerCredentials, createInsecureClientCredentials, createInsecureServerCredentials, + createServerCredentials, generateAndSaveGrpcCert, + GrpcCertName, readGrpcCert, shouldEncryptConnection, } from 'teleterm/services/grpcCredentials'; -import { ElectronGlobals, RuntimeSettings } from 'teleterm/types'; +import { createFileLoggerService } from 'teleterm/services/logger'; +import { createPtyService } from 'teleterm/services/pty/ptyService'; +import { createTshdClient, createVnetClient } from 'teleterm/services/tshd'; +import { loggingInterceptor } from 'teleterm/services/tshd/interceptors'; import { createTshdEventsServer } from 'teleterm/services/tshdEvents'; +import { ElectronGlobals, RuntimeSettings } from 'teleterm/types'; const mainProcessClient = createMainProcessClient(); const runtimeSettings = mainProcessClient.getRuntimeSettings(); diff --git a/web/packages/teleterm/src/services/config/configService.test.ts b/web/packages/teleterm/src/services/config/configService.test.ts index 88f7be952bdfe..ef5a718757369 100644 --- a/web/packages/teleterm/src/services/config/configService.test.ts +++ b/web/packages/teleterm/src/services/config/configService.test.ts @@ -17,8 +17,8 @@ */ import Logger, { NullService } from 'teleterm/logger'; -import { createMockFileStorage } from 'teleterm/services/fileStorage/fixtures/mocks'; import { makeRuntimeSettings } from 'teleterm/mainProcess/fixtures/mocks'; +import { createMockFileStorage } from 'teleterm/services/fileStorage/fixtures/mocks'; import { createConfigService } from './configService'; diff --git a/web/packages/teleterm/src/services/config/configService.ts b/web/packages/teleterm/src/services/config/configService.ts index 64abe3fcc3401..6def57378dfd3 100644 --- a/web/packages/teleterm/src/services/config/configService.ts +++ b/web/packages/teleterm/src/services/config/configService.ts @@ -19,14 +19,14 @@ import { z, ZodIssue } from 'zod'; import zodToJsonSchema from 'zod-to-json-schema'; -import { FileStorage } from 'teleterm/services/fileStorage'; import Logger from 'teleterm/logger'; import { RuntimeSettings } from 'teleterm/mainProcess/types'; +import { FileStorage } from 'teleterm/services/fileStorage'; import { - createAppConfigSchema, - AppConfigSchema, AppConfig, + AppConfigSchema, + createAppConfigSchema, } from './appConfigSchema'; const logger = new Logger('ConfigService'); diff --git a/web/packages/teleterm/src/services/config/keyboardShortcutSchema.test.ts b/web/packages/teleterm/src/services/config/keyboardShortcutSchema.test.ts index da9b3672d3526..16254ee2f7db0 100644 --- a/web/packages/teleterm/src/services/config/keyboardShortcutSchema.test.ts +++ b/web/packages/teleterm/src/services/config/keyboardShortcutSchema.test.ts @@ -20,9 +20,9 @@ import { z, ZodError } from 'zod'; import { createKeyboardShortcutSchema, - invalidModifierIssue, - invalidKeyCodeIssue, duplicateModifierIssue, + invalidKeyCodeIssue, + invalidModifierIssue, missingModifierIssue, } from './keyboardShortcutSchema'; diff --git a/web/packages/teleterm/src/services/config/migration.ts b/web/packages/teleterm/src/services/config/migration.ts index b22e1ebe46b56..a20660567ddd2 100644 --- a/web/packages/teleterm/src/services/config/migration.ts +++ b/web/packages/teleterm/src/services/config/migration.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { FileStorage } from 'teleterm/services/fileStorage'; import Logger from 'teleterm/logger'; +import { FileStorage } from 'teleterm/services/fileStorage'; const logger = new Logger('ConfigMigration'); diff --git a/web/packages/teleterm/src/services/fileStorage/fileStorage.ts b/web/packages/teleterm/src/services/fileStorage/fileStorage.ts index 994db45a0e610..0332f29abd618 100644 --- a/web/packages/teleterm/src/services/fileStorage/fileStorage.ts +++ b/web/packages/teleterm/src/services/fileStorage/fileStorage.ts @@ -17,8 +17,8 @@ */ // Both versions are imported because some operations need to be sync. -import fsAsync from 'node:fs/promises'; import fs from 'node:fs'; +import fsAsync from 'node:fs/promises'; import path from 'node:path'; import { debounce } from 'shared/utils/highbar'; diff --git a/web/packages/teleterm/src/services/fileStorage/fileStorageClient.ts b/web/packages/teleterm/src/services/fileStorage/fileStorageClient.ts index a639dcd949443..c9820a6cb4bbc 100644 --- a/web/packages/teleterm/src/services/fileStorage/fileStorageClient.ts +++ b/web/packages/teleterm/src/services/fileStorage/fileStorageClient.ts @@ -22,7 +22,6 @@ import { FileStorageEventChannel, FileStorageEventType, } from '../../mainProcess/types'; - import { FileStorage } from './fileStorage'; // TODO(ravicious): The main process should not expose the whole interface of FileStorage to the diff --git a/web/packages/teleterm/src/services/grpcCredentials/files.ts b/web/packages/teleterm/src/services/grpcCredentials/files.ts index e639bf6d8382c..3d16676490aa2 100644 --- a/web/packages/teleterm/src/services/grpcCredentials/files.ts +++ b/web/packages/teleterm/src/services/grpcCredentials/files.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -import path from 'path'; import { watch } from 'fs'; -import { readFile, writeFile, stat, rename } from 'fs/promises'; +import { readFile, rename, stat, writeFile } from 'fs/promises'; +import path from 'path'; import { makeCert } from './makeCert'; diff --git a/web/packages/teleterm/src/services/grpcCredentials/makeCert/makeCert.ts b/web/packages/teleterm/src/services/grpcCredentials/makeCert/makeCert.ts index 4399a38b87765..ae6c4e13e5454 100644 --- a/web/packages/teleterm/src/services/grpcCredentials/makeCert/makeCert.ts +++ b/web/packages/teleterm/src/services/grpcCredentials/makeCert/makeCert.ts @@ -43,7 +43,7 @@ import { promisify } from 'util'; -import { pki, md } from 'node-forge'; +import { md, pki } from 'node-forge'; const generateKeyPair = promisify(pki.rsa.generateKeyPair.bind(pki.rsa)); diff --git a/web/packages/teleterm/src/services/logger/loggerService.ts b/web/packages/teleterm/src/services/logger/loggerService.ts index e83ce742aee1a..fd580f8f528a4 100644 --- a/web/packages/teleterm/src/services/logger/loggerService.ts +++ b/web/packages/teleterm/src/services/logger/loggerService.ts @@ -16,23 +16,21 @@ * along with this program. If not, see . */ +import type { ChildProcess } from 'node:child_process'; import stream from 'node:stream'; +import split2 from 'split2'; import winston, { createLogger as createWinston, format, transports, + type Logform, } from 'winston'; -import { isObject } from 'shared/utils/highbar'; -import split2 from 'split2'; +import { isObject } from 'shared/utils/highbar'; -import { Logger, LoggerService, NodeLoggerService } from './types'; import { KeepLastChunks } from './keepLastChunks'; - -import type { Logform } from 'winston'; - -import type { ChildProcess } from 'node:child_process'; +import { Logger, LoggerService, NodeLoggerService } from './types'; /** * stdout logger should be used in child processes. diff --git a/web/packages/teleterm/src/services/logger/types.ts b/web/packages/teleterm/src/services/logger/types.ts index a48068e467651..1bc5f231113bc 100644 --- a/web/packages/teleterm/src/services/logger/types.ts +++ b/web/packages/teleterm/src/services/logger/types.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { KeepLastChunks } from './keepLastChunks'; - import type { ChildProcess } from 'node:child_process'; +import { KeepLastChunks } from './keepLastChunks'; + export interface Logger { error(...args: unknown[]): void; warn(...args: unknown[]): void; diff --git a/web/packages/teleterm/src/services/pty/fixtures/mocks.ts b/web/packages/teleterm/src/services/pty/fixtures/mocks.ts index 1beeb875b2670..7e731025c9850 100644 --- a/web/packages/teleterm/src/services/pty/fixtures/mocks.ts +++ b/web/packages/teleterm/src/services/pty/fixtures/mocks.ts @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; import { PtyProcessCreationStatus, PtyServiceClient, } from 'teleterm/services/pty'; +import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; export class MockPtyProcess implements IPtyProcess { start() {} diff --git a/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.test.ts b/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.test.ts index 4c3ccc926f40e..4dbab055667d2 100644 --- a/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.test.ts +++ b/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.test.ts @@ -16,19 +16,17 @@ * along with this program. If not, see . */ -import { makeRuntimeSettings } from 'teleterm/mainProcess/fixtures/mocks'; - import Logger, { NullService } from 'teleterm/logger'; +import { makeRuntimeSettings } from 'teleterm/mainProcess/fixtures/mocks'; import { - ShellCommand, - TshLoginCommand, GatewayCliClientCommand, PtyProcessCreationStatus, + ShellCommand, SshOptions, + TshLoginCommand, } from '../types'; - -import { getPtyProcessOptions, buildPtyOptions } from './buildPtyOptions'; +import { buildPtyOptions, getPtyProcessOptions } from './buildPtyOptions'; beforeAll(() => { Logger.init(new NullService()); diff --git a/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.ts b/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.ts index d73f888ebefb0..218f7c36cc1ab 100644 --- a/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.ts +++ b/web/packages/teleterm/src/services/pty/ptyHost/buildPtyOptions.ts @@ -18,25 +18,24 @@ import path, { delimiter } from 'path'; +import { makeCustomShellFromPath, Shell } from 'teleterm/mainProcess/shell'; import { RuntimeSettings } from 'teleterm/mainProcess/types'; -import { PtyProcessOptions } from 'teleterm/sharedProcess/ptyHost'; -import { assertUnreachable } from 'teleterm/ui/utils'; -import { Shell, makeCustomShellFromPath } from 'teleterm/mainProcess/shell'; -import { CUSTOM_SHELL_ID } from 'teleterm/services/config/appConfigSchema'; import { TSH_AUTOUPDATE_ENV_VAR, TSH_AUTOUPDATE_OFF, } from 'teleterm/node/tshAutoupdate'; +import { CUSTOM_SHELL_ID } from 'teleterm/services/config/appConfigSchema'; +import { PtyProcessOptions } from 'teleterm/sharedProcess/ptyHost'; +import { assertUnreachable } from 'teleterm/ui/utils'; import { PtyCommand, PtyProcessCreationStatus, - TshKubeLoginCommand, - WindowsPty, ShellCommand, SshOptions, + TshKubeLoginCommand, + WindowsPty, } from '../types'; - import { resolveShellEnvCached, ResolveShellEnvTimeoutError, diff --git a/web/packages/teleterm/src/services/pty/ptyHost/ptyEventsStreamHandler.ts b/web/packages/teleterm/src/services/pty/ptyHost/ptyEventsStreamHandler.ts index ef0fdf9a07c83..e82b09938969a 100644 --- a/web/packages/teleterm/src/services/pty/ptyHost/ptyEventsStreamHandler.ts +++ b/web/packages/teleterm/src/services/pty/ptyHost/ptyEventsStreamHandler.ts @@ -18,8 +18,12 @@ import { ClientDuplexStream } from '@grpc/grpc-js'; +import { + ptyEventOneOfIsData, + ptyEventOneOfIsExit, + ptyEventOneOfIsStartError, +} from 'teleterm/helpers'; import Logger from 'teleterm/logger'; - import { PtyClientEvent, PtyEventData, @@ -27,11 +31,6 @@ import { PtyEventStart, PtyServerEvent, } from 'teleterm/sharedProcess/ptyHost'; -import { - ptyEventOneOfIsData, - ptyEventOneOfIsExit, - ptyEventOneOfIsStartError, -} from 'teleterm/helpers'; export class PtyEventsStreamHandler { private logger: Logger; diff --git a/web/packages/teleterm/src/services/pty/ptyHost/ptyHostClient.ts b/web/packages/teleterm/src/services/pty/ptyHost/ptyHostClient.ts index 8990bfb0a1f64..5c0aa57df6cb1 100644 --- a/web/packages/teleterm/src/services/pty/ptyHost/ptyHostClient.ts +++ b/web/packages/teleterm/src/services/pty/ptyHost/ptyHostClient.ts @@ -18,16 +18,14 @@ import { ChannelCredentials, Metadata } from '@grpc/grpc-js'; +import { Struct } from 'teleterm/sharedProcess/api/protogen/google/protobuf/struct_pb'; import { PtyHostClient as GrpcClient, PtyCreate, PtyId, } from 'teleterm/sharedProcess/ptyHost'; -import { Struct } from 'teleterm/sharedProcess/api/protogen/google/protobuf/struct_pb'; - import { PtyHostClient } from '../types'; - import { PtyEventsStreamHandler } from './ptyEventsStreamHandler'; export function createPtyHostClient( diff --git a/web/packages/teleterm/src/services/pty/ptyService.ts b/web/packages/teleterm/src/services/pty/ptyService.ts index 254e029e94f0e..6fadcfe1fe305 100644 --- a/web/packages/teleterm/src/services/pty/ptyService.ts +++ b/web/packages/teleterm/src/services/pty/ptyService.ts @@ -24,8 +24,8 @@ import { ConfigService } from 'teleterm/services/config'; import { buildPtyOptions } from './ptyHost/buildPtyOptions'; import { createPtyHostClient } from './ptyHost/ptyHostClient'; import { createPtyProcess } from './ptyHost/ptyProcess'; -import { PtyServiceClient } from './types'; import { getWindowsPty } from './ptyHost/windowsPty'; +import { PtyServiceClient } from './types'; export function createPtyService( address: string, diff --git a/web/packages/teleterm/src/services/pty/types.ts b/web/packages/teleterm/src/services/pty/types.ts index 0ccaf91427148..548fb389acfb4 100644 --- a/web/packages/teleterm/src/services/pty/types.ts +++ b/web/packages/teleterm/src/services/pty/types.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { PtyProcessOptions, IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; import { Shell } from 'teleterm/mainProcess/shell'; +import { IPtyProcess, PtyProcessOptions } from 'teleterm/sharedProcess/ptyHost'; import { PtyEventsStreamHandler } from './ptyHost/ptyEventsStreamHandler'; diff --git a/web/packages/teleterm/src/services/tshd/cloneableClient.test.ts b/web/packages/teleterm/src/services/tshd/cloneableClient.test.ts index 02e266b490e9e..e1cd6001a253b 100644 --- a/web/packages/teleterm/src/services/tshd/cloneableClient.test.ts +++ b/web/packages/teleterm/src/services/tshd/cloneableClient.test.ts @@ -22,21 +22,21 @@ import { EventEmitter } from 'node:events'; import { - UnaryCall, - RpcError, ClientStreamingCall, - ServerStreamingCall, DuplexStreamingCall, + MethodInfo, + RpcError, RpcOutputStream, + ServerStreamingCall, ServiceInfo, - MethodInfo, + UnaryCall, } from '@protobuf-ts/runtime-rpc'; import { cloneAbortSignal, - TshdRpcError, cloneClient, isTshdRpcError, + TshdRpcError, } from './cloneableClient'; function getRpcError() { diff --git a/web/packages/teleterm/src/services/tshd/cloneableClient.ts b/web/packages/teleterm/src/services/tshd/cloneableClient.ts index 045622ee8283d..05e4193b7cc1e 100644 --- a/web/packages/teleterm/src/services/tshd/cloneableClient.ts +++ b/web/packages/teleterm/src/services/tshd/cloneableClient.ts @@ -17,16 +17,16 @@ */ import { - RpcInputStream, - UnaryCall, ClientStreamingCall, - ServerStreamingCall, DuplexStreamingCall, - RpcOutputStream, + FinishedUnaryCall, RpcError, + RpcInputStream, RpcOptions, + RpcOutputStream, + ServerStreamingCall, ServiceInfo, - FinishedUnaryCall, + UnaryCall, } from '@protobuf-ts/runtime-rpc'; /** diff --git a/web/packages/teleterm/src/services/tshd/createClient.ts b/web/packages/teleterm/src/services/tshd/createClient.ts index 31bc749b1589b..23b16517eed93 100644 --- a/web/packages/teleterm/src/services/tshd/createClient.ts +++ b/web/packages/teleterm/src/services/tshd/createClient.ts @@ -17,6 +17,7 @@ */ import { GrpcTransport } from '@protobuf-ts/grpc-transport'; + import { ITerminalServiceClient, TerminalServiceClient, diff --git a/web/packages/teleterm/src/services/tshd/fixtures/mocks.ts b/web/packages/teleterm/src/services/tshd/fixtures/mocks.ts index e5b9be0442407..ce1a2630cdc9e 100644 --- a/web/packages/teleterm/src/services/tshd/fixtures/mocks.ts +++ b/web/packages/teleterm/src/services/tshd/fixtures/mocks.ts @@ -17,12 +17,12 @@ */ import { - makeRootCluster, makeAppGateway, + makeRootCluster, } from 'teleterm/services/tshd/testHelpers'; -import { VnetClient, TshdClient } from '../createClient'; import { MockedUnaryCall } from '../cloneableClient'; +import { TshdClient, VnetClient } from '../createClient'; export class MockTshClient implements TshdClient { listRootClusters = () => new MockedUnaryCall({ clusters: [] }); diff --git a/web/packages/teleterm/src/services/tshd/gateway.ts b/web/packages/teleterm/src/services/tshd/gateway.ts index 629706188b24e..266732bda6474 100644 --- a/web/packages/teleterm/src/services/tshd/gateway.ts +++ b/web/packages/teleterm/src/services/tshd/gateway.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { routing, GatewayTargetUri } from 'teleterm/ui/uri'; +import { GatewayTargetUri, routing } from 'teleterm/ui/uri'; import { GatewayCLICommand } from './types'; diff --git a/web/packages/teleterm/src/services/tshd/interceptors.test.ts b/web/packages/teleterm/src/services/tshd/interceptors.test.ts index 917906a8184af..3aa0a354a2063 100644 --- a/web/packages/teleterm/src/services/tshd/interceptors.test.ts +++ b/web/packages/teleterm/src/services/tshd/interceptors.test.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { UnaryCall, MethodInfo, ServiceInfo } from '@protobuf-ts/runtime-rpc'; +import { MethodInfo, ServiceInfo, UnaryCall } from '@protobuf-ts/runtime-rpc'; import Logger from 'teleterm/logger'; diff --git a/web/packages/teleterm/src/services/tshd/testHelpers.ts b/web/packages/teleterm/src/services/tshd/testHelpers.ts index 92f70050d27b4..9fd997e6781f5 100644 --- a/web/packages/teleterm/src/services/tshd/testHelpers.ts +++ b/web/packages/teleterm/src/services/tshd/testHelpers.ts @@ -16,14 +16,14 @@ * along with this program. If not, see . */ +import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; import { ACL, ShowResources, } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; -import * as tsh from './types'; import { TshdRpcError } from './cloneableClient'; +import * as tsh from './types'; export const rootClusterUri = '/clusters/teleport-local'; export const leafClusterUri = `${rootClusterUri}/leaves/leaf`; diff --git a/web/packages/teleterm/src/services/tshdEvents/index.ts b/web/packages/teleterm/src/services/tshdEvents/index.ts index a8744d9a7c576..99240c87bf910 100644 --- a/web/packages/teleterm/src/services/tshdEvents/index.ts +++ b/web/packages/teleterm/src/services/tshdEvents/index.ts @@ -17,17 +17,18 @@ */ import * as grpc from '@grpc/grpc-js'; + import * as api from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; import * as apiService from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb.grpc-server'; -import * as uri from 'teleterm/ui/uri'; import Logger from 'teleterm/logger'; +import { filterSensitiveProperties } from 'teleterm/services/tshd/interceptors'; import { ExtractRequestType, ExtractResponseType, TshdEventContextBridgeService, } from 'teleterm/types'; -import { filterSensitiveProperties } from 'teleterm/services/tshd/interceptors'; +import * as uri from 'teleterm/ui/uri'; export interface ReloginRequest extends api.ReloginRequest { rootClusterUri: uri.RootClusterUri; diff --git a/web/packages/teleterm/src/sharedProcess/ptyHost/ptyEventsStreamHandler.ts b/web/packages/teleterm/src/sharedProcess/ptyHost/ptyEventsStreamHandler.ts index a9aa281451131..8b8639fd6fe94 100644 --- a/web/packages/teleterm/src/sharedProcess/ptyHost/ptyEventsStreamHandler.ts +++ b/web/packages/teleterm/src/sharedProcess/ptyHost/ptyEventsStreamHandler.ts @@ -18,13 +18,12 @@ import { ServerDuplexStream } from '@grpc/grpc-js'; -import Logger from 'teleterm/logger'; - import { ptyEventOneOfIsData, ptyEventOneOfIsResize, ptyEventOneOfIsStart, } from 'teleterm/helpers'; +import Logger from 'teleterm/logger'; import { PtyClientEvent, @@ -36,7 +35,6 @@ import { PtyEventStartError, PtyServerEvent, } from '../api/protogen/ptyHostService_pb'; - import { PtyProcess } from './ptyProcess'; export class PtyEventsStreamHandler { diff --git a/web/packages/teleterm/src/sharedProcess/ptyHost/ptyHostService.ts b/web/packages/teleterm/src/sharedProcess/ptyHost/ptyHostService.ts index ffb1cb524321b..890da62b5ddac 100644 --- a/web/packages/teleterm/src/sharedProcess/ptyHost/ptyHostService.ts +++ b/web/packages/teleterm/src/sharedProcess/ptyHost/ptyHostService.ts @@ -16,16 +16,14 @@ * along with this program. If not, see . */ -import { unique } from 'teleterm/ui/utils'; - import Logger from 'teleterm/logger'; - import { Struct } from 'teleterm/sharedProcess/api/protogen/google/protobuf/struct_pb'; +import { unique } from 'teleterm/ui/utils'; -import { PtyProcess } from './ptyProcess'; -import { IPtyHost } from './../api/protogen/ptyHostService_pb.grpc-server'; import { PtyCwd, PtyId } from './../api/protogen/ptyHostService_pb'; +import { IPtyHost } from './../api/protogen/ptyHostService_pb.grpc-server'; import { PtyEventsStreamHandler } from './ptyEventsStreamHandler'; +import { PtyProcess } from './ptyProcess'; export function createPtyHostService(): IPtyHost & { dispose(): Promise; diff --git a/web/packages/teleterm/src/sharedProcess/ptyHost/ptyProcess.ts b/web/packages/teleterm/src/sharedProcess/ptyHost/ptyProcess.ts index 1762ca17a1ef2..771065ded6a67 100644 --- a/web/packages/teleterm/src/sharedProcess/ptyHost/ptyProcess.ts +++ b/web/packages/teleterm/src/sharedProcess/ptyHost/ptyProcess.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { readlink } from 'node:fs'; import { exec } from 'node:child_process'; -import { promisify } from 'node:util'; import { EventEmitter } from 'node:events'; +import { readlink } from 'node:fs'; +import { promisify } from 'node:util'; import * as nodePTY from 'node-pty'; import which from 'which'; @@ -28,7 +28,7 @@ import { wait } from 'shared/utils/wait'; import Logger from 'teleterm/logger'; -import { PtyProcessOptions, IPtyProcess } from './types'; +import { IPtyProcess, PtyProcessOptions } from './types'; type Status = 'open' | 'not_initialized' | 'terminated'; diff --git a/web/packages/teleterm/src/sharedProcess/sharedProcess.ts b/web/packages/teleterm/src/sharedProcess/sharedProcess.ts index 1b9be627d8f3e..790104d46ccbd 100644 --- a/web/packages/teleterm/src/sharedProcess/sharedProcess.ts +++ b/web/packages/teleterm/src/sharedProcess/sharedProcess.ts @@ -18,8 +18,8 @@ import { Server, ServerCredentials } from '@grpc/grpc-js'; -import { createStdoutLoggerService } from 'teleterm/services/logger'; - +import Logger from 'teleterm/logger'; +import { RuntimeSettings, TERMINATE_MESSAGE } from 'teleterm/mainProcess/types'; import { createInsecureServerCredentials, createServerCredentials, @@ -28,9 +28,7 @@ import { readGrpcCert, shouldEncryptConnection, } from 'teleterm/services/grpcCredentials'; -import { RuntimeSettings, TERMINATE_MESSAGE } from 'teleterm/mainProcess/types'; -import Logger from 'teleterm/logger'; - +import { createStdoutLoggerService } from 'teleterm/services/logger'; import { ptyHostDefinition } from 'teleterm/sharedProcess/api/protogen/ptyHostService_pb.grpc-server'; import { createPtyHostService } from './ptyHost/ptyHostService'; diff --git a/web/packages/teleterm/src/types.ts b/web/packages/teleterm/src/types.ts index 6f41116362a76..fd0d074ff8239 100644 --- a/web/packages/teleterm/src/types.ts +++ b/web/packages/teleterm/src/types.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import { ITshdEventsService } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb.grpc-server'; - import { sendUnaryData, ServerUnaryCall } from '@grpc/grpc-js'; -import { Logger, LoggerService } from 'teleterm/services/logger/types'; -import { FileStorage } from 'teleterm/services/fileStorage'; +import { ITshdEventsService } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb.grpc-server'; + import { MainProcessClient, RuntimeSettings } from 'teleterm/mainProcess/types'; +import { FileStorage } from 'teleterm/services/fileStorage'; +import { Logger, LoggerService } from 'teleterm/services/logger/types'; import { PtyServiceClient } from 'teleterm/services/pty'; -import { VnetClient, TshdClient } from 'teleterm/services/tshd/createClient'; +import { TshdClient, VnetClient } from 'teleterm/services/tshd/createClient'; export type { Logger, diff --git a/web/packages/teleterm/src/ui/AccessRequestCheckout/AccessRequestCheckout.tsx b/web/packages/teleterm/src/ui/AccessRequestCheckout/AccessRequestCheckout.tsx index 74e9d278697d4..4871d6afa0844 100644 --- a/web/packages/teleterm/src/ui/AccessRequestCheckout/AccessRequestCheckout.tsx +++ b/web/packages/teleterm/src/ui/AccessRequestCheckout/AccessRequestCheckout.tsx @@ -21,21 +21,20 @@ import { Transition } from 'react-transition-group'; import { Box, - Flex, + ButtonIcon, ButtonPrimary, ButtonText, - Text, - ButtonIcon, + Flex, Label, + Text, } from 'design'; import * as Icon from 'design/Icon'; -import { pluralize } from 'shared/utils/text'; - import { RequestCheckoutWithSlider } from 'shared/components/AccessRequests/NewRequest'; import { isKubeClusterWithNamespaces } from 'shared/components/AccessRequests/NewRequest/kube'; +import { pluralize } from 'shared/utils/text'; -import useAccessRequestCheckout from './useAccessRequestCheckout'; import { AssumedRolesBar } from './AssumedRolesBar'; +import useAccessRequestCheckout from './useAccessRequestCheckout'; const MAX_RESOURCES_IN_BAR_TO_SHOW = 5; diff --git a/web/packages/teleterm/src/ui/AccessRequestCheckout/AssumedRolesBar.tsx b/web/packages/teleterm/src/ui/AccessRequestCheckout/AssumedRolesBar.tsx index 0c0cddbb11192..1fb33661dccf7 100644 --- a/web/packages/teleterm/src/ui/AccessRequestCheckout/AssumedRolesBar.tsx +++ b/web/packages/teleterm/src/ui/AccessRequestCheckout/AssumedRolesBar.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Box, Flex, Text } from 'design'; import { pluralize } from 'shared/utils/text'; diff --git a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.test.tsx b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.test.tsx index 7788270ace51f..b08d1075f202d 100644 --- a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.test.tsx +++ b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.test.tsx @@ -16,19 +16,18 @@ * along with this program. If not, see . */ -import { renderHook, waitFor, act } from '@testing-library/react'; +import { act, renderHook, waitFor } from '@testing-library/react'; import { + makeKube, makeRootCluster, makeServer, - makeKube, rootClusterUri, } from 'teleterm/services/tshd/testHelpers'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { mapRequestToKubeNamespaceUri } from '../services/workspacesService/accessRequestsService'; - import useAccessRequestCheckout, { PendingListKubeClusterWithOriginalItem, } from './useAccessRequestCheckout'; diff --git a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts index 25d8765feec37..529a72211a3db 100644 --- a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts +++ b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts @@ -16,39 +16,35 @@ * along with this program. If not, see . */ -import { useState, useEffect } from 'react'; -import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; - -import useAttempt from 'shared/hooks/useAttemptNext'; +import { useEffect, useState } from 'react'; +import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; import { getDryRunMaxDuration, - PendingListItem, - PendingKubeResourceItem, isKubeClusterWithNamespaces, + PendingKubeResourceItem, + PendingListItem, } from 'shared/components/AccessRequests/NewRequest'; import { useSpecifiableFields } from 'shared/components/AccessRequests/NewRequest/useSpecifiableFields'; - import { CreateRequest } from 'shared/components/AccessRequests/Shared/types'; +import useAttempt from 'shared/hooks/useAttemptNext'; +import { + CreateAccessRequestRequest, + AccessRequest as TeletermAccessRequest, +} from 'teleterm/services/tshd/types'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { - PendingAccessRequest, extractResourceRequestProperties, - ResourceRequest, - mapRequestToKubeNamespaceUri, mapKubeNamespaceUriToRequest, + mapRequestToKubeNamespaceUri, + PendingAccessRequest, + ResourceRequest, } from 'teleterm/ui/services/workspacesService/accessRequestsService'; -import { retryWithRelogin } from 'teleterm/ui/utils'; -import { - CreateAccessRequestRequest, - AccessRequest as TeletermAccessRequest, -} from 'teleterm/services/tshd/types'; - import { routing } from 'teleterm/ui/uri'; +import { retryWithRelogin } from 'teleterm/ui/utils'; import { ResourceKind } from '../DocumentAccessRequests/NewRequest/useNewRequest'; - import { makeUiAccessRequest } from '../DocumentAccessRequests/useAccessRequests'; export default function useAccessRequestCheckout() { diff --git a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.test.tsx b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.test.tsx index 9bcef0bc06467..d0bcc2dcba6f0 100644 --- a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.test.tsx +++ b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.test.tsx @@ -16,16 +16,16 @@ * along with this program. If not, see . */ +import { act, renderHook } from '@testing-library/react'; import { useEffect } from 'react'; -import { renderHook, act } from '@testing-library/react'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { ResourcesContextProvider, useResourcesContext, } from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { RootClusterUri } from 'teleterm/ui/uri'; import { useAssumedRolesBar } from './useAssumedRolesBar'; diff --git a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.ts b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.ts index b038ec8d6b283..d43d50c0d531a 100644 --- a/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.ts +++ b/web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.ts @@ -16,23 +16,22 @@ * along with this program. If not, see . */ -import { useState, useCallback } from 'react'; import { + Duration, + formatDuration, intervalToDuration, isBefore, secondsToMilliseconds, - formatDuration, - Duration, } from 'date-fns'; - -import { useAsync } from 'shared/hooks/useAsync'; +import { useCallback, useState } from 'react'; import { useInterval } from 'shared/hooks'; +import { useAsync } from 'shared/hooks/useAsync'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { retryWithRelogin } from 'teleterm/ui/utils'; import { AssumedRequest } from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { useResourcesContext } from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { retryWithRelogin } from 'teleterm/ui/utils'; export function useAssumedRolesBar(assumedRequest: AssumedRequest) { const ctx = useAppContext(); diff --git a/web/packages/teleterm/src/ui/App.tsx b/web/packages/teleterm/src/ui/App.tsx index 204a3e467ce04..5bb3a7bbd3faa 100644 --- a/web/packages/teleterm/src/ui/App.tsx +++ b/web/packages/teleterm/src/ui/App.tsx @@ -22,14 +22,14 @@ import { HTML5Backend } from 'react-dnd-html5-backend'; import { AppInitializer } from 'teleterm/ui/AppInitializer'; -import { CatchError } from './components/CatchError'; -import { StyledApp } from './components/App'; -import AppContextProvider from './appContextProvider'; import AppContext from './appContext'; +import AppContextProvider from './appContextProvider'; +import { StyledApp } from './components/App'; +import { CatchError } from './components/CatchError'; +import { ResourcesContextProvider } from './DocumentCluster/resourcesContext'; import { ThemeProvider } from './ThemeProvider'; -import { VnetContextProvider } from './Vnet/vnetContext'; import { ConnectionsContextProvider } from './TopBar/Connections/connectionsContext'; -import { ResourcesContextProvider } from './DocumentCluster/resourcesContext'; +import { VnetContextProvider } from './Vnet/vnetContext'; export const App: React.FC<{ ctx: AppContext }> = ({ ctx }) => { return ( diff --git a/web/packages/teleterm/src/ui/AppInitializer/AppInitializer.tsx b/web/packages/teleterm/src/ui/AppInitializer/AppInitializer.tsx index c931f0fcab39a..dc25aca95867d 100644 --- a/web/packages/teleterm/src/ui/AppInitializer/AppInitializer.tsx +++ b/web/packages/teleterm/src/ui/AppInitializer/AppInitializer.tsx @@ -18,12 +18,13 @@ import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; + import { Indicator } from 'design'; -import { useLogger } from 'teleterm/ui/hooks/useLogger'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import ModalsHost from 'teleterm/ui/ModalsHost'; +import { useLogger } from 'teleterm/ui/hooks/useLogger'; import { LayoutManager } from 'teleterm/ui/LayoutManager'; +import ModalsHost from 'teleterm/ui/ModalsHost'; import { showStartupModalsAndNotifications } from './showStartupModalsAndNotifications'; diff --git a/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.test.ts b/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.test.ts index 2a49db9f6fa4e..8803b1e83862e 100644 --- a/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.test.ts +++ b/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.test.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import Logger, { NullService } from 'teleterm/logger'; import AppContext from 'teleterm/ui/appContext'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { Dialog } from 'teleterm/ui/services/modals'; import { showStartupModalsAndNotifications } from './showStartupModalsAndNotifications'; diff --git a/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.ts b/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.ts index 219fabd5dd2cf..6f5e93a5cfd4c 100644 --- a/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.ts +++ b/web/packages/teleterm/src/ui/AppInitializer/showStartupModalsAndNotifications.ts @@ -16,14 +16,14 @@ * along with this program. If not, see . */ +import { ConfigService } from 'teleterm/services/config'; +import { KeyboardShortcutsService } from 'teleterm/ui/services/keyboardShortcuts'; +import { NotificationsService } from 'teleterm/ui/services/notifications'; import { askAboutUserJobRoleIfNeeded, setUpUsageReporting, } from 'teleterm/ui/services/usage'; import { IAppContext } from 'teleterm/ui/types'; -import { ConfigService } from 'teleterm/services/config'; -import { NotificationsService } from 'teleterm/ui/services/notifications'; -import { KeyboardShortcutsService } from 'teleterm/ui/services/keyboardShortcuts'; /** * Runs after the UI becomes visible. diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.story.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.story.tsx index a895f63f4aa9a..7eb9335362775 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.story.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.story.tsx @@ -18,14 +18,13 @@ import React from 'react'; +import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; +import type * as tshd from 'teleterm/services/tshd/types'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { ClusterAdd } from './ClusterAdd'; -import type * as tshd from 'teleterm/services/tshd/types'; - export default { title: 'Teleterm/ModalsHost/ClusterAdd', }; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.tsx index d23442183c1be..44a88b1362c64 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterAdd/ClusterAdd.tsx @@ -17,12 +17,13 @@ */ import React, { useState } from 'react'; + +import { Box, ButtonPrimary, ButtonSecondary, Text } from 'design'; import * as Alerts from 'design/Alert'; -import { Box, Text, ButtonPrimary, ButtonSecondary } from 'design'; +import { DialogContent, DialogHeader } from 'design/Dialog'; import FieldInput from 'shared/components/FieldInput'; import Validation from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; -import { DialogContent, DialogHeader } from 'design/Dialog'; import { useAsync } from 'shared/hooks/useAsync'; import { useAppContext } from 'teleterm/ui/appContextProvider'; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.story.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.story.tsx index d33cc46ec8c43..a63e027e9b3b5 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.story.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.story.tsx @@ -21,12 +21,12 @@ import React, { PropsWithChildren } from 'react'; import { Box } from 'design'; import { Attempt, makeErrorAttempt } from 'shared/hooks/useAsync'; -import * as types from 'teleterm/ui/services/clusters/types'; import { appUri, makeDatabaseGateway, makeKubeGateway, } from 'teleterm/services/tshd/testHelpers'; +import * as types from 'teleterm/ui/services/clusters/types'; import { ClusterLoginPresentation, diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.tsx index 380ec15922ae8..fc1dd26dd58ae 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/ClusterLogin.tsx @@ -17,18 +17,19 @@ */ import React from 'react'; + +import { Box, ButtonIcon, Indicator, Text } from 'design'; import * as Alerts from 'design/Alert'; -import { ButtonIcon, Text, Indicator, Box } from 'design'; +import { DialogContent, DialogHeader } from 'design/Dialog'; import * as Icons from 'design/Icon'; -import { DialogHeader, DialogContent } from 'design/Dialog'; import { PrimaryAuthType } from 'shared/services'; +import { getTargetNameFromUri } from 'teleterm/services/tshd/gateway'; import { AuthSettings } from 'teleterm/ui/services/clusters/types'; import { ClusterConnectReason } from 'teleterm/ui/services/modals'; -import { getTargetNameFromUri } from 'teleterm/services/tshd/gateway'; import LoginForm from './FormLogin'; -import useClusterLogin, { State, Props } from './useClusterLogin'; +import useClusterLogin, { Props, State } from './useClusterLogin'; export function ClusterLogin(props: Props & { reason: ClusterConnectReason }) { const { reason, ...otherProps } = props; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLocal/FormLocal.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLocal/FormLocal.tsx index 41fa189bb990e..130a65c5a673c 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLocal/FormLocal.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLocal/FormLocal.tsx @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import React, { useState, useMemo } from 'react'; -import { Flex, ButtonPrimary, Box } from 'design'; +import React, { useMemo, useState } from 'react'; -import Validation, { Validator } from 'shared/components/Validation'; +import { Box, ButtonPrimary, Flex } from 'design'; import FieldInput from 'shared/components/FieldInput'; import FieldSelect from 'shared/components/FieldSelect'; +import Validation, { Validator } from 'shared/components/Validation'; import { - requiredToken, requiredField, + requiredToken, } from 'shared/components/Validation/rules'; import { useRefAutoFocus } from 'shared/hooks'; import createMfaOptions, { MfaOption } from 'shared/utils/createMfaOptions'; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLogin.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLogin.tsx index 9d1fd538c66dc..300bb7a2703a2 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLogin.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormLogin.tsx @@ -18,22 +18,21 @@ import React from 'react'; import styled from 'styled-components'; -import { Text, Flex, ButtonText, Box } from 'design'; + +import { Box, ButtonText, Flex, Text } from 'design'; import * as Alerts from 'design/Alert'; -import { StepSlider } from 'design/StepSlider'; +import { StepSlider, type StepComponentProps } from 'design/StepSlider'; import { Attempt } from 'shared/hooks/useAsync'; +import type { PrimaryAuthType } from 'shared/services'; import * as types from 'teleterm/ui/services/clusters/types'; -import { PromptWebauthn } from './PromptWebauthn'; -import PromptSsoStatus from './PromptSsoStatus'; +import type { WebauthnLogin } from '../useClusterLogin'; +import { FormLocal } from './FormLocal'; import { FormPasswordless } from './FormPasswordless'; import { FormSso } from './FormSso'; -import { FormLocal } from './FormLocal'; - -import type { WebauthnLogin } from '../useClusterLogin'; -import type { PrimaryAuthType } from 'shared/services'; -import type { StepComponentProps } from 'design/StepSlider'; +import PromptSsoStatus from './PromptSsoStatus'; +import { PromptWebauthn } from './PromptWebauthn'; export default function LoginForm(props: Props) { const { diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormPasswordless/FormPasswordless.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormPasswordless/FormPasswordless.tsx index bf9cceb71583e..1adc0df03e2b6 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormPasswordless/FormPasswordless.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormPasswordless/FormPasswordless.tsx @@ -18,8 +18,9 @@ import React from 'react'; import styled from 'styled-components'; -import { Text, Flex, ButtonText, Box } from 'design'; -import { Key, ArrowForward } from 'design/Icon'; + +import { Box, ButtonText, Flex, Text } from 'design'; +import { ArrowForward, Key } from 'design/Icon'; import type { Props } from '../FormLogin'; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/FormSso.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/FormSso.tsx index 9aa3474e0d36e..d5d39fd4dcd8a 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/FormSso.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/FormSso.tsx @@ -17,11 +17,11 @@ */ import React from 'react'; -import { Box } from 'design'; -import SSOButtonList from './SsoButtons'; +import { Box } from 'design'; import type { Props } from '../FormLogin'; +import SSOButtonList from './SsoButtons'; export const FormSso = ({ loginAttempt, diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/SsoButtons.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/SsoButtons.tsx index 0c9cd204539e2..d068ede16e318 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/SsoButtons.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/FormSso/SsoButtons.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Box } from 'design'; import ButtonSso, { guessProviderType } from 'shared/components/ButtonSso'; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/PromptSsoStatus.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/PromptSsoStatus.tsx index 83b25f9869915..0e800d0b28f26 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/PromptSsoStatus.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/PromptSsoStatus.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { Box, ButtonSecondary, Text, Flex } from 'design'; +import { Box, ButtonSecondary, Flex, Text } from 'design'; import LinearProgress from 'teleterm/ui/components/LinearProgress'; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/index.ts b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/index.ts index cb149a5e44797..d13ccda3d81f0 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/index.ts +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptSsoStatus/index.ts @@ -17,4 +17,5 @@ */ import PromptSsoStatus from './PromptSsoStatus'; + export default PromptSsoStatus; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/PromptWebauthn.tsx b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/PromptWebauthn.tsx index 48bd5734d457c..5e89780e06090 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/PromptWebauthn.tsx +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/PromptWebauthn.tsx @@ -17,17 +17,16 @@ */ import { useState } from 'react'; -import { Box, ButtonSecondary, ButtonPrimary, Text, Image, Flex } from 'design'; +import styled from 'styled-components'; + +import { Box, ButtonPrimary, ButtonSecondary, Flex, Image, Text } from 'design'; import FieldInput from 'shared/components/FieldInput'; import Validation from 'shared/components/Validation'; -import styled from 'styled-components'; - import LinearProgress from 'teleterm/ui/components/LinearProgress'; -import svgHardwareKey from './hardware.svg'; - import type { WebauthnLogin } from '../../useClusterLogin'; +import svgHardwareKey from './hardware.svg'; export function PromptWebauthn(props: Props) { const { prompt } = props; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/index.ts b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/index.ts index 447367bd552b9..0466b1cc850fd 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/index.ts +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/FormLogin/index.ts @@ -17,4 +17,5 @@ */ import FormLogin from './FormLogin'; + export default FormLogin; diff --git a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/useClusterLogin.ts b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/useClusterLogin.ts index 3c9c58f07d855..5bfef76b50482 100644 --- a/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/useClusterLogin.ts +++ b/web/packages/teleterm/src/ui/ClusterConnect/ClusterLogin/useClusterLogin.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import { useState, useEffect, useRef } from 'react'; +import { useEffect, useRef, useState } from 'react'; + import { useAsync } from 'shared/hooks/useAsync'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { assertUnreachable } from 'teleterm/ui/utils'; -import { RootClusterUri } from 'teleterm/ui/uri'; import { cloneAbortSignal } from 'teleterm/services/tshd/cloneableClient'; - +import { useAppContext } from 'teleterm/ui/appContextProvider'; import type * as types from 'teleterm/ui/services/clusters/types'; +import { RootClusterUri } from 'teleterm/ui/uri'; +import { assertUnreachable } from 'teleterm/ui/utils'; export default function useClusterLogin(props: Props) { const { onSuccess, clusterUri } = props; diff --git a/web/packages/teleterm/src/ui/ClusterLogout/ClusterLogout.tsx b/web/packages/teleterm/src/ui/ClusterLogout/ClusterLogout.tsx index 5ded620019358..0bac4921ecb55 100644 --- a/web/packages/teleterm/src/ui/ClusterLogout/ClusterLogout.tsx +++ b/web/packages/teleterm/src/ui/ClusterLogout/ClusterLogout.tsx @@ -17,14 +17,14 @@ */ import React from 'react'; + +import { ButtonIcon, ButtonPrimary, Text } from 'design'; +import * as Alerts from 'design/Alert'; import DialogConfirmation, { DialogContent, DialogFooter, DialogHeader, } from 'design/DialogConfirmation'; -import * as Alerts from 'design/Alert'; -import { ButtonIcon, ButtonPrimary, Text } from 'design'; - import { Cross } from 'design/Icon'; import { RootClusterUri } from 'teleterm/ui/uri'; diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.test.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.test.tsx index cff7eeaeaeca5..5faaa35283ba5 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.test.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.test.tsx @@ -16,15 +16,16 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; + import { render } from 'design/utils/testing'; -import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { makeRuntimeSettings } from 'teleterm/mainProcess/fixtures/mocks'; +import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { checkAgentCompatibility, diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx index b2b9731414d15..bb87c5b4da180 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; -import { Text, ButtonPrimary, Alert, Flex } from 'design'; + +import { Alert, ButtonPrimary, Flex, Text } from 'design'; import Link from 'design/Link'; +import { RuntimeSettings } from 'teleterm/mainProcess/types'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { RuntimeSettings } from 'teleterm/mainProcess/types'; const CONNECT_MY_COMPUTER_RELEASE_VERSION = '14.1.0'; const CONNECT_MY_COMPUTER_RELEASE_MAJOR_VERSION = 14; diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/DocumentConnectMyComputer.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/DocumentConnectMyComputer.tsx index cf95f0e64a6ee..81745f4226b4c 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/DocumentConnectMyComputer.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/DocumentConnectMyComputer.tsx @@ -20,14 +20,13 @@ import React, { useCallback } from 'react'; import Indicator from 'design/Indicator'; -import * as types from 'teleterm/ui/services/workspacesService'; import Document from 'teleterm/ui/Document'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import * as types from 'teleterm/ui/services/workspacesService'; import { useConnectMyComputerContext } from '../connectMyComputerContext'; - -import { Status } from './Status'; import { Setup } from './Setup'; +import { Status } from './Status'; export function DocumentConnectMyComputer(props: { visible: boolean; diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/ProgressBar.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/ProgressBar.tsx index c533e35b1ca33..83393be253fe2 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/ProgressBar.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/ProgressBar.tsx @@ -18,7 +18,8 @@ import React from 'react'; import styled, { useTheme } from 'styled-components'; -import { Flex, Box, rotate360 } from 'design'; + +import { Box, Flex, rotate360 } from 'design'; import * as icons from 'design/Icon'; import { decomposeColor, emphasize } from 'design/theme/utils/colorManipulator'; import { AttemptStatus } from 'shared/hooks/useAsync'; diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.story.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.story.tsx index 2ae06420f2445..e80cbdf7f0d61 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.story.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.story.tsx @@ -16,21 +16,20 @@ * along with this program. If not, see . */ -import React, { useEffect, useRef, useLayoutEffect } from 'react'; +import React, { useEffect, useLayoutEffect, useRef } from 'react'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { makeRootCluster, makeServer, } from 'teleterm/services/tshd/testHelpers'; -import { IAppContext } from 'teleterm/ui/types'; import { Cluster, LoggedInUser_UserType } from 'teleterm/services/tshd/types'; import { ResourcesContextProvider } from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; +import { IAppContext } from 'teleterm/ui/types'; import { ConnectMyComputerContextProvider } from '../connectMyComputerContext'; - import { Setup } from './Setup'; export default { diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.test.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.test.tsx index f3c90df14a358..41912c9b4adc6 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.test.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.test.tsx @@ -16,25 +16,24 @@ * along with this program. If not, see . */ +import { act } from '@testing-library/react'; import React from 'react'; -import { render, screen, waitFor } from 'design/utils/testing'; -import { act } from '@testing-library/react'; +import { render, screen, waitFor } from 'design/utils/testing'; +import Logger, { NullService } from 'teleterm/logger'; import { makeAcl, makeLoggedInUser, makeRootCluster, makeServer, } from 'teleterm/services/tshd/testHelpers'; +import * as useResourcesContext from 'teleterm/ui/DocumentCluster/resourcesContext'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import Logger, { NullService } from 'teleterm/logger'; -import * as useResourcesContext from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import * as connectMyComputerContext from '../connectMyComputerContext'; - import { Setup } from './Setup'; beforeAll(() => { diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.tsx index f8b3135d92427..43d3bf765a090 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Setup.tsx @@ -18,29 +18,29 @@ import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Box, ButtonPrimary, Flex, Text, Alert } from 'design'; + +import { Alert, Box, ButtonPrimary, Flex, Text } from 'design'; +import * as Alerts from 'design/Alert'; import { Attempt, makeEmptyAttempt, useAsync } from 'shared/hooks/useAsync'; import { wait } from 'shared/utils/wait'; -import * as Alerts from 'design/Alert'; +import { isTshdRpcError } from 'teleterm/services/tshd/cloneableClient'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { assertUnreachable, retryWithRelogin } from 'teleterm/ui/utils'; import { AgentProcessError, NodeWaitJoinTimeout, useConnectMyComputerContext, } from 'teleterm/ui/ConnectMyComputer'; -import { codeOrSignal } from 'teleterm/ui/utils/process'; -import { isTshdRpcError } from 'teleterm/services/tshd/cloneableClient'; import { useResourcesContext } from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { DocumentConnectMyComputer } from 'teleterm/ui/services/workspacesService'; +import { assertUnreachable, retryWithRelogin } from 'teleterm/ui/utils'; +import { codeOrSignal } from 'teleterm/ui/utils/process'; -import { useAgentProperties } from '../useAgentProperties'; -import { Logs } from '../Logs'; -import { CompatibilityError } from '../CompatibilityPromise'; import { ConnectMyComputerAccessNoAccess } from '../access'; - +import { CompatibilityError } from '../CompatibilityPromise'; +import { Logs } from '../Logs'; +import { useAgentProperties } from '../useAgentProperties'; import { ProgressBar } from './ProgressBar'; export function Setup(props: { diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.story.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.story.tsx index 0f46c1cdf5376..43f6c8011dfc9 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.story.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.story.tsx @@ -18,26 +18,24 @@ import React, { useLayoutEffect } from 'react'; +import { makeRuntimeSettings } from 'teleterm/mainProcess/fixtures/mocks'; +import { AgentProcessState } from 'teleterm/mainProcess/types'; import { + makeLabelsList, makeRootCluster, makeServer, - makeLabelsList, } from 'teleterm/services/tshd/testHelpers'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import AppContext from 'teleterm/ui/appContext'; - -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { AgentProcessState } from 'teleterm/mainProcess/types'; -import { makeRuntimeSettings } from 'teleterm/mainProcess/fixtures/mocks'; import { ResourcesContextProvider } from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { AgentCompatibilityError, ConnectMyComputerContextProvider, NodeWaitJoinTimeout, } from '../connectMyComputerContext'; - import { Status } from './Status'; export default { diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.tsx index 8c080a8ec907c..87fa37238a821 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputer/Status.tsx @@ -17,47 +17,46 @@ */ import React, { useCallback } from 'react'; +import { Transition } from 'react-transition-group'; +import styled, { css } from 'styled-components'; + import { Alert, Box, ButtonPrimary, + ButtonSecondary, Flex, Label, Link, MenuItem, Text, - ButtonSecondary, } from 'design'; -import styled, { css } from 'styled-components'; -import { Transition } from 'react-transition-group'; - -import { makeLabelTag } from 'teleport/components/formatters'; -import { MenuIcon } from 'shared/components/MenuAction'; import * as icons from 'design/Icon'; +import type { IconProps } from 'design/Icon/Icon'; import Indicator from 'design/Indicator'; +import { MenuIcon } from 'shared/components/MenuAction'; +import { makeLabelTag } from 'teleport/components/formatters'; +import type * as tsh from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { AgentProcessError, CurrentAction, NodeWaitJoinTimeout, useConnectMyComputerContext, } from 'teleterm/ui/ConnectMyComputer'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import { connectToServer } from 'teleterm/ui/services/workspacesService'; import { assertUnreachable } from 'teleterm/ui/utils'; import { codeOrSignal } from 'teleterm/ui/utils/process'; -import { connectToServer } from 'teleterm/ui/services/workspacesService'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { useAgentProperties } from '../useAgentProperties'; -import { Logs } from '../Logs'; import { CompatibilityError, useVersions } from '../CompatibilityPromise'; +import { Logs } from '../Logs'; import { shouldShowAgentUpgradeSuggestion, UpgradeAgentSuggestion, } from '../UpgradeAgentSuggestion'; - -import type * as tsh from 'teleterm/services/tshd/types'; -import type { IconProps } from 'design/Icon/Icon'; +import { useAgentProperties } from '../useAgentProperties'; export function Status(props: { closeDocument?: () => void }) { const ctx = useAppContext(); diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/Logs.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/Logs.tsx index 3db3194709b2f..9a4957440a1f0 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/Logs.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/Logs.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -import { Flex, Text } from 'design'; import React from 'react'; +import { Flex, Text } from 'design'; + interface LogsProps { logs: string; } diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.story.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.story.tsx index 3daaebdbadec7..3c61041f280dd 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.story.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.story.tsx @@ -16,17 +16,17 @@ * along with this program. If not, see . */ -import React, { useEffect, useRef, useLayoutEffect } from 'react'; +import React, { useEffect, useLayoutEffect, useRef } from 'react'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; +import { AgentProcessState } from 'teleterm/mainProcess/types'; import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { ResourcesContextProvider } from 'teleterm/ui/DocumentCluster/resourcesContext'; -import { AgentProcessState } from 'teleterm/mainProcess/types'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; -import { NavigationMenu } from './NavigationMenu'; import { ConnectMyComputerContextProvider } from './connectMyComputerContext'; +import { NavigationMenu } from './NavigationMenu'; export default { title: 'Teleterm/ConnectMyComputer/NavigationMenu', diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx index 4e70e5b299427..c1293263ee5c5 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx @@ -18,9 +18,9 @@ import React, { forwardRef, useRef, useState } from 'react'; import styled, { css } from 'styled-components'; -import { Box, Button, Indicator, Menu, MenuItem, blink } from 'design'; -import { Laptop, Warning } from 'design/Icon'; +import { blink, Box, Button, Indicator, Menu, MenuItem } from 'design'; +import { Laptop, Warning } from 'design/Icon'; import { Attempt, AttemptStatus } from 'shared/hooks/useAsync'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.test.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.test.tsx index fdff6097572d0..99dfd32620aed 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.test.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.test.tsx @@ -16,13 +16,14 @@ * along with this program. If not, see . */ +import { screen } from '@testing-library/react'; import React from 'react'; + import { render } from 'design/utils/testing'; -import { screen } from '@testing-library/react'; import { - UpgradeAgentSuggestion, shouldShowAgentUpgradeSuggestion, + UpgradeAgentSuggestion, } from './UpgradeAgentSuggestion'; test('upgradeAgentSuggestion renders correct versions', async () => { diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.tsx index bd279dd04b105..080f5bff007b6 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/UpgradeAgentSuggestion.tsx @@ -17,9 +17,9 @@ */ import React from 'react'; + import { Alert, Text } from 'design'; import Link from 'design/Link'; - import { compareSemVers } from 'shared/utils/semVer'; import { RuntimeSettings } from 'teleterm/mainProcess/types'; diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.test.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.test.tsx index 518ca20db8134..2db3f681ec2c0 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.test.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.test.tsx @@ -18,22 +18,25 @@ import { EventEmitter } from 'node:events'; -import React from 'react'; import { act, renderHook, waitFor } from '@testing-library/react'; +import React from 'react'; + import { makeErrorAttempt } from 'shared/hooks/useAsync'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { WorkspaceContextProvider } from 'teleterm/ui/Documents'; +import Logger, { NullService } from 'teleterm/logger'; import { AgentProcessState } from 'teleterm/mainProcess/types'; -import * as resourcesContext from 'teleterm/ui/DocumentCluster/resourcesContext'; import { makeAcl, makeLoggedInUser, makeRootCluster, makeServer, } from 'teleterm/services/tshd/testHelpers'; -import Logger, { NullService } from 'teleterm/logger'; +import type { Cluster } from 'teleterm/services/tshd/types'; +import * as resourcesContext from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { WorkspaceContextProvider } from 'teleterm/ui/Documents'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import type { IAppContext } from 'teleterm/ui/types'; import { AgentCompatibilityError, @@ -42,9 +45,6 @@ import { useConnectMyComputerContext, } from './connectMyComputerContext'; -import type { IAppContext } from 'teleterm/ui/types'; -import type { Cluster } from 'teleterm/services/tshd/types'; - beforeAll(() => { Logger.init(new NullService()); }); diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.tsx index e6c6929ef25fa..dc2b23db8beb0 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.tsx +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.tsx @@ -26,37 +26,36 @@ import { useMemo, useState, } from 'react'; + import { Attempt, + makeEmptyAttempt, makeSuccessAttempt, useAsync, - makeEmptyAttempt, } from 'shared/hooks/useAsync'; import { wait } from 'shared/utils/wait'; -import { RootClusterUri, routing } from 'teleterm/ui/uri'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { Server } from 'teleterm/services/tshd/types'; +import type { + AgentProcessState, + MainProcessClient, +} from 'teleterm/mainProcess/types'; import { cloneAbortSignal, isTshdRpcError, } from 'teleterm/services/tshd/cloneableClient'; +import { Server } from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { useResourcesContext } from 'teleterm/ui/DocumentCluster/resourcesContext'; import { useLogger } from 'teleterm/ui/hooks/useLogger'; +import { RootClusterUri, routing } from 'teleterm/ui/uri'; import { assertUnreachable, retryWithRelogin } from '../utils'; - import { ConnectMyComputerAccess, getConnectMyComputerAccess } from './access'; import { - checkAgentCompatibility, AgentCompatibility, + checkAgentCompatibility, } from './CompatibilityPromise'; -import type { - AgentProcessState, - MainProcessClient, -} from 'teleterm/mainProcess/types'; - export type CurrentAction = | { kind: 'download'; diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/useAgentProperties.ts b/web/packages/teleterm/src/ui/ConnectMyComputer/useAgentProperties.ts index 4331bcb765c5f..97552aa36bfc1 100644 --- a/web/packages/teleterm/src/ui/ConnectMyComputer/useAgentProperties.ts +++ b/web/packages/teleterm/src/ui/ConnectMyComputer/useAgentProperties.ts @@ -20,8 +20,8 @@ import { useMemo } from 'react'; import * as connectMyComputer from 'shared/connectMyComputer'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; export function useAgentProperties(): { systemUsername: string; diff --git a/web/packages/teleterm/src/ui/Document/Document.tsx b/web/packages/teleterm/src/ui/Document/Document.tsx index 879f0c700b85c..3a5d48f140b94 100644 --- a/web/packages/teleterm/src/ui/Document/Document.tsx +++ b/web/packages/teleterm/src/ui/Document/Document.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { Flex } from 'design'; import { useRefAutoFocus } from 'shared/hooks'; diff --git a/web/packages/teleterm/src/ui/Document/index.ts b/web/packages/teleterm/src/ui/Document/index.ts index 53f8277a52916..16c6ec99d3f61 100644 --- a/web/packages/teleterm/src/ui/Document/index.ts +++ b/web/packages/teleterm/src/ui/Document/index.ts @@ -17,4 +17,5 @@ */ import Document from './Document'; + export default Document; diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/DocumentAccessRequests.tsx b/web/packages/teleterm/src/ui/DocumentAccessRequests/DocumentAccessRequests.tsx index f9aa75338cf97..145b092519196 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/DocumentAccessRequests.tsx +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/DocumentAccessRequests.tsx @@ -18,20 +18,18 @@ import React from 'react'; +import { RequestFlags } from 'shared/components/AccessRequests/ReviewRequests'; import { Attempt } from 'shared/hooks/useAsync'; - import { AccessRequest } from 'shared/services/accessRequests'; -import { RequestFlags } from 'shared/components/AccessRequests/ReviewRequests'; import Document from 'teleterm/ui/Document'; import * as types from 'teleterm/ui/services/workspacesService'; -import { useAssumeAccess } from './useAssumeAccess'; - -import useAccessRequests from './useAccessRequests'; +import { NewRequest } from './NewRequest'; import { RequestList } from './RequestList/RequestList'; import { ReviewAccessRequest } from './ReviewAccessRequest'; -import { NewRequest } from './NewRequest'; +import useAccessRequests from './useAccessRequests'; +import { useAssumeAccess } from './useAssumeAccess'; export function DocumentAccessRequests(props: DocumentProps) { const state = useAccessRequests(props.doc); diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/NewRequest.tsx b/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/NewRequest.tsx index 3576c2c5a8691..c939ffb9b7265 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/NewRequest.tsx +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/NewRequest.tsx @@ -18,29 +18,26 @@ import styled from 'styled-components'; -import { Alert, Box, Flex, Link, Text, Indicator } from 'design'; -import { space, SpaceProps, width } from 'design/system'; +import { Alert, Box, Flex, Indicator, Link, Text } from 'design'; import { Info as InfoIcon } from 'design/Icon'; - +import { space, SpaceProps, width } from 'design/system'; import { - ShowResources, Cluster, + ShowResources, } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; - -import { SearchPagination, SearchPanel } from 'shared/components/Search'; import { ResourceList, ResourceMap, } from 'shared/components/AccessRequests/NewRequest'; +import { SearchPagination, SearchPanel } from 'shared/components/Search'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { - PendingAccessRequest, extractResourceRequestProperties, + PendingAccessRequest, } from 'teleterm/ui/services/workspacesService/accessRequestsService'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; - import useNewRequest, { ResourceKind } from './useNewRequest'; const agentOptions: ResourceOption[] = [ diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/useNewRequest.ts b/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/useNewRequest.ts index 1154377464032..549710dabb3dd 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/useNewRequest.ts +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/useNewRequest.ts @@ -16,43 +16,39 @@ * along with this program. If not, see . */ -import { useState, useEffect, useCallback } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { FetchStatus, SortType } from 'design/DataTable/types'; - -import useAttempt from 'shared/hooks/useAttemptNext'; -import { makeAdvancedSearchQueryForLabel } from 'shared/utils/advancedSearchLabelQuery'; -import { RequestableResourceKind } from 'shared/components/AccessRequests/NewRequest/resource'; - import { - ShowResources, Cluster, + ShowResources, } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; - -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { - makeDatabase, - makeServer, - makeKube, -} from 'teleterm/ui/services/clusters'; -import { retryWithRelogin } from 'teleterm/ui/utils'; - -import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { - GetResourcesParams, - App as tshdApp, -} from 'teleterm/services/tshd/types'; -import { useWorkspaceLoggedInUser } from 'teleterm/ui/hooks/useLoggedInUser'; -import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; -import { toResourceRequest } from 'teleterm/ui/services/workspacesService/accessRequestsService'; +import { RequestableResourceKind } from 'shared/components/AccessRequests/NewRequest/resource'; +import useAttempt from 'shared/hooks/useAttemptNext'; +import { makeAdvancedSearchQueryForLabel } from 'shared/utils/advancedSearchLabelQuery'; import type { ResourceLabel, - ResourceFilter as WeakAgentFilter, ResourcesResponse, UnifiedResource, + ResourceFilter as WeakAgentFilter, } from 'teleport/services/agents'; import type * as teleportApps from 'teleport/services/apps'; +import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; +import { + GetResourcesParams, + App as tshdApp, +} from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import { useWorkspaceLoggedInUser } from 'teleterm/ui/hooks/useLoggedInUser'; +import { + makeDatabase, + makeKube, + makeServer, +} from 'teleterm/ui/services/clusters'; +import { toResourceRequest } from 'teleterm/ui/services/workspacesService/accessRequestsService'; +import { retryWithRelogin } from 'teleterm/ui/utils'; const pageSize = 10; diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.test.tsx b/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.test.tsx index 12f6765db50b3..ebd7579e4f4b9 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.test.tsx @@ -18,11 +18,11 @@ import React from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { fireEvent, render, screen } from 'design/utils/testing'; +import { fireEvent, render, screen } from 'design/utils/testing'; import { requestRoleApproved } from 'shared/components/AccessRequests/fixtures'; -import { AccessRequest } from 'shared/services/accessRequests'; import { RequestFlags } from 'shared/components/AccessRequests/ReviewRequests'; +import { AccessRequest } from 'shared/services/accessRequests'; import { RequestList } from './RequestList'; diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.tsx b/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.tsx index 8c036f7d828e9..7f5cbcd5befed 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.tsx +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/RequestList/RequestList.tsx @@ -19,24 +19,23 @@ import React from 'react'; import styled from 'styled-components'; -import { Label, Alert, ButtonBorder, Flex, ButtonPrimary, Box } from 'design'; +import { Alert, Box, ButtonBorder, ButtonPrimary, Flex, Label } from 'design'; import Table, { Cell } from 'design/DataTable'; -import { Attempt } from 'shared/hooks/useAttemptNext'; -import { Attempt as AsyncAttempt } from 'shared/hooks/useAsync'; - -import { AccessRequest, canAssumeNow } from 'shared/services/accessRequests'; +import { requestMatcher } from 'shared/components/AccessRequests/NewRequest/matcher'; import { + formattedName, renderIdCell, renderStatusCell, renderUserCell, - formattedName, RequestFlags, } from 'shared/components/AccessRequests/ReviewRequests'; import { BlockedByStartTimeButton, ButtonPromotedInfo, } from 'shared/components/AccessRequests/Shared/Shared'; -import { requestMatcher } from 'shared/components/AccessRequests/NewRequest/matcher'; +import { Attempt as AsyncAttempt } from 'shared/hooks/useAsync'; +import { Attempt } from 'shared/hooks/useAttemptNext'; +import { AccessRequest, canAssumeNow } from 'shared/services/accessRequests'; export function RequestList({ attempt, diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/ReviewAccessRequest.tsx b/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/ReviewAccessRequest.tsx index 4ae34ef6ee953..893f25179700a 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/ReviewAccessRequest.tsx +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/ReviewAccessRequest.tsx @@ -18,17 +18,15 @@ import styled from 'styled-components'; -import { Text, Flex, Box, Alert } from 'design'; +import { Alert, Box, Flex, Text } from 'design'; import { ArrowBack } from 'design/Icon'; -import { makeEmptyAttempt } from 'shared/hooks/useAsync'; - import { RequestDelete, RequestView, } from 'shared/components/AccessRequests/ReviewRequests'; +import { makeEmptyAttempt } from 'shared/hooks/useAsync'; import { useAssumeAccess } from '../useAssumeAccess'; - import { useReviewAccessRequest } from './useReviewAccessRequest'; export function ReviewAccessRequest(props: { diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/useReviewAccessRequest.ts b/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/useReviewAccessRequest.ts index d4e6e8a98cffc..bcbed8baf4921 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/useReviewAccessRequest.ts +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/ReviewAccessRequest/useReviewAccessRequest.ts @@ -16,24 +16,23 @@ * along with this program. If not, see . */ -import { useState, useEffect, useCallback } from 'react'; -import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; +import { useCallback, useEffect, useState } from 'react'; -import { AccessRequest } from 'shared/services/accessRequests'; +import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; import { + RequestFlags, SubmitReview, SuggestedAccessList, - RequestFlags, } from 'shared/components/AccessRequests/ReviewRequests'; - import { useAsync } from 'shared/hooks/useAsync'; +import { AccessRequest } from 'shared/services/accessRequests'; +import { isUnimplementedError } from 'teleterm/services/tshd/errors'; import * as tsh from 'teleterm/services/tshd/types'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { useWorkspaceLoggedInUser } from 'teleterm/ui/hooks/useLoggedInUser'; -import { isUnimplementedError } from 'teleterm/services/tshd/errors'; import { retryWithRelogin } from 'teleterm/ui/utils'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { makeUiAccessRequest } from '../useAccessRequests'; diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.test.tsx b/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.test.tsx index e2b9366714425..cd6501bb62746 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.test.tsx @@ -16,9 +16,8 @@ * along with this program. If not, see . */ -import { AccessRequest } from 'shared/services/accessRequests'; - import { AccessRequest as TshdAccessRequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/access_request_pb'; +import { AccessRequest } from 'shared/services/accessRequests'; import { makeUiAccessRequest } from './useAccessRequests'; diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.tsx b/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.tsx index 240625c22797c..5a1573acf9566 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.tsx +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/useAccessRequests.tsx @@ -16,28 +16,24 @@ * along with this program. If not, see . */ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; +import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; +import { AccessRequest as TshdAccessRequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/access_request_pb'; +import { LoggedInUser } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; +import { RequestFlags } from 'shared/components/AccessRequests/ReviewRequests'; import useAttempt from 'shared/hooks/useAttemptNext'; - import { - makeAccessRequest, AccessRequest, + makeAccessRequest, } from 'shared/services/accessRequests'; -import { RequestFlags } from 'shared/components/AccessRequests/ReviewRequests'; - -import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; -import { LoggedInUser } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { AccessRequest as TshdAccessRequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/access_request_pb'; - -import * as types from 'teleterm/ui/services/workspacesService'; import { AssumedRequest } from 'teleterm/services/tshd/types'; - import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { retryWithRelogin } from 'teleterm/ui/utils'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { useWorkspaceLoggedInUser } from 'teleterm/ui/hooks/useLoggedInUser'; +import * as types from 'teleterm/ui/services/workspacesService'; +import { retryWithRelogin } from 'teleterm/ui/utils'; export default function useAccessRequests(doc: types.DocumentAccessRequests) { const ctx = useAppContext(); diff --git a/web/packages/teleterm/src/ui/DocumentAccessRequests/useAssumeAccess.ts b/web/packages/teleterm/src/ui/DocumentAccessRequests/useAssumeAccess.ts index 8493052ba7b5b..ed4742889ada8 100644 --- a/web/packages/teleterm/src/ui/DocumentAccessRequests/useAssumeAccess.ts +++ b/web/packages/teleterm/src/ui/DocumentAccessRequests/useAssumeAccess.ts @@ -18,10 +18,10 @@ import { useAsync } from 'shared/hooks/useAsync'; -import { retryWithRelogin } from 'teleterm/ui/utils'; -import { useResourcesContext } from 'teleterm/ui/DocumentCluster/resourcesContext'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useResourcesContext } from 'teleterm/ui/DocumentCluster/resourcesContext'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import { retryWithRelogin } from 'teleterm/ui/utils'; export function useAssumeAccess() { const ctx = useAppContext(); diff --git a/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.story.tsx b/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.story.tsx index 052af8793f406..69bc2b5a80623 100644 --- a/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.story.tsx +++ b/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.story.tsx @@ -18,16 +18,16 @@ import { wait } from 'shared/utils/wait'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { - makeRootCluster, makeLoggedInUser, + makeRootCluster, rootClusterUri, } from 'teleterm/services/tshd/testHelpers'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import * as types from 'teleterm/ui/services/workspacesService'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { DocumentAuthorizeWebSession } from './DocumentAuthorizeWebSession'; diff --git a/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.test.tsx b/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.test.tsx index 67f47026cde36..59246adf0cf32 100644 --- a/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.test.tsx @@ -16,18 +16,19 @@ * along with this program. If not, see . */ -import { render, screen } from 'design/utils/testing'; import userEvent from '@testing-library/user-event'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; +import { render, screen } from 'design/utils/testing'; + import { - makeRootCluster, makeLoggedInUser, + makeRootCluster, rootClusterUri, } from 'teleterm/services/tshd/testHelpers'; -import * as types from 'teleterm/ui/services/workspacesService'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; +import * as types from 'teleterm/ui/services/workspacesService'; import { DocumentAuthorizeWebSession } from './DocumentAuthorizeWebSession'; diff --git a/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.tsx b/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.tsx index 92331f996fd9c..3b9a8cba3a707 100644 --- a/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.tsx +++ b/web/packages/teleterm/src/ui/DocumentAuthorizeWebSession/DocumentAuthorizeWebSession.tsx @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -import { Text, Alert, ButtonPrimary, H1, ButtonText, Link } from 'design'; +import { Alert, ButtonPrimary, ButtonText, H1, Link, Text } from 'design'; import Flex from 'design/Flex'; -import { useAsync, Attempt } from 'shared/hooks/useAsync'; -import { processRedirectUri } from 'shared/redirects'; -import { Cluster } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; import { DeviceConfirmationToken } from 'gen-proto-ts/teleport/devicetrust/v1/device_confirmation_token_pb'; +import { Cluster } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; +import { Attempt, useAsync } from 'shared/hooks/useAsync'; +import { processRedirectUri } from 'shared/redirects'; -import Document from 'teleterm/ui/Document'; -import { routing } from 'teleterm/ui/uri'; -import { retryWithRelogin } from 'teleterm/ui/utils'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import Document from 'teleterm/ui/Document'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; import * as types from 'teleterm/ui/services/workspacesService'; import { WebSessionRequest } from 'teleterm/ui/services/workspacesService'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import { routing } from 'teleterm/ui/uri'; +import { retryWithRelogin } from 'teleterm/ui/utils'; export function DocumentAuthorizeWebSession(props: { doc: types.DocumentAuthorizeWebSession; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx b/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx index 3b397d9b6093f..9032dd417710b 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.story.tsx @@ -16,26 +16,26 @@ * along with this program. If not, see . */ -import { Flex, Text, Box } from 'design'; +import { Box, Flex, Text } from 'design'; import { makeApp, - makeRootCluster, - makeServer, makeDatabase, makeKube, + makeRootCluster, + makeServer, } from 'teleterm/services/tshd/testHelpers'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { VnetContextProvider } from 'teleterm/ui/Vnet'; import { ConnectionsContextProvider } from 'teleterm/ui/TopBar/Connections/connectionsContext'; +import { VnetContextProvider } from 'teleterm/ui/Vnet'; import { + AccessRequestButton, ConnectAppActionButton, - ConnectServerActionButton, ConnectDatabaseActionButton, ConnectKubeActionButton, - AccessRequestButton, + ConnectServerActionButton, } from './ActionButtons'; export default { diff --git a/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.tsx b/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.tsx index 86c081eeaca97..f936a7f64ad35 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/ActionButtons.tsx @@ -17,37 +17,37 @@ */ import React from 'react'; -import { MenuLogin, MenuLoginProps } from 'shared/components/MenuLogin'; + +import { ButtonBorder, ButtonPrimary, ButtonWithMenu, MenuItem } from 'design'; import { AwsLaunchButton } from 'shared/components/AwsLaunchButton'; -import { ButtonBorder, ButtonWithMenu, MenuItem, ButtonPrimary } from 'design'; +import { MenuLogin, MenuLoginProps } from 'shared/components/MenuLogin'; import { - connectToServer, - connectToDatabase, - connectToKube, - connectToAppWithVnet, - captureAppLaunchInBrowser, - setUpAppGateway, -} from 'teleterm/ui/services/workspacesService'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; + getAwsAppLaunchUrl, + getSamlAppSsoUrl, + getWebAppLaunchUrl, + isWebApp, +} from 'teleterm/services/tshd/app'; import { - Server, - Kube, - GatewayProtocol, - Database, App, Cluster, + Database, + GatewayProtocol, + Kube, + Server, } from 'teleterm/services/tshd/types'; - -import { DatabaseUri, routing } from 'teleterm/ui/uri'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { + captureAppLaunchInBrowser, + connectToAppWithVnet, + connectToDatabase, + connectToKube, + connectToServer, + setUpAppGateway, +} from 'teleterm/ui/services/workspacesService'; import { IAppContext } from 'teleterm/ui/types'; +import { DatabaseUri, routing } from 'teleterm/ui/uri'; import { retryWithRelogin } from 'teleterm/ui/utils'; -import { - getWebAppLaunchUrl, - isWebApp, - getAwsAppLaunchUrl, - getSamlAppSsoUrl, -} from 'teleterm/services/tshd/app'; import { useVnetContext, useVnetLauncher } from 'teleterm/ui/Vnet'; export function ConnectServerActionButton(props: { diff --git a/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.story.tsx b/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.story.tsx index f2472378077d8..ed03457975004 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.story.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.story.tsx @@ -19,34 +19,33 @@ import React, { useEffect } from 'react'; import styled from 'styled-components'; -import AppContextProvider from 'teleterm/ui/appContextProvider'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { - createClusterServiceState, - ClustersServiceState, -} from 'teleterm/ui/services/clusters'; -import { routing } from 'teleterm/ui/uri'; import { + leafClusterUri, + makeAcl, + makeApp, + makeDatabase, + makeKube, makeLoggedInUser, makeRootCluster, makeServer, - makeDatabase, - makeKube, - makeApp, rootClusterUri, - leafClusterUri, - makeAcl, } from 'teleterm/services/tshd/testHelpers'; - -import { ResourcesService } from 'teleterm/ui/services/resources'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; -import { ConnectMyComputerContextProvider } from 'teleterm/ui/ConnectMyComputer'; -import * as docTypes from 'teleterm/ui/services/workspacesService/documentsService/types'; import * as tsh from 'teleterm/services/tshd/types'; -import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; -import { VnetContextProvider } from 'teleterm/ui/Vnet'; +import AppContextProvider from 'teleterm/ui/appContextProvider'; +import { ConnectMyComputerContextProvider } from 'teleterm/ui/ConnectMyComputer'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; +import { + ClustersServiceState, + createClusterServiceState, +} from 'teleterm/ui/services/clusters'; +import { ResourcesService } from 'teleterm/ui/services/resources'; import { getEmptyPendingAccessRequest } from 'teleterm/ui/services/workspacesService/accessRequestsService'; +import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; +import * as docTypes from 'teleterm/ui/services/workspacesService/documentsService/types'; import { ConnectionsContextProvider } from 'teleterm/ui/TopBar/Connections/connectionsContext'; +import { routing } from 'teleterm/ui/uri'; +import { VnetContextProvider } from 'teleterm/ui/Vnet'; import DocumentCluster from './DocumentCluster'; import { ResourcesContextProvider } from './resourcesContext'; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.test.tsx b/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.test.tsx index 1c4903d5b59c8..0959f3277be18 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.test.tsx @@ -16,27 +16,27 @@ * along with this program. If not, see . */ -import React from 'react'; import { act } from '@testing-library/react'; -import { render, screen } from 'design/utils/testing'; import { mockIntersectionObserver } from 'jsdom-testing-mocks'; +import React from 'react'; + +import { render, screen } from 'design/utils/testing'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { - makeRootCluster, - makeLoggedInUser, makeAcl, + makeLoggedInUser, + makeRootCluster, } from 'teleterm/services/tshd/testHelpers'; import * as tsh from 'teleterm/services/tshd/types'; import { ConnectMyComputerContextProvider } from 'teleterm/ui/ConnectMyComputer'; -import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { getEmptyPendingAccessRequest } from 'teleterm/ui/services/workspacesService/accessRequestsService'; - -import { ResourcesContextProvider } from './resourcesContext'; +import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; import DocumentCluster from './DocumentCluster'; +import { ResourcesContextProvider } from './resourcesContext'; const mio = mockIntersectionObserver(); diff --git a/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.tsx b/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.tsx index f78ce862471d7..d87bf2de9c4ee 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/DocumentCluster.tsx @@ -18,18 +18,18 @@ import React, { useEffect } from 'react'; import styled from 'styled-components'; -import { Box, ButtonPrimary, Flex, Text, Alert } from 'design'; -import { useAsync, Attempt } from 'shared/hooks/useAsync'; +import { Alert, Box, ButtonPrimary, Flex, Text } from 'design'; +import { Attempt, useAsync } from 'shared/hooks/useAsync'; + +import { Cluster } from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import Document from 'teleterm/ui/Document'; import * as types from 'teleterm/ui/services/workspacesService'; import { DocumentClusterQueryParams } from 'teleterm/ui/services/workspacesService'; -import Document from 'teleterm/ui/Document'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { retryWithRelogin } from 'teleterm/ui/utils'; -import { Cluster } from 'teleterm/services/tshd/types'; - import * as uri from 'teleterm/ui/uri'; import { routing } from 'teleterm/ui/uri'; +import { retryWithRelogin } from 'teleterm/ui/utils'; import { UnifiedResources } from './UnifiedResources'; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.test.tsx b/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.test.tsx index a69d79f3eb9ea..c6d81570b11c2 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.test.tsx @@ -16,36 +16,36 @@ * along with this program. If not, see . */ -import { useImperativeHandle, forwardRef, createRef } from 'react'; -import { render, screen } from 'design/utils/testing'; -import { mockIntersectionObserver } from 'jsdom-testing-mocks'; import { act } from '@testing-library/react'; +import { mockIntersectionObserver } from 'jsdom-testing-mocks'; +import { createRef, forwardRef, useImperativeHandle } from 'react'; +import { render, screen } from 'design/utils/testing'; +import { ShowResources } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; import { AvailableResourceMode, DefaultTab, - ViewMode, LabelsViewMode, + ViewMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; -import { ShowResources } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { UnifiedResources } from 'teleterm/ui/DocumentCluster/UnifiedResources'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import { + makeRootCluster, + makeServer, + rootClusterUri, +} from 'teleterm/services/tshd/testHelpers'; +import { ConnectMyComputerContextProvider } from 'teleterm/ui/ConnectMyComputer'; import { ResourcesContextProvider, useResourcesContext, } from 'teleterm/ui/DocumentCluster/resourcesContext'; -import { ConnectMyComputerContextProvider } from 'teleterm/ui/ConnectMyComputer'; -import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; -import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; +import { UnifiedResources } from 'teleterm/ui/DocumentCluster/UnifiedResources'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { - makeRootCluster, - rootClusterUri, - makeServer, -} from 'teleterm/services/tshd/testHelpers'; +import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; import { getEmptyPendingAccessRequest } from 'teleterm/ui/services/workspacesService/accessRequestsService'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; import * as uri from 'teleterm/ui/uri'; const mio = mockIntersectionObserver(); diff --git a/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.tsx b/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.tsx index 46e96726ba374..eb0ada21c06dc 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.tsx @@ -16,63 +16,55 @@ * along with this program. If not, see . */ -import { useCallback, useEffect, useMemo, memo } from 'react'; +import { memo, useCallback, useEffect, useMemo } from 'react'; +import { ButtonPrimary, Flex, Link, ResourceIcon, Text } from 'design'; +import * as icons from 'design/Icon'; +import { ShowResources } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; +import { + ListUnifiedResourcesRequest, + UserPreferences, +} from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; +import { DefaultTab } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; import { - UnifiedResources as SharedUnifiedResources, - useUnifiedResourcesFetch, - UnifiedResourcesQueryParams, - SharedUnifiedResource, - UnifiedResourcesPinning, getResourceAvailabilityFilter, ResourceAvailabilityFilter, + SharedUnifiedResource, + UnifiedResources as SharedUnifiedResources, + UnifiedResourcesPinning, + UnifiedResourcesQueryParams, + useUnifiedResourcesFetch, } from 'shared/components/UnifiedResources'; +import { Attempt } from 'shared/hooks/useAsync'; +import { NodeSubKind } from 'shared/services'; import { DbProtocol, - formatDatabaseInfo, DbType, + formatDatabaseInfo, } from 'shared/services/databases'; - -import { Flex, ButtonPrimary, Text, Link, ResourceIcon } from 'design'; - -import * as icons from 'design/Icon'; - -import { Attempt } from 'shared/hooks/useAsync'; - -import { ShowResources } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { DefaultTab } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; - -import { NodeSubKind } from 'shared/services'; import { waitForever } from 'shared/utils/wait'; -import { - UserPreferences, - ListUnifiedResourcesRequest, -} from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; - -import { UnifiedResourceResponse } from 'teleterm/ui/services/resources'; +import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import * as uri from 'teleterm/ui/uri'; +import { useConnectMyComputerContext } from 'teleterm/ui/ConnectMyComputer'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { useWorkspaceLoggedInUser } from 'teleterm/ui/hooks/useLoggedInUser'; -import { useConnectMyComputerContext } from 'teleterm/ui/ConnectMyComputer'; - -import { retryWithRelogin } from 'teleterm/ui/utils'; +import { useStoreSelector } from 'teleterm/ui/hooks/useStoreSelector'; +import { UnifiedResourceResponse } from 'teleterm/ui/services/resources'; import { - DocumentClusterQueryParams, DocumentCluster, + DocumentClusterQueryParams, DocumentClusterResourceKind, } from 'teleterm/ui/services/workspacesService'; -import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; - -import { useStoreSelector } from 'teleterm/ui/hooks/useStoreSelector'; +import * as uri from 'teleterm/ui/uri'; +import { retryWithRelogin } from 'teleterm/ui/utils'; import { - ConnectServerActionButton, - ConnectKubeActionButton, - ConnectDatabaseActionButton, - ConnectAppActionButton, AccessRequestButton, + ConnectAppActionButton, + ConnectDatabaseActionButton, + ConnectKubeActionButton, + ConnectServerActionButton, } from './ActionButtons'; import { useResourcesContext } from './resourcesContext'; import { useUserPreferences } from './useUserPreferences'; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/index.ts b/web/packages/teleterm/src/ui/DocumentCluster/index.ts index b3a60f29ec442..47714280d83ab 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/index.ts +++ b/web/packages/teleterm/src/ui/DocumentCluster/index.ts @@ -17,4 +17,5 @@ */ import DocumentCluster from './DocumentCluster'; + export default DocumentCluster; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/resourcesContext.test.tsx b/web/packages/teleterm/src/ui/DocumentCluster/resourcesContext.test.tsx index 37d1339db9611..8a4e5912b2769 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/resourcesContext.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/resourcesContext.test.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import React from 'react'; import { renderHook } from '@testing-library/react'; +import React from 'react'; import { rootClusterUri } from 'teleterm/services/tshd/testHelpers'; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.test.tsx b/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.test.tsx index 9fb6636900c9f..be8994d3ce0fd 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.test.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { renderHook, act } from '@testing-library/react'; +import { act, renderHook } from '@testing-library/react'; import { AvailableResourceMode, @@ -25,16 +25,15 @@ import { ViewMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; -import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; - -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { - UserPreferences, GetUserPreferencesResponse, UpdateUserPreferencesResponse, + UserPreferences, } from 'teleterm/services/tshd/types'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { useUserPreferences } from './useUserPreferences'; diff --git a/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.ts b/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.ts index bce52fb8b65fa..d1ce4c098dca5 100644 --- a/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.ts +++ b/web/packages/teleterm/src/ui/DocumentCluster/useUserPreferences.ts @@ -16,19 +16,7 @@ * along with this program. If not, see . */ -import { useCallback, useEffect, useRef, useState, useMemo } from 'react'; - -import { - useAsync, - Attempt, - makeEmptyAttempt, - makeProcessingAttempt, - makeErrorAttempt, - makeSuccessAttempt, - mapAttempt, - CanceledError, - hasFinished, -} from 'shared/hooks/useAsync'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { AvailableResourceMode, @@ -37,14 +25,23 @@ import { UnifiedResourcePreferences, ViewMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; +import { + Attempt, + CanceledError, + hasFinished, + makeEmptyAttempt, + makeErrorAttempt, + makeProcessingAttempt, + makeSuccessAttempt, + mapAttempt, + useAsync, +} from 'shared/hooks/useAsync'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; - -import { routing, ClusterUri } from 'teleterm/ui/uri'; - +import { cloneAbortSignal } from 'teleterm/services/tshd/cloneableClient'; import { UserPreferences } from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { ClusterUri, routing } from 'teleterm/ui/uri'; import { retryWithRelogin } from 'teleterm/ui/utils'; -import { cloneAbortSignal } from 'teleterm/services/tshd/cloneableClient'; export function useUserPreferences(clusterUri: ClusterUri): { userPreferencesAttempt: Attempt; diff --git a/web/packages/teleterm/src/ui/DocumentGateway/CliCommand.tsx b/web/packages/teleterm/src/ui/DocumentGateway/CliCommand.tsx index c770f87095d31..f3df59a4413b2 100644 --- a/web/packages/teleterm/src/ui/DocumentGateway/CliCommand.tsx +++ b/web/packages/teleterm/src/ui/DocumentGateway/CliCommand.tsx @@ -17,9 +17,10 @@ */ import React, { useEffect, useState } from 'react'; +import styled from 'styled-components'; + import { Box, ButtonPrimary, Flex, Indicator } from 'design'; import { fade } from 'design/theme/utils/colorManipulator'; -import styled from 'styled-components'; interface CliCommandProps { cliCommand: string; diff --git a/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.story.tsx b/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.story.tsx index 40be4308b7be7..7478299b730b8 100644 --- a/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.story.tsx +++ b/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.story.tsx @@ -20,8 +20,8 @@ import React from 'react'; import { makeEmptyAttempt, - makeProcessingAttempt, makeErrorAttemptWithStatusText, + makeProcessingAttempt, makeSuccessAttempt, } from 'shared/hooks/useAsync'; diff --git a/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.tsx b/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.tsx index 7da5e54696438..4856791ce142a 100644 --- a/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.tsx +++ b/web/packages/teleterm/src/ui/DocumentGateway/DocumentGateway.tsx @@ -22,9 +22,8 @@ import Document from 'teleterm/ui/Document'; import * as types from 'teleterm/ui/services/workspacesService'; import { OfflineGateway } from '../components/OfflineGateway'; - -import { useDocumentGateway } from './useDocumentGateway'; import { OnlineDocumentGateway } from './OnlineDocumentGateway'; +import { useDocumentGateway } from './useDocumentGateway'; type Props = { visible: boolean; diff --git a/web/packages/teleterm/src/ui/DocumentGateway/OnlineDocumentGateway.tsx b/web/packages/teleterm/src/ui/DocumentGateway/OnlineDocumentGateway.tsx index 3e4ebb85a2b88..00f0e3b3e6875 100644 --- a/web/packages/teleterm/src/ui/DocumentGateway/OnlineDocumentGateway.tsx +++ b/web/packages/teleterm/src/ui/DocumentGateway/OnlineDocumentGateway.tsx @@ -17,13 +17,13 @@ */ import React, { useMemo, useRef } from 'react'; -import { debounce } from 'shared/utils/highbar'; + import { Box, ButtonSecondary, Flex, Link, Text } from 'design'; -import Validation from 'shared/components/Validation'; import * as Alerts from 'design/Alert'; +import Validation from 'shared/components/Validation'; +import { debounce } from 'shared/utils/highbar'; import { ConfigFieldInput, PortFieldInput } from '../components/FieldInputs'; - import { CliCommand } from './CliCommand'; import { DocumentGatewayProps } from './DocumentGateway'; diff --git a/web/packages/teleterm/src/ui/DocumentGateway/index.ts b/web/packages/teleterm/src/ui/DocumentGateway/index.ts index 824e4c702d571..958e9ed748300 100644 --- a/web/packages/teleterm/src/ui/DocumentGateway/index.ts +++ b/web/packages/teleterm/src/ui/DocumentGateway/index.ts @@ -17,4 +17,5 @@ */ import DocumentGateway from './DocumentGateway'; + export default DocumentGateway; diff --git a/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.test.tsx b/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.test.tsx index f2c0ed0023bb4..0f0aeeb920841 100644 --- a/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.test.tsx @@ -16,12 +16,12 @@ * along with this program. If not, see . */ +import { act, renderHook, waitFor } from '@testing-library/react'; import React from 'react'; -import { renderHook, act, waitFor } from '@testing-library/react'; import { - makeRootCluster, makeDatabaseGateway, + makeRootCluster, } from 'teleterm/services/tshd/testHelpers'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { DocumentGateway } from 'teleterm/ui/services/workspacesService'; @@ -29,7 +29,6 @@ import { DatabaseUri } from 'teleterm/ui/uri'; import { WorkspaceContextProvider } from '../Documents'; import { MockAppContextProvider } from '../fixtures/MockAppContextProvider'; - import { useDocumentGateway } from './useDocumentGateway'; beforeEach(() => { diff --git a/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.ts b/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.ts index 17374d401282c..d441258021314 100644 --- a/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.ts +++ b/web/packages/teleterm/src/ui/DocumentGateway/useDocumentGateway.ts @@ -20,13 +20,13 @@ import { useEffect } from 'react'; import { useAsync } from 'shared/hooks/useAsync'; +import * as tshdGateway from 'teleterm/services/tshd/gateway'; +import { Gateway } from 'teleterm/services/tshd/types'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import * as types from 'teleterm/ui/services/workspacesService'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import * as types from 'teleterm/ui/services/workspacesService'; +import { isAppUri, isDatabaseUri } from 'teleterm/ui/uri'; import { retryWithRelogin } from 'teleterm/ui/utils'; -import * as tshdGateway from 'teleterm/services/tshd/gateway'; -import { Gateway } from 'teleterm/services/tshd/types'; -import { isDatabaseUri, isAppUri } from 'teleterm/ui/uri'; export function useGateway(doc: types.DocumentGateway) { const ctx = useAppContext(); diff --git a/web/packages/teleterm/src/ui/DocumentGatewayApp/AppGateway.tsx b/web/packages/teleterm/src/ui/DocumentGatewayApp/AppGateway.tsx index ac264f9d93aa3..b0145fa2b2db0 100644 --- a/web/packages/teleterm/src/ui/DocumentGatewayApp/AppGateway.tsx +++ b/web/packages/teleterm/src/ui/DocumentGatewayApp/AppGateway.tsx @@ -19,21 +19,19 @@ import { useMemo, useRef } from 'react'; import { - Flex, - Text, - ButtonSecondary, - Link, - Box, Alert, + Box, + ButtonSecondary, + Flex, Indicator, + Link, + Text, } from 'design'; - +import { TextSelectCopy } from 'shared/components/TextSelectCopy'; import Validation from 'shared/components/Validation'; import { Attempt } from 'shared/hooks/useAsync'; import { debounce } from 'shared/utils/highbar'; -import { TextSelectCopy } from 'shared/components/TextSelectCopy'; - import { Gateway } from 'teleterm/services/tshd/types'; import { PortFieldInput } from '../components/FieldInputs'; diff --git a/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.story.tsx b/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.story.tsx index 99d07789e7047..0e0f676750aab 100644 --- a/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.story.tsx +++ b/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.story.tsx @@ -20,13 +20,13 @@ import React from 'react'; import { wait } from 'shared/utils/wait'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import { makeAppGateway } from 'teleterm/services/tshd/testHelpers'; import { DocumentGatewayApp } from 'teleterm/ui/DocumentGatewayApp/DocumentGatewayApp'; -import * as types from 'teleterm/ui/services/workspacesService'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; -import { makeAppGateway } from 'teleterm/services/tshd/testHelpers'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import * as types from 'teleterm/ui/services/workspacesService'; export default { title: 'Teleterm/DocumentGatewayApp', diff --git a/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.tsx b/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.tsx index 39f8b5958bb3a..6e49864158a09 100644 --- a/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.tsx +++ b/web/packages/teleterm/src/ui/DocumentGatewayApp/DocumentGatewayApp.tsx @@ -17,13 +17,11 @@ */ import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { DocumentGateway } from 'teleterm/ui/services/workspacesService'; import Document from 'teleterm/ui/Document'; - -import { useDocumentGateway } from '../DocumentGateway/useDocumentGateway'; +import { DocumentGateway } from 'teleterm/ui/services/workspacesService'; import { OfflineGateway } from '../components/OfflineGateway'; - +import { useDocumentGateway } from '../DocumentGateway/useDocumentGateway'; import { AppGateway } from './AppGateway'; export function DocumentGatewayApp(props: { diff --git a/web/packages/teleterm/src/ui/DocumentGatewayCliClient/DocumentGatewayCliClient.tsx b/web/packages/teleterm/src/ui/DocumentGatewayCliClient/DocumentGatewayCliClient.tsx index b5226f6c67097..fcd4cde1bd146 100644 --- a/web/packages/teleterm/src/ui/DocumentGatewayCliClient/DocumentGatewayCliClient.tsx +++ b/web/packages/teleterm/src/ui/DocumentGatewayCliClient/DocumentGatewayCliClient.tsx @@ -16,15 +16,16 @@ * along with this program. If not, see . */ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Flex, Text, ButtonPrimary } from 'design'; -import Document from 'teleterm/ui/Document'; -import * as types from 'teleterm/ui/services/workspacesService'; +import { ButtonPrimary, Flex, Text } from 'design'; + import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { DocumentTerminal } from 'teleterm/ui/DocumentTerminal'; +import Document from 'teleterm/ui/Document'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import { DocumentTerminal } from 'teleterm/ui/DocumentTerminal'; +import * as types from 'teleterm/ui/services/workspacesService'; import { connectToDatabase } from 'teleterm/ui/services/workspacesService'; /** diff --git a/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.story.tsx b/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.story.tsx index a7a2ad9676485..a4e083c034712 100644 --- a/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.story.tsx +++ b/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.story.tsx @@ -18,11 +18,10 @@ import React from 'react'; -import * as types from 'teleterm/ui/services/workspacesService'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; - import { MockWorkspaceContextProvider } from 'teleterm/ui/fixtures/MockWorkspaceContextProvider'; +import * as types from 'teleterm/ui/services/workspacesService'; import { DocumentGatewayKube } from './DocumentGatewayKube'; diff --git a/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.tsx b/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.tsx index 0ea71ffc33c93..68a86c3df8923 100644 --- a/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.tsx +++ b/web/packages/teleterm/src/ui/DocumentGatewayKube/DocumentGatewayKube.tsx @@ -20,13 +20,13 @@ import React, { useEffect } from 'react'; import { useAsync } from 'shared/hooks/useAsync'; -import * as types from 'teleterm/ui/services/workspacesService'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { retryWithRelogin } from 'teleterm/ui/utils'; import Document from 'teleterm/ui/Document'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; import { DocumentTerminal } from 'teleterm/ui/DocumentTerminal'; +import * as types from 'teleterm/ui/services/workspacesService'; import { routing } from 'teleterm/ui/uri'; +import { retryWithRelogin } from 'teleterm/ui/utils'; import { OfflineGateway } from '../components/OfflineGateway'; diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/DocumentTerminal.tsx b/web/packages/teleterm/src/ui/DocumentTerminal/DocumentTerminal.tsx index def77da4ec252..e3a8255a92d12 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/DocumentTerminal.tsx +++ b/web/packages/teleterm/src/ui/DocumentTerminal/DocumentTerminal.tsx @@ -17,24 +17,24 @@ */ import React, { useCallback, useState } from 'react'; + import { - FileTransferActionBar, FileTransfer, + FileTransferActionBar, FileTransferContextProvider, } from 'shared/components/FileTransfer'; import { TerminalSearch } from 'shared/components/TerminalSearch'; -import Document from 'teleterm/ui/Document'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import Document from 'teleterm/ui/Document'; import { isDocumentTshNodeWithServerId } from 'teleterm/ui/services/workspacesService'; +import type * as types from 'teleterm/ui/services/workspacesService'; -import { Terminal } from './Terminal'; import { Reconnect } from './Reconnect'; +import { Terminal } from './Terminal'; import { useDocumentTerminal } from './useDocumentTerminal'; import { useTshFileTransferHandlers } from './useTshFileTransferHandlers'; -import type * as types from 'teleterm/ui/services/workspacesService'; - export function DocumentTerminal(props: { doc: types.DocumentTerminal; visible: boolean; diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/Reconnect.tsx b/web/packages/teleterm/src/ui/DocumentTerminal/Reconnect.tsx index 23238ce62eea9..b24a9e79f191d 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/Reconnect.tsx +++ b/web/packages/teleterm/src/ui/DocumentTerminal/Reconnect.tsx @@ -17,13 +17,13 @@ */ import React from 'react'; -import { Flex, Text, ButtonPrimary } from 'design'; + +import { ButtonPrimary, Flex, Text } from 'design'; import { Danger } from 'design/Alert'; import { Attempt } from 'shared/hooks/useAsync'; -import { assertUnreachable } from 'teleterm/ui/utils'; - import type * as types from 'teleterm/ui/services/workspacesService'; +import { assertUnreachable } from 'teleterm/ui/utils'; export function Reconnect(props: { docKind: types.DocumentTerminal['kind']; diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.test.tsx b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.test.tsx index 1fe5f522280d1..007627e43ea88 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.test.tsx @@ -17,14 +17,16 @@ */ import 'jest-canvas-mock'; + import { EventEmitter } from 'node:events'; -import userEvent from '@testing-library/user-event'; import { screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; + import { render } from 'design/utils/testing'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import Logger, { NullService } from 'teleterm/logger'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { IAppContext } from 'teleterm/ui/types'; import { Terminal } from './Terminal'; diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.tsx b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.tsx index 3217f60c38ae3..1db5f8d8b85ed 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.tsx +++ b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/Terminal.tsx @@ -18,24 +18,23 @@ import React, { useEffect, useRef, useState } from 'react'; import styled, { useTheme } from 'styled-components'; + import { Box, Flex } from 'design'; -import { debounce } from 'shared/utils/highbar'; import { Attempt, makeEmptyAttempt, makeErrorAttemptWithStatusText, makeSuccessAttempt, } from 'shared/hooks/useAsync'; +import { debounce } from 'shared/utils/highbar'; +import { ConfigService } from 'teleterm/services/config'; import { WindowsPty } from 'teleterm/services/pty'; import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; -import { DocumentTerminal } from 'teleterm/ui/services/workspacesService'; import { KeyboardShortcutsService } from 'teleterm/ui/services/keyboardShortcuts'; - -import { ConfigService } from 'teleterm/services/config'; +import { DocumentTerminal } from 'teleterm/ui/services/workspacesService'; import { Reconnect } from '../Reconnect'; - import XTermCtrl from './ctrl'; type TerminalProps = { diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts index d6877b69fcecd..a96d462490b8f 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts +++ b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts @@ -17,18 +17,20 @@ */ import '@xterm/xterm/css/xterm.css'; -import { IDisposable, ITheme, Terminal } from '@xterm/xterm'; + import { FitAddon } from '@xterm/addon-fit'; +import { IDisposable, ITheme, Terminal } from '@xterm/xterm'; + import { SearchAddon, TerminalSearcher, } from 'shared/components/TerminalSearch'; import { debounce } from 'shared/utils/highbar'; +import Logger from 'teleterm/logger'; +import { AppConfig, ConfigService } from 'teleterm/services/config'; import { WindowsPty } from 'teleterm/services/pty'; import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; -import Logger from 'teleterm/logger'; -import { ConfigService, AppConfig } from 'teleterm/services/config'; import { KeyboardShortcutsService } from 'teleterm/ui/services/keyboardShortcuts'; const WINDOW_RESIZE_DEBOUNCE_DELAY = 200; diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.test.tsx b/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.test.tsx index 1b4e1560ad797..8aeb603e5f6d1 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.test.tsx +++ b/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.test.tsx @@ -16,40 +16,39 @@ * along with this program. If not, see . */ -import React from 'react'; import { renderHook, waitFor } from '@testing-library/react'; +import React from 'react'; + import 'jest-canvas-mock'; import Logger, { NullService } from 'teleterm/logger'; import { PtyCommand, PtyProcessCreationStatus } from 'teleterm/services/pty'; +import { + makeLeafCluster, + makeRootCluster, + makeServer, +} from 'teleterm/services/tshd/testHelpers'; +import type * as tsh from 'teleterm/services/tshd/types'; +import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { + AmbiguousHostnameError, + ResourcesService, +} from 'teleterm/ui/services/resources'; +import { + DocumentPtySession, DocumentTerminal, DocumentTshNode, DocumentTshNodeWithLoginHost, DocumentTshNodeWithServerId, - DocumentPtySession, } from 'teleterm/ui/services/workspacesService'; -import { - ResourcesService, - AmbiguousHostnameError, -} from 'teleterm/ui/services/resources'; -import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; -import { - makeRootCluster, - makeLeafCluster, - makeServer, -} from 'teleterm/services/tshd/testHelpers'; +import type { IAppContext } from 'teleterm/ui/types'; +import type * as uri from 'teleterm/ui/uri'; import { WorkspaceContextProvider } from '../Documents'; - import { useDocumentTerminal } from './useDocumentTerminal'; -import type { IAppContext } from 'teleterm/ui/types'; -import type * as tsh from 'teleterm/services/tshd/types'; -import type * as uri from 'teleterm/ui/uri'; - beforeAll(() => { Logger.init(new NullService()); }); diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.ts b/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.ts index b4b30c01bcfd7..1245045473f0d 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.ts +++ b/web/packages/teleterm/src/ui/DocumentTerminal/useDocumentTerminal.ts @@ -17,34 +17,34 @@ */ import { useEffect, useRef } from 'react'; + import { useAsync } from 'shared/hooks/useAsync'; import { runOnce } from 'shared/utils/highbar'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { IAppContext } from 'teleterm/ui/types'; -import { - DocumentsService, - isDocumentTshNodeWithLoginHost, - canDocChangeShell, -} from 'teleterm/ui/services/workspacesService'; -import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; -import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { routing } from 'teleterm/ui/uri'; +import Logger from 'teleterm/logger'; +import type { Shell } from 'teleterm/mainProcess/shell'; import { PtyCommand, PtyProcessCreationStatus, WindowsPty, } from 'teleterm/services/pty'; -import { AmbiguousHostnameError } from 'teleterm/ui/services/resources'; -import { retryWithRelogin } from 'teleterm/ui/utils'; -import Logger from 'teleterm/logger'; -import { ClustersService } from 'teleterm/ui/services/clusters'; import * as tshdGateway from 'teleterm/services/tshd/gateway'; - -import type { Shell } from 'teleterm/mainProcess/shell'; +import type * as tsh from 'teleterm/services/tshd/types'; +import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useWorkspaceContext } from 'teleterm/ui/Documents'; +import { ClustersService } from 'teleterm/ui/services/clusters'; +import { AmbiguousHostnameError } from 'teleterm/ui/services/resources'; +import { + canDocChangeShell, + DocumentsService, + isDocumentTshNodeWithLoginHost, +} from 'teleterm/ui/services/workspacesService'; import type * as types from 'teleterm/ui/services/workspacesService'; +import { IAppContext } from 'teleterm/ui/types'; +import { routing } from 'teleterm/ui/uri'; import type * as uri from 'teleterm/ui/uri'; -import type * as tsh from 'teleterm/services/tshd/types'; +import { retryWithRelogin } from 'teleterm/ui/utils'; export function useDocumentTerminal(doc: types.DocumentTerminal) { const logger = useRef(new Logger('useDocumentTerminal')); diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/useTshFileTransferHandlers.ts b/web/packages/teleterm/src/ui/DocumentTerminal/useTshFileTransferHandlers.ts index 5fdc9c3b2835e..7c1c5387b935b 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/useTshFileTransferHandlers.ts +++ b/web/packages/teleterm/src/ui/DocumentTerminal/useTshFileTransferHandlers.ts @@ -16,18 +16,16 @@ * along with this program. If not, see . */ +import { FileTransferDirection } from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; import { - FileTransferListeners, createFileTransferEventsEmitter, + FileTransferListeners, } from 'shared/components/FileTransfer'; -import { FileTransferDirection } from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; - -import { retryWithRelogin } from 'teleterm/ui/utils'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { IAppContext } from 'teleterm/ui/types'; - import type * as uri from 'teleterm/ui/uri'; +import { retryWithRelogin } from 'teleterm/ui/utils'; export function useTshFileTransferHandlers() { const appContext = useAppContext(); diff --git a/web/packages/teleterm/src/ui/Documents/DocumentsRenderer.tsx b/web/packages/teleterm/src/ui/Documents/DocumentsRenderer.tsx index d1d300f0d8428..717d0bf344e79 100644 --- a/web/packages/teleterm/src/ui/Documents/DocumentsRenderer.tsx +++ b/web/packages/teleterm/src/ui/Documents/DocumentsRenderer.tsx @@ -18,36 +18,34 @@ import { useMemo } from 'react'; import { createPortal } from 'react-dom'; - import styled from 'styled-components'; + import { Text } from 'design'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { + ConnectMyComputerContextProvider, + ConnectMyComputerNavigationMenu, + DocumentConnectMyComputer, +} from 'teleterm/ui/ConnectMyComputer'; +import Document from 'teleterm/ui/Document'; import { DocumentAccessRequests } from 'teleterm/ui/DocumentAccessRequests'; +import { DocumentAuthorizeWebSession } from 'teleterm/ui/DocumentAuthorizeWebSession'; +import DocumentCluster from 'teleterm/ui/DocumentCluster'; +import DocumentGateway from 'teleterm/ui/DocumentGateway'; +import { DocumentGatewayApp } from 'teleterm/ui/DocumentGatewayApp'; import { DocumentGatewayCliClient } from 'teleterm/ui/DocumentGatewayCliClient'; - -import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { DocumentGatewayKube } from 'teleterm/ui/DocumentGatewayKube'; +import { DocumentTerminal } from 'teleterm/ui/DocumentTerminal'; import * as types from 'teleterm/ui/services/workspacesService'; import { DocumentsService, Workspace, } from 'teleterm/ui/services/workspacesService'; -import DocumentCluster from 'teleterm/ui/DocumentCluster'; -import DocumentGateway from 'teleterm/ui/DocumentGateway'; -import { DocumentTerminal } from 'teleterm/ui/DocumentTerminal'; -import { - ConnectMyComputerContextProvider, - DocumentConnectMyComputer, - ConnectMyComputerNavigationMenu, -} from 'teleterm/ui/ConnectMyComputer'; -import { DocumentGatewayKube } from 'teleterm/ui/DocumentGatewayKube'; -import { DocumentGatewayApp } from 'teleterm/ui/DocumentGatewayApp'; -import { DocumentAuthorizeWebSession } from 'teleterm/ui/DocumentAuthorizeWebSession'; +import { isAppUri, isDatabaseUri, RootClusterUri } from 'teleterm/ui/uri'; -import Document from 'teleterm/ui/Document'; -import { RootClusterUri, isDatabaseUri, isAppUri } from 'teleterm/ui/uri'; - -import { WorkspaceContextProvider } from './workspaceContext'; import { KeyboardShortcutsPanel } from './KeyboardShortcutsPanel'; +import { WorkspaceContextProvider } from './workspaceContext'; export function DocumentsRenderer(props: { topBarContainerRef: React.MutableRefObject; diff --git a/web/packages/teleterm/src/ui/Documents/KeyboardShortcutsPanel.tsx b/web/packages/teleterm/src/ui/Documents/KeyboardShortcutsPanel.tsx index 58554c11cbf1c..9c7402da37a15 100644 --- a/web/packages/teleterm/src/ui/Documents/KeyboardShortcutsPanel.tsx +++ b/web/packages/teleterm/src/ui/Documents/KeyboardShortcutsPanel.tsx @@ -17,14 +17,14 @@ */ import React from 'react'; -import { Text } from 'design'; - import styled from 'styled-components'; -import Document from 'teleterm/ui/Document'; -import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; +import { Text } from 'design'; + import { KeyboardShortcutAction } from 'teleterm/services/config'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import Document from 'teleterm/ui/Document'; +import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; export function KeyboardShortcutsPanel() { const { mainProcessClient } = useAppContext(); diff --git a/web/packages/teleterm/src/ui/Documents/workspaceContext.tsx b/web/packages/teleterm/src/ui/Documents/workspaceContext.tsx index f3e89ee30c022..d02e44a861f41 100644 --- a/web/packages/teleterm/src/ui/Documents/workspaceContext.tsx +++ b/web/packages/teleterm/src/ui/Documents/workspaceContext.tsx @@ -18,9 +18,9 @@ import React, { PropsWithChildren } from 'react'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { DocumentsService } from 'teleterm/ui/services/workspacesService'; import { AccessRequestsService } from 'teleterm/ui/services/workspacesService/accessRequestsService'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; import { ClusterUri, RootClusterUri } from 'teleterm/ui/uri'; const WorkspaceContext = React.createContext<{ diff --git a/web/packages/teleterm/src/ui/DocumentsReopen/DocumentsReopen.tsx b/web/packages/teleterm/src/ui/DocumentsReopen/DocumentsReopen.tsx index 8b94b4ec39f5d..c1dfce958c849 100644 --- a/web/packages/teleterm/src/ui/DocumentsReopen/DocumentsReopen.tsx +++ b/web/packages/teleterm/src/ui/DocumentsReopen/DocumentsReopen.tsx @@ -17,17 +17,18 @@ */ import React from 'react'; + +import { ButtonIcon, ButtonPrimary, ButtonSecondary, Text } from 'design'; import DialogConfirmation, { DialogContent, DialogFooter, DialogHeader, } from 'design/DialogConfirmation'; -import { ButtonIcon, ButtonPrimary, ButtonSecondary, Text } from 'design'; import { Cross } from 'design/Icon'; import { pluralize } from 'shared/utils/text'; -import { RootClusterUri, routing } from 'teleterm/ui/uri'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { RootClusterUri, routing } from 'teleterm/ui/uri'; export function DocumentsReopen(props: { rootClusterUri: RootClusterUri; diff --git a/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessAuthentication.tsx b/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessAuthentication.tsx index 1cb1a0e5e20c4..5df75c19b0e49 100644 --- a/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessAuthentication.tsx +++ b/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessAuthentication.tsx @@ -16,17 +16,15 @@ * along with this program. If not, see . */ -import React, { useRef, useEffect } from 'react'; - -import { useAsync } from 'shared/hooks/useAsync'; +import React, { useEffect, useRef } from 'react'; import { HeadlessAuthenticationState } from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; +import { useAsync } from 'shared/hooks/useAsync'; +import { cloneAbortSignal } from 'teleterm/services/tshd/cloneableClient'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { RootClusterUri } from 'teleterm/ui/uri'; -import { cloneAbortSignal } from 'teleterm/services/tshd/cloneableClient'; - import { HeadlessPrompt } from './HeadlessPrompt'; interface HeadlessAuthenticationProps { diff --git a/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessPrompt/HeadlessPrompt.tsx b/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessPrompt/HeadlessPrompt.tsx index 5bad9bbb59bb6..c64b92c65ef47 100644 --- a/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessPrompt/HeadlessPrompt.tsx +++ b/web/packages/teleterm/src/ui/HeadlessAuthn/HeadlessPrompt/HeadlessPrompt.tsx @@ -17,20 +17,20 @@ */ import React, { useState } from 'react'; + +import { Box, ButtonIcon, ButtonSecondary, Flex, Image, Text } from 'design'; import * as Alerts from 'design/Alert'; -import { ButtonIcon, Text, ButtonSecondary, Image, Flex, Box } from 'design'; import DialogConfirmation, { DialogContent, - DialogHeader, DialogFooter, + DialogHeader, } from 'design/DialogConfirmation'; -import { Attempt } from 'shared/hooks/useAsync'; import * as Icons from 'design/Icon'; - -import LinearProgress from 'teleterm/ui/components/LinearProgress'; -import svgHardwareKey from 'teleterm/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/hardware.svg'; +import { Attempt } from 'shared/hooks/useAsync'; import type * as tsh from 'teleterm/services/tshd/types'; +import svgHardwareKey from 'teleterm/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/hardware.svg'; +import LinearProgress from 'teleterm/ui/components/LinearProgress'; export type HeadlessPromptProps = { cluster: tsh.Cluster; diff --git a/web/packages/teleterm/src/ui/LayoutManager.tsx b/web/packages/teleterm/src/ui/LayoutManager.tsx index ffbf1893daccd..95a0ede392694 100644 --- a/web/packages/teleterm/src/ui/LayoutManager.tsx +++ b/web/packages/teleterm/src/ui/LayoutManager.tsx @@ -17,13 +17,14 @@ */ import React, { useRef } from 'react'; + import { Flex } from 'design'; import { AccessRequestCheckout } from 'teleterm/ui/AccessRequestCheckout'; +import { NotificationsHost } from 'teleterm/ui/components/Notifcations'; +import { StatusBar } from 'teleterm/ui/StatusBar'; import { TabHostContainer } from 'teleterm/ui/TabHost'; import { TopBar } from 'teleterm/ui/TopBar'; -import { StatusBar } from 'teleterm/ui/StatusBar'; -import { NotificationsHost } from 'teleterm/ui/components/Notifcations'; export function LayoutManager() { const topBarContainerRef = useRef(); diff --git a/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.story.tsx b/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.story.tsx index b09eeff930c91..29cdebecec897 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.story.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.story.tsx @@ -22,9 +22,9 @@ import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvi import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { DialogDocumentsReopen, - ModalsService, - DialogHardwareKeyTouch, DialogHardwareKeyPin, + DialogHardwareKeyTouch, + ModalsService, } from 'teleterm/ui/services/modals'; import ModalsHost from './ModalsHost'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.test.tsx b/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.test.tsx index de5743e01dac0..7d27a474a3f19 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.test.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.test.tsx @@ -16,17 +16,18 @@ * along with this program. If not, see . */ +import { act } from '@testing-library/react'; import React from 'react'; + import { render, screen } from 'design/utils/testing'; -import { act } from '@testing-library/react'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { - ModalsService, - DialogDocumentsReopen, DialogClusterConnect, + DialogDocumentsReopen, DialogHardwareKeyTouch, + ModalsService, } from 'teleterm/ui/services/modals'; import ModalsHost from './ModalsHost'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.tsx b/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.tsx index 2ec7841a07ca3..8023f500ef219 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/ModalsHost.tsx @@ -19,21 +19,19 @@ import React, { Fragment } from 'react'; import { useAppContext } from 'teleterm/ui/appContextProvider'; - import { ClusterConnect } from 'teleterm/ui/ClusterConnect'; import { DocumentsReopen } from 'teleterm/ui/DocumentsReopen'; -import { Dialog } from 'teleterm/ui/services/modals'; import { HeadlessAuthentication } from 'teleterm/ui/HeadlessAuthn'; +import { Dialog } from 'teleterm/ui/services/modals'; import { ClusterLogout } from '../ClusterLogout'; import { ResourceSearchErrors } from '../Search/ResourceSearchErrors'; import { assertUnreachable } from '../utils'; - -import { UsageData } from './modals/UsageData'; -import { UserJobRole } from './modals/UserJobRole'; -import { ReAuthenticate } from './modals/ReAuthenticate'; import { ChangeAccessRequestKind } from './modals/ChangeAccessRequestKind'; import { AskPin, ChangePin, OverwriteSlot, Touch } from './modals/HardwareKeys'; +import { ReAuthenticate } from './modals/ReAuthenticate'; +import { UsageData } from './modals/UsageData'; +import { UserJobRole } from './modals/UserJobRole'; export default function ModalsHost() { const { modalsService } = useAppContext(); diff --git a/web/packages/teleterm/src/ui/ModalsHost/index.ts b/web/packages/teleterm/src/ui/ModalsHost/index.ts index caa8458fdaa29..0f2214c9936fb 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/index.ts +++ b/web/packages/teleterm/src/ui/ModalsHost/index.ts @@ -17,4 +17,5 @@ */ import ModalsHost from './ModalsHost'; + export default ModalsHost; diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/ChangeAccessRequestKind/ChangeAccessRequestKind.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/ChangeAccessRequestKind/ChangeAccessRequestKind.tsx index 1464e91fa49de..8a1f969a2844a 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/ChangeAccessRequestKind/ChangeAccessRequestKind.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/ChangeAccessRequestKind/ChangeAccessRequestKind.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { Text, ButtonIcon, ButtonWarning } from 'design'; +import { ButtonIcon, ButtonWarning, Text } from 'design'; import DialogConfirmation, { DialogContent, DialogFooter, diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/AskPin.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/AskPin.tsx index 964ec26cd54cf..a476b8f04189c 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/AskPin.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/AskPin.tsx @@ -18,17 +18,16 @@ import { useState } from 'react'; +import { ButtonPrimary, Flex, P2 } from 'design'; import DialogConfirmation, { DialogContent, DialogFooter, } from 'design/DialogConfirmation'; -import { ButtonPrimary, Flex, P2 } from 'design'; +import { PromptHardwareKeyPINRequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; import FieldInput from 'shared/components/FieldInput'; import Validation from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; -import { PromptHardwareKeyPINRequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; - import { CommonHeader } from './CommonHeader'; export function AskPin(props: { diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/ChangePin.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/ChangePin.tsx index 29b19e5e08eac..97b5b3e25dd4c 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/ChangePin.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/ChangePin.tsx @@ -18,22 +18,21 @@ import { useState } from 'react'; +import { ButtonPrimary, Flex, P2, Toggle } from 'design'; import DialogConfirmation, { DialogContent, DialogFooter, } from 'design/DialogConfirmation'; -import { ButtonPrimary, Flex, Toggle, P2 } from 'design'; -import Validation from 'shared/components/Validation'; -import FieldInput from 'shared/components/FieldInput'; import { PromptHardwareKeyPINChangeRequest, PromptHardwareKeyPINChangeResponse, } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; - +import FieldInput from 'shared/components/FieldInput'; +import Validation from 'shared/components/Validation'; import { + requiredAll, requiredField, Rule, - requiredAll, } from 'shared/components/Validation/rules'; import { CommonHeader } from './CommonHeader'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/CommonHeader.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/CommonHeader.tsx index 8027886e8fa64..fd41eaddaed6f 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/CommonHeader.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/CommonHeader.tsx @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -import { H2, ButtonIcon } from 'design'; -import * as icons from 'design/Icon'; +import { ButtonIcon, H2 } from 'design'; import { DialogHeader } from 'design/Dialog'; +import * as icons from 'design/Icon'; import { RootClusterUri, routing } from 'teleterm/ui/uri'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/OverwriteSlot.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/OverwriteSlot.tsx index 7a7aa9ab5bedc..8b0fccf6daca4 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/OverwriteSlot.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/OverwriteSlot.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ +import { ButtonPrimary, ButtonSecondary, Flex, P2 } from 'design'; import DialogConfirmation, { DialogContent, DialogFooter, } from 'design/DialogConfirmation'; -import { ButtonPrimary, ButtonSecondary, Flex, P2 } from 'design'; import { ConfirmHardwareKeySlotOverwriteRequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; import { CommonHeader } from './CommonHeader'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/Touch.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/Touch.tsx index 287f1e91b3bff..48d67007d3067 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/Touch.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/Touch.tsx @@ -16,9 +16,8 @@ * along with this program. If not, see . */ -import DialogConfirmation, { DialogContent } from 'design/DialogConfirmation'; import { Flex, Image, P2 } from 'design'; - +import DialogConfirmation, { DialogContent } from 'design/DialogConfirmation'; import { PromptHardwareKeyTouchRequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; import svgHardwareKey from 'teleterm/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/hardware.svg'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/index.story.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/index.story.tsx index 835e3b17606b6..34e7418554c3c 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/index.story.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/HardwareKeys/index.story.tsx @@ -20,10 +20,10 @@ import { Meta } from '@storybook/react'; import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; -import { Touch as TouchComponent } from './Touch'; -import { OverwriteSlot as OverwriteSlotComponent } from './OverwriteSlot'; -import { ChangePin as ChangePinComponent } from './ChangePin'; import { AskPin as AskPinComponent } from './AskPin'; +import { ChangePin as ChangePinComponent } from './ChangePin'; +import { OverwriteSlot as OverwriteSlotComponent } from './OverwriteSlot'; +import { Touch as TouchComponent } from './Touch'; const rootCluster = makeRootCluster(); diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.story.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.story.tsx index 42a48089b48a0..1e8ffab2076b7 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.story.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.story.tsx @@ -17,8 +17,8 @@ */ import { - makeRootCluster, makeLeafCluster, + makeRootCluster, } from 'teleterm/services/tshd/testHelpers'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.tsx index 3c7a7a46a76bc..433e658e57da4 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/ReAuthenticate/ReAuthenticate.tsx @@ -18,35 +18,32 @@ import { FC, useState } from 'react'; -import { PromptMFARequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; - -import DialogConfirmation, { - DialogContent, - DialogFooter, - DialogHeader, -} from 'design/DialogConfirmation'; import { + Box, ButtonIcon, ButtonPrimary, ButtonSecondary, - Text, - Image, Flex, - Box, + Image, + Text, } from 'design'; +import DialogConfirmation, { + DialogContent, + DialogFooter, + DialogHeader, +} from 'design/DialogConfirmation'; import * as icons from 'design/Icon'; -import Validation from 'shared/components/Validation'; -import { requiredToken } from 'shared/components/Validation/rules'; +import { PromptMFARequest } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; import FieldInput from 'shared/components/FieldInput'; import FieldSelect from 'shared/components/FieldSelect'; - import { Option } from 'shared/components/Select'; - +import Validation from 'shared/components/Validation'; +import { requiredToken } from 'shared/components/Validation/rules'; import { assertUnreachable } from 'shared/utils/assertUnreachable'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import LinearProgress from 'teleterm/ui/components/LinearProgress'; import svgHardwareKey from 'teleterm/ui/ClusterConnect/ClusterLogin/FormLogin/PromptWebauthn/hardware.svg'; +import LinearProgress from 'teleterm/ui/components/LinearProgress'; import { useLogger } from 'teleterm/ui/hooks/useLogger'; import { routing } from 'teleterm/ui/uri'; diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/UsageData/UsageData.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/UsageData/UsageData.tsx index c48c369f22167..a377840928960 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/UsageData/UsageData.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/UsageData/UsageData.tsx @@ -17,12 +17,13 @@ */ import React from 'react'; + +import { ButtonIcon, ButtonPrimary, ButtonSecondary, Link, Text } from 'design'; import DialogConfirmation, { DialogContent, DialogFooter, DialogHeader, } from 'design/DialogConfirmation'; -import { ButtonIcon, ButtonPrimary, ButtonSecondary, Link, Text } from 'design'; import { Cross } from 'design/Icon'; export function UsageData(props: { diff --git a/web/packages/teleterm/src/ui/ModalsHost/modals/UserJobRole/UserJobRole.tsx b/web/packages/teleterm/src/ui/ModalsHost/modals/UserJobRole/UserJobRole.tsx index e4a7746cd972b..86be089f60eda 100644 --- a/web/packages/teleterm/src/ui/ModalsHost/modals/UserJobRole/UserJobRole.tsx +++ b/web/packages/teleterm/src/ui/ModalsHost/modals/UserJobRole/UserJobRole.tsx @@ -18,6 +18,7 @@ import React, { useRef, useState } from 'react'; import styled from 'styled-components'; + import { ButtonIcon, ButtonPrimary, diff --git a/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.story.tsx b/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.story.tsx index 3864ded2f2bc5..1c2942ecf3a85 100644 --- a/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.story.tsx +++ b/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.story.tsx @@ -18,8 +18,8 @@ import React from 'react'; -import { routing } from 'teleterm/ui/uri'; import { ResourceSearchError } from 'teleterm/ui/services/resources'; +import { routing } from 'teleterm/ui/uri'; import { ResourceSearchErrors } from './ResourceSearchErrors'; diff --git a/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.tsx b/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.tsx index 6f81cda282e7c..5370078006627 100644 --- a/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.tsx +++ b/web/packages/teleterm/src/ui/Search/ResourceSearchErrors.tsx @@ -17,16 +17,16 @@ */ import React from 'react'; + +import { ButtonIcon, ButtonSecondary, Text } from 'design'; import DialogConfirmation, { DialogContent, DialogFooter, DialogHeader, } from 'design/DialogConfirmation'; -import { ButtonIcon, ButtonSecondary, Text } from 'design'; import { Cross } from 'design/Icon'; import { ResourceSearchError } from 'teleterm/ui/services/resources'; - import type * as uri from 'teleterm/ui/uri'; export function ResourceSearchErrors(props: { diff --git a/web/packages/teleterm/src/ui/Search/SearchBar.test.tsx b/web/packages/teleterm/src/ui/Search/SearchBar.test.tsx index 00524ce787187..9a625ae121d9a 100644 --- a/web/packages/teleterm/src/ui/Search/SearchBar.test.tsx +++ b/web/packages/teleterm/src/ui/Search/SearchBar.test.tsx @@ -16,32 +16,31 @@ * along with this program. If not, see . */ -import React from 'react'; import userEvent from '@testing-library/user-event'; -import { render, screen, waitFor, act } from 'design/utils/testing'; +import React from 'react'; + +import { act, render, screen, waitFor } from 'design/utils/testing'; import { makeSuccessAttempt } from 'shared/hooks/useAsync'; import Logger, { NullService } from 'teleterm/logger'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { ResourceSearchError } from 'teleterm/ui/services/resources'; -import ModalsHost from 'teleterm/ui/ModalsHost'; import { - makeRootCluster, makeRetryableError, + makeRootCluster, } from 'teleterm/services/tshd/testHelpers'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import ModalsHost from 'teleterm/ui/ModalsHost'; +import { ResourceSearchError } from 'teleterm/ui/services/resources'; +import { ConnectionsContextProvider } from 'teleterm/ui/TopBar/Connections/connectionsContext'; import { ClusterUri } from 'teleterm/ui/uri'; import { VnetContextProvider } from 'teleterm/ui/Vnet'; -import { ConnectionsContextProvider } from 'teleterm/ui/TopBar/Connections/connectionsContext'; import { SearchAction } from './actions'; - import * as pickers from './pickers/pickers'; import * as useActionAttempts from './pickers/useActionAttempts'; -import * as useSearch from './useSearch'; -import * as SearchContext from './SearchContext'; - import { SearchBarConnected } from './SearchBar'; +import * as SearchContext from './SearchContext'; +import * as useSearch from './useSearch'; beforeAll(() => { Logger.init(new NullService()); diff --git a/web/packages/teleterm/src/ui/Search/SearchBar.tsx b/web/packages/teleterm/src/ui/Search/SearchBar.tsx index 750662ea0ec62..ee8a5bbab0d6a 100644 --- a/web/packages/teleterm/src/ui/Search/SearchBar.tsx +++ b/web/packages/teleterm/src/ui/Search/SearchBar.tsx @@ -16,15 +16,16 @@ * along with this program. If not, see . */ -import React, { useRef, useEffect } from 'react'; +import React, { useEffect, useRef } from 'react'; import styled from 'styled-components'; + import { Box, Flex } from 'design'; +import { KeyboardShortcutAction } from 'teleterm/services/config'; import { SearchContextProvider, useSearchContext, } from 'teleterm/ui/Search/SearchContext'; -import { KeyboardShortcutAction } from 'teleterm/services/config'; import { useKeyboardShortcutFormatters, useKeyboardShortcuts, diff --git a/web/packages/teleterm/src/ui/Search/SearchContext.test.tsx b/web/packages/teleterm/src/ui/Search/SearchContext.test.tsx index caa7cf9dd02a8..b35fb07e53243 100644 --- a/web/packages/teleterm/src/ui/Search/SearchContext.test.tsx +++ b/web/packages/teleterm/src/ui/Search/SearchContext.test.tsx @@ -17,14 +17,21 @@ */ import React, { PropsWithChildren } from 'react'; + import '@testing-library/jest-dom'; -import { fireEvent, createEvent, render, screen } from '@testing-library/react'; -import { renderHook, act } from '@testing-library/react'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { + act, + createEvent, + fireEvent, + render, + renderHook, + screen, +} from '@testing-library/react'; -import { IAppContext } from 'teleterm/ui/types'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { IAppContext } from 'teleterm/ui/types'; import { SearchContextProvider, useSearchContext } from './SearchContext'; diff --git a/web/packages/teleterm/src/ui/Search/SearchContext.tsx b/web/packages/teleterm/src/ui/Search/SearchContext.tsx index 86682321d3ef8..28c32255fc93a 100644 --- a/web/packages/teleterm/src/ui/Search/SearchContext.tsx +++ b/web/packages/teleterm/src/ui/Search/SearchContext.tsx @@ -17,19 +17,18 @@ */ import React, { - useContext, - useState, - FC, - useCallback, createContext, - useRef, + FC, MutableRefObject, PropsWithChildren, + useCallback, + useContext, + useRef, + useState, } from 'react'; -import { SearchFilter } from 'teleterm/ui/Search/searchResult'; - import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { SearchFilter } from 'teleterm/ui/Search/searchResult'; import { Document, DocumentClusterQueryParams, diff --git a/web/packages/teleterm/src/ui/Search/actions.tsx b/web/packages/teleterm/src/ui/Search/actions.tsx index d2a693a92496f..1525b89a5b6dd 100644 --- a/web/packages/teleterm/src/ui/Search/actions.tsx +++ b/web/packages/teleterm/src/ui/Search/actions.tsx @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -import { IAppContext } from 'teleterm/ui/types'; -import { SearchResult } from 'teleterm/ui/Search/searchResult'; import { SearchContext } from 'teleterm/ui/Search/SearchContext'; +import { SearchResult } from 'teleterm/ui/Search/searchResult'; import { + connectToApp, connectToDatabase, connectToKube, connectToServer, - connectToApp, DocumentCluster, getDefaultDocumentClusterQueryParams, } from 'teleterm/ui/services/workspacesService'; -import { retryWithRelogin, assertUnreachable } from 'teleterm/ui/utils'; -import { routing } from 'teleterm/ui/uri'; import { ResourceRequest } from 'teleterm/ui/services/workspacesService/accessRequestsService'; +import { IAppContext } from 'teleterm/ui/types'; +import { routing } from 'teleterm/ui/uri'; +import { assertUnreachable, retryWithRelogin } from 'teleterm/ui/utils'; export interface SimpleAction { type: 'simple-action'; diff --git a/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.test.ts b/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.test.ts index bb778e29ad25f..1b8637a109024 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.test.ts +++ b/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.test.ts @@ -19,8 +19,8 @@ import { makeSuccessAttempt } from 'shared/hooks/useAsync'; import { - makeRootCluster, makeRetryableError, + makeRootCluster, } from 'teleterm/services/tshd/testHelpers'; import { ResourceSearchError } from 'teleterm/ui/services/resources'; diff --git a/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.tsx b/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.tsx index 3e244b0eff330..8a0e96a59778e 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.tsx +++ b/web/packages/teleterm/src/ui/Search/pickers/ActionPicker.tsx @@ -18,38 +18,39 @@ import React, { ReactElement, useCallback, useMemo } from 'react'; import styled from 'styled-components'; -import { Box, ButtonBorder, Flex, Label as DesignLabel, Text } from 'design'; + +import { Box, ButtonBorder, Label as DesignLabel, Flex, Text } from 'design'; import * as icons from 'design/Icon'; import { Cross as CloseIcon } from 'design/Icon'; +import { AdvancedSearchToggle } from 'shared/components/AdvancedSearchToggle'; import { Highlight } from 'shared/components/Highlight'; import { Attempt, hasFinished, makeSuccessAttempt, } from 'shared/hooks/useAsync'; -import { AdvancedSearchToggle } from 'shared/components/AdvancedSearchToggle'; +import { isWebApp } from 'teleterm/services/tshd/app'; +import * as tsh from 'teleterm/services/tshd/types'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { + DisplayResults, + isClusterSearchFilter, ResourceMatch, ResourceSearchResult, SearchFilter, SearchResult, + SearchResultApp, SearchResultCluster, SearchResultDatabase, SearchResultKube, - SearchResultApp, SearchResultResourceType, SearchResultServer, - DisplayResults, - isClusterSearchFilter, } from 'teleterm/ui/Search/searchResult'; -import * as tsh from 'teleterm/services/tshd/types'; -import * as uri from 'teleterm/ui/uri'; import { ResourceSearchError } from 'teleterm/ui/services/resources'; -import { isRetryable } from 'teleterm/ui/utils/retryWithRelogin'; +import * as uri from 'teleterm/ui/uri'; import { assertUnreachable } from 'teleterm/ui/utils'; -import { isWebApp } from 'teleterm/services/tshd/app'; +import { isRetryable } from 'teleterm/ui/utils/retryWithRelogin'; import { useVnetContext } from 'teleterm/ui/Vnet'; import { SearchAction } from '../actions'; @@ -58,11 +59,10 @@ import { CrossClusterResourceSearchResult, resourceTypeToReadableName, } from '../useSearch'; - -import { useActionAttempts } from './useActionAttempts'; -import { getParameterPicker } from './pickers'; -import { ResultList, NonInteractiveItem, IconAndContent } from './ResultList'; import { PickerContainer } from './PickerContainer'; +import { getParameterPicker } from './pickers'; +import { IconAndContent, NonInteractiveItem, ResultList } from './ResultList'; +import { useActionAttempts } from './useActionAttempts'; export function ActionPicker(props: { input: ReactElement }) { const ctx = useAppContext(); diff --git a/web/packages/teleterm/src/ui/Search/pickers/ParameterPicker.tsx b/web/packages/teleterm/src/ui/Search/pickers/ParameterPicker.tsx index 3d927eec9de95..ba614171fbe6a 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/ParameterPicker.tsx +++ b/web/packages/teleterm/src/ui/Search/pickers/ParameterPicker.tsx @@ -17,22 +17,22 @@ */ import React, { ReactElement, useCallback, useEffect } from 'react'; + +import { Text } from 'design'; +import * as icons from 'design/Icon'; import { Highlight } from 'shared/components/Highlight'; import { + Attempt, makeSuccessAttempt, mapAttempt, useAsync, - Attempt, } from 'shared/hooks/useAsync'; -import { Text } from 'design'; -import * as icons from 'design/Icon'; +import { Parameter, ParametrizedAction } from '../actions'; import { useSearchContext } from '../SearchContext'; -import { ParametrizedAction, Parameter } from '../actions'; - -import { IconAndContent, NonInteractiveItem, ResultList } from './ResultList'; -import { actionPicker } from './pickers'; import { PickerContainer } from './PickerContainer'; +import { actionPicker } from './pickers'; +import { IconAndContent, NonInteractiveItem, ResultList } from './ResultList'; interface ParameterPickerProps { action: ParametrizedAction; diff --git a/web/packages/teleterm/src/ui/Search/pickers/ResultList.tsx b/web/packages/teleterm/src/ui/Search/pickers/ResultList.tsx index cd93e694e3d28..f0fa28d8901e2 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/ResultList.tsx +++ b/web/packages/teleterm/src/ui/Search/pickers/ResultList.tsx @@ -18,14 +18,15 @@ import React, { ReactElement, + useCallback, useEffect, useRef, useState, - useCallback, } from 'react'; +import styled, { css } from 'styled-components'; + import { Flex } from 'design'; import { IconProps } from 'design/Icon/Icon'; -import styled, { css } from 'styled-components'; import { Attempt } from 'shared/hooks/useAsync'; import LinearProgress from 'teleterm/ui/components/LinearProgress'; diff --git a/web/packages/teleterm/src/ui/Search/pickers/pickers.tsx b/web/packages/teleterm/src/ui/Search/pickers/pickers.tsx index 770ab05d091ec..493b2e3fd068a 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/pickers.tsx +++ b/web/packages/teleterm/src/ui/Search/pickers/pickers.tsx @@ -19,7 +19,6 @@ import React from 'react'; import { ParametrizedAction } from '../actions'; - import { ActionPicker } from './ActionPicker'; import { ParameterPicker } from './ParameterPicker'; diff --git a/web/packages/teleterm/src/ui/Search/pickers/results.story.tsx b/web/packages/teleterm/src/ui/Search/pickers/results.story.tsx index ac2f734049fa7..25ba7a8495f2c 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/results.story.tsx +++ b/web/packages/teleterm/src/ui/Search/pickers/results.story.tsx @@ -17,40 +17,37 @@ */ import React, { useState } from 'react'; -import { makeSuccessAttempt } from 'shared/hooks/useAsync'; import { Flex } from 'design'; - import { App } from 'gen-proto-ts/teleport/lib/teleterm/v1/app_pb'; +import { makeSuccessAttempt } from 'shared/hooks/useAsync'; -import { routing } from 'teleterm/ui/uri'; +import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; import { + makeApp, makeDatabase, makeKube, - makeServer, makeLabelsList, makeRootCluster, - makeApp, + makeServer, } from 'teleterm/services/tshd/testHelpers'; import { ResourceSearchError } from 'teleterm/ui/services/resources'; -import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; +import { routing } from 'teleterm/ui/uri'; +import type * as uri from 'teleterm/ui/uri'; import { SearchResult, SearchResultApp } from '../searchResult'; import { makeResourceResult } from '../testHelpers'; - import { + AdvancedSearchEnabledItem, + AppItem, ComponentMap, NoResultsItem, ResourceSearchErrorsItem, TypeToSearchItem, - AdvancedSearchEnabledItem, - AppItem, } from './ActionPicker'; -import { SuggestionsError, NoSuggestionsAvailable } from './ParameterPicker'; +import { NoSuggestionsAvailable, SuggestionsError } from './ParameterPicker'; import { NonInteractiveItem, ResultList } from './ResultList'; -import type * as uri from 'teleterm/ui/uri'; - export default { title: 'Teleterm/Search', }; diff --git a/web/packages/teleterm/src/ui/Search/pickers/useActionAttempts.ts b/web/packages/teleterm/src/ui/Search/pickers/useActionAttempts.ts index c5218ea2b0977..49b024db6b4c8 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/useActionAttempts.ts +++ b/web/packages/teleterm/src/ui/Search/pickers/useActionAttempts.ts @@ -17,24 +17,25 @@ */ import { + useCallback, useEffect, useLayoutEffect, useMemo, useRef, - useCallback, } from 'react'; + import { makeEmptyAttempt, mapAttempt, useAsync } from 'shared/hooks/useAsync'; import { debounce } from 'shared/utils/highbar'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { mapToAction } from 'teleterm/ui/Search/actions'; +import { useSearchContext } from 'teleterm/ui/Search/SearchContext'; +import { SearchFilter } from 'teleterm/ui/Search/searchResult'; import { rankResults, useFilterSearch, useResourceSearch, } from 'teleterm/ui/Search/useSearch'; -import { mapToAction } from 'teleterm/ui/Search/actions'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { useSearchContext } from 'teleterm/ui/Search/SearchContext'; -import { SearchFilter } from 'teleterm/ui/Search/searchResult'; import { routing } from 'teleterm/ui/uri'; import { isRetryable } from 'teleterm/ui/utils/retryWithRelogin'; import { useVnetContext, useVnetLauncher } from 'teleterm/ui/Vnet'; diff --git a/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.test.tsx b/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.test.tsx index 67928b71a7dfe..d30acba473db3 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.test.tsx +++ b/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.test.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import React from 'react'; import { renderHook } from '@testing-library/react'; +import React from 'react'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; import { useDisplayResults } from './useDisplayResults'; diff --git a/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.ts b/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.ts index 84a53651f75e1..dbcf92cdeabcf 100644 --- a/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.ts +++ b/web/packages/teleterm/src/ui/Search/pickers/useDisplayResults.ts @@ -18,13 +18,13 @@ import { useMemo } from 'react'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { + DisplayResults, isClusterSearchFilter, isResourceTypeSearchFilter, SearchFilter, - DisplayResults, } from 'teleterm/ui/Search/searchResult'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; export function useDisplayResults(args: { filters: SearchFilter[]; diff --git a/web/packages/teleterm/src/ui/Search/searchResult.ts b/web/packages/teleterm/src/ui/Search/searchResult.ts index 16f47dfcb9778..fa1a89a5609e9 100644 --- a/web/packages/teleterm/src/ui/Search/searchResult.ts +++ b/web/packages/teleterm/src/ui/Search/searchResult.ts @@ -16,11 +16,10 @@ * along with this program. If not, see . */ -import type { ClusterUri, DocumentUri } from 'teleterm/ui/uri'; import type { Cluster } from 'teleterm/services/tshd/types'; - import type * as resourcesServiceTypes from 'teleterm/ui/services/resources'; import type { DocumentClusterResourceKind } from 'teleterm/ui/services/workspacesService'; +import type { ClusterUri, DocumentUri } from 'teleterm/ui/uri'; type ResourceSearchResultBase< Result extends resourcesServiceTypes.SearchResult, diff --git a/web/packages/teleterm/src/ui/Search/useSearch.test.tsx b/web/packages/teleterm/src/ui/Search/useSearch.test.tsx index 6030b4aded786..3a5699033417c 100644 --- a/web/packages/teleterm/src/ui/Search/useSearch.test.tsx +++ b/web/packages/teleterm/src/ui/Search/useSearch.test.tsx @@ -16,24 +16,23 @@ * along with this program. If not, see . */ -import React from 'react'; import { renderHook } from '@testing-library/react'; +import React from 'react'; import { ShowResources } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { ServerUri } from 'teleterm/ui/uri'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { SearchResult } from 'teleterm/ui/services/resources'; import { - makeServer, makeKube, makeLabelsList, - makeRootCluster, makeLeafCluster, + makeRootCluster, + makeServer, } from 'teleterm/services/tshd/testHelpers'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { SearchResult } from 'teleterm/ui/services/resources'; +import { ServerUri } from 'teleterm/ui/uri'; import { MockAppContextProvider } from '../fixtures/MockAppContextProvider'; - import { makeResourceResult } from './testHelpers'; import { rankResults, useFilterSearch, useResourceSearch } from './useSearch'; diff --git a/web/packages/teleterm/src/ui/Search/useSearch.ts b/web/packages/teleterm/src/ui/Search/useSearch.ts index e656ae8066617..a28288f72cac4 100644 --- a/web/packages/teleterm/src/ui/Search/useSearch.ts +++ b/web/packages/teleterm/src/ui/Search/useSearch.ts @@ -20,25 +20,24 @@ import { useCallback } from 'react'; import { ShowResources } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { assertUnreachable } from 'teleterm/ui/utils'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import type * as resourcesServiceTypes from 'teleterm/ui/services/resources'; +import { assertUnreachable } from 'teleterm/ui/utils'; import { - isResourceTypeSearchFilter, + FilterSearchResult, isClusterSearchFilter, - SearchFilter, + isResourceTypeSearchFilter, LabelMatch, mainResourceField, mainResourceName, ResourceMatch, - searchableFields, ResourceSearchResult, - FilterSearchResult, ResourceTypeFilter, + searchableFields, + SearchFilter, } from './searchResult'; -import type * as resourcesServiceTypes from 'teleterm/ui/services/resources'; - export type CrossClusterResourceSearchResult = { results: resourcesServiceTypes.SearchResult[]; errors: resourcesServiceTypes.ResourceSearchError[]; diff --git a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.test.tsx b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.test.tsx index 460126b2d0869..921d03c2f5cad 100644 --- a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.test.tsx +++ b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.test.tsx @@ -16,14 +16,15 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; +import React from 'react'; + import { fireEvent, render } from 'design/utils/testing'; +import { Cluster } from 'teleterm/services/tshd/types'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { IAppContext } from 'teleterm/ui/types'; -import { Cluster } from 'teleterm/services/tshd/types'; import { ShareFeedback } from './ShareFeedback'; diff --git a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.tsx b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.tsx index 3dcca5c57bb15..06aa75c4f2e02 100644 --- a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.tsx +++ b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedback.tsx @@ -16,11 +16,12 @@ * along with this program. If not, see . */ -import { ButtonIcon, Popover } from 'design'; -import { ChatBubble } from 'design/Icon'; import React, { useRef } from 'react'; import styled from 'styled-components'; +import { ButtonIcon, Popover } from 'design'; +import { ChatBubble } from 'design/Icon'; + import { ShareFeedbackForm } from './ShareFeedbackForm'; import { useShareFeedback } from './useShareFeedback'; diff --git a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackForm.tsx b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackForm.tsx index 9fe97d4ad6cdc..ea65ea97f9370 100644 --- a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackForm.tsx +++ b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackForm.tsx @@ -17,16 +17,16 @@ */ import React from 'react'; + import { ButtonIcon, ButtonPrimary, Flex, Link, Text } from 'design'; -import Validation from 'shared/components/Validation'; +import * as Alerts from 'design/Alert'; import { Cross } from 'design/Icon'; - +import Validation from 'shared/components/Validation'; import { Attempt } from 'shared/hooks/useAsync'; -import * as Alerts from 'design/Alert'; import { ShareFeedbackFormFields } from './ShareFeedbackFormFields'; -import { FEEDBACK_TOO_LONG_ERROR } from './useShareFeedback'; import { ShareFeedbackFormValues } from './types'; +import { FEEDBACK_TOO_LONG_ERROR } from './useShareFeedback'; interface ShareFeedbackProps { submitFeedbackAttempt: Attempt; diff --git a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackFormFields.tsx b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackFormFields.tsx index a4a2e16055cae..1f140dcd7970d 100644 --- a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackFormFields.tsx +++ b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/ShareFeedbackFormFields.tsx @@ -17,10 +17,11 @@ */ import React from 'react'; + +import { Text, Toggle } from 'design'; import FieldInput from 'shared/components/FieldInput'; -import { requiredField } from 'shared/components/Validation/rules'; import { FieldTextArea } from 'shared/components/FieldTextArea'; -import { Text, Toggle } from 'design'; +import { requiredField } from 'shared/components/Validation/rules'; import { ShareFeedbackFormValues } from './types'; diff --git a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/useShareFeedback.ts b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/useShareFeedback.ts index 2c3d695fc1b22..75d1b9944eed8 100644 --- a/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/useShareFeedback.ts +++ b/web/packages/teleterm/src/ui/StatusBar/ShareFeedback/useShareFeedback.ts @@ -21,7 +21,6 @@ import { useState } from 'react'; import { makeEmptyAttempt, useAsync } from 'shared/hooks/useAsync'; import { staticConfig } from 'teleterm/staticConfig'; - import { useAppContext } from 'teleterm/ui/appContextProvider'; import { ShareFeedbackFormValues } from './types'; diff --git a/web/packages/teleterm/src/ui/StatusBar/StatusBar.tsx b/web/packages/teleterm/src/ui/StatusBar/StatusBar.tsx index 6dd601bf9689e..6d2748412df80 100644 --- a/web/packages/teleterm/src/ui/StatusBar/StatusBar.tsx +++ b/web/packages/teleterm/src/ui/StatusBar/StatusBar.tsx @@ -17,11 +17,12 @@ */ import React from 'react'; + import { Flex, Text } from 'design'; -import { useActiveDocumentClusterBreadcrumbs } from './useActiveDocumentClusterBreadcrumbs'; -import { ShareFeedback } from './ShareFeedback'; import { AccessRequestCheckoutButton } from './AccessRequestCheckoutButton'; +import { ShareFeedback } from './ShareFeedback'; +import { useActiveDocumentClusterBreadcrumbs } from './useActiveDocumentClusterBreadcrumbs'; export function StatusBar() { const clusterBreadcrumbs = useActiveDocumentClusterBreadcrumbs(); diff --git a/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/ClusterConnectPanel.tsx b/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/ClusterConnectPanel.tsx index 6166b68c34113..704c6fd213134 100644 --- a/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/ClusterConnectPanel.tsx +++ b/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/ClusterConnectPanel.tsx @@ -17,9 +17,10 @@ */ import React from 'react'; -import { Box, ButtonPrimary, Flex, ResourceIcon, Text } from 'design'; import styled from 'styled-components'; +import { Box, ButtonPrimary, Flex, ResourceIcon, Text } from 'design'; + import { useAppContext } from 'teleterm/ui/appContextProvider'; import { RecentClusters } from './RecentClusters'; diff --git a/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/RecentClusters.tsx b/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/RecentClusters.tsx index 6dd142135672c..c83b6d5db38dc 100644 --- a/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/RecentClusters.tsx +++ b/web/packages/teleterm/src/ui/TabHost/ClusterConnectPanel/RecentClusters.tsx @@ -18,12 +18,12 @@ import React from 'react'; -import { Box, ButtonBorder, Card, Text, Flex } from 'design'; +import { Box, ButtonBorder, Card, Flex, Text } from 'design'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { getUserWithClusterName } from 'teleterm/ui/utils'; -import { RootClusterUri } from 'teleterm/ui/uri'; import { ProfileStatusError } from 'teleterm/ui/components/ProfileStatusError'; +import { RootClusterUri } from 'teleterm/ui/uri'; +import { getUserWithClusterName } from 'teleterm/ui/utils'; export function RecentClusters() { const ctx = useAppContext(); diff --git a/web/packages/teleterm/src/ui/TabHost/TabHost.test.tsx b/web/packages/teleterm/src/ui/TabHost/TabHost.test.tsx index a9db4eae41588..f1ea15d4ed605 100644 --- a/web/packages/teleterm/src/ui/TabHost/TabHost.test.tsx +++ b/web/packages/teleterm/src/ui/TabHost/TabHost.test.tsx @@ -17,17 +17,19 @@ */ import 'jest-canvas-mock'; + import { createRef } from 'react'; + import { fireEvent, render, screen } from 'design/utils/testing'; -import { TabHost } from 'teleterm/ui/TabHost/TabHost'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { Document } from 'teleterm/ui/services/workspacesService'; import { TabContextMenuOptions } from 'teleterm/mainProcess/types'; -import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { ResourcesContextProvider } from 'teleterm/ui/DocumentCluster/resourcesContext'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { Document } from 'teleterm/ui/services/workspacesService'; +import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; +import { TabHost } from 'teleterm/ui/TabHost/TabHost'; function getMockDocuments(): Document[] { return [ diff --git a/web/packages/teleterm/src/ui/TabHost/TabHost.tsx b/web/packages/teleterm/src/ui/TabHost/TabHost.tsx index 8e59d1ef01668..9ce555a010ed5 100644 --- a/web/packages/teleterm/src/ui/TabHost/TabHost.tsx +++ b/web/packages/teleterm/src/ui/TabHost/TabHost.tsx @@ -18,20 +18,21 @@ import React from 'react'; import styled from 'styled-components'; + import { Flex } from 'design'; +import { Shell } from 'teleterm/mainProcess/shell'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { DocumentsRenderer } from 'teleterm/ui/Documents/DocumentsRenderer'; +import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; import * as types from 'teleterm/ui/services/workspacesService/documentsService/types'; import { canDocChangeShell } from 'teleterm/ui/services/workspacesService/documentsService/types'; import { Tabs } from 'teleterm/ui/Tabs'; -import { DocumentsRenderer } from 'teleterm/ui/Documents/DocumentsRenderer'; import { IAppContext } from 'teleterm/ui/types'; -import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; -import { Shell } from 'teleterm/mainProcess/shell'; -import { useTabShortcuts } from './useTabShortcuts'; -import { useNewTabOpener } from './useNewTabOpener'; import { ClusterConnectPanel } from './ClusterConnectPanel/ClusterConnectPanel'; +import { useNewTabOpener } from './useNewTabOpener'; +import { useTabShortcuts } from './useTabShortcuts'; export function TabHostContainer(props: { topBarContainerRef: React.MutableRefObject; diff --git a/web/packages/teleterm/src/ui/TabHost/useTabShortcuts.test.tsx b/web/packages/teleterm/src/ui/TabHost/useTabShortcuts.test.tsx index f96372ca2df79..ce65290c2eb1f 100644 --- a/web/packages/teleterm/src/ui/TabHost/useTabShortcuts.test.tsx +++ b/web/packages/teleterm/src/ui/TabHost/useTabShortcuts.test.tsx @@ -17,17 +17,18 @@ */ import { PropsWithChildren } from 'react'; + import renderHook from 'design/utils/renderHook'; -import { useTabShortcuts } from 'teleterm/ui/TabHost/useTabShortcuts'; -import { Document } from 'teleterm/ui/services/workspacesService/documentsService'; +import AppContextProvider from 'teleterm/ui/appContextProvider'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { KeyboardShortcutEvent, KeyboardShortcutEventSubscriber, } from 'teleterm/ui/services/keyboardShortcuts'; -import AppContextProvider from 'teleterm/ui/appContextProvider'; +import { Document } from 'teleterm/ui/services/workspacesService/documentsService'; import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; +import { useTabShortcuts } from 'teleterm/ui/TabHost/useTabShortcuts'; function getMockDocuments(): Document[] { return [ diff --git a/web/packages/teleterm/src/ui/Tabs/TabItem.tsx b/web/packages/teleterm/src/ui/Tabs/TabItem.tsx index 037c94e12e0a3..e70c32fa7aa88 100644 --- a/web/packages/teleterm/src/ui/Tabs/TabItem.tsx +++ b/web/packages/teleterm/src/ui/Tabs/TabItem.tsx @@ -18,8 +18,9 @@ import React, { useRef } from 'react'; import styled from 'styled-components'; -import * as Icons from 'design/Icon'; + import { ButtonIcon, Text } from 'design'; +import * as Icons from 'design/Icon'; import LinearProgress from 'teleterm/ui/components/LinearProgress'; diff --git a/web/packages/teleterm/src/ui/Tabs/Tabs.tsx b/web/packages/teleterm/src/ui/Tabs/Tabs.tsx index 1b0704eabc26b..3531a12fcb026 100644 --- a/web/packages/teleterm/src/ui/Tabs/Tabs.tsx +++ b/web/packages/teleterm/src/ui/Tabs/Tabs.tsx @@ -18,14 +18,14 @@ import React from 'react'; import styled from 'styled-components'; -import { typography } from 'design/system'; -import { Box } from 'design'; +import { Box } from 'design'; +import { typography } from 'design/system'; import { TypographyProps } from 'design/system/typography'; import { Document } from 'teleterm/ui/services/workspacesService'; -import { TabItem, NewTabItem } from './TabItem'; +import { NewTabItem, TabItem } from './TabItem'; export function Tabs(props: Props) { const { diff --git a/web/packages/teleterm/src/ui/ThemeProvider/globals.ts b/web/packages/teleterm/src/ui/ThemeProvider/globals.ts index fbbd59db8b5c9..768989592d592 100644 --- a/web/packages/teleterm/src/ui/ThemeProvider/globals.ts +++ b/web/packages/teleterm/src/ui/ThemeProvider/globals.ts @@ -17,6 +17,7 @@ */ import { createGlobalStyle, css } from 'styled-components'; + import { getPlatformType } from 'design/platform'; const GlobalStyle = createGlobalStyle` diff --git a/web/packages/teleterm/src/ui/ThemeProvider/theme.ts b/web/packages/teleterm/src/ui/ThemeProvider/theme.ts index 09d1c3a5806d3..5f03e7ef2dcdf 100644 --- a/web/packages/teleterm/src/ui/ThemeProvider/theme.ts +++ b/web/packages/teleterm/src/ui/ThemeProvider/theme.ts @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { fonts } from 'design/theme/fonts'; import { darkTheme as designDarkTheme, lightTheme as designLightTheme, } from 'design/theme'; +import { fonts } from 'design/theme/fonts'; const sansSerif = 'system-ui'; diff --git a/web/packages/teleterm/src/ui/TopBar/AdditionalActions.story.tsx b/web/packages/teleterm/src/ui/TopBar/AdditionalActions.story.tsx index 4c92ee21c0ae0..9adaca025a280 100644 --- a/web/packages/teleterm/src/ui/TopBar/AdditionalActions.story.tsx +++ b/web/packages/teleterm/src/ui/TopBar/AdditionalActions.story.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import * as icons from 'design/Icon'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; diff --git a/web/packages/teleterm/src/ui/TopBar/AdditionalActions.tsx b/web/packages/teleterm/src/ui/TopBar/AdditionalActions.tsx index ec755a5d9450d..58ba8d18aa602 100644 --- a/web/packages/teleterm/src/ui/TopBar/AdditionalActions.tsx +++ b/web/packages/teleterm/src/ui/TopBar/AdditionalActions.tsx @@ -16,22 +16,21 @@ * along with this program. If not, see . */ -import React, { useState, useRef } from 'react'; +import React, { useRef, useState } from 'react'; import styled from 'styled-components'; -import { Flex, Text, Popover } from 'design'; +import { Flex, Popover, Text } from 'design'; import * as icons from 'design/Icon'; - import { ShowResources } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { TopBarButton } from 'teleterm/ui/TopBar/TopBarButton'; -import { IAppContext } from 'teleterm/ui/types'; -import { Cluster } from 'teleterm/services/tshd/types'; import { KeyboardShortcutAction } from 'teleterm/services/config'; -import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; +import { Cluster } from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { ListItem } from 'teleterm/ui/components/ListItem'; +import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; import { useNewTabOpener } from 'teleterm/ui/TabHost'; +import { TopBarButton } from 'teleterm/ui/TopBar/TopBarButton'; +import { IAppContext } from 'teleterm/ui/types'; type MenuItem = { title: string; diff --git a/web/packages/teleterm/src/ui/TopBar/Clusters/ClusterSelector/ClusterSelector.tsx b/web/packages/teleterm/src/ui/TopBar/Clusters/ClusterSelector/ClusterSelector.tsx index 38f6de93f26ad..a41b31fe997cf 100644 --- a/web/packages/teleterm/src/ui/TopBar/Clusters/ClusterSelector/ClusterSelector.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Clusters/ClusterSelector/ClusterSelector.tsx @@ -17,9 +17,10 @@ */ import React, { forwardRef } from 'react'; -import { ChevronUp, ChevronDown } from 'design/Icon'; import styled from 'styled-components'; + import { Text } from 'design'; +import { ChevronDown, ChevronUp } from 'design/Icon'; import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; diff --git a/web/packages/teleterm/src/ui/TopBar/Clusters/Clusters.tsx b/web/packages/teleterm/src/ui/TopBar/Clusters/Clusters.tsx index 232375aba1543..302bbe56d8628 100644 --- a/web/packages/teleterm/src/ui/TopBar/Clusters/Clusters.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Clusters/Clusters.tsx @@ -17,17 +17,18 @@ */ import React, { useCallback, useMemo, useRef, useState } from 'react'; -import Popover from 'design/Popover'; import styled from 'styled-components'; + import { Box } from 'design'; +import Popover from 'design/Popover'; -import { useKeyboardShortcuts } from 'teleterm/ui/services/keyboardShortcuts'; import { KeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; +import { useKeyboardShortcuts } from 'teleterm/ui/services/keyboardShortcuts'; import { ClusterUri } from 'teleterm/ui/uri'; -import { useClusters } from './useClusters'; import { ClusterSelector } from './ClusterSelector/ClusterSelector'; import { ClustersFilterableList } from './ClustersFilterableList/ClustersFilterableList'; +import { useClusters } from './useClusters'; export function Clusters() { const iconRef = useRef(); diff --git a/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClusterItem.tsx b/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClusterItem.tsx index 4aace2f87289d..f1f54e504f246 100644 --- a/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClusterItem.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClusterItem.tsx @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -import { useRef, useEffect } from 'react'; -import { Flex, Label, Text } from 'design'; - +import { useEffect, useRef } from 'react'; import styled from 'styled-components'; -import { ListItem } from 'teleterm/ui/components/ListItem'; -import { useKeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; +import { Flex, Label, Text } from 'design'; + import { Cluster } from 'teleterm/services/tshd/types'; +import { useKeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; +import { ListItem } from 'teleterm/ui/components/ListItem'; interface ClusterItemProps { index: number; diff --git a/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClustersFilterableList.tsx b/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClustersFilterableList.tsx index c815eb5ec8956..80554b8a7592b 100644 --- a/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClustersFilterableList.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Clusters/ClustersFilterableList/ClustersFilterableList.tsx @@ -20,9 +20,9 @@ import React from 'react'; import { Box, Text } from 'design'; +import { Cluster } from 'teleterm/services/tshd/types'; import { FilterableList } from 'teleterm/ui/components/FilterableList'; import { useKeyboardArrowsNavigationStateUpdate } from 'teleterm/ui/components/KeyboardArrowsNavigation'; -import { Cluster } from 'teleterm/services/tshd/types'; import { ClusterItem } from './ClusterItem'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx index 47fe727ab873f..dbc7e0ab3e6dd 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.story.tsx @@ -17,13 +17,14 @@ */ import { useLayoutEffect } from 'react'; + import { Flex, Text } from 'design'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import AppContextProvider from 'teleterm/ui/appContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { VnetContextProvider } from 'teleterm/ui/Vnet'; -import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { Connections } from './Connections'; import { ConnectionsContextProvider } from './connectionsContext'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.test.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.test.tsx index c9f27f0f4669c..b09cca9588228 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.test.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.test.tsx @@ -19,17 +19,16 @@ import { act, render, screen, userEvent } from 'design/utils/testing'; import Logger, { NullService } from 'teleterm/logger'; -import { VnetContextProvider } from 'teleterm/ui/Vnet'; +import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { DocumentTshNode, Workspace, } from 'teleterm/ui/services/workspacesService'; - import { routing } from 'teleterm/ui/uri'; import { unique } from 'teleterm/ui/utils'; +import { VnetContextProvider } from 'teleterm/ui/Vnet'; import { Connections } from './Connections'; import { ConnectionsContextProvider } from './connectionsContext'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.tsx index 31384e58f7ecc..003026bedd190 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/Connections.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/Connections.tsx @@ -17,16 +17,17 @@ */ import { useMemo, useRef } from 'react'; -import Popover from 'design/Popover'; + import { Box, StepSlider } from 'design'; +import Popover from 'design/Popover'; -import { useKeyboardShortcuts } from 'teleterm/ui/services/keyboardShortcuts'; -import { VnetSliderStep, useVnetContext } from 'teleterm/ui/Vnet'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useKeyboardShortcuts } from 'teleterm/ui/services/keyboardShortcuts'; +import { useVnetContext, VnetSliderStep } from 'teleterm/ui/Vnet'; +import { Step, useConnectionsContext } from './connectionsContext'; import { ConnectionsIcon } from './ConnectionsIcon/ConnectionsIcon'; import { ConnectionsSliderStep } from './ConnectionsSliderStep'; -import { Step, useConnectionsContext } from './connectionsContext'; export function Connections() { const { connectionTracker } = useAppContext(); diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionItem.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionItem.tsx index 739de8d889aa1..9954c271d48e9 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionItem.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionItem.tsx @@ -17,15 +17,14 @@ */ import { useEffect, useRef } from 'react'; -import { ButtonIcon, Flex, Text } from 'design'; -import { Trash, Unlink } from 'design/Icon'; - import styled from 'styled-components'; -import { ExtendedTrackedConnection } from 'teleterm/ui/services/connectionTracker'; -import { ListItem } from 'teleterm/ui/components/ListItem'; +import { ButtonIcon, Flex, Text } from 'design'; +import { Trash, Unlink } from 'design/Icon'; import { useKeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; +import { ListItem } from 'teleterm/ui/components/ListItem'; +import { ExtendedTrackedConnection } from 'teleterm/ui/services/connectionTracker'; import { isAppUri, isDatabaseUri } from 'teleterm/ui/uri'; import { ConnectionStatusIndicator } from './ConnectionStatusIndicator'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.story.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.story.tsx index 1494739a0532b..2f9e7c6fed201 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.story.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.story.tsx @@ -17,7 +17,8 @@ */ import styled from 'styled-components'; -import { Flex, Box, Text } from 'design'; + +import { Box, Flex, Text } from 'design'; import { StaticListItem } from 'teleterm/ui/components/ListItem'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.tsx index d5fd400a1ebdb..48c3912ba509f 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator.tsx @@ -17,7 +17,8 @@ */ import styled, { css } from 'styled-components'; -import { Box, blink } from 'design'; + +import { blink, Box } from 'design'; type Status = 'on' | 'off' | 'error' | 'warning' | 'processing'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionsFilterableList.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionsFilterableList.tsx index c826182025eb4..8ced7e7b1267f 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionsFilterableList.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionsFilterableList.tsx @@ -18,11 +18,11 @@ import { Text } from 'design'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { FilterableList } from 'teleterm/ui/components/FilterableList'; -import { ExtendedTrackedConnection } from 'teleterm/ui/services/connectionTracker'; import { useKeyboardArrowsNavigationStateUpdate } from 'teleterm/ui/components/KeyboardArrowsNavigation'; -import { VnetConnectionItem, useVnetContext } from 'teleterm/ui/Vnet'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { ExtendedTrackedConnection } from 'teleterm/ui/services/connectionTracker'; +import { useVnetContext, VnetConnectionItem } from 'teleterm/ui/Vnet'; import { ConnectionItem } from './ConnectionItem'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIcon.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIcon.tsx index 9e8f01bbdfd08..cc922157ef605 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIcon.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIcon.tsx @@ -17,9 +17,10 @@ */ import React, { forwardRef } from 'react'; -import { Cluster } from 'design/Icon'; import styled from 'styled-components'; + import { Button } from 'design'; +import { Cluster } from 'design/Icon'; import { useKeyboardShortcutFormatters } from 'teleterm/ui/services/keyboardShortcuts'; diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIconStatusIndicator.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIconStatusIndicator.tsx index 2951230709391..007f8036eabc8 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIconStatusIndicator.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsIcon/ConnectionsIconStatusIndicator.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Box } from 'design'; export const ConnectionsIconStatusIndicator: React.FC = props => { diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsSliderStep.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsSliderStep.tsx index 64e4d327fc181..ee36aa5ee7155 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsSliderStep.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/ConnectionsSliderStep.tsx @@ -17,14 +17,15 @@ */ import { useState } from 'react'; + import { Box } from 'design'; import { StepComponentProps } from 'design/StepSlider'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { KeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; -import { ConnectionsFilterableList } from './ConnectionsFilterableList/ConnectionsFilterableList'; import { useConnectionsContext } from './connectionsContext'; +import { ConnectionsFilterableList } from './ConnectionsFilterableList/ConnectionsFilterableList'; export const ConnectionsSliderStep = (props: StepComponentProps) => { const { connectionTracker } = useAppContext(); diff --git a/web/packages/teleterm/src/ui/TopBar/Connections/connectionsContext.tsx b/web/packages/teleterm/src/ui/TopBar/Connections/connectionsContext.tsx index e3b46972e0440..7e311869145b3 100644 --- a/web/packages/teleterm/src/ui/TopBar/Connections/connectionsContext.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Connections/connectionsContext.tsx @@ -17,9 +17,9 @@ */ import { + createContext, FC, PropsWithChildren, - createContext, useCallback, useContext, useState, diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/EmptyIdentityList/EmptyIdentityList.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/EmptyIdentityList/EmptyIdentityList.tsx index 7dfe3acdfbc03..59cdbad46418f 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/EmptyIdentityList/EmptyIdentityList.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/EmptyIdentityList/EmptyIdentityList.tsx @@ -17,6 +17,7 @@ */ import React from 'react'; + import { ButtonPrimary, Flex, ResourceIcon, Text } from 'design'; interface EmptyIdentityListProps { diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/Identity.story.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/Identity.story.tsx index 99c638f3b4071..ad72162e8c9bb 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/Identity.story.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/Identity.story.tsx @@ -16,7 +16,8 @@ * along with this program. If not, see . */ -import React, { useRef, useEffect } from 'react'; +import React, { useEffect, useRef } from 'react'; + import Flex from 'design/Flex'; import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/Identity.test.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/Identity.test.tsx index c6940c311a440..ba52b2a9a872c 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/Identity.test.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/Identity.test.tsx @@ -16,17 +16,18 @@ * along with this program. If not, see . */ -import { render } from 'design/utils/testing'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; + +import { render } from 'design/utils/testing'; import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; -import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { - rootClusterUri, - makeRootCluster, makeLoggedInUser, + makeRootCluster, + rootClusterUri, } from 'teleterm/services/tshd/testHelpers'; +import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { IdentityContainer } from './Identity'; diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/Identity.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/Identity.tsx index fcddc3f2b72ce..a4ec08cbdad5a 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/Identity.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/Identity.tsx @@ -18,27 +18,27 @@ import React, { useCallback, + useImperativeHandle, useMemo, useRef, useState, - useImperativeHandle, } from 'react'; import styled from 'styled-components'; + import { Box } from 'design'; import Popover from 'design/Popover'; import { TrustedDeviceRequirement } from 'gen-proto-ts/teleport/legacy/types/trusted_device_requirement_pb'; +import * as tshd from 'teleterm/services/tshd/types'; import { - useKeyboardShortcuts, useKeyboardShortcutFormatters, + useKeyboardShortcuts, } from 'teleterm/ui/services/keyboardShortcuts'; -import * as tshd from 'teleterm/services/tshd/types'; - -import { IdentityRootCluster, useIdentity } from './useIdentity'; +import { EmptyIdentityList } from './EmptyIdentityList/EmptyIdentityList'; import { IdentityList } from './IdentityList/IdentityList'; import { IdentitySelector } from './IdentitySelector/IdentitySelector'; -import { EmptyIdentityList } from './EmptyIdentityList/EmptyIdentityList'; +import { IdentityRootCluster, useIdentity } from './useIdentity'; export function IdentityContainer() { const { diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/AddNewClusterItem.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/AddNewClusterItem.tsx index 60ecc110a1481..c27f50fc44f74 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/AddNewClusterItem.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/AddNewClusterItem.tsx @@ -17,11 +17,10 @@ */ import React from 'react'; +import styled from 'styled-components'; import { Add } from 'design/Icon'; -import styled from 'styled-components'; - import { useKeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; import { ListItem } from 'teleterm/ui/components/ListItem'; diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityList.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityList.tsx index 443e33c2bd0a4..376c642385ebc 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityList.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityList.tsx @@ -18,18 +18,18 @@ import React, { JSX } from 'react'; import styled from 'styled-components'; -import { Box, Flex, Text, Label, P3 } from 'design'; + +import { Box, Flex, Label, P3, Text } from 'design'; import { ShieldCheck, ShieldWarning } from 'design/Icon'; import Link from 'design/Link'; -import { KeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; import { LoggedInUser } from 'teleterm/services/tshd/types'; +import { KeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; import { DeviceTrustStatus } from 'teleterm/ui/TopBar/Identity/Identity'; import { IdentityRootCluster } from '../useIdentity'; - -import { IdentityListItem } from './IdentityListItem'; import { AddNewClusterItem } from './AddNewClusterItem'; +import { IdentityListItem } from './IdentityListItem'; export function IdentityList(props: { loggedInUser: LoggedInUser; diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityListItem.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityListItem.tsx index f60e1258198ed..1634a4e073250 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityListItem.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/IdentityList/IdentityListItem.tsx @@ -17,13 +17,14 @@ */ import { useState } from 'react'; + import { ButtonIcon, Flex, Label, Text } from 'design'; import { Logout } from 'design/Icon'; -import { ListItem } from 'teleterm/ui/components/ListItem'; import { useKeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; -import { getUserWithClusterName } from 'teleterm/ui/utils'; +import { ListItem } from 'teleterm/ui/components/ListItem'; import { ProfileStatusError } from 'teleterm/ui/components/ProfileStatusError'; +import { getUserWithClusterName } from 'teleterm/ui/utils'; import { IdentityRootCluster } from '../useIdentity'; diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/IdentitySelector.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/IdentitySelector.tsx index c95c5aceb2c47..69dae65b9c556 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/IdentitySelector.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/IdentitySelector.tsx @@ -17,16 +17,16 @@ */ import React, { forwardRef } from 'react'; -import { Box } from 'design'; -import { getUserWithClusterName } from 'teleterm/ui/utils'; +import { Box } from 'design'; -import { TopBarButton } from 'teleterm/ui/TopBar/TopBarButton'; -import { DeviceTrustStatus } from 'teleterm/ui/TopBar/Identity/Identity'; import { ConnectionStatusIndicator } from 'teleterm/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator'; +import { DeviceTrustStatus } from 'teleterm/ui/TopBar/Identity/Identity'; +import { TopBarButton } from 'teleterm/ui/TopBar/TopBarButton'; +import { getUserWithClusterName } from 'teleterm/ui/utils'; -import { UserIcon } from './UserIcon'; import { PamIcon } from './PamIcon'; +import { UserIcon } from './UserIcon'; interface IdentitySelectorProps { isOpened: boolean; diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/PamIcon.tsx b/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/PamIcon.tsx index ddd6d1ed69e2c..c9df52447da3d 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/PamIcon.tsx +++ b/web/packages/teleterm/src/ui/TopBar/Identity/IdentitySelector/PamIcon.tsx @@ -18,6 +18,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Image } from 'design'; import pam from './pam.svg'; diff --git a/web/packages/teleterm/src/ui/TopBar/Identity/useIdentity.ts b/web/packages/teleterm/src/ui/TopBar/Identity/useIdentity.ts index 2df389a4205a9..a49be5593599c 100644 --- a/web/packages/teleterm/src/ui/TopBar/Identity/useIdentity.ts +++ b/web/packages/teleterm/src/ui/TopBar/Identity/useIdentity.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { useAppContext } from 'teleterm/ui/appContextProvider'; import { Cluster, LoggedInUser } from 'teleterm/services/tshd/types'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { RootClusterUri } from 'teleterm/ui/uri'; export function useIdentity() { diff --git a/web/packages/teleterm/src/ui/TopBar/TopBar.tsx b/web/packages/teleterm/src/ui/TopBar/TopBar.tsx index 450287ecaee52..49298d20d3e89 100644 --- a/web/packages/teleterm/src/ui/TopBar/TopBar.tsx +++ b/web/packages/teleterm/src/ui/TopBar/TopBar.tsx @@ -18,14 +18,14 @@ import React from 'react'; import styled from 'styled-components'; + import { Flex } from 'design'; import { SearchBar } from '../Search'; - -import { Connections } from './Connections'; +import { AdditionalActions } from './AdditionalActions'; import { Clusters } from './Clusters'; +import { Connections } from './Connections'; import { Identity } from './Identity'; -import { AdditionalActions } from './AdditionalActions'; export function TopBar(props: { topBarContainerRef: React.MutableRefObject; diff --git a/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.test.tsx b/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.test.tsx index cc9336847e9ed..f39151682c80a 100644 --- a/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.test.tsx +++ b/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.test.tsx @@ -18,12 +18,12 @@ import { render, screen, userEvent } from 'design/utils/testing'; import { wait } from 'shared/utils/wait'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; -import { VnetContextProvider } from './vnetContext'; import { VnetSliderStepHeader } from './VnetConnectionItem'; +import { VnetContextProvider } from './vnetContext'; describe('VnetSliderStepHeader', () => { it('allows to tab through the header itself as well as the buttons', async () => { diff --git a/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.tsx b/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.tsx index f474f0a0d1197..71378b2e68c4a 100644 --- a/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.tsx +++ b/web/packages/teleterm/src/ui/Vnet/VnetConnectionItem.tsx @@ -18,14 +18,15 @@ import React, { forwardRef, useEffect, useRef } from 'react'; import styled from 'styled-components'; -import { Text, ButtonIcon, Flex, rotate360 } from 'design'; + +import { ButtonIcon, Flex, rotate360, Text } from 'design'; import * as icons from 'design/Icon'; import { copyToClipboard } from 'design/utils/copyToClipboard'; -import { ConnectionStatusIndicator } from 'teleterm/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator'; -import { ListItem, StaticListItem } from 'teleterm/ui/components/ListItem'; -import { useKeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; import { useAppContext } from 'teleterm/ui/appContextProvider'; +import { useKeyboardArrowsNavigation } from 'teleterm/ui/components/KeyboardArrowsNavigation'; +import { ListItem, StaticListItem } from 'teleterm/ui/components/ListItem'; +import { ConnectionStatusIndicator } from 'teleterm/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator'; import { useVnetContext } from './vnetContext'; diff --git a/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.story.tsx b/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.story.tsx index 4a9eb7d9ab8aa..4093f921533bf 100644 --- a/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.story.tsx +++ b/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.story.tsx @@ -16,13 +16,13 @@ * along with this program. If not, see . */ import { useEffect } from 'react'; -import { Box } from 'design'; +import { Box } from 'design'; import { usePromiseRejectedOnUnmount } from 'shared/utils/wait'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { useVnetContext, VnetContextProvider } from './vnetContext'; import { VnetSliderStep } from './VnetSliderStep'; diff --git a/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.tsx b/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.tsx index 234fe9c95344c..034e637127832 100644 --- a/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.tsx +++ b/web/packages/teleterm/src/ui/Vnet/VnetSliderStep.tsx @@ -17,16 +17,17 @@ */ import { PropsWithChildren, useEffect, useRef } from 'react'; -import { StepComponentProps } from 'design/StepSlider'; + import { Box, ButtonSecondary, Flex, Text } from 'design'; -import { mergeRefs } from 'shared/libs/mergeRefs'; +import { StepComponentProps } from 'design/StepSlider'; import { useRefAutoFocus } from 'shared/hooks'; import { useDelayedRepeatedAttempt } from 'shared/hooks/useAsync'; +import { mergeRefs } from 'shared/libs/mergeRefs'; import { ConnectionStatusIndicator } from 'teleterm/ui/TopBar/Connections/ConnectionsFilterableList/ConnectionStatusIndicator'; -import { useVnetContext } from './vnetContext'; import { VnetSliderStepHeader } from './VnetConnectionItem'; +import { useVnetContext } from './vnetContext'; /** * VnetSliderStep is the second step of StepSlider used in TopBar/Connections. It is shown after diff --git a/web/packages/teleterm/src/ui/Vnet/vnetContext.test.tsx b/web/packages/teleterm/src/ui/Vnet/vnetContext.test.tsx index 21360ee5e1872..6a60814b21db8 100644 --- a/web/packages/teleterm/src/ui/Vnet/vnetContext.test.tsx +++ b/web/packages/teleterm/src/ui/Vnet/vnetContext.test.tsx @@ -16,19 +16,19 @@ * along with this program. If not, see . */ +import { act, renderHook, waitFor } from '@testing-library/react'; import { PropsWithChildren } from 'react'; -import { renderHook, waitFor, act } from '@testing-library/react'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; -import { IAppContext } from 'teleterm/ui/types'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import { IAppContext } from 'teleterm/ui/types'; import { + useVnetContext, VnetContextProvider, VnetStatus, VnetStoppedReason, - useVnetContext, } from './vnetContext'; describe('autostart', () => { diff --git a/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx b/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx index 4caf7ece9b3e5..887f4a86b82ea 100644 --- a/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx +++ b/web/packages/teleterm/src/ui/Vnet/vnetContext.tsx @@ -17,22 +17,23 @@ */ import { + createContext, FC, PropsWithChildren, - createContext, - useContext, - useState, useCallback, - useMemo, + useContext, useEffect, + useMemo, + useState, } from 'react'; -import { useAsync, Attempt } from 'shared/hooks/useAsync'; + import { BackgroundItemStatus } from 'gen-proto-ts/teleport/lib/teleterm/vnet/v1/vnet_service_pb'; +import { Attempt, useAsync } from 'shared/hooks/useAsync'; +import { isTshdRpcError } from 'teleterm/services/tshd'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { usePersistedState } from 'teleterm/ui/hooks/usePersistedState'; import { useStoreSelector } from 'teleterm/ui/hooks/useStoreSelector'; -import { isTshdRpcError } from 'teleterm/services/tshd'; import { IAppContext } from 'teleterm/ui/types'; /** diff --git a/web/packages/teleterm/src/ui/appContext.ts b/web/packages/teleterm/src/ui/appContext.ts index 506e441986071..c58911076eace 100644 --- a/web/packages/teleterm/src/ui/appContext.ts +++ b/web/packages/teleterm/src/ui/appContext.ts @@ -18,32 +18,32 @@ import { debounce } from 'shared/utils/highbar'; +import { parseDeepLink } from 'teleterm/deepLinks'; +import Logger from 'teleterm/logger'; +import { ConfigService } from 'teleterm/services/config'; +import { TshdClient, VnetClient } from 'teleterm/services/tshd/createClient'; import { - MainProcessClient, ElectronGlobals, + MainProcessClient, TshdEventContextBridgeService, } from 'teleterm/types'; -import Logger from 'teleterm/logger'; import { ClustersService } from 'teleterm/ui/services/clusters'; -import { ModalsService } from 'teleterm/ui/services/modals'; -import { TerminalsService } from 'teleterm/ui/services/terminals'; import { ConnectionTrackerService } from 'teleterm/ui/services/connectionTracker'; -import { StatePersistenceService } from 'teleterm/ui/services/statePersistence'; +import { ConnectMyComputerService } from 'teleterm/ui/services/connectMyComputer'; +import { DeepLinksService } from 'teleterm/ui/services/deepLinks'; +import { FileTransferService } from 'teleterm/ui/services/fileTransferClient'; +import { HeadlessAuthenticationService } from 'teleterm/ui/services/headlessAuthn/headlessAuthnService'; import { KeyboardShortcutsService } from 'teleterm/ui/services/keyboardShortcuts'; -import { WorkspacesService } from 'teleterm/ui/services/workspacesService/workspacesService'; +import { ModalsService } from 'teleterm/ui/services/modals'; import { NotificationsService } from 'teleterm/ui/services/notifications'; -import { FileTransferService } from 'teleterm/ui/services/fileTransferClient'; import { ReloginService } from 'teleterm/ui/services/relogin/reloginService'; +import { ResourcesService } from 'teleterm/ui/services/resources'; +import { StatePersistenceService } from 'teleterm/ui/services/statePersistence'; +import { TerminalsService } from 'teleterm/ui/services/terminals'; import { TshdNotificationsService } from 'teleterm/ui/services/tshdNotifications/tshdNotificationService'; -import { HeadlessAuthenticationService } from 'teleterm/ui/services/headlessAuthn/headlessAuthnService'; import { UsageService } from 'teleterm/ui/services/usage'; -import { ResourcesService } from 'teleterm/ui/services/resources'; -import { ConnectMyComputerService } from 'teleterm/ui/services/connectMyComputer'; -import { ConfigService } from 'teleterm/services/config'; -import { TshdClient, VnetClient } from 'teleterm/services/tshd/createClient'; +import { WorkspacesService } from 'teleterm/ui/services/workspacesService/workspacesService'; import { IAppContext, UnexpectedVnetShutdownListener } from 'teleterm/ui/types'; -import { DeepLinksService } from 'teleterm/ui/services/deepLinks'; -import { parseDeepLink } from 'teleterm/deepLinks'; import { CommandLauncher } from './commandLauncher'; import { createTshdEventsContextBridgeService } from './tshdEvents'; diff --git a/web/packages/teleterm/src/ui/boot.tsx b/web/packages/teleterm/src/ui/boot.tsx index b74f2172c9819..868f31e8bfa09 100644 --- a/web/packages/teleterm/src/ui/boot.tsx +++ b/web/packages/teleterm/src/ui/boot.tsx @@ -17,14 +17,13 @@ */ import React from 'react'; - import { createRoot } from 'react-dom/client'; +import Logger from 'teleterm/logger'; import { ElectronGlobals } from 'teleterm/types'; import { App } from 'teleterm/ui/App'; -import { FailedApp } from 'teleterm/ui/components/App'; import AppContext from 'teleterm/ui/appContext'; -import Logger from 'teleterm/logger'; +import { FailedApp } from 'teleterm/ui/components/App'; async function boot(): Promise { Logger.init(window['loggerService']); diff --git a/web/packages/teleterm/src/ui/components/App.test.tsx b/web/packages/teleterm/src/ui/components/App.test.tsx index 6ef9d04853b3e..4de458ff65435 100644 --- a/web/packages/teleterm/src/ui/components/App.test.tsx +++ b/web/packages/teleterm/src/ui/components/App.test.tsx @@ -16,7 +16,8 @@ * along with this program. If not, see . */ -import { screen, render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; + import '@testing-library/jest-dom'; import { FailedApp } from './App'; diff --git a/web/packages/teleterm/src/ui/components/App.tsx b/web/packages/teleterm/src/ui/components/App.tsx index c7ea226126ac2..597202b43b978 100644 --- a/web/packages/teleterm/src/ui/components/App.tsx +++ b/web/packages/teleterm/src/ui/components/App.tsx @@ -16,6 +16,7 @@ * along with this program. If not, see . */ import styled from 'styled-components'; + import { Failed } from 'design/CardError'; import { StaticThemeProvider } from 'teleterm/ui/ThemeProvider'; diff --git a/web/packages/teleterm/src/ui/components/CatchError/CatchError.jsx b/web/packages/teleterm/src/ui/components/CatchError/CatchError.jsx index 11d78f41a277e..78ff1dbdac068 100644 --- a/web/packages/teleterm/src/ui/components/CatchError/CatchError.jsx +++ b/web/packages/teleterm/src/ui/components/CatchError/CatchError.jsx @@ -20,8 +20,8 @@ import React from 'react'; import { UnhandledCaseError } from 'shared/utils/assertUnreachable'; -import { FailedApp } from 'teleterm/ui/components/App'; import Logger from 'teleterm/logger'; +import { FailedApp } from 'teleterm/ui/components/App'; export class CatchError extends React.Component { logger = new Logger('CatchError'); diff --git a/web/packages/teleterm/src/ui/components/CatchError/CatchError.test.tsx b/web/packages/teleterm/src/ui/components/CatchError/CatchError.test.tsx index 436e840f2eaf5..69806a4b9a5a3 100644 --- a/web/packages/teleterm/src/ui/components/CatchError/CatchError.test.tsx +++ b/web/packages/teleterm/src/ui/components/CatchError/CatchError.test.tsx @@ -16,7 +16,8 @@ * along with this program. If not, see . */ -import { screen, render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; + import '@testing-library/jest-dom'; import Logger, { NullService } from 'teleterm/logger'; diff --git a/web/packages/teleterm/src/ui/components/FieldInputs.tsx b/web/packages/teleterm/src/ui/components/FieldInputs.tsx index 6c0d933de3c28..d64ec936f632e 100644 --- a/web/packages/teleterm/src/ui/components/FieldInputs.tsx +++ b/web/packages/teleterm/src/ui/components/FieldInputs.tsx @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import FieldInput from 'shared/components/FieldInput'; -import styled from 'styled-components'; import React, { forwardRef } from 'react'; -import { FieldInputProps } from 'shared/components/FieldInput'; +import styled from 'styled-components'; + +import FieldInput, { FieldInputProps } from 'shared/components/FieldInput'; export const ConfigFieldInput = styled(FieldInput)` input { diff --git a/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.test.tsx b/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.test.tsx index 68dca2a049afb..060d8eb4deb1b 100644 --- a/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.test.tsx +++ b/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.test.tsx @@ -16,8 +16,9 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen, within } from '@testing-library/react'; +import React from 'react'; + import { fireEvent, render } from 'design/utils/testing'; import { FilterableList } from './FilterableList'; diff --git a/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.tsx b/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.tsx index bcc32985c6a84..099bb5fcb4f8b 100644 --- a/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.tsx +++ b/web/packages/teleterm/src/ui/components/FilterableList/FilterableList.tsx @@ -17,9 +17,10 @@ */ import React, { Fragment, ReactNode, useMemo, useState } from 'react'; -import { Input } from 'design'; import styled from 'styled-components'; +import { Input } from 'design'; + interface FilterableListProps { items: T[]; filterBy: keyof T; diff --git a/web/packages/teleterm/src/ui/components/KeyboardArrowsNavigation/KeyboardArrowsNavigation.test.tsx b/web/packages/teleterm/src/ui/components/KeyboardArrowsNavigation/KeyboardArrowsNavigation.test.tsx index dec2bbfe57ebe..c937494212ef7 100644 --- a/web/packages/teleterm/src/ui/components/KeyboardArrowsNavigation/KeyboardArrowsNavigation.test.tsx +++ b/web/packages/teleterm/src/ui/components/KeyboardArrowsNavigation/KeyboardArrowsNavigation.test.tsx @@ -22,6 +22,7 @@ import React, { useCallback, useImperativeHandle, } from 'react'; + import { act, fireEvent, render, screen } from 'design/utils/testing'; import { KeyboardArrowsNavigation } from './KeyboardArrowsNavigation'; diff --git a/web/packages/teleterm/src/ui/components/LinearProgress/index.ts b/web/packages/teleterm/src/ui/components/LinearProgress/index.ts index f126c653db3d1..928e3b3e002dd 100644 --- a/web/packages/teleterm/src/ui/components/LinearProgress/index.ts +++ b/web/packages/teleterm/src/ui/components/LinearProgress/index.ts @@ -17,4 +17,5 @@ */ import LinearProgress from './LinearProgress'; + export default LinearProgress; diff --git a/web/packages/teleterm/src/ui/components/Notifcations/Notifications.story.tsx b/web/packages/teleterm/src/ui/components/Notifcations/Notifications.story.tsx index f5f9cbf46764c..fadf852a2ba40 100644 --- a/web/packages/teleterm/src/ui/components/Notifcations/Notifications.story.tsx +++ b/web/packages/teleterm/src/ui/components/Notifcations/Notifications.story.tsx @@ -17,14 +17,14 @@ */ import React, { useState } from 'react'; + +import type { NotificationItem } from '@gravitational/shared/components/Notification'; import { ButtonPrimary, Flex } from 'design'; import { unique } from 'teleterm/ui/utils/uid'; import { Notifications } from '.'; -import type { NotificationItem } from '@gravitational/shared/components/Notification'; - export default { title: 'Teleterm/components/Notifications', }; diff --git a/web/packages/teleterm/src/ui/components/Notifcations/Notifications.tsx b/web/packages/teleterm/src/ui/components/Notifcations/Notifications.tsx index 0ec05a8968beb..6c5b01fc0413e 100644 --- a/web/packages/teleterm/src/ui/components/Notifcations/Notifications.tsx +++ b/web/packages/teleterm/src/ui/components/Notifcations/Notifications.tsx @@ -18,10 +18,12 @@ import React from 'react'; import styled from 'styled-components'; -import { Notification } from 'shared/components/Notification'; -import { Info, Warning } from 'design/Icon'; -import type { NotificationItem } from 'shared/components/Notification'; +import { Info, Warning } from 'design/Icon'; +import { + Notification, + type NotificationItem, +} from 'shared/components/Notification'; interface NotificationsProps { items: NotificationItem[]; diff --git a/web/packages/teleterm/src/ui/components/OfflineGateway.tsx b/web/packages/teleterm/src/ui/components/OfflineGateway.tsx index 8cf392ea8ac80..2a6a61d94966c 100644 --- a/web/packages/teleterm/src/ui/components/OfflineGateway.tsx +++ b/web/packages/teleterm/src/ui/components/OfflineGateway.tsx @@ -17,8 +17,8 @@ */ import React, { useState } from 'react'; -import { ButtonPrimary, Flex, Text } from 'design'; +import { ButtonPrimary, Flex, Text } from 'design'; import * as Alerts from 'design/Alert'; import Validation from 'shared/components/Validation'; import { Attempt } from 'shared/hooks/useAsync'; diff --git a/web/packages/teleterm/src/ui/components/ProfileStatusError.tsx b/web/packages/teleterm/src/ui/components/ProfileStatusError.tsx index f08ccc3f72722..dfc6be8684823 100644 --- a/web/packages/teleterm/src/ui/components/ProfileStatusError.tsx +++ b/web/packages/teleterm/src/ui/components/ProfileStatusError.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see . */ +import { Flex, P3 } from 'design'; import { Warning } from 'design/Icon'; -import { P3, Flex } from 'design'; export function ProfileStatusError(props: { error: string; diff --git a/web/packages/teleterm/src/ui/components/VirtualScroll/VirtualScroll.tsx b/web/packages/teleterm/src/ui/components/VirtualScroll/VirtualScroll.tsx index eeb275e457cc4..9ce8b943fb499 100644 --- a/web/packages/teleterm/src/ui/components/VirtualScroll/VirtualScroll.tsx +++ b/web/packages/teleterm/src/ui/components/VirtualScroll/VirtualScroll.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import React, { useRef, useEffect } from 'react'; +import React, { useEffect, useRef } from 'react'; import styled from 'styled-components'; -import { useVirtualScrollNodes } from './useVirtualScrollNodes'; import { VirtualScrollProps } from './types'; +import { useVirtualScrollNodes } from './useVirtualScrollNodes'; export function VirtualScroll(props: VirtualScrollProps) { // consider using `content-visibility: auto` https://github.com/gravitational/webapps/pull/595#pullrequestreview-880424544 diff --git a/web/packages/teleterm/src/ui/components/VirtualScroll/useVirtualScrollNodes.tsx b/web/packages/teleterm/src/ui/components/VirtualScroll/useVirtualScrollNodes.tsx index 644408dc827a5..76b606658eeb1 100644 --- a/web/packages/teleterm/src/ui/components/VirtualScroll/useVirtualScrollNodes.tsx +++ b/web/packages/teleterm/src/ui/components/VirtualScroll/useVirtualScrollNodes.tsx @@ -17,9 +17,10 @@ */ import React, { Fragment, useMemo, useState } from 'react'; -import { debounce } from 'shared/utils/highbar'; import styled from 'styled-components'; +import { debounce } from 'shared/utils/highbar'; + import { prepareVirtualScrollItems } from './prepareVirtualScrollItems'; import { VirtualScrollProps } from './types'; diff --git a/web/packages/teleterm/src/ui/fixtures/MockAppContextProvider.tsx b/web/packages/teleterm/src/ui/fixtures/MockAppContextProvider.tsx index c7e978ec4fa62..9bd3e3514624e 100644 --- a/web/packages/teleterm/src/ui/fixtures/MockAppContextProvider.tsx +++ b/web/packages/teleterm/src/ui/fixtures/MockAppContextProvider.tsx @@ -17,10 +17,8 @@ */ import React, { PropsWithChildren } from 'react'; - -import { HTML5Backend } from 'react-dnd-html5-backend'; - import { DndProvider } from 'react-dnd'; +import { HTML5Backend } from 'react-dnd-html5-backend'; import AppContextProvider from 'teleterm/ui/appContextProvider'; import { IAppContext } from 'teleterm/ui/types'; diff --git a/web/packages/teleterm/src/ui/fixtures/MockWorkspaceContextProvider.tsx b/web/packages/teleterm/src/ui/fixtures/MockWorkspaceContextProvider.tsx index e82107d98e71b..4480119d092c2 100644 --- a/web/packages/teleterm/src/ui/fixtures/MockWorkspaceContextProvider.tsx +++ b/web/packages/teleterm/src/ui/fixtures/MockWorkspaceContextProvider.tsx @@ -18,9 +18,9 @@ import React, { PropsWithChildren } from 'react'; +import { useAppContext } from 'teleterm/ui/appContextProvider'; import { WorkspaceContextProvider } from 'teleterm/ui/Documents'; import { RootClusterUri } from 'teleterm/ui/uri'; -import { useAppContext } from 'teleterm/ui/appContextProvider'; export const MockWorkspaceContextProvider: React.FC< PropsWithChildren<{ diff --git a/web/packages/teleterm/src/ui/fixtures/mocks.ts b/web/packages/teleterm/src/ui/fixtures/mocks.ts index fea17b77e8b26..e2c6d9d0a6985 100644 --- a/web/packages/teleterm/src/ui/fixtures/mocks.ts +++ b/web/packages/teleterm/src/ui/fixtures/mocks.ts @@ -17,13 +17,13 @@ */ import { MockMainProcessClient } from 'teleterm/mainProcess/fixtures/mocks'; +import { MockPtyServiceClient } from 'teleterm/services/pty/fixtures/mocks'; import { MockTshClient, MockVnetClient, } from 'teleterm/services/tshd/fixtures/mocks'; -import { MockPtyServiceClient } from 'teleterm/services/pty/fixtures/mocks'; -import AppContext from 'teleterm/ui/appContext'; import { RuntimeSettings } from 'teleterm/types'; +import AppContext from 'teleterm/ui/appContext'; export class MockAppContext extends AppContext { constructor(runtimeSettings?: Partial) { diff --git a/web/packages/teleterm/src/ui/hooks/useLoggedInUser.ts b/web/packages/teleterm/src/ui/hooks/useLoggedInUser.ts index 42bc74a989bb6..3f366ef07de8d 100644 --- a/web/packages/teleterm/src/ui/hooks/useLoggedInUser.ts +++ b/web/packages/teleterm/src/ui/hooks/useLoggedInUser.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ +import { LoggedInUser } from 'teleterm/services/tshd/types'; import { useAppContext } from 'teleterm/ui/appContextProvider'; import { useWorkspaceContext } from 'teleterm/ui/Documents'; -import { LoggedInUser } from 'teleterm/services/tshd/types'; /** * useLoggedInUser returns the user logged into the root cluster of the active workspace. The return diff --git a/web/packages/teleterm/src/ui/hooks/usePersistedState.test.tsx b/web/packages/teleterm/src/ui/hooks/usePersistedState.test.tsx index 4aab64ddca95a..c901136828a26 100644 --- a/web/packages/teleterm/src/ui/hooks/usePersistedState.test.tsx +++ b/web/packages/teleterm/src/ui/hooks/usePersistedState.test.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { render, screen, act } from 'design/utils/testing'; +import { act, render, screen } from 'design/utils/testing'; import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider'; import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; diff --git a/web/packages/teleterm/src/ui/hooks/useStoreSelector.ts b/web/packages/teleterm/src/ui/hooks/useStoreSelector.ts index f0f2f07cbece2..c1972ccd9c032 100644 --- a/web/packages/teleterm/src/ui/hooks/useStoreSelector.ts +++ b/web/packages/teleterm/src/ui/hooks/useStoreSelector.ts @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { useSyncExternalStore, useCallback } from 'react'; +import { useCallback, useSyncExternalStore } from 'react'; import { useAppContext } from 'teleterm/ui/appContextProvider'; -import { IAppContext } from 'teleterm/ui/types'; import { ImmutableStore } from 'teleterm/ui/services/immutableStore'; +import { IAppContext } from 'teleterm/ui/types'; /** * useStoreSelector selects a value out of a store and triggers a component update whenever that diff --git a/web/packages/teleterm/src/ui/services/clusters/clustersService.test.ts b/web/packages/teleterm/src/ui/services/clusters/clustersService.test.ts index 6658012512c3e..2088207b78781 100644 --- a/web/packages/teleterm/src/ui/services/clusters/clustersService.test.ts +++ b/web/packages/teleterm/src/ui/services/clusters/clustersService.test.ts @@ -16,22 +16,21 @@ * along with this program. If not, see . */ -import { NotificationsService } from 'teleterm/ui/services/notifications'; -import { UsageService } from 'teleterm/ui/services/usage'; import { MainProcessClient } from 'teleterm/mainProcess/types'; +import type { TshdClient } from 'teleterm/services/tshd'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { makeDatabaseGateway, makeKubeGateway, - makeRootCluster, makeLeafCluster, + makeRootCluster, } from 'teleterm/services/tshd/testHelpers'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import { NotificationsService } from 'teleterm/ui/services/notifications'; +import { UsageService } from 'teleterm/ui/services/usage'; +import type * as uri from 'teleterm/ui/uri'; import { ClustersService } from './clustersService'; -import type * as uri from 'teleterm/ui/uri'; -import type { TshdClient } from 'teleterm/services/tshd'; - jest.mock('teleterm/ui/services/notifications'); jest.mock('teleterm/ui/services/usage'); diff --git a/web/packages/teleterm/src/ui/services/clusters/clustersService.ts b/web/packages/teleterm/src/ui/services/clusters/clustersService.ts index 72f6808526145..26f6771066a1d 100644 --- a/web/packages/teleterm/src/ui/services/clusters/clustersService.ts +++ b/web/packages/teleterm/src/ui/services/clusters/clustersService.ts @@ -16,40 +16,38 @@ * along with this program. If not, see . */ -import { useStore } from 'shared/libs/stores'; -import { - DbProtocol, - DbType, - formatDatabaseInfo, -} from 'shared/services/databases'; -import { pipe } from 'shared/utils/pipe'; - import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; -import { Gateway } from 'gen-proto-ts/teleport/lib/teleterm/v1/gateway_pb'; import { Cluster, ShowResources, } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; +import { Database } from 'gen-proto-ts/teleport/lib/teleterm/v1/database_pb'; +import { Gateway } from 'gen-proto-ts/teleport/lib/teleterm/v1/gateway_pb'; import { Kube } from 'gen-proto-ts/teleport/lib/teleterm/v1/kube_pb'; import { Server } from 'gen-proto-ts/teleport/lib/teleterm/v1/server_pb'; -import { Database } from 'gen-proto-ts/teleport/lib/teleterm/v1/database_pb'; import { CreateAccessRequestRequest, - ReviewAccessRequestRequest, - PromoteAccessRequestRequest, - PasswordlessPrompt, CreateGatewayRequest, + PasswordlessPrompt, + PromoteAccessRequestRequest, + ReviewAccessRequestRequest, } from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; +import { useStore } from 'shared/libs/stores'; +import { + DbProtocol, + DbType, + formatDatabaseInfo, +} from 'shared/services/databases'; +import { pipe } from 'shared/utils/pipe'; -import * as uri from 'teleterm/ui/uri'; -import { NotificationsService } from 'teleterm/ui/services/notifications'; import { MainProcessClient } from 'teleterm/mainProcess/types'; +import type { CloneableAbortSignal, TshdClient } from 'teleterm/services/tshd'; +import { NotificationsService } from 'teleterm/ui/services/notifications'; import { UsageService } from 'teleterm/ui/services/usage'; +import * as uri from 'teleterm/ui/uri'; import { ImmutableStore } from '../immutableStore'; - import type * as types from './types'; -import type { TshdClient, CloneableAbortSignal } from 'teleterm/services/tshd'; const { routing } = uri; diff --git a/web/packages/teleterm/src/ui/services/connectMyComputer/connectMyComputerService.ts b/web/packages/teleterm/src/ui/services/connectMyComputer/connectMyComputerService.ts index f938bc8642b39..f77ec2c1d91df 100644 --- a/web/packages/teleterm/src/ui/services/connectMyComputer/connectMyComputerService.ts +++ b/web/packages/teleterm/src/ui/services/connectMyComputer/connectMyComputerService.ts @@ -17,13 +17,12 @@ */ import { MainProcessClient } from 'teleterm/mainProcess/types'; +import { CloneableAbortSignal, TshdClient } from 'teleterm/services/tshd'; import { Cluster, CreateConnectMyComputerRoleResponse, Server, } from 'teleterm/services/tshd/types'; -import { TshdClient, CloneableAbortSignal } from 'teleterm/services/tshd'; - import type * as uri from 'teleterm/ui/uri'; export class ConnectMyComputerService { diff --git a/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.test.ts b/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.test.ts index b31e607a98293..1b465499c8902 100644 --- a/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.test.ts +++ b/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.test.ts @@ -18,6 +18,8 @@ import Logger, { NullService } from 'teleterm/logger'; +import { ClustersService } from '../clusters'; +import { StatePersistenceService } from '../statePersistence'; import { Document, DocumentGateway, @@ -26,11 +28,7 @@ import { DocumentTshNodeWithServerId, WorkspacesService, } from '../workspacesService'; -import { ClustersService } from '../clusters'; -import { StatePersistenceService } from '../statePersistence'; - import { getEmptyPendingAccessRequest } from '../workspacesService/accessRequestsService'; - import { ConnectionTrackerService } from './connectionTrackerService'; import { TrackedConnection, TrackedGatewayConnection } from './types'; diff --git a/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.ts b/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.ts index fcf918dd22012..8e382f8a6299a 100644 --- a/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.ts +++ b/web/packages/teleterm/src/ui/services/connectionTracker/connectionTrackerService.ts @@ -19,29 +19,28 @@ import { useStore } from 'shared/libs/stores'; import { ClustersService } from 'teleterm/ui/services/clusters'; +import { StatePersistenceService } from 'teleterm/ui/services/statePersistence'; import { Document, DocumentOrigin, isDocumentTshNodeWithLoginHost, WorkspacesService, } from 'teleterm/ui/services/workspacesService'; -import { StatePersistenceService } from 'teleterm/ui/services/statePersistence'; import * as uri from 'teleterm/ui/uri'; import { RootClusterUri, routing } from 'teleterm/ui/uri'; import { assertUnreachable } from 'teleterm/ui/utils'; import { ImmutableStore } from '../immutableStore'; - import { TrackedConnectionOperationsFactory } from './trackedConnectionOperationsFactory'; import { createGatewayConnection, - createKubeConnection, createGatewayKubeConnection, + createKubeConnection, createServerConnection, getGatewayConnectionByDocument, + getGatewayKubeConnectionByDocument, getKubeConnectionByDocument, getServerConnectionByDocument, - getGatewayKubeConnectionByDocument, } from './trackedConnectionUtils'; import { ExtendedTrackedConnection, diff --git a/web/packages/teleterm/src/ui/services/connectionTracker/trackedConnectionOperationsFactory.ts b/web/packages/teleterm/src/ui/services/connectionTracker/trackedConnectionOperationsFactory.ts index eb0ac1c58c50f..39c13173aaa59 100644 --- a/web/packages/teleterm/src/ui/services/connectionTracker/trackedConnectionOperationsFactory.ts +++ b/web/packages/teleterm/src/ui/services/connectionTracker/trackedConnectionOperationsFactory.ts @@ -16,18 +16,18 @@ * along with this program. If not, see . */ -import { LeafClusterUri, RootClusterUri, routing } from 'teleterm/ui/uri'; import { ClustersService } from 'teleterm/ui/services/clusters'; import { DocumentOrigin, WorkspacesService, } from 'teleterm/ui/services/workspacesService'; +import { LeafClusterUri, RootClusterUri, routing } from 'teleterm/ui/uri'; import { getGatewayDocumentByConnection, + getGatewayKubeDocumentByConnection, getKubeDocumentByConnection, getServerDocumentByConnection, - getGatewayKubeDocumentByConnection, } from './trackedConnectionUtils'; import { TrackedConnection, diff --git a/web/packages/teleterm/src/ui/services/connectionTracker/types.ts b/web/packages/teleterm/src/ui/services/connectionTracker/types.ts index 0991ebff5de40..8534f67ca72e2 100644 --- a/web/packages/teleterm/src/ui/services/connectionTracker/types.ts +++ b/web/packages/teleterm/src/ui/services/connectionTracker/types.ts @@ -17,11 +17,11 @@ */ import { + AppUri, DatabaseUri, GatewayUri, KubeUri, ServerUri, - AppUri, } from 'teleterm/ui/uri'; type TrackedConnectionBase = { diff --git a/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.test.ts b/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.test.ts index b2d7092e825ca..695e86c86cac0 100644 --- a/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.test.ts +++ b/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.test.ts @@ -17,9 +17,9 @@ */ import { DeepLinkParseResult } from 'teleterm/deepLinks'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { RuntimeSettings } from 'teleterm/types'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { DeepLinksService } from './deepLinksService'; diff --git a/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.ts b/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.ts index ea98c9a51ef40..fa412f280fde5 100644 --- a/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.ts +++ b/web/packages/teleterm/src/ui/services/deepLinks/deepLinksService.ts @@ -19,13 +19,13 @@ import { AuthenticateWebDeviceDeepURL, DeepURL } from 'shared/deepLinks'; import { DeepLinkParseResult } from 'teleterm/deepLinks'; -import { RootClusterUri, routing } from 'teleterm/ui/uri'; -import { assertUnreachable } from 'teleterm/ui/utils'; import { RuntimeSettings } from 'teleterm/types'; import { ClustersService } from 'teleterm/ui/services/clusters'; -import { WorkspacesService } from 'teleterm/ui/services/workspacesService'; import { ModalsService } from 'teleterm/ui/services/modals'; import { NotificationsService } from 'teleterm/ui/services/notifications'; +import { WorkspacesService } from 'teleterm/ui/services/workspacesService'; +import { RootClusterUri, routing } from 'teleterm/ui/uri'; +import { assertUnreachable } from 'teleterm/ui/utils'; export class DeepLinksService { constructor( diff --git a/web/packages/teleterm/src/ui/services/fileTransferClient/fileTransferService.ts b/web/packages/teleterm/src/ui/services/fileTransferClient/fileTransferService.ts index 68e0049ddc94f..bed2ee66c0f87 100644 --- a/web/packages/teleterm/src/ui/services/fileTransferClient/fileTransferService.ts +++ b/web/packages/teleterm/src/ui/services/fileTransferClient/fileTransferService.ts @@ -16,14 +16,13 @@ * along with this program. If not, see . */ -import { FileTransferListeners } from 'shared/components/FileTransfer'; - import { FileTransferDirection } from 'gen-proto-ts/teleport/lib/teleterm/v1/service_pb'; +import { FileTransferListeners } from 'shared/components/FileTransfer'; -import { FileTransferRequest } from 'teleterm/services/tshd/types'; import { TshdClient } from 'teleterm/services/tshd'; -import { UsageService } from 'teleterm/ui/services/usage'; import { cloneAbortSignal } from 'teleterm/services/tshd/cloneableClient'; +import { FileTransferRequest } from 'teleterm/services/tshd/types'; +import { UsageService } from 'teleterm/ui/services/usage'; export class FileTransferService { constructor( diff --git a/web/packages/teleterm/src/ui/services/headlessAuthn/headlessAuthnService.ts b/web/packages/teleterm/src/ui/services/headlessAuthn/headlessAuthnService.ts index fa5dc997e08e7..fbc56d0d3e245 100644 --- a/web/packages/teleterm/src/ui/services/headlessAuthn/headlessAuthnService.ts +++ b/web/packages/teleterm/src/ui/services/headlessAuthn/headlessAuthnService.ts @@ -16,13 +16,12 @@ * along with this program. If not, see . */ +import { ConfigService } from 'teleterm/services/config'; +import type { CloneableAbortSignal, TshdClient } from 'teleterm/services/tshd'; +import type * as types from 'teleterm/services/tshd/types'; import { SendPendingHeadlessAuthenticationRequest } from 'teleterm/services/tshdEvents'; import { MainProcessClient } from 'teleterm/types'; import { ModalsService } from 'teleterm/ui/services/modals'; -import { ConfigService } from 'teleterm/services/config'; - -import type { TshdClient, CloneableAbortSignal } from 'teleterm/services/tshd'; -import type * as types from 'teleterm/services/tshd/types'; export class HeadlessAuthenticationService { constructor( diff --git a/web/packages/teleterm/src/ui/services/immutableStore/immutableStore.ts b/web/packages/teleterm/src/ui/services/immutableStore/immutableStore.ts index 972cbbae6523c..65979a1c04712 100644 --- a/web/packages/teleterm/src/ui/services/immutableStore/immutableStore.ts +++ b/web/packages/teleterm/src/ui/services/immutableStore/immutableStore.ts @@ -19,8 +19,9 @@ /* eslint-disable @typescript-eslint/ban-ts-comment*/ import { enableMapSet, produce } from 'immer'; -import Store from 'shared/libs/stores/store'; + import stateLogger from 'shared/libs/stores/logger'; +import Store from 'shared/libs/stores/store'; import Logger from 'teleterm/logger'; diff --git a/web/packages/teleterm/src/ui/services/keyboardShortcuts/keyboardShortcutsService.ts b/web/packages/teleterm/src/ui/services/keyboardShortcuts/keyboardShortcutsService.ts index 78c3220fd4269..53ff5f3fe7e33 100644 --- a/web/packages/teleterm/src/ui/services/keyboardShortcuts/keyboardShortcutsService.ts +++ b/web/packages/teleterm/src/ui/services/keyboardShortcuts/keyboardShortcutsService.ts @@ -18,8 +18,8 @@ import { Platform } from 'teleterm/mainProcess/types'; import { - KeyboardShortcutAction, ConfigService, + KeyboardShortcutAction, } from 'teleterm/services/config'; import { getKeyName } from './getKeyName'; diff --git a/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcutFormatters.ts b/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcutFormatters.ts index 292745d38bb2e..a608d48e3d769 100644 --- a/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcutFormatters.ts +++ b/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcutFormatters.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ +import { Platform } from '../../../mainProcess/types'; import { KeyboardShortcutAction } from '../../../services/config'; import { useAppContext } from '../../appContextProvider'; -import { Platform } from '../../../mainProcess/types'; interface KeyboardShortcutFormatters { getLabelWithAccelerator( diff --git a/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcuts.test.tsx b/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcuts.test.tsx index 847c80404a493..8c8a8d3fcae59 100644 --- a/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcuts.test.tsx +++ b/web/packages/teleterm/src/ui/services/keyboardShortcuts/useKeyboardShortcuts.test.tsx @@ -16,18 +16,16 @@ * along with this program. If not, see . */ -import renderHook from 'design/utils/renderHook'; - import React from 'react'; -import AppContextProvider from 'teleterm/ui/appContextProvider'; +import renderHook from 'design/utils/renderHook'; import AppContext from 'teleterm/ui/appContext'; - -import { useKeyboardShortcuts } from './useKeyboardShortcuts'; +import AppContextProvider from 'teleterm/ui/appContextProvider'; import { KeyboardShortcutsService } from './keyboardShortcutsService'; import { KeyboardShortcutEventSubscriber } from './types'; +import { useKeyboardShortcuts } from './useKeyboardShortcuts'; test('call handler on its event type', () => { const { handler, getEventEmitter, wrapper } = getTestSetup(); diff --git a/web/packages/teleterm/src/ui/services/modals/modalsService.ts b/web/packages/teleterm/src/ui/services/modals/modalsService.ts index a9a2c19d2b983..bc69205ea4269 100644 --- a/web/packages/teleterm/src/ui/services/modals/modalsService.ts +++ b/web/packages/teleterm/src/ui/services/modals/modalsService.ts @@ -16,17 +16,16 @@ * along with this program. If not, see . */ -import { useStore } from 'shared/libs/stores'; import * as tshdEventsApi from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; +import { useStore } from 'shared/libs/stores'; import * as types from 'teleterm/services/tshd/types'; -import { RootClusterUri } from 'teleterm/ui/uri'; import { ResourceSearchError } from 'teleterm/ui/services/resources'; +import { RootClusterUri } from 'teleterm/ui/uri'; +import type * as uri from 'teleterm/ui/uri'; import { ImmutableStore } from '../immutableStore'; -import type * as uri from 'teleterm/ui/uri'; - type State = { // One regular dialog and multiple important dialogs can be rendered at the same time. // The rule is that the regular dialogs are opened from user actions in the Electron app, while diff --git a/web/packages/teleterm/src/ui/services/notifications/notificationsService.ts b/web/packages/teleterm/src/ui/services/notifications/notificationsService.ts index 2508dbfc5770f..4a3c4dbe8386c 100644 --- a/web/packages/teleterm/src/ui/services/notifications/notificationsService.ts +++ b/web/packages/teleterm/src/ui/services/notifications/notificationsService.ts @@ -16,15 +16,14 @@ * along with this program. If not, see . */ -import { useStore } from 'shared/libs/stores'; - -import { ImmutableStore } from 'teleterm/ui/services/immutableStore'; -import { unique } from 'teleterm/ui/utils/uid'; - import type { NotificationItem, NotificationItemContent, } from 'shared/components/Notification'; +import { useStore } from 'shared/libs/stores'; + +import { ImmutableStore } from 'teleterm/ui/services/immutableStore'; +import { unique } from 'teleterm/ui/utils/uid'; export class NotificationsService extends ImmutableStore { state: NotificationItem[] = []; diff --git a/web/packages/teleterm/src/ui/services/relogin/reloginService.ts b/web/packages/teleterm/src/ui/services/relogin/reloginService.ts index 8d5a2cdee63ce..df1196107b155 100644 --- a/web/packages/teleterm/src/ui/services/relogin/reloginService.ts +++ b/web/packages/teleterm/src/ui/services/relogin/reloginService.ts @@ -16,17 +16,17 @@ * along with this program. If not, see . */ -import { MainProcessClient } from 'teleterm/types'; -import { ReloginRequest } from 'teleterm/services/tshdEvents'; -import { - ModalsService, - ClusterConnectReason, -} from 'teleterm/ui/services/modals'; -import { ClustersService } from 'teleterm/ui/services/clusters'; import { reloginReasonOneOfIsGatewayCertExpired, reloginReasonOneOfIsVnetCertExpired, } from 'teleterm/helpers'; +import { ReloginRequest } from 'teleterm/services/tshdEvents'; +import { MainProcessClient } from 'teleterm/types'; +import { ClustersService } from 'teleterm/ui/services/clusters'; +import { + ClusterConnectReason, + ModalsService, +} from 'teleterm/ui/services/modals'; export class ReloginService { constructor( diff --git a/web/packages/teleterm/src/ui/services/resources/resourcesService.test.ts b/web/packages/teleterm/src/ui/services/resources/resourcesService.test.ts index a4d3a45ebafd8..750ce60d02be7 100644 --- a/web/packages/teleterm/src/ui/services/resources/resourcesService.test.ts +++ b/web/packages/teleterm/src/ui/services/resources/resourcesService.test.ts @@ -16,13 +16,15 @@ * along with this program. If not, see . */ +import type { TshdClient } from 'teleterm/services/tshd'; +import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; import { + makeApp, makeDatabase, makeKube, makeServer, - makeApp, } from 'teleterm/services/tshd/testHelpers'; -import { MockedUnaryCall } from 'teleterm/services/tshd/cloneableClient'; +import type * as tsh from 'teleterm/services/tshd/types'; import { AmbiguousHostnameError, @@ -30,9 +32,6 @@ import { ResourcesService, } from './resourcesService'; -import type { TshdClient } from 'teleterm/services/tshd'; -import type * as tsh from 'teleterm/services/tshd/types'; - describe('getServerByHostname', () => { const server: tsh.Server = makeServer(); const getServerByHostnameTests: Array< diff --git a/web/packages/teleterm/src/ui/services/resources/resourcesService.ts b/web/packages/teleterm/src/ui/services/resources/resourcesService.ts index c2d0f80b6b1e9..31f4f1788de3c 100644 --- a/web/packages/teleterm/src/ui/services/resources/resourcesService.ts +++ b/web/packages/teleterm/src/ui/services/resources/resourcesService.ts @@ -17,25 +17,21 @@ */ import { - cloneAbortSignal, - TshdRpcError, -} from 'teleterm/services/tshd/cloneableClient'; - -import { - resourceOneOfIsServer, - resourceOneOfIsDatabase, resourceOneOfIsApp, + resourceOneOfIsDatabase, resourceOneOfIsKube, + resourceOneOfIsServer, } from 'teleterm/helpers'; - import Logger from 'teleterm/logger'; - -import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; - import type { TshdClient } from 'teleterm/services/tshd'; +import { getAppAddrWithProtocol } from 'teleterm/services/tshd/app'; +import { + cloneAbortSignal, + TshdRpcError, +} from 'teleterm/services/tshd/cloneableClient'; import type * as types from 'teleterm/services/tshd/types'; -import type * as uri from 'teleterm/ui/uri'; import type { ResourceTypeFilter } from 'teleterm/ui/Search/searchResult'; +import type * as uri from 'teleterm/ui/uri'; export class ResourcesService { private logger = new Logger('ResourcesService'); diff --git a/web/packages/teleterm/src/ui/services/tshdNotifications/tshdNotificationService.ts b/web/packages/teleterm/src/ui/services/tshdNotifications/tshdNotificationService.ts index 60300c025b9bc..b11f83836f874 100644 --- a/web/packages/teleterm/src/ui/services/tshdNotifications/tshdNotificationService.ts +++ b/web/packages/teleterm/src/ui/services/tshdNotifications/tshdNotificationService.ts @@ -18,15 +18,15 @@ import { NotificationItemContent } from 'shared/components/Notification'; +import { + notificationRequestOneOfIsCannotProxyGatewayConnection, + notificationRequestOneOfIsCannotProxyVnetConnection, +} from 'teleterm/helpers'; import { getTargetNameFromUri } from 'teleterm/services/tshd/gateway'; import { SendNotificationRequest } from 'teleterm/services/tshdEvents'; import { ClustersService } from 'teleterm/ui/services/clusters'; import { NotificationsService } from 'teleterm/ui/services/notifications'; import { routing } from 'teleterm/ui/uri'; -import { - notificationRequestOneOfIsCannotProxyGatewayConnection, - notificationRequestOneOfIsCannotProxyVnetConnection, -} from 'teleterm/helpers'; export class TshdNotificationsService { constructor( diff --git a/web/packages/teleterm/src/ui/services/usage/askAboutUserJobRoleIfNeeded.ts b/web/packages/teleterm/src/ui/services/usage/askAboutUserJobRoleIfNeeded.ts index e5344920b7507..ed00ab70547c0 100644 --- a/web/packages/teleterm/src/ui/services/usage/askAboutUserJobRoleIfNeeded.ts +++ b/web/packages/teleterm/src/ui/services/usage/askAboutUserJobRoleIfNeeded.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { UsageService } from 'teleterm/ui/services/usage'; +import { ConfigService } from 'teleterm/services/config'; import { ModalsService } from 'teleterm/ui/services/modals'; import { StatePersistenceService } from 'teleterm/ui/services/statePersistence'; -import { ConfigService } from 'teleterm/services/config'; +import { UsageService } from 'teleterm/ui/services/usage'; export async function askAboutUserJobRoleIfNeeded( statePersistenceService: StatePersistenceService, diff --git a/web/packages/teleterm/src/ui/services/usage/setUpUsageReporting.ts b/web/packages/teleterm/src/ui/services/usage/setUpUsageReporting.ts index 2ccfa77f24f4e..912680da4e171 100644 --- a/web/packages/teleterm/src/ui/services/usage/setUpUsageReporting.ts +++ b/web/packages/teleterm/src/ui/services/usage/setUpUsageReporting.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ +import Logger from 'teleterm/logger'; import { ConfigService } from 'teleterm/services/config'; -import { ModalsService } from 'teleterm/ui/services/modals'; import { staticConfig } from 'teleterm/staticConfig'; -import Logger from 'teleterm/logger'; +import { ModalsService } from 'teleterm/ui/services/modals'; export async function setUpUsageReporting( configService: ConfigService, diff --git a/web/packages/teleterm/src/ui/services/usage/usageService.ts b/web/packages/teleterm/src/ui/services/usage/usageService.ts index 58b840a5a323b..68dc0dc8ac017 100644 --- a/web/packages/teleterm/src/ui/services/usage/usageService.ts +++ b/web/packages/teleterm/src/ui/services/usage/usageService.ts @@ -16,18 +16,18 @@ * along with this program. If not, see . */ -import { SubmitConnectEventRequest } from 'gen-proto-ts/prehog/v1alpha/connect_pb'; import { Timestamp } from 'gen-proto-ts/google/protobuf/timestamp_pb'; +import { SubmitConnectEventRequest } from 'gen-proto-ts/prehog/v1alpha/connect_pb'; import { Cluster } from 'gen-proto-ts/teleport/lib/teleterm/v1/cluster_pb'; -import { ClusterOrResourceUri, ClusterUri, routing } from 'teleterm/ui/uri'; -import { TshdClient } from 'teleterm/services/tshd'; +import Logger from 'teleterm/logger'; import { RuntimeSettings } from 'teleterm/mainProcess/types'; import { ConfigService } from 'teleterm/services/config'; -import Logger from 'teleterm/logger'; +import { TshdClient } from 'teleterm/services/tshd'; import { staticConfig } from 'teleterm/staticConfig'; import { NotificationsService } from 'teleterm/ui/services/notifications'; import { DocumentOrigin } from 'teleterm/ui/services/workspacesService'; +import { ClusterOrResourceUri, ClusterUri, routing } from 'teleterm/ui/uri'; type PrehogEventReq = Omit< SubmitConnectEventRequest, diff --git a/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.test.ts b/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.test.ts index 6f003943cc65c..0ccb760851bcc 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.test.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.test.ts @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -import { ImmutableStore } from 'teleterm/ui/services/immutableStore'; import { - rootClusterUri, leafClusterUri, - makeServer, makeApp, - makeKube, makeDatabase, + makeKube, + makeServer, + rootClusterUri, } from 'teleterm/services/tshd/testHelpers'; +import { ImmutableStore } from 'teleterm/ui/services/immutableStore'; import { ModalsService } from 'teleterm/ui/services/modals'; import { diff --git a/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts b/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts index 794e2e302a07e..29f1f0d16593b 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts @@ -16,17 +16,17 @@ * along with this program. If not, see . */ +import { ModalsService } from 'teleterm/ui/services/modals'; import { - ResourceUri, - routing, + AppUri, ClusterUri, - ServerUri, DatabaseUri, - KubeUri, - AppUri, KubeResourceNamespaceUri, + KubeUri, + ResourceUri, + routing, + ServerUri, } from 'teleterm/ui/uri'; -import { ModalsService } from 'teleterm/ui/services/modals'; export class AccessRequestsService { constructor( diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.test.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.test.ts index 9d4fba2663fda..ef432d0b037a8 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.test.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.test.ts @@ -16,12 +16,12 @@ * along with this program. If not, see . */ +import { makeApp, makeRootCluster } from 'teleterm/services/tshd/testHelpers'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { connectToApp, setUpAppGateway, } from 'teleterm/ui/services/workspacesService'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { makeApp, makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import { IAppContext } from 'teleterm/ui/types'; describe('connectToApp', () => { diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.ts index 92dac2447f71f..a7ad3d4074bb9 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToApp.ts @@ -18,15 +18,14 @@ import { App } from 'gen-proto-ts/teleport/lib/teleterm/v1/app_pb'; -import { routing } from 'teleterm/ui/uri'; -import { IAppContext } from 'teleterm/ui/types'; - import { - getWebAppLaunchUrl, - isWebApp, getAwsAppLaunchUrl, getSamlAppSsoUrl, + getWebAppLaunchUrl, + isWebApp, } from 'teleterm/services/tshd/app'; +import { IAppContext } from 'teleterm/ui/types'; +import { routing } from 'teleterm/ui/uri'; import { DocumentOrigin } from './types'; diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToDatabase.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToDatabase.ts index 4f53ad3c376e3..20238815acc3b 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToDatabase.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToDatabase.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ +import { GatewayProtocol } from 'teleterm/services/tshd/types'; import { IAppContext } from 'teleterm/ui/types'; import { DatabaseUri, routing } from 'teleterm/ui/uri'; -import { GatewayProtocol } from 'teleterm/services/tshd/types'; import { DocumentOrigin } from './types'; diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToKube.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToKube.ts index 365bdc6251d27..0fd3369653547 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToKube.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToKube.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { KubeUri, routing } from 'teleterm/ui/uri'; import { IAppContext } from 'teleterm/ui/types'; +import { KubeUri, routing } from 'teleterm/ui/uri'; import { DocumentOrigin } from './types'; diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToServer.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToServer.ts index eb6d115f0c983..9f58de0ee3f8c 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToServer.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/connectToServer.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import { routing, ServerUri } from 'teleterm/ui/uri'; import { IAppContext } from 'teleterm/ui/types'; +import { routing, ServerUri } from 'teleterm/ui/uri'; import { DocumentOrigin } from './types'; diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/documentsService.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/documentsService.ts index ad91d8081016c..83b3d89ff05d2 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/documentsService.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/documentsService.ts @@ -16,16 +16,18 @@ * along with this program. If not, see . */ -import { unique } from 'teleterm/ui/utils/uid'; +import type { Shell } from 'teleterm/mainProcess/shell'; +import type { RuntimeSettings } from 'teleterm/mainProcess/types'; import * as uri from 'teleterm/ui/uri'; import { DocumentUri, - ServerUri, + KubeUri, paths, - routing, RootClusterUri, - KubeUri, + routing, + ServerUri, } from 'teleterm/ui/uri'; +import { unique } from 'teleterm/ui/utils/uid'; import { CreateAccessRequestDocumentOpts, @@ -33,24 +35,21 @@ import { CreateTshKubeDocumentOptions, Document, DocumentAccessRequests, + DocumentAuthorizeWebSession, DocumentCluster, + DocumentClusterQueryParams, DocumentConnectMyComputer, DocumentGateway, - DocumentGatewayKube, DocumentGatewayCliClient, + DocumentGatewayKube, DocumentOrigin, + DocumentPtySession, DocumentTshKube, DocumentTshNode, DocumentTshNodeWithServerId, - DocumentClusterQueryParams, - DocumentPtySession, WebSessionRequest, - DocumentAuthorizeWebSession, } from './types'; -import type { Shell } from 'teleterm/mainProcess/shell'; -import type { RuntimeSettings } from 'teleterm/mainProcess/types'; - export class DocumentsService { constructor( private getState: () => { documents: Document[]; location: string }, diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.test.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.test.ts index 5b92b830c58d1..e6f749653d271 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.test.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.test.ts @@ -17,10 +17,10 @@ */ import { - isDocumentTshNodeWithServerId, - isDocumentTshNodeWithLoginHost, - DocumentTshNodeWithServerId, DocumentTshNodeWithLoginHost, + DocumentTshNodeWithServerId, + isDocumentTshNodeWithLoginHost, + isDocumentTshNodeWithServerId, } from './types'; const docWithServerId: DocumentTshNodeWithServerId = { diff --git a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.ts b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.ts index 00238ae5b35fd..970fb09d22ba7 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/documentsService/types.ts @@ -18,9 +18,8 @@ import { SharedUnifiedResource } from 'shared/components/UnifiedResources'; -import * as uri from 'teleterm/ui/uri'; - import type * as tsh from 'teleterm/services/tshd/types'; +import * as uri from 'teleterm/ui/uri'; export type Kind = Document['kind']; diff --git a/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.test.ts b/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.test.ts index ccb1add834217..628bbedd62190 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.test.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.test.ts @@ -17,30 +17,28 @@ */ import { + AvailableResourceMode, DefaultTab, - ViewMode, LabelsViewMode, - AvailableResourceMode, + ViewMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; -import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; import Logger, { NullService } from 'teleterm/logger'; +import { makeRootCluster } from 'teleterm/services/tshd/testHelpers'; +import type * as tshd from 'teleterm/services/tshd/types'; import { makeDocumentCluster } from 'teleterm/ui/services/workspacesService/documentsService/testHelpers'; import { ClustersService } from '../clusters'; -import { StatePersistenceService } from '../statePersistence'; -import { NotificationsService } from '../notifications'; import { ModalsService } from '../modals'; - +import { NotificationsService } from '../notifications'; +import { StatePersistenceService } from '../statePersistence'; import { getEmptyPendingAccessRequest } from './accessRequestsService'; +import { DocumentCluster, DocumentsService } from './documentsService'; import { Workspace, WorkspacesService, WorkspacesState, } from './workspacesService'; -import { DocumentCluster, DocumentsService } from './documentsService'; - -import type * as tshd from 'teleterm/services/tshd/types'; beforeAll(() => { Logger.init(new NullService()); diff --git a/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.ts b/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.ts index 02ebb8de45c7a..129b961759e2e 100644 --- a/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.ts +++ b/web/packages/teleterm/src/ui/services/workspacesService/workspacesService.ts @@ -17,25 +17,25 @@ */ import { z } from 'zod'; -import { useStore } from 'shared/libs/stores'; -import { arrayObjectIsEqual } from 'shared/utils/highbar'; import { + AvailableResourceMode, DefaultTab, LabelsViewMode, UnifiedResourcePreferences, ViewMode, - AvailableResourceMode, } from 'gen-proto-ts/teleport/userpreferences/v1/unified_resource_preferences_pb'; +import { useStore } from 'shared/libs/stores'; +import { arrayObjectIsEqual } from 'shared/utils/highbar'; -import { ModalsService } from 'teleterm/ui/services/modals'; import { ClustersService } from 'teleterm/ui/services/clusters'; +import { ImmutableStore } from 'teleterm/ui/services/immutableStore'; +import { ModalsService } from 'teleterm/ui/services/modals'; +import { NotificationsService } from 'teleterm/ui/services/notifications'; import { StatePersistenceService, WorkspacesPersistedState, } from 'teleterm/ui/services/statePersistence'; -import { ImmutableStore } from 'teleterm/ui/services/immutableStore'; -import { NotificationsService } from 'teleterm/ui/services/notifications'; import { ClusterOrResourceUri, ClusterUri, @@ -49,15 +49,14 @@ import { getEmptyPendingAccessRequest, PendingAccessRequest, } from './accessRequestsService'; - import { Document, - DocumentsService, - getDefaultDocumentClusterQueryParams, DocumentCluster, DocumentGateway, + DocumentsService, DocumentTshKube, DocumentTshNode, + getDefaultDocumentClusterQueryParams, } from './documentsService'; export interface WorkspacesState { diff --git a/web/packages/teleterm/src/ui/tshdEvents.ts b/web/packages/teleterm/src/ui/tshdEvents.ts index b06aa73196b9e..298e0cd2763e1 100644 --- a/web/packages/teleterm/src/ui/tshdEvents.ts +++ b/web/packages/teleterm/src/ui/tshdEvents.ts @@ -18,9 +18,9 @@ import { PromptHardwareKeyPINChangeResponse } from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; +import Logger from 'teleterm/logger'; import { TshdEventContextBridgeService } from 'teleterm/types'; import { IAppContext } from 'teleterm/ui/types'; -import Logger from 'teleterm/logger'; export function createTshdEventsContextBridgeService( ctx: IAppContext diff --git a/web/packages/teleterm/src/ui/types.ts b/web/packages/teleterm/src/ui/types.ts index bef3fdaa6d216..ed00bfb246c14 100644 --- a/web/packages/teleterm/src/ui/types.ts +++ b/web/packages/teleterm/src/ui/types.ts @@ -17,28 +17,28 @@ */ import * as tshdEventsApi from 'gen-proto-ts/teleport/lib/teleterm/v1/tshd_events_service_pb'; +import { ConfigService } from 'teleterm/services/config'; +import { TshdClient, VnetClient } from 'teleterm/services/tshd'; import { MainProcessClient, TshdEventContextBridgeService, } from 'teleterm/types'; -import { ClustersService } from 'teleterm/ui/services/clusters'; -import { ModalsService } from 'teleterm/ui/services/modals'; -import { TerminalsService } from 'teleterm/ui/services/terminals'; -import { StatePersistenceService } from 'teleterm/ui/services/statePersistence'; import { CommandLauncher } from 'teleterm/ui/commandLauncher'; -import { KeyboardShortcutsService } from 'teleterm/ui/services/keyboardShortcuts'; -import { WorkspacesService } from 'teleterm/ui/services/workspacesService'; -import { NotificationsService } from 'teleterm/ui/services/notifications'; +import { ClustersService } from 'teleterm/ui/services/clusters'; import { ConnectionTrackerService } from 'teleterm/ui/services/connectionTracker'; +import { ConnectMyComputerService } from 'teleterm/ui/services/connectMyComputer'; import { FileTransferService } from 'teleterm/ui/services/fileTransferClient'; -import { ResourcesService } from 'teleterm/ui/services/resources'; +import { HeadlessAuthenticationService } from 'teleterm/ui/services/headlessAuthn/headlessAuthnService'; +import { KeyboardShortcutsService } from 'teleterm/ui/services/keyboardShortcuts'; +import { ModalsService } from 'teleterm/ui/services/modals'; +import { NotificationsService } from 'teleterm/ui/services/notifications'; import { ReloginService } from 'teleterm/ui/services/relogin/reloginService'; +import { ResourcesService } from 'teleterm/ui/services/resources'; +import { StatePersistenceService } from 'teleterm/ui/services/statePersistence'; +import { TerminalsService } from 'teleterm/ui/services/terminals'; import { TshdNotificationsService } from 'teleterm/ui/services/tshdNotifications/tshdNotificationService'; import { UsageService } from 'teleterm/ui/services/usage'; -import { ConfigService } from 'teleterm/services/config'; -import { ConnectMyComputerService } from 'teleterm/ui/services/connectMyComputer'; -import { HeadlessAuthenticationService } from 'teleterm/ui/services/headlessAuthn/headlessAuthnService'; -import { TshdClient, VnetClient } from 'teleterm/services/tshd'; +import { WorkspacesService } from 'teleterm/ui/services/workspacesService'; export interface IAppContext { clustersService: ClustersService; diff --git a/web/packages/teleterm/src/ui/uri.ts b/web/packages/teleterm/src/ui/uri.ts index 7ee57263b8761..683d37c8d9fd6 100644 --- a/web/packages/teleterm/src/ui/uri.ts +++ b/web/packages/teleterm/src/ui/uri.ts @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -import { matchPath, generatePath } from 'react-router'; - -import type { RouteProps } from 'react-router'; +import { generatePath, matchPath, type RouteProps } from 'react-router'; /* * Resource URIs diff --git a/web/packages/teleterm/src/ui/utils/retryWithRelogin.test.ts b/web/packages/teleterm/src/ui/utils/retryWithRelogin.test.ts index 90d3df8a6d1f9..2f38e03b63e20 100644 --- a/web/packages/teleterm/src/ui/utils/retryWithRelogin.test.ts +++ b/web/packages/teleterm/src/ui/utils/retryWithRelogin.test.ts @@ -18,9 +18,9 @@ import { waitFor } from '@testing-library/react'; -import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; -import { makeRetryableError } from 'teleterm/services/tshd/testHelpers'; import Logger, { NullService } from 'teleterm/logger'; +import { makeRetryableError } from 'teleterm/services/tshd/testHelpers'; +import { MockAppContext } from 'teleterm/ui/fixtures/mocks'; import { retryWithRelogin } from './retryWithRelogin'; diff --git a/web/packages/teleterm/src/ui/utils/retryWithRelogin.ts b/web/packages/teleterm/src/ui/utils/retryWithRelogin.ts index a3224e87e0a6a..cee18ad793870 100644 --- a/web/packages/teleterm/src/ui/utils/retryWithRelogin.ts +++ b/web/packages/teleterm/src/ui/utils/retryWithRelogin.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { ClusterOrResourceUri, RootClusterUri, routing } from 'teleterm/ui/uri'; -import { IAppContext } from 'teleterm/ui/types'; import Logger from 'teleterm/logger'; import { isTshdRpcError } from 'teleterm/services/tshd/cloneableClient'; +import { IAppContext } from 'teleterm/ui/types'; +import { ClusterOrResourceUri, RootClusterUri, routing } from 'teleterm/ui/uri'; const logger = new Logger('retryWithRelogin');