From 6f17541395dcedb52fe54e7755be95f2e5941086 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Thu, 19 Aug 2021 12:49:11 +0200 Subject: SONAR-15297 Move all code from sonar-ui-common back to respective sonar-web folders --- .../sonar-web/src/main/js/api/alm-integrations.ts | 2 +- server/sonar-web/src/main/js/api/alm-settings.ts | 9 +- server/sonar-web/src/main/js/api/application.ts | 2 +- server/sonar-web/src/main/js/api/auth.ts | 2 +- server/sonar-web/src/main/js/api/branches.ts | 2 +- server/sonar-web/src/main/js/api/ce.ts | 2 +- .../sonar-web/src/main/js/api/component-report.ts | 2 +- server/sonar-web/src/main/js/api/components.ts | 2 +- server/sonar-web/src/main/js/api/favorites.ts | 2 +- server/sonar-web/src/main/js/api/issue-filters.ts | 2 +- server/sonar-web/src/main/js/api/issues.ts | 2 +- server/sonar-web/src/main/js/api/l10n.ts | 2 +- server/sonar-web/src/main/js/api/languages.ts | 2 +- server/sonar-web/src/main/js/api/marketplace.ts | 2 +- server/sonar-web/src/main/js/api/measures.ts | 2 +- server/sonar-web/src/main/js/api/metrics.ts | 2 +- server/sonar-web/src/main/js/api/nav.ts | 2 +- server/sonar-web/src/main/js/api/newCodePeriod.ts | 2 +- server/sonar-web/src/main/js/api/notifications.ts | 2 +- server/sonar-web/src/main/js/api/permissions.ts | 2 +- server/sonar-web/src/main/js/api/plugins.ts | 4 +- .../sonar-web/src/main/js/api/projectActivity.ts | 2 +- server/sonar-web/src/main/js/api/projectLinks.ts | 2 +- server/sonar-web/src/main/js/api/quality-gates.ts | 2 +- .../sonar-web/src/main/js/api/quality-profiles.ts | 4 +- server/sonar-web/src/main/js/api/rules.ts | 2 +- .../sonar-web/src/main/js/api/security-hotspots.ts | 2 +- server/sonar-web/src/main/js/api/settings.ts | 2 +- server/sonar-web/src/main/js/api/static.ts | 2 +- server/sonar-web/src/main/js/api/system.ts | 7 +- server/sonar-web/src/main/js/api/time-machine.ts | 2 +- server/sonar-web/src/main/js/api/user-tokens.ts | 2 +- server/sonar-web/src/main/js/api/user_groups.ts | 2 +- server/sonar-web/src/main/js/api/users.ts | 2 +- server/sonar-web/src/main/js/api/web-api.ts | 2 +- server/sonar-web/src/main/js/api/webhooks.ts | 2 +- .../src/main/js/app/components/AdminContainer.tsx | 2 +- .../sonar-web/src/main/js/app/components/App.tsx | 2 +- .../main/js/app/components/ComponentContainer.tsx | 2 +- .../app/components/ComponentContainerNotFound.tsx | 2 +- .../src/main/js/app/components/GlobalFooter.tsx | 4 +- .../js/app/components/GlobalMessagesContainer.tsx | 2 +- .../js/app/components/KeyboardShortcutsModal.tsx | 6 +- .../src/main/js/app/components/NotFound.tsx | 2 +- .../main/js/app/components/PluginRiskConsent.tsx | 4 +- .../src/main/js/app/components/RecentHistory.ts | 2 +- .../src/main/js/app/components/ResetPassword.tsx | 2 +- .../src/main/js/app/components/SimpleContainer.tsx | 2 +- .../js/app/components/SimpleSessionsContainer.tsx | 2 +- .../src/main/js/app/components/StartupModal.tsx | 8 +- .../__tests__/ComponentContainer-test.tsx | 2 +- .../__tests__/KeyboardShortcutsModal-test.tsx | 2 +- .../__tests__/PluginRiskConsent-test.tsx | 2 +- .../components/__tests__/RecentHistory-test.tsx | 4 +- .../app/components/__tests__/StartupModal-test.tsx | 14 +- .../main/js/app/components/a11y/A11ySkipTarget.tsx | 2 +- .../a11y/__tests__/A11yProvider-test.tsx | 2 +- .../components/embed-docs-modal/EmbedDocsPopup.tsx | 6 +- .../embed-docs-modal/EmbedDocsPopupHelper.tsx | 10 +- .../extensions/CreateApplicationForm.tsx | 17 +- .../js/app/components/extensions/Extension.tsx | 3 +- .../__tests__/CreateApplicationForm-test.tsx | 4 +- .../extensions/__tests__/Extension-test.tsx | 2 +- .../app/components/extensions/exposeLibraries.ts | 127 +- .../indexation/IndexationNotificationHelper.ts | 2 +- .../indexation/IndexationNotificationRenderer.tsx | 4 +- .../indexation/PageUnavailableDueToIndexation.tsx | 4 +- .../IndexationNotificationHelper-test.tsx | 4 +- .../js/app/components/nav/component/Breadcrumb.tsx | 2 +- .../app/components/nav/component/ComponentNav.tsx | 2 +- .../nav/component/ComponentNavBgTaskNotif.tsx | 4 +- .../nav/component/ComponentNavLicenseNotif.tsx | 4 +- .../ComponentNavProjectBindingErrorNotif.tsx | 4 +- .../nav/component/ComponentNavWarnings.tsx | 6 +- .../js/app/components/nav/component/HeaderMeta.tsx | 6 +- .../main/js/app/components/nav/component/Menu.tsx | 12 +- .../__tests__/ComponentNavBgTaskNotif-test.tsx | 8 +- .../__tests__/ComponentNavLicenseNotif-test.tsx | 6 +- .../component/branch-like/BranchLikeNavigation.tsx | 2 +- .../component/branch-like/CurrentBranchLike.tsx | 8 +- .../CurrentBranchLikeMergeInformation.tsx | 2 +- .../components/nav/component/branch-like/Menu.tsx | 8 +- .../nav/component/branch-like/MenuItem.tsx | 2 +- .../nav/component/branch-like/MenuItemList.tsx | 8 +- .../__tests__/BranchLikeNavigation-test.tsx | 4 +- .../component/branch-like/__tests__/Menu-test.tsx | 6 +- .../branch-like/__tests__/MenuItem-test.tsx | 2 +- .../component/projectInformation/DrawerLink.tsx | 2 +- .../component/projectInformation/InfoDrawer.tsx | 6 +- .../projectInformation/InfoDrawerPage.tsx | 4 +- .../ProjectInformationRenderer.tsx | 2 +- .../__tests__/ProjectInformation-test.tsx | 2 +- .../projectInformation/badges/BadgeButton.tsx | 4 +- .../projectInformation/badges/BadgeParams.tsx | 4 +- .../projectInformation/badges/ProjectBadges.tsx | 2 +- .../badges/__tests__/BadgeButton-test.tsx | 2 +- .../badges/__tests__/ProjectBadges-test.tsx | 9 +- .../badges/__tests__/utils-test.ts | 6 +- .../component/projectInformation/badges/utils.ts | 7 +- .../component/projectInformation/meta/MetaKey.tsx | 4 +- .../component/projectInformation/meta/MetaLink.tsx | 4 +- .../projectInformation/meta/MetaLinks.tsx | 2 +- .../projectInformation/meta/MetaQualityGate.tsx | 2 +- .../meta/MetaQualityProfiles.tsx | 4 +- .../component/projectInformation/meta/MetaSize.tsx | 6 +- .../component/projectInformation/meta/MetaTags.tsx | 8 +- .../meta/__tests__/MetaLink-test.tsx | 4 +- .../meta/__tests__/MetaQualityProfiles-test.tsx | 2 +- .../notifications/ProjectNotifications.tsx | 6 +- .../js/app/components/nav/global/GlobalNav.tsx | 2 +- .../components/nav/global/GlobalNavBranding.tsx | 4 +- .../js/app/components/nav/global/GlobalNavMenu.tsx | 6 +- .../js/app/components/nav/global/GlobalNavUser.tsx | 6 +- .../nav/global/__tests__/GlobalNav-test.tsx | 2 +- .../nav/settings/PendingPluginsActionNotif.tsx | 6 +- .../js/app/components/nav/settings/SettingsNav.tsx | 12 +- .../components/nav/settings/SystemRestartNotif.tsx | 4 +- .../__tests__/PendingPluginsActionNotif-test.tsx | 2 +- .../src/main/js/app/components/search/Search.tsx | 16 +- .../main/js/app/components/search/SearchResult.tsx | 8 +- .../js/app/components/search/SearchResults.tsx | 2 +- .../js/app/components/search/SearchShowMore.tsx | 4 +- .../components/search/__tests__/Search-test.tsx | 2 +- .../search/__tests__/SearchShowMore-test.tsx | 2 +- server/sonar-web/src/main/js/app/index.ts | 4 +- .../js/app/utils/handleRequiredAuthorization.ts | 2 +- .../src/main/js/app/utils/startReactApp.tsx | 6 +- .../src/main/js/app/utils/throwGlobalError.ts | 2 +- .../src/main/js/apps/about/components/AboutApp.tsx | 4 +- .../js/apps/about/components/AboutCleanCode.tsx | 2 +- .../js/apps/about/components/AboutLanguages.tsx | 2 +- .../js/apps/about/components/AboutLeakPeriod.tsx | 2 +- .../js/apps/about/components/AboutProjects.tsx | 4 +- .../js/apps/about/components/AboutQualityGates.tsx | 2 +- .../js/apps/about/components/AboutQualityModel.tsx | 10 +- .../js/apps/about/components/AboutScanners.tsx | 4 +- .../js/apps/about/components/AboutStandards.tsx | 4 +- .../js/apps/about/components/EntryIssueTypes.tsx | 10 +- .../src/main/js/apps/about/components/ReadMore.tsx | 2 +- .../about/components/__tests__/AboutApp-test.tsx | 6 +- server/sonar-web/src/main/js/apps/about/routes.ts | 2 +- .../main/js/apps/account/components/Account.tsx | 4 +- .../src/main/js/apps/account/components/Nav.tsx | 4 +- .../main/js/apps/account/components/Security.tsx | 2 +- .../src/main/js/apps/account/components/Tokens.tsx | 2 +- .../account/components/__tests__/Account-test.tsx | 4 +- .../account/notifications/GlobalNotifications.tsx | 2 +- .../apps/account/notifications/Notifications.tsx | 6 +- .../account/notifications/NotificationsList.tsx | 4 +- .../js/apps/account/notifications/ProjectModal.tsx | 13 +- .../account/notifications/ProjectNotifications.tsx | 4 +- .../js/apps/account/notifications/Projects.tsx | 6 +- .../notifications/SonarCloudNotifications.tsx | 4 +- .../__tests__/NotificationsList-test.tsx | 8 +- .../notifications/__tests__/ProjectModal-test.tsx | 7 +- .../notifications/__tests__/Projects-test.tsx | 2 +- .../src/main/js/apps/account/profile/Profile.tsx | 4 +- .../apps/account/profile/UserExternalIdentity.tsx | 4 +- .../__tests__/UserExternalIdentity-test.tsx | 2 +- .../main/js/apps/account/projects/ProjectCard.tsx | 8 +- .../src/main/js/apps/account/projects/Projects.tsx | 4 +- .../js/apps/account/projects/ProjectsContainer.tsx | 2 +- .../account/projects/__tests__/Projects-test.tsx | 2 +- .../sonar-web/src/main/js/apps/account/routes.ts | 2 +- .../application-console/ApplicationBranches.tsx | 4 +- .../application-console/ApplicationConsoleApp.tsx | 2 +- .../ApplicationConsoleAppRenderer.tsx | 4 +- .../ApplicationProjectBranch.tsx | 4 +- .../application-console/ApplicationProjects.tsx | 4 +- .../apps/application-console/BranchRowActions.tsx | 8 +- .../apps/application-console/BranchSelectItem.tsx | 4 +- .../apps/application-console/CreateBranchForm.tsx | 12 +- .../main/js/apps/application-console/EditForm.tsx | 8 +- .../apps/application-console/ProjectBranchRow.tsx | 10 +- .../__tests__/ApplicationConsoleApp-test.tsx | 2 +- .../__tests__/ApplicationConsoleRender-test.tsx | 2 +- .../__tests__/ApplicationProjects-test.tsx | 6 +- .../__tests__/CreateBranchForm-test.tsx | 2 +- .../__tests__/EditForm-test.tsx | 4 +- .../src/main/js/apps/application-console/routes.ts | 2 +- .../ApplicationSettingsApp.tsx | 4 +- .../application-settings/ReportFrequencyForm.tsx | 6 +- .../__tests__/ApplicationSettingsApp-test.tsx | 2 +- .../__tests__/ReportFrequencyForm-test.tsx | 4 +- .../main/js/apps/application-settings/routes.ts | 2 +- .../audit-logs/components/AuditAppRenderer.tsx | 4 +- .../apps/audit-logs/components/DownloadButton.tsx | 2 +- .../components/__tests__/AuditApp-test.tsx | 2 +- .../src/main/js/apps/audit-logs/routes.ts | 2 +- .../__tests__/BackgroundTasks-test.tsx | 2 +- .../components/BackgroundTasksApp.tsx | 6 +- .../background-tasks/components/CurrentsFilter.tsx | 4 +- .../js/apps/background-tasks/components/Footer.tsx | 2 +- .../js/apps/background-tasks/components/Header.tsx | 2 +- .../components/NoWorkersSupportPopup.tsx | 2 +- .../background-tasks/components/ScannerContext.tsx | 4 +- .../js/apps/background-tasks/components/Search.tsx | 6 +- .../background-tasks/components/Stacktrace.tsx | 4 +- .../components/StatPendingCount.tsx | 8 +- .../components/StatPendingTime.tsx | 6 +- .../components/StatStillFailing.tsx | 6 +- .../background-tasks/components/StatusFilter.tsx | 4 +- .../background-tasks/components/TaskActions.tsx | 10 +- .../background-tasks/components/TaskComponent.tsx | 6 +- .../apps/background-tasks/components/TaskDate.tsx | 4 +- .../apps/background-tasks/components/TaskDay.tsx | 4 +- .../background-tasks/components/TaskStatus.tsx | 4 +- .../background-tasks/components/TaskSubmitter.tsx | 2 +- .../apps/background-tasks/components/TaskType.tsx | 2 +- .../js/apps/background-tasks/components/Tasks.tsx | 2 +- .../background-tasks/components/TypesFilter.tsx | 4 +- .../apps/background-tasks/components/Workers.tsx | 12 +- .../background-tasks/components/WorkersForm.tsx | 13 +- .../__tests__/BackgroundTasksApp-test.tsx | 2 +- .../components/__tests__/ScannerContext-test.tsx | 2 +- .../components/__tests__/Stacktrace-test.tsx | 2 +- .../components/__tests__/StatStillFailing-test.tsx | 2 +- .../components/__tests__/TaskActions-test.tsx | 2 +- .../components/__tests__/Workers-test.tsx | 2 +- .../components/__tests__/WorkersForm-test.tsx | 2 +- .../src/main/js/apps/background-tasks/routes.ts | 2 +- .../src/main/js/apps/background-tasks/utils.ts | 2 +- .../ChangeAdminPasswordAppRenderer.tsx | 12 +- .../__tests__/ChangeAdminPasswordApp-test.tsx | 2 +- .../ChangeAdminPasswordAppRenderer-test.tsx | 2 +- .../src/main/js/apps/code/components/AppCode.tsx | 4 +- .../main/js/apps/code/components/ComponentName.tsx | 6 +- .../main/js/apps/code/components/ComponentPin.tsx | 4 +- .../js/apps/code/components/ComponentsEmpty.tsx | 2 +- .../js/apps/code/components/ComponentsHeader.tsx | 2 +- .../src/main/js/apps/code/components/Search.tsx | 6 +- .../apps/code/components/SourceViewerWrapper.tsx | 2 +- .../code/components/__tests__/AppCode-test.tsx | 2 +- server/sonar-web/src/main/js/apps/code/routes.ts | 2 +- .../coding-rules/components/ActivationButton.tsx | 2 +- .../components/ActivationFormModal.tsx | 13 +- .../components/ActivationSeverityFacet.tsx | 2 +- .../main/js/apps/coding-rules/components/App.tsx | 14 +- .../components/AvailableSinceFacet.tsx | 4 +- .../js/apps/coding-rules/components/BulkChange.tsx | 10 +- .../coding-rules/components/BulkChangeModal.tsx | 15 +- .../components/CustomRuleFormModal.tsx | 21 +- .../components/DefaultSeverityFacet.tsx | 2 +- .../main/js/apps/coding-rules/components/Facet.tsx | 6 +- .../coding-rules/components/InheritanceFacet.tsx | 2 +- .../apps/coding-rules/components/LanguageFacet.tsx | 4 +- .../apps/coding-rules/components/PageActions.tsx | 6 +- .../apps/coding-rules/components/ProfileFacet.tsx | 2 +- .../components/RemoveExtendedDescriptionModal.tsx | 9 +- .../apps/coding-rules/components/RuleDetails.tsx | 10 +- .../components/RuleDetailsCustomRules.tsx | 8 +- .../components/RuleDetailsDescription.tsx | 4 +- .../coding-rules/components/RuleDetailsIssues.tsx | 8 +- .../coding-rules/components/RuleDetailsMeta.tsx | 18 +- .../components/RuleDetailsParameters.tsx | 2 +- .../components/RuleDetailsProfiles.tsx | 8 +- .../apps/coding-rules/components/RuleListItem.tsx | 12 +- .../coding-rules/components/SimilarRulesFilter.tsx | 12 +- .../apps/coding-rules/components/StatusFacet.tsx | 2 +- .../js/apps/coding-rules/components/TagFacet.tsx | 6 +- .../apps/coding-rules/components/TemplateFacet.tsx | 4 +- .../js/apps/coding-rules/components/TypeFacet.tsx | 4 +- .../coding-rules/components/__tests__/App-test.tsx | 2 +- .../components/__tests__/BulkChangeModal-test.tsx | 2 +- .../__tests__/CustomRuleFormModal-test.tsx | 2 +- .../components/__tests__/RuleDetails-test.tsx | 2 +- .../__tests__/RuleDetailsDescription-test.tsx | 2 +- .../__tests__/RuleDetailsIssues-test.tsx | 2 +- .../components/__tests__/RuleListItem-test.tsx | 2 +- .../__tests__/SimilarRulesFilter-test.tsx | 2 +- .../src/main/js/apps/coding-rules/query.ts | 2 +- .../src/main/js/apps/coding-rules/routes.ts | 2 +- .../js/apps/component-measures/components/App.tsx | 4 +- .../component-measures/components/Breadcrumb.tsx | 4 +- .../components/LeakPeriodLegend.tsx | 14 +- .../components/MeasureContent.tsx | 8 +- .../components/MeasureHeader.tsx | 8 +- .../components/MeasureOverview.tsx | 4 +- .../components/MeasureViewSelect.tsx | 10 +- .../components/MeasuresEmpty.tsx | 2 +- .../components/__tests__/App-test.tsx | 2 +- .../components/__tests__/Breadcrumbs-test.tsx | 2 +- .../components/__tests__/MeasureContent-test.tsx | 6 +- .../component-measures/drilldown/BubbleChart.tsx | 11 +- .../component-measures/drilldown/ComponentCell.tsx | 12 +- .../drilldown/ComponentsList.tsx | 2 +- .../component-measures/drilldown/EmptyResult.tsx | 2 +- .../component-measures/drilldown/FilesView.tsx | 13 +- .../component-measures/drilldown/TreeMapView.tsx | 17 +- .../drilldown/__tests__/BubbleChart-test.tsx | 2 +- .../src/main/js/apps/component-measures/routes.ts | 2 +- .../component-measures/sidebar/DomainFacet.tsx | 4 +- .../sidebar/ProjectOverviewFacet.tsx | 2 +- .../js/apps/component-measures/sidebar/Sidebar.tsx | 2 +- .../src/main/js/apps/component-measures/utils.ts | 4 +- .../project/AzurePersonalAccessTokenForm.tsx | 10 +- .../apps/create/project/AzureProjectAccordion.tsx | 14 +- .../create/project/AzureProjectCreateRenderer.tsx | 10 +- .../js/apps/create/project/AzureProjectsList.tsx | 6 +- .../project/BitbucketCloudProjectCreateRender.tsx | 4 +- .../create/project/BitbucketCloudSearchForm.tsx | 20 +- .../project/BitbucketImportRepositoryForm.tsx | 6 +- .../create/project/BitbucketProjectAccordion.tsx | 10 +- .../project/BitbucketProjectCreateRenderer.tsx | 8 +- .../apps/create/project/BitbucketRepositories.tsx | 4 +- .../apps/create/project/BitbucketSearchResults.tsx | 6 +- .../create/project/CreateProjectModeSelection.tsx | 8 +- .../js/apps/create/project/CreateProjectPage.tsx | 2 +- .../js/apps/create/project/GitHubProjectCreate.tsx | 2 +- .../create/project/GitHubProjectCreateRenderer.tsx | 20 +- .../create/project/GitlabProjectCreateRenderer.tsx | 4 +- .../create/project/GitlabProjectSelectionForm.tsx | 20 +- .../js/apps/create/project/ManualProjectCreate.tsx | 12 +- .../create/project/PersonalAccessTokenForm.tsx | 12 +- .../apps/create/project/WrongBindingCountAlert.tsx | 4 +- .../AzurePersonalAccessTokenForm-test.tsx | 4 +- .../__tests__/AzureProjectAccordion-test.tsx | 4 +- .../project/__tests__/AzureProjectCreate-test.tsx | 2 +- .../project/__tests__/AzureProjectsList-test.tsx | 2 +- .../__tests__/BitbucketCloudProjectCreate-test.tsx | 2 +- .../BitbucketImportRepositoryForm-test.tsx | 4 +- .../__tests__/BitbucketProjectAccordion-test.tsx | 2 +- .../__tests__/BitbucketProjectCreate-test.tsx | 2 +- .../__tests__/BitbucketRepositories-test.tsx | 2 +- .../__tests__/CreateProjectModeSelection-test.tsx | 2 +- .../project/__tests__/CreateProjectPage-test.tsx | 2 +- .../project/__tests__/GitHubProjectCreate-test.tsx | 2 +- .../__tests__/GitHubProjectCreateRenderer-test.tsx | 6 +- .../project/__tests__/GitlabProjectCreate-test.tsx | 2 +- .../__tests__/GitlabProjectSelectionForm-test.tsx | 6 +- .../project/__tests__/ManualProjectCreate-test.tsx | 6 +- .../__tests__/PersonalAccessTokenForm-test.tsx | 4 +- .../main/js/apps/documentation/components/App.tsx | 8 +- .../js/apps/documentation/components/MenuBlock.tsx | 4 +- .../documentation/components/MenuExternalLink.tsx | 2 +- .../documentation/components/SearchResults.tsx | 2 +- .../js/apps/documentation/components/Sidebar.tsx | 2 +- .../components/__tests__/App-test.tsx | 10 +- .../components/__tests__/MenuBlock-test.tsx | 2 +- .../src/main/js/apps/documentation/routes.ts | 2 +- .../src/main/js/apps/groups/components/App.tsx | 8 +- .../main/js/apps/groups/components/DeleteForm.tsx | 11 +- .../main/js/apps/groups/components/EditMembers.tsx | 6 +- .../js/apps/groups/components/EditMembersModal.tsx | 8 +- .../src/main/js/apps/groups/components/Form.tsx | 15 +- .../src/main/js/apps/groups/components/Header.tsx | 4 +- .../src/main/js/apps/groups/components/List.tsx | 2 +- .../main/js/apps/groups/components/ListItem.tsx | 4 +- .../apps/groups/components/__tests__/App-test.tsx | 2 +- .../components/__tests__/EditMembers-test.tsx | 2 +- .../components/__tests__/EditMembersModal-test.tsx | 6 +- .../apps/groups/components/__tests__/Form-test.tsx | 2 +- .../groups/components/__tests__/Header-test.tsx | 2 +- server/sonar-web/src/main/js/apps/groups/routes.ts | 2 +- .../main/js/apps/issues/__tests__/utils-test.ts | 4 +- .../src/main/js/apps/issues/components/App.tsx | 20 +- .../js/apps/issues/components/AppContainer.tsx | 2 +- .../js/apps/issues/components/BulkChangeModal.tsx | 25 +- .../issues/components/ComponentBreadcrumbs.tsx | 6 +- .../js/apps/issues/components/IssuesCounter.tsx | 2 +- .../apps/issues/components/IssuesSourceViewer.tsx | 2 +- .../js/apps/issues/components/MyIssuesFilter.tsx | 4 +- .../main/js/apps/issues/components/NoIssues.tsx | 2 +- .../main/js/apps/issues/components/NoMyIssues.tsx | 2 +- .../main/js/apps/issues/components/PageActions.tsx | 2 +- .../main/js/apps/issues/components/TotalEffort.tsx | 4 +- .../apps/issues/components/__tests__/App-test.tsx | 22 +- .../components/__tests__/BulkChangeModal-test.tsx | 6 +- .../components/__tests__/IssuesList-test.tsx | 2 +- .../ConciseIssueLocationBadge.tsx | 6 +- .../conciseIssuesList/ConciseIssueLocations.tsx | 2 +- .../issues/conciseIssuesList/ConciseIssuesList.tsx | 2 +- .../conciseIssuesList/ConciseIssuesListHeader.tsx | 4 +- .../CrossFileLocationsNavigator.tsx | 4 +- .../__tests__/ConciseIssueBox-test.tsx | 2 +- .../__tests__/CrossFileLocationsNavigator-test.tsx | 2 +- .../CrossComponentSourceViewer.tsx | 2 +- .../CrossComponentSourceViewerWrapper.tsx | 6 +- .../crossComponentSourceViewer/SnippetViewer.tsx | 6 +- .../ComponentSourceSnippetGroupViewer-test.tsx | 2 +- .../CrossComponentSourceViewerWrapper-test.tsx | 2 +- .../__tests__/SnippetViewer-test.tsx | 4 +- .../sonar-web/src/main/js/apps/issues/redirects.ts | 2 +- .../main/js/apps/issues/sidebar/AssigneeFacet.tsx | 4 +- .../main/js/apps/issues/sidebar/AuthorFacet.tsx | 4 +- .../js/apps/issues/sidebar/CreationDateFacet.tsx | 14 +- .../main/js/apps/issues/sidebar/DirectoryFacet.tsx | 8 +- .../src/main/js/apps/issues/sidebar/FileFacet.tsx | 10 +- .../main/js/apps/issues/sidebar/LanguageFacet.tsx | 4 +- .../main/js/apps/issues/sidebar/ProjectFacet.tsx | 6 +- .../js/apps/issues/sidebar/ResolutionFacet.tsx | 2 +- .../src/main/js/apps/issues/sidebar/RuleFacet.tsx | 2 +- .../src/main/js/apps/issues/sidebar/ScopeFacet.tsx | 4 +- .../main/js/apps/issues/sidebar/SeverityFacet.tsx | 2 +- .../main/js/apps/issues/sidebar/StandardFacet.tsx | 4 +- .../main/js/apps/issues/sidebar/StatusFacet.tsx | 2 +- .../src/main/js/apps/issues/sidebar/TagFacet.tsx | 6 +- .../src/main/js/apps/issues/sidebar/TypeFacet.tsx | 4 +- .../sidebar/__tests__/StandardFacet-test.tsx | 2 +- .../issues/sidebar/__tests__/StatusFacet-test.tsx | 2 +- .../issues/sidebar/__tests__/TypeFacet-test.tsx | 2 +- server/sonar-web/src/main/js/apps/issues/utils.ts | 8 +- .../main/js/apps/maintenance/components/App.tsx | 10 +- .../maintenance/components/__tests__/App-test.tsx | 2 +- .../src/main/js/apps/maintenance/routes.tsx | 2 +- .../sonar-web/src/main/js/apps/marketplace/App.tsx | 6 +- .../src/main/js/apps/marketplace/Footer.tsx | 2 +- .../src/main/js/apps/marketplace/Header.tsx | 2 +- .../src/main/js/apps/marketplace/Search.tsx | 6 +- .../js/apps/marketplace/__tests__/App-test.tsx | 2 +- .../js/apps/marketplace/components/EditionBox.tsx | 4 +- .../marketplace/components/LicensePromptModal.tsx | 6 +- .../apps/marketplace/components/PluginActions.tsx | 10 +- .../marketplace/components/PluginAvailable.tsx | 2 +- .../marketplace/components/PluginChangeLog.tsx | 2 +- .../components/PluginChangeLogButton.tsx | 6 +- .../marketplace/components/PluginChangeLogItem.tsx | 6 +- .../marketplace/components/PluginInstalled.tsx | 2 +- .../apps/marketplace/components/PluginLicense.tsx | 4 +- .../marketplace/components/PluginOrganization.tsx | 2 +- .../components/PluginRiskConsentBox.tsx | 4 +- .../apps/marketplace/components/PluginStatus.tsx | 2 +- .../marketplace/components/PluginUpdateButton.tsx | 6 +- .../marketplace/components/PluginUpdateItem.tsx | 4 +- .../apps/marketplace/components/PluginUpdates.tsx | 2 +- .../js/apps/marketplace/components/PluginUrls.tsx | 2 +- .../src/main/js/apps/marketplace/routes.ts | 2 +- .../src/main/js/apps/marketplace/utils.ts | 2 +- .../js/apps/overview/branches/ActivityPanel.tsx | 6 +- .../main/js/apps/overview/branches/Analysis.tsx | 4 +- .../branches/ApplicationLeakPeriodInfo.tsx | 6 +- .../js/apps/overview/branches/BranchOverview.tsx | 4 +- .../overview/branches/BranchOverviewRenderer.tsx | 2 +- .../main/js/apps/overview/branches/DebtValue.tsx | 5 +- .../overview/branches/DrilldownMeasureValue.tsx | 5 +- .../src/main/js/apps/overview/branches/Event.tsx | 4 +- .../branches/FirstAnalysisNextStepsNotif.tsx | 2 +- .../js/apps/overview/branches/MeasuresPanel.tsx | 9 +- .../branches/MeasuresPanelIssueMeasureRow.tsx | 2 +- .../overview/branches/MeasuresPanelNoNewCode.tsx | 4 +- .../js/apps/overview/branches/NoCodeWarning.tsx | 4 +- .../overview/branches/ProjectLeakPeriodInfo.tsx | 8 +- .../js/apps/overview/branches/QualityGatePanel.tsx | 8 +- .../overview/branches/QualityGatePanelSection.tsx | 2 +- .../overview/branches/SecurityHotspotsReviewed.tsx | 5 +- .../branches/__tests__/ActivityPanel-test.tsx | 2 +- .../__tests__/ApplicationLeakPeriodInfo-test.tsx | 2 +- .../branches/__tests__/BranchOverview-test.tsx | 6 +- .../branches/__tests__/MeasuresPanel-test.tsx | 2 +- .../src/main/js/apps/overview/components/App.tsx | 2 +- .../js/apps/overview/components/EmptyOverview.tsx | 4 +- .../js/apps/overview/components/IssueLabel.tsx | 7 +- .../js/apps/overview/components/IssueRating.tsx | 4 +- .../apps/overview/components/LeakPeriodLegend.tsx | 14 +- .../apps/overview/components/MeasurementLabel.tsx | 5 +- .../overview/components/QualityGateCondition.tsx | 14 +- .../overview/components/QualityGateConditions.tsx | 6 +- .../__tests__/QualityGateConditions-test.tsx | 2 +- .../overview/pullRequests/AfterMergeEstimate.tsx | 5 +- .../pullRequests/LargeQualityGateBadge.tsx | 6 +- .../overview/pullRequests/PullRequestOverview.tsx | 8 +- .../__tests__/PullRequestOverview-test.tsx | 2 +- .../sonar-web/src/main/js/apps/overview/routes.ts | 2 +- .../sonar-web/src/main/js/apps/overview/utils.ts | 4 +- .../components/ActionsCell.tsx | 8 +- .../apps/permission-templates/components/App.tsx | 2 +- .../permission-templates/components/Defaults.tsx | 2 +- .../permission-templates/components/DeleteForm.tsx | 11 +- .../apps/permission-templates/components/Form.tsx | 15 +- .../permission-templates/components/Header.tsx | 4 +- .../apps/permission-templates/components/Home.tsx | 2 +- .../permission-templates/components/ListHeader.tsx | 6 +- .../components/PermissionCell.tsx | 4 +- .../permission-templates/components/Template.tsx | 2 +- .../components/TemplateHeader.tsx | 2 +- .../components/__tests__/App-test.tsx | 2 +- .../main/js/apps/permission-templates/routes.ts | 2 +- .../js/apps/permissions/__tests__/utils-test.ts | 2 +- .../global/components/AllHoldersList.tsx | 2 +- .../js/apps/permissions/global/components/App.tsx | 2 +- .../permissions/global/components/PageHeader.tsx | 2 +- .../global/components/__tests__/App-test.tsx | 2 +- .../project/components/AllHoldersList.tsx | 2 +- .../js/apps/permissions/project/components/App.tsx | 2 +- .../project/components/ApplyTemplate.tsx | 19 +- .../permissions/project/components/PageHeader.tsx | 4 +- .../project/components/PublicProjectDisclaimer.tsx | 6 +- .../project/components/__tests__/App-test.tsx | 2 +- .../components/__tests__/ApplyTemplate-test.tsx | 2 +- .../src/main/js/apps/permissions/routes.ts | 2 +- .../permissions/shared/components/GroupHolder.tsx | 2 +- .../permissions/shared/components/HoldersList.tsx | 2 +- .../shared/components/PermissionCell.tsx | 2 +- .../shared/components/PermissionHeader.tsx | 8 +- .../permissions/shared/components/SearchForm.tsx | 6 +- .../permissions/shared/components/UserHolder.tsx | 2 +- .../components/__tests__/GroupHolder-test.tsx | 2 +- .../components/__tests__/UserHolder-test.tsx | 2 +- .../src/main/js/apps/permissions/utils.ts | 2 +- .../src/main/js/apps/portfolio/components/App.tsx | 4 +- .../main/js/apps/portfolio/components/Effort.tsx | 4 +- .../js/apps/portfolio/components/MainRating.tsx | 2 +- .../js/apps/portfolio/components/MetricBox.tsx | 6 +- .../apps/portfolio/components/RatingFreshness.tsx | 6 +- .../portfolio/components/UnsubscribeEmailModal.tsx | 14 +- .../js/apps/portfolio/components/WorstProjects.tsx | 6 +- .../portfolio/components/__tests__/App-test.tsx | 6 +- .../__tests__/UnsubscribeEmailModal-test.tsx | 4 +- .../sonar-web/src/main/js/apps/portfolio/routes.ts | 2 +- .../apps/projectActivity/__tests__/actions-test.ts | 2 +- .../apps/projectActivity/__tests__/utils-test.ts | 2 +- .../components/DefinitionChangeEventInner.tsx | 10 +- .../js/apps/projectActivity/components/Event.tsx | 4 +- .../apps/projectActivity/components/EventInner.tsx | 4 +- .../components/ProjectActivityAnalysesList.tsx | 8 +- .../components/ProjectActivityAnalysis.tsx | 16 +- .../components/ProjectActivityApp.tsx | 4 +- .../components/ProjectActivityAppContainer.tsx | 2 +- .../components/ProjectActivityDateInput.tsx | 4 +- .../components/ProjectActivityPageFooter.tsx | 2 +- .../components/ProjectActivityPageHeader.tsx | 4 +- .../components/RichQualityGateEventInner.tsx | 8 +- .../__tests__/DefinitionChangeEventInner-test.tsx | 2 +- .../components/__tests__/Event-test.tsx | 4 +- .../__tests__/ProjectActivityAnalysesList-test.tsx | 6 +- .../__tests__/ProjectActivityAnalysis-test.tsx | 10 +- .../__tests__/ProjectActivityApp-test.tsx | 2 +- .../__tests__/ProjectActivityDateInput-test.tsx | 2 +- .../__tests__/ProjectActivityGraphs-test.tsx | 2 +- .../__tests__/ProjectActivityPageHeader-test.tsx | 2 +- .../__tests__/RichQualityGateEventInner-test.tsx | 2 +- .../components/forms/AddEventForm.tsx | 4 +- .../components/forms/ChangeEventForm.tsx | 4 +- .../components/forms/RemoveAnalysisForm.tsx | 4 +- .../components/forms/RemoveEventForm.tsx | 4 +- .../forms/__tests__/RemoveEventForm-test.tsx | 2 +- .../src/main/js/apps/projectActivity/routes.ts | 2 +- .../src/main/js/apps/projectActivity/utils.ts | 4 +- .../js/apps/projectBaseline/components/App.tsx | 6 +- .../apps/projectBaseline/components/AppHeader.tsx | 2 +- .../components/BaselineSettingAnalysis.tsx | 4 +- .../components/BaselineSettingDays.tsx | 8 +- .../components/BaselineSettingPreviousVersion.tsx | 4 +- .../components/BaselineSettingReferenceBranch.tsx | 14 +- .../components/BranchAnalysisList.tsx | 4 +- .../components/BranchAnalysisListRenderer.tsx | 16 +- .../components/BranchBaselineSettingModal.tsx | 13 +- .../apps/projectBaseline/components/BranchList.tsx | 4 +- .../projectBaseline/components/BranchListRow.tsx | 12 +- .../components/ProjectBaselineSelector.tsx | 13 +- .../components/__tests__/App-test.tsx | 2 +- .../BaselineSettingReferenceBranch-test.tsx | 4 +- .../__tests__/BranchAnalysisList-test.tsx | 6 +- .../__tests__/BranchAnalysisListRenderer-test.tsx | 4 +- .../__tests__/BranchBaselineSettingModal-test.tsx | 2 +- .../components/__tests__/BranchList-test.tsx | 2 +- .../components/__tests__/BranchListRow-test.tsx | 2 +- .../src/main/js/apps/projectBaseline/routes.ts | 2 +- .../js/apps/projectBranches/components/App.tsx | 2 +- .../projectBranches/components/BranchLikeRow.tsx | 8 +- .../projectBranches/components/BranchLikeTable.tsx | 4 +- .../projectBranches/components/BranchLikeTabs.tsx | 8 +- .../components/BranchPurgeSetting.tsx | 8 +- .../components/DeleteBranchModal.tsx | 9 +- .../components/LifetimeInformationRenderer.tsx | 6 +- .../components/RenameBranchModal.tsx | 13 +- .../components/__tests__/BranchLikeTabs-test.tsx | 2 +- .../__tests__/BranchPurgeSetting-test.tsx | 2 +- .../__tests__/DeleteBranchModal-test.tsx | 7 +- .../__tests__/LifetimeInformation-test.tsx | 2 +- .../__tests__/RenameBranchModal-test.tsx | 8 +- .../src/main/js/apps/projectBranches/routes.ts | 2 +- .../src/main/js/apps/projectDeletion/App.tsx | 2 +- .../src/main/js/apps/projectDeletion/Form.tsx | 6 +- .../src/main/js/apps/projectDeletion/Header.tsx | 2 +- .../sonar-web/src/main/js/apps/projectKey/Key.tsx | 2 +- .../src/main/js/apps/projectKey/UpdateForm.tsx | 8 +- .../apps/projectKey/__tests__/UpdateForm-test.tsx | 4 +- .../src/main/js/apps/projectLinks/App.tsx | 4 +- .../main/js/apps/projectLinks/CreationModal.tsx | 12 +- .../src/main/js/apps/projectLinks/Header.tsx | 4 +- .../src/main/js/apps/projectLinks/LinkRow.tsx | 8 +- .../src/main/js/apps/projectLinks/Table.tsx | 2 +- .../js/apps/projectLinks/__tests__/App-test.tsx | 2 +- .../projectLinks/__tests__/CreationModal-test.tsx | 2 +- .../js/apps/projectLinks/__tests__/Header-test.tsx | 2 +- .../projectQualityGate/ProjectQualityGateApp.tsx | 2 +- .../ProjectQualityGateAppRenderer.tsx | 14 +- .../__tests__/ProjectQualityGateApp-test.tsx | 2 +- .../ProjectQualityGateAppRenderer-test.tsx | 6 +- .../src/main/js/apps/projectQualityGate/routes.ts | 2 +- .../ProjectQualityProfilesApp.tsx | 4 +- .../ProjectQualityProfilesAppRenderer.tsx | 10 +- .../__tests__/ProjectQualityProfilesApp-test.tsx | 2 +- .../components/AddLanguageModal.tsx | 8 +- .../components/SetQualityProfileModal.tsx | 12 +- .../components/__tests__/AddLanguageModal-test.tsx | 4 +- .../__tests__/SetQualityProfileModal-test.tsx | 6 +- .../main/js/apps/projectQualityProfiles/routes.ts | 2 +- .../js/apps/projects/components/AllProjects.tsx | 12 +- .../projects/components/AllProjectsContainer.tsx | 2 +- .../projects/components/ApplicationCreation.tsx | 4 +- .../main/js/apps/projects/components/ClearAll.tsx | 4 +- .../projects/components/DefaultPageSelector.tsx | 2 +- .../projects/components/EmptyFavoriteSearch.tsx | 2 +- .../js/apps/projects/components/EmptyInstance.tsx | 4 +- .../js/apps/projects/components/FavoriteFilter.tsx | 4 +- .../projects/components/NoFavoriteProjects.tsx | 2 +- .../js/apps/projects/components/PageHeader.tsx | 4 +- .../js/apps/projects/components/PageSidebar.tsx | 2 +- .../apps/projects/components/PerspectiveSelect.tsx | 4 +- .../components/PerspectiveSelectOption.tsx | 4 +- .../projects/components/ProjectCreationMenu.tsx | 10 +- .../components/ProjectCreationMenuItem.tsx | 6 +- .../js/apps/projects/components/ProjectsList.tsx | 2 +- .../projects/components/ProjectsSortingSelect.tsx | 12 +- .../components/__tests__/AllProjects-test.tsx | 4 +- .../__tests__/ApplicationCreation-test.tsx | 2 +- .../components/__tests__/ClearAll-test.tsx | 2 +- .../__tests__/DefaultPageSelector-test.tsx | 6 +- .../components/__tests__/FavoriteFilter-test.tsx | 6 +- .../__tests__/ProjectCreationMenu-test.tsx | 2 +- .../__tests__/ProjectsSortingSelect-test.tsx | 2 +- .../components/project-card/ProjectCard.tsx | 12 +- .../project-card/ProjectCardLanguages.tsx | 2 +- .../components/project-card/ProjectCardMeasure.tsx | 2 +- .../project-card/ProjectCardMeasures.tsx | 10 +- .../project-card/ProjectCardQualityGate.tsx | 8 +- .../js/apps/projects/filters/CoverageFilter.tsx | 7 +- .../apps/projects/filters/DuplicationsFilter.tsx | 6 +- .../src/main/js/apps/projects/filters/Filter.tsx | 4 +- .../main/js/apps/projects/filters/IssuesFilter.tsx | 4 +- .../js/apps/projects/filters/LanguagesFilter.tsx | 2 +- .../projects/filters/MaintainabilityFilter.tsx | 4 +- .../js/apps/projects/filters/NewLinesFilter.tsx | 4 +- .../projects/filters/NewMaintainabilityFilter.tsx | 4 +- .../apps/projects/filters/NewReliabilityFilter.tsx | 4 +- .../js/apps/projects/filters/NewSecurityFilter.tsx | 4 +- .../js/apps/projects/filters/QualifierFilter.tsx | 4 +- .../js/apps/projects/filters/QualityGateFilter.tsx | 6 +- .../js/apps/projects/filters/ReliabilityFilter.tsx | 4 +- .../projects/filters/SearchFilterContainer.tsx | 4 +- .../projects/filters/SearchableFilterFooter.tsx | 4 +- .../projects/filters/SearchableFilterOption.tsx | 2 +- .../js/apps/projects/filters/SecurityFilter.tsx | 4 +- .../apps/projects/filters/SecurityReviewFilter.tsx | 6 +- .../main/js/apps/projects/filters/SizeFilter.tsx | 9 +- .../main/js/apps/projects/filters/TagsFilter.tsx | 2 +- .../sonar-web/src/main/js/apps/projects/routes.ts | 4 +- .../sonar-web/src/main/js/apps/projects/utils.ts | 4 +- .../js/apps/projects/visualizations/Coverage.tsx | 2 +- .../apps/projects/visualizations/Duplications.tsx | 2 +- .../projects/visualizations/Maintainability.tsx | 2 +- .../apps/projects/visualizations/Reliability.tsx | 2 +- .../main/js/apps/projects/visualizations/Risk.tsx | 12 +- .../js/apps/projects/visualizations/Security.tsx | 2 +- .../projects/visualizations/SimpleBubbleChart.tsx | 12 +- .../projects/visualizations/Visualizations.tsx | 2 +- .../src/main/js/apps/projectsManagement/App.tsx | 6 +- .../projectsManagement/BulkApplyTemplateModal.tsx | 16 +- .../ChangeDefaultVisibilityForm.tsx | 10 +- .../apps/projectsManagement/CreateProjectForm.tsx | 12 +- .../js/apps/projectsManagement/DeleteModal.tsx | 10 +- .../src/main/js/apps/projectsManagement/Header.tsx | 4 +- .../main/js/apps/projectsManagement/ProjectRow.tsx | 8 +- .../apps/projectsManagement/ProjectRowActions.tsx | 8 +- .../main/js/apps/projectsManagement/Projects.tsx | 2 +- .../apps/projectsManagement/RestoreAccessModal.tsx | 6 +- .../src/main/js/apps/projectsManagement/Search.tsx | 14 +- .../apps/projectsManagement/__tests__/App-test.tsx | 2 +- .../__tests__/BulkApplyTemplateModal-test.tsx | 4 +- .../__tests__/ChangeDefaultVisibilityForm-test.tsx | 4 +- .../__tests__/CreateProjectForm-test.tsx | 2 +- .../__tests__/DeleteModal-test.tsx | 4 +- .../projectsManagement/__tests__/Header-test.tsx | 2 +- .../__tests__/ProjectRowActions-test.tsx | 2 +- .../projectsManagement/__tests__/Search-test.tsx | 2 +- .../src/main/js/apps/projectsManagement/routes.ts | 2 +- .../main/js/apps/quality-gates/components/App.tsx | 8 +- .../components/BuiltInQualityGateBadge.tsx | 4 +- .../js/apps/quality-gates/components/Condition.tsx | 12 +- .../quality-gates/components/ConditionModal.tsx | 10 +- .../quality-gates/components/ConditionOperator.tsx | 4 +- .../apps/quality-gates/components/Conditions.tsx | 10 +- .../components/CopyQualityGateForm.tsx | 8 +- .../components/CreateQualityGateForm.tsx | 8 +- .../components/DeleteQualityGateForm.tsx | 6 +- .../js/apps/quality-gates/components/Details.tsx | 4 +- .../quality-gates/components/DetailsContent.tsx | 6 +- .../quality-gates/components/DetailsHeader.tsx | 8 +- .../main/js/apps/quality-gates/components/List.tsx | 2 +- .../apps/quality-gates/components/ListHeader.tsx | 6 +- .../apps/quality-gates/components/MetricSelect.tsx | 4 +- .../js/apps/quality-gates/components/Projects.tsx | 4 +- .../components/RenameQualityGateForm.tsx | 8 +- .../quality-gates/components/ThresholdInput.tsx | 2 +- .../quality-gates/components/__tests__/App.tsx | 8 +- .../__tests__/CreateQualityGateForm-test.tsx | 4 +- .../components/__tests__/Details-test.tsx | 2 +- .../components/__tests__/DetailsHeader-test.tsx | 2 +- .../components/__tests__/Projects-test.tsx | 6 +- .../components/__tests__/ThresholdInput-test.tsx | 2 +- .../src/main/js/apps/quality-gates/routes.ts | 2 +- .../src/main/js/apps/quality-gates/utils.ts | 2 +- .../apps/quality-profiles/changelog/Changelog.tsx | 6 +- .../changelog/ChangelogContainer.tsx | 4 +- .../quality-profiles/changelog/ChangelogEmpty.tsx | 2 +- .../quality-profiles/changelog/ChangelogSearch.tsx | 4 +- .../quality-profiles/changelog/ParameterChange.tsx | 2 +- .../quality-profiles/changelog/SeverityChange.tsx | 2 +- .../__tests__/ChangelogContainer-test.tsx | 2 +- .../changelog/__tests__/ChangelogSearch-test.tsx | 4 +- .../quality-profiles/compare/ComparisonEmpty.tsx | 2 +- .../quality-profiles/compare/ComparisonForm.tsx | 4 +- .../compare/ComparisonResultActivation.tsx | 8 +- .../quality-profiles/compare/ComparisonResults.tsx | 8 +- .../__tests__/ComparisonResultActivation-test.tsx | 2 +- .../js/apps/quality-profiles/components/App.tsx | 2 +- .../components/BuiltInQualityProfileBadge.tsx | 4 +- .../components/DeleteProfileForm.tsx | 11 +- .../quality-profiles/components/ProfileActions.tsx | 12 +- .../components/ProfileModalForm.tsx | 13 +- .../components/ProfileNotFound.tsx | 2 +- .../components/__tests__/ProfileActions-test.tsx | 2 +- .../components/__tests__/ProfileModalForm-test.tsx | 2 +- .../quality-profiles/details/ChangeParentForm.tsx | 15 +- .../details/ChangeProjectsForm.tsx | 6 +- .../quality-profiles/details/ProfileDetails.tsx | 4 +- .../quality-profiles/details/ProfileExporters.tsx | 2 +- .../quality-profiles/details/ProfileHeader.tsx | 4 +- .../details/ProfileInheritance.tsx | 4 +- .../details/ProfileInheritanceBox.tsx | 4 +- .../details/ProfilePermissions.tsx | 4 +- .../details/ProfilePermissionsForm.tsx | 9 +- .../details/ProfilePermissionsFormSelect.tsx | 6 +- .../details/ProfilePermissionsGroup.tsx | 14 +- .../details/ProfilePermissionsUser.tsx | 12 +- .../quality-profiles/details/ProfileProjects.tsx | 10 +- .../apps/quality-profiles/details/ProfileRules.tsx | 6 +- .../details/ProfileRulesDeprecatedWarning.tsx | 4 +- .../details/ProfileRulesRowOfType.tsx | 6 +- .../details/ProfileRulesRowTotal.tsx | 4 +- .../details/ProfileRulesSonarWayComparison.tsx | 4 +- .../details/__tests__/ChangeParentForm-test.tsx | 2 +- .../details/__tests__/ChangeProjectsForm-test.tsx | 6 +- .../details/__tests__/ProfileInheritance-test.tsx | 2 +- .../details/__tests__/ProfilePermissions-test.tsx | 2 +- .../__tests__/ProfilePermissionsForm-test.tsx | 2 +- .../__tests__/ProfilePermissionsGroup-test.tsx | 2 +- .../__tests__/ProfilePermissionsUser-test.tsx | 2 +- .../details/__tests__/ProfileProjects-test.tsx | 2 +- .../details/__tests__/ProfileRules-test.tsx | 2 +- .../quality-profiles/home/CreateProfileForm.tsx | 17 +- .../quality-profiles/home/EvolutionDeprecated.tsx | 2 +- .../apps/quality-profiles/home/EvolutionRules.tsx | 6 +- .../quality-profiles/home/EvolutionStagnant.tsx | 4 +- .../js/apps/quality-profiles/home/PageHeader.tsx | 6 +- .../js/apps/quality-profiles/home/ProfilesList.tsx | 6 +- .../quality-profiles/home/ProfilesListHeader.tsx | 4 +- .../apps/quality-profiles/home/ProfilesListRow.tsx | 6 +- .../quality-profiles/home/RestoreProfileForm.tsx | 15 +- .../home/__tests__/CreateProfileForm-test.tsx | 2 +- .../home/__tests__/PageHeader-test.tsx | 2 +- .../src/main/js/apps/quality-profiles/routes.ts | 2 +- .../src/main/js/apps/quality-profiles/utils.ts | 2 +- .../SecurityHotspotsAppRenderer.tsx | 6 +- .../__tests__/SecurityHotspotsApp-test.tsx | 2 +- .../__tests__/SecurityHotspotsAppRenderer-test.tsx | 4 +- .../components/EmptyHotspotsPage.tsx | 4 +- .../security-hotspots/components/FilterBar.tsx | 10 +- .../components/HotspotCategory.tsx | 4 +- .../components/HotspotCommentPopup.tsx | 4 +- .../security-hotspots/components/HotspotList.tsx | 8 +- .../components/HotspotListItem.tsx | 2 +- .../components/HotspotOpenInIdeButton.tsx | 10 +- .../components/HotspotReviewHistory.tsx | 16 +- .../components/HotspotReviewHistoryAndComments.tsx | 4 +- .../components/HotspotSimpleList.tsx | 14 +- .../components/HotspotSnippetContainerRenderer.tsx | 4 +- .../security-hotspots/components/HotspotViewer.tsx | 2 +- .../components/HotspotViewerRenderer.tsx | 17 +- .../components/HotspotViewerTabs.tsx | 6 +- .../components/__tests__/FilterBar-test.tsx | 4 +- .../__tests__/HotspotCommentPopup-test.tsx | 2 +- .../components/__tests__/HotspotList-test.tsx | 6 +- .../__tests__/HotspotOpenInIdeButton-test.tsx | 2 +- .../HotspotReviewHistoryAndComments-test.tsx | 2 +- .../__tests__/HotspotSimpleList-test.tsx | 6 +- .../__tests__/HotspotSnippetContainer-test.tsx | 2 +- .../components/__tests__/HotspotViewer-test.tsx | 6 +- .../__tests__/HotspotViewerTabs-test.tsx | 2 +- .../components/assignee/Assignee.tsx | 2 +- .../components/assignee/AssigneeRenderer.tsx | 10 +- .../components/assignee/AssigneeSelection.tsx | 4 +- .../assignee/AssigneeSelectionRenderer.tsx | 10 +- .../assignee/__tests__/Assignee-test.tsx | 2 +- .../assignee/__tests__/AssigneeRenderer-test.tsx | 6 +- .../assignee/__tests__/AssigneeSelection-test.tsx | 4 +- .../security-hotspots/components/status/Status.tsx | 14 +- .../components/status/StatusDescription.tsx | 2 +- .../components/status/StatusSelection.tsx | 2 +- .../components/status/StatusSelectionRenderer.tsx | 6 +- .../components/status/__tests__/Status-test.tsx | 6 +- .../status/__tests__/StatusSelection-test.tsx | 2 +- .../__tests__/StatusSelectionRenderer-test.tsx | 6 +- .../src/main/js/apps/sessions/components/Login.tsx | 4 +- .../js/apps/sessions/components/LoginContainer.tsx | 2 +- .../main/js/apps/sessions/components/LoginForm.tsx | 8 +- .../main/js/apps/sessions/components/Logout.tsx | 4 +- .../js/apps/sessions/components/OAuthProviders.tsx | 8 +- .../js/apps/sessions/components/Unauthorized.tsx | 6 +- .../components/__tests__/LoginContainer-test.tsx | 2 +- .../components/__tests__/LoginForm-test.tsx | 7 +- .../sessions/components/__tests__/Logout-test.tsx | 2 +- .../components/__tests__/Unauthorized-test.tsx | 2 +- .../sonar-web/src/main/js/apps/sessions/routes.ts | 2 +- .../settings/components/AdditionalCategories.tsx | 2 +- .../js/apps/settings/components/AnalysisScope.tsx | 2 +- .../js/apps/settings/components/AppContainer.tsx | 4 +- .../js/apps/settings/components/Definition.tsx | 6 +- .../apps/settings/components/DefinitionActions.tsx | 10 +- .../main/js/apps/settings/components/EmailForm.tsx | 14 +- .../main/js/apps/settings/components/Languages.tsx | 4 +- .../js/apps/settings/components/NewCodePeriod.tsx | 11 +- .../js/apps/settings/components/PageHeader.tsx | 2 +- .../components/SubCategoryDefinitionsList.tsx | 2 +- .../components/__tests__/AppContainer-test.tsx | 8 +- .../components/__tests__/Definition-test.tsx | 2 +- .../components/__tests__/EmailForm-test.tsx | 4 +- .../components/__tests__/Languages-test.tsx | 2 +- .../components/__tests__/NewCodePeriod-test.tsx | 2 +- .../__tests__/SubCategoryDefinitionsList-test.tsx | 6 +- .../almIntegration/AlmBindingDefinitionBox.tsx | 18 +- .../AlmBindingDefinitionFormField.tsx | 8 +- .../AlmBindingDefinitionFormRenderer.tsx | 13 +- .../almIntegration/AlmIntegrationRenderer.tsx | 6 +- .../components/almIntegration/AlmTabRenderer.tsx | 6 +- .../components/almIntegration/AzureForm.tsx | 4 +- .../almIntegration/BitbucketCloudForm.tsx | 2 +- .../components/almIntegration/BitbucketForm.tsx | 6 +- .../almIntegration/BitbucketServerForm.tsx | 2 +- .../components/almIntegration/CreationTooltip.tsx | 4 +- .../components/almIntegration/DeleteModal.tsx | 4 +- .../components/almIntegration/GithubForm.tsx | 4 +- .../components/almIntegration/GitlabForm.tsx | 4 +- .../__tests__/AlmBindingDefinitionForm-test.tsx | 2 +- .../AlmBindingDefinitionFormField-test.tsx | 4 +- .../AlmBindingDefinitionFormRenderer-test.tsx | 4 +- .../__tests__/AlmIntegration-test.tsx | 2 +- .../almIntegration/__tests__/AlmTab-test.tsx | 2 +- .../__tests__/BitbucketForm-test.tsx | 2 +- .../settings/components/inputs/InputForBoolean.tsx | 4 +- .../settings/components/inputs/InputForJSON.tsx | 6 +- .../components/inputs/InputForPassword.tsx | 6 +- .../components/inputs/InputForSingleSelectList.tsx | 2 +- .../settings/components/inputs/MultiValueInput.tsx | 2 +- .../components/inputs/PropertySetInput.tsx | 2 +- .../inputs/__tests__/InputForJSON-test.tsx | 2 +- .../inputs/__tests__/InputForPassword-test.tsx | 2 +- .../inputs/__tests__/InputForText-test.tsx | 2 +- .../inputs/__tests__/MultiValueInput-test.tsx | 2 +- .../inputs/__tests__/SimpleInput-test.tsx | 2 +- .../AlmSpecificForm.tsx | 6 +- .../PRDecorationBinding.tsx | 2 +- .../PRDecorationBindingRenderer.tsx | 16 +- .../__tests__/PRDecorationBinding-test.tsx | 2 +- .../__tests__/PRDecorationBindingRenderer-test.tsx | 4 +- .../js/apps/settings/encryption/EncryptionApp.tsx | 4 +- .../js/apps/settings/encryption/EncryptionForm.tsx | 8 +- .../settings/encryption/GenerateSecretKeyForm.tsx | 8 +- .../encryption/__tests__/EncryptionApp-test.tsx | 2 +- .../sonar-web/src/main/js/apps/settings/routes.ts | 2 +- .../src/main/js/apps/settings/store/actions.ts | 4 +- .../sonar-web/src/main/js/apps/settings/utils.ts | 2 +- .../src/main/js/apps/system/components/App.tsx | 2 +- .../apps/system/components/ChangeLogLevelForm.tsx | 11 +- .../js/apps/system/components/ClusterSysInfos.tsx | 2 +- .../main/js/apps/system/components/PageActions.tsx | 10 +- .../main/js/apps/system/components/PageHeader.tsx | 6 +- .../apps/system/components/__tests__/App-test.tsx | 2 +- .../components/__tests__/PageActions-test.tsx | 2 +- .../components/__tests__/PageHeader-test.tsx | 2 +- .../system/components/info-items/HealthCard.tsx | 6 +- .../components/info-items/HealthCauseItem.tsx | 2 +- .../system/components/info-items/HealthItem.tsx | 4 +- .../system/components/info-items/SysInfoItem.tsx | 2 +- .../system-upgrade/SystemUpgradeForm.tsx | 6 +- .../system-upgrade/SystemUpgradeIntermediate.tsx | 8 +- .../system-upgrade/SystemUpgradeItem.tsx | 4 +- .../system-upgrade/SystemUpgradeNotif.tsx | 6 +- .../__tests__/SystemUpgradeIntermediate-test.tsx | 2 +- .../__tests__/SystemUpgradeNotif-test.tsx | 2 +- server/sonar-web/src/main/js/apps/system/routes.ts | 2 +- server/sonar-web/src/main/js/apps/system/utils.ts | 9 +- .../js/apps/tutorials/components/TutorialsApp.tsx | 2 +- .../components/__tests__/TutorialsApp-test.tsx | 4 +- .../sonar-web/src/main/js/apps/tutorials/routes.ts | 2 +- server/sonar-web/src/main/js/apps/users/Header.tsx | 6 +- server/sonar-web/src/main/js/apps/users/Search.tsx | 4 +- .../sonar-web/src/main/js/apps/users/UsersApp.tsx | 4 +- .../sonar-web/src/main/js/apps/users/UsersList.tsx | 2 +- .../main/js/apps/users/__tests__/Header-test.tsx | 2 +- .../main/js/apps/users/__tests__/UsersApp-test.tsx | 2 +- .../js/apps/users/components/DeactivateForm.tsx | 9 +- .../main/js/apps/users/components/GroupsForm.tsx | 6 +- .../main/js/apps/users/components/PasswordForm.tsx | 17 +- .../main/js/apps/users/components/TokensForm.tsx | 6 +- .../js/apps/users/components/TokensFormItem.tsx | 16 +- .../js/apps/users/components/TokensFormModal.tsx | 6 +- .../apps/users/components/TokensFormNewToken.tsx | 6 +- .../main/js/apps/users/components/UserActions.tsx | 6 +- .../src/main/js/apps/users/components/UserForm.tsx | 18 +- .../main/js/apps/users/components/UserGroups.tsx | 6 +- .../main/js/apps/users/components/UserListItem.tsx | 8 +- .../apps/users/components/UserListItemIdentity.tsx | 4 +- .../apps/users/components/UserScmAccountInput.tsx | 2 +- .../js/apps/users/components/UserScmAccounts.tsx | 2 +- .../js/apps/users/components/UsersSelectSearch.tsx | 4 +- .../users/components/__tests__/GroupsForm-test.tsx | 6 +- .../users/components/__tests__/TokensForm-test.tsx | 2 +- .../components/__tests__/TokensFormItem-test.tsx | 8 +- .../components/__tests__/UserActions-test.tsx | 2 +- .../users/components/__tests__/UserForm-test.tsx | 4 +- .../users/components/__tests__/UserGroups-test.tsx | 2 +- .../components/__tests__/UserListItem-test.tsx | 6 +- server/sonar-web/src/main/js/apps/users/routes.ts | 2 +- server/sonar-web/src/main/js/apps/users/utils.ts | 2 +- .../src/main/js/apps/web-api/components/Action.tsx | 4 +- .../js/apps/web-api/components/DeprecatedBadge.tsx | 4 +- .../js/apps/web-api/components/InternalBadge.tsx | 4 +- .../src/main/js/apps/web-api/components/Params.tsx | 2 +- .../src/main/js/apps/web-api/components/Search.tsx | 8 +- .../main/js/apps/web-api/components/WebApiApp.tsx | 6 +- .../components/__tests__/WebApiApp-test.tsx | 6 +- .../sonar-web/src/main/js/apps/web-api/routes.ts | 2 +- server/sonar-web/src/main/js/apps/web-api/utils.ts | 2 +- .../src/main/js/apps/webhooks/components/App.tsx | 2 +- .../apps/webhooks/components/CreateWebhookForm.tsx | 10 +- .../apps/webhooks/components/DeleteWebhookForm.tsx | 11 +- .../js/apps/webhooks/components/DeliveriesForm.tsx | 10 +- .../apps/webhooks/components/DeliveryAccordion.tsx | 8 +- .../js/apps/webhooks/components/DeliveryItem.tsx | 6 +- .../webhooks/components/LatestDeliveryForm.tsx | 6 +- .../js/apps/webhooks/components/PageActions.tsx | 6 +- .../js/apps/webhooks/components/PageHeader.tsx | 2 +- .../js/apps/webhooks/components/WebhookActions.tsx | 4 +- .../js/apps/webhooks/components/WebhookItem.tsx | 2 +- .../components/WebhookItemLatestDelivery.tsx | 12 +- .../js/apps/webhooks/components/WebhooksList.tsx | 2 +- .../components/__tests__/PageActions-test.tsx | 2 +- .../components/__tests__/WebhookActions-test.tsx | 2 +- .../__tests__/WebhookItemLatestDelivery-test.tsx | 2 +- .../sonar-web/src/main/js/apps/webhooks/routes.ts | 2 +- .../js/components/SourceViewer/SourceViewer.tsx | 2 +- .../components/SourceViewer/SourceViewerBase.tsx | 4 +- .../components/SourceViewer/SourceViewerCode.tsx | 4 +- .../components/SourceViewer/SourceViewerHeader.tsx | 29 +- .../SourceViewer/SourceViewerHeaderSlim.tsx | 17 +- .../__tests__/SourceViewerBase-test.tsx | 2 +- .../SourceViewer/components/DuplicationPopup.tsx | 8 +- .../SourceViewer/components/LineCoverage.tsx | 4 +- .../components/LineDuplicationBlock.tsx | 10 +- .../components/LineIssuesIndicator.tsx | 6 +- .../SourceViewer/components/LineNumber.tsx | 4 +- .../SourceViewer/components/LineOptionsPopup.tsx | 11 +- .../components/SourceViewer/components/LineSCM.tsx | 6 +- .../SourceViewer/components/MeasuresOverlay.tsx | 21 +- .../components/MeasuresOverlayMeasure.tsx | 4 +- .../SourceViewer/components/SCMPopup.tsx | 4 +- .../__tests__/LineDuplicationBlock-test.tsx | 4 +- .../__tests__/LineIssuesIndicator-test.tsx | 2 +- .../components/__tests__/MeasuresOverlay-test.tsx | 2 +- .../__snapshots__/lazyLoadComponent-test.tsx.snap | 36 + .../__tests__/lazyLoadComponent-test.tsx | 57 + .../components/activity-graph/AddGraphMetric.tsx | 8 +- .../activity-graph/AddGraphMetricPopup.tsx | 4 +- .../js/components/activity-graph/GraphHistory.tsx | 5 +- .../js/components/activity-graph/GraphsHeader.tsx | 4 +- .../js/components/activity-graph/GraphsHistory.tsx | 6 +- .../activity-graph/GraphsLegendCustom.tsx | 4 +- .../components/activity-graph/GraphsLegendItem.tsx | 6 +- .../activity-graph/GraphsLegendNewCode.tsx | 4 +- .../components/activity-graph/GraphsTooltips.tsx | 6 +- .../activity-graph/GraphsTooltipsContent.tsx | 2 +- .../GraphsTooltipsContentCoverage.tsx | 4 +- .../GraphsTooltipsContentDuplication.tsx | 4 +- .../activity-graph/GraphsTooltipsContentIssues.tsx | 4 +- .../js/components/activity-graph/GraphsZoom.tsx | 2 +- .../activity-graph/__tests__/GraphHistory-test.tsx | 2 +- .../__tests__/GraphsHistory-test.tsx | 2 +- .../__tests__/GraphsLegendCustom-test.tsx | 2 +- .../__tests__/GraphsLegendItem-test.tsx | 4 +- .../__tests__/GraphsTooltips-test.tsx | 2 +- .../GraphsTooltipsContentCoverage-test.tsx | 2 +- .../GraphsTooltipsContentDuplication-test.tsx | 2 +- .../__tests__/GraphsTooltipsContentIssues-test.tsx | 2 +- .../activity-graph/__tests__/utils-test.ts | 2 +- .../src/main/js/components/activity-graph/utils.ts | 4 +- .../main/js/components/charts/AdvancedTimeline.css | 82 ++ .../main/js/components/charts/AdvancedTimeline.tsx | 629 +++++++++ .../src/main/js/components/charts/BarChart.css | 28 + .../src/main/js/components/charts/BarChart.tsx | 176 +++ .../src/main/js/components/charts/BubbleChart.css | 56 + .../src/main/js/components/charts/BubbleChart.tsx | 390 ++++++ .../main/js/components/charts/ColorBoxLegend.tsx | 2 +- .../js/components/charts/ColorGradientLegend.css | 33 + .../js/components/charts/ColorGradientLegend.tsx | 133 ++ .../js/components/charts/ColorRatingsLegend.tsx | 8 +- .../src/main/js/components/charts/DonutChart.tsx | 89 ++ .../src/main/js/components/charts/Histogram.css | 30 + .../src/main/js/components/charts/Histogram.tsx | 139 ++ .../js/components/charts/LanguageDistribution.tsx | 6 +- .../src/main/js/components/charts/LineChart.css | 69 + .../src/main/js/components/charts/LineChart.tsx | 199 +++ .../src/main/js/components/charts/TreeMap.css | 95 ++ .../src/main/js/components/charts/TreeMap.tsx | 116 ++ .../src/main/js/components/charts/TreeMapRect.tsx | 145 ++ .../src/main/js/components/charts/ZoomTimeLine.css | 46 + .../src/main/js/components/charts/ZoomTimeLine.tsx | 401 ++++++ .../charts/__tests__/AdvancedTimeline-test.tsx | 300 +++++ .../components/charts/__tests__/BarChart-test.tsx | 73 + .../charts/__tests__/BubbleChart-test.tsx | 59 + .../charts/__tests__/ColorGradientLegend-test.tsx | 43 + .../charts/__tests__/ColorRatingsLegend-test.tsx | 2 +- .../charts/__tests__/DonutChart-test.tsx | 52 + .../components/charts/__tests__/Histogram-test.tsx | 68 + .../components/charts/__tests__/LineChart-test.tsx | 54 + .../components/charts/__tests__/TreeMap-test.tsx | 53 + .../charts/__tests__/ZoomTimeLine-test.tsx | 123 ++ .../__snapshots__/AdvancedTimeline-test.tsx.snap | 1409 ++++++++++++++++++++ .../__snapshots__/BubbleChart-test.tsx.snap | 187 +++ .../ColorGradientLegend-test.tsx.snap | 220 +++ .../__snapshots__/DonutChart-test.tsx.snap | 122 ++ .../__snapshots__/Histogram-test.tsx.snap | 352 +++++ .../__snapshots__/ZoomTimeLine-test.tsx.snap | 5 + .../src/main/js/components/common/ActivityLink.tsx | 4 +- .../js/components/common/AnalysisWarningsModal.tsx | 10 +- .../src/main/js/components/common/BranchStatus.tsx | 2 +- .../src/main/js/components/common/CodeSnippet.tsx | 4 +- .../components/common/DisableableSelectOption.tsx | 2 +- .../js/components/common/DocumentationTooltip.tsx | 4 +- .../src/main/js/components/common/EmptySearch.tsx | 2 +- .../main/js/components/common/FiltersHeader.tsx | 4 +- .../main/js/components/common/FormattingTips.tsx | 2 +- .../src/main/js/components/common/MeasuresLink.tsx | 4 +- .../src/main/js/components/common/MultiSelect.tsx | 4 +- .../js/components/common/MultiSelectOption.tsx | 4 +- .../src/main/js/components/common/PageCounter.tsx | 2 +- .../js/components/common/PrivacyBadgeContainer.tsx | 4 +- .../main/js/components/common/ProjectKeyInput.tsx | 4 +- .../js/components/common/ResetPasswordForm.tsx | 10 +- .../main/js/components/common/RestartButton.tsx | 6 +- .../main/js/components/common/SelectListItem.tsx | 2 +- .../main/js/components/common/StatusIndicator.tsx | 2 +- .../js/components/common/VisibilitySelector.tsx | 4 +- .../__tests__/AnalysisWarningsModal-test.tsx | 2 +- .../common/__tests__/FormattingTips-test.tsx | 2 +- .../common/__tests__/ProjectKeyInput-test.tsx | 2 +- .../common/__tests__/ResetPasswordForm-test.tsx | 2 +- .../common/__tests__/SelectList-test.tsx | 2 +- .../common/__tests__/VisibilitySelector-test.tsx | 2 +- .../js/components/controls/ActionsDropdown.tsx | 138 ++ .../src/main/js/components/controls/BackButton.tsx | 72 + .../js/components/controls/BoxedGroupAccordion.tsx | 78 ++ .../src/main/js/components/controls/BoxedTabs.tsx | 92 ++ .../src/main/js/components/controls/Checkbox.css | 91 ++ .../src/main/js/components/controls/Checkbox.tsx | 101 ++ .../js/components/controls/ClickEventBoundary.tsx | 35 + .../components/controls/ComponentReportActions.tsx | 2 +- .../controls/ComponentReportActionsRenderer.tsx | 8 +- .../main/js/components/controls/ConfirmButton.tsx | 58 + .../main/js/components/controls/ConfirmModal.tsx | 107 ++ .../src/main/js/components/controls/DateInput.tsx | 20 +- .../main/js/components/controls/DateRangeInput.tsx | 2 +- .../components/controls/DocumentClickHandler.tsx | 53 + .../src/main/js/components/controls/Dropdown.css | 34 + .../src/main/js/components/controls/Dropdown.tsx | 159 +++ .../js/components/controls/EscKeydownHandler.tsx | 48 + .../src/main/js/components/controls/Favorite.tsx | 2 +- .../main/js/components/controls/FavoriteButton.tsx | 53 + .../main/js/components/controls/GlobalMessages.tsx | 124 ++ .../main/js/components/controls/HelpTooltip.css | 31 + .../main/js/components/controls/HelpTooltip.tsx | 66 + .../main/js/components/controls/HomePageSelect.tsx | 8 +- .../components/controls/IdentityProviderLink.css | 67 + .../components/controls/IdentityProviderLink.tsx | 63 + .../components/controls/InputValidationField.tsx | 52 + .../src/main/js/components/controls/ListFooter.tsx | 73 + .../src/main/js/components/controls/Modal.css | 211 +++ .../src/main/js/components/controls/Modal.tsx | 76 ++ .../main/js/components/controls/ModalButton.tsx | 80 ++ .../components/controls/ModalValidationField.tsx | 49 + .../js/components/controls/OutsideClickHandler.tsx | 64 + .../src/main/js/components/controls/Radio.css | 76 ++ .../src/main/js/components/controls/Radio.tsx | 56 + .../src/main/js/components/controls/RadioCard.css | 134 ++ .../src/main/js/components/controls/RadioCard.tsx | 92 ++ .../main/js/components/controls/RadioToggle.css | 73 + .../main/js/components/controls/RadioToggle.tsx | 74 + .../main/js/components/controls/ReloadButton.tsx | 63 + .../js/components/controls/ScreenPositionFixer.tsx | 117 ++ .../src/main/js/components/controls/SearchBox.css | 104 ++ .../src/main/js/components/controls/SearchBox.tsx | 176 +++ .../main/js/components/controls/SearchSelect.tsx | 154 +++ .../src/main/js/components/controls/Select.css | 477 +++++++ .../src/main/js/components/controls/Select.tsx | 72 + .../src/main/js/components/controls/SelectList.css | 59 + .../src/main/js/components/controls/SelectList.tsx | 189 +++ .../controls/SelectListListContainer.tsx | 129 ++ .../components/controls/SelectListListElement.tsx | 76 ++ .../main/js/components/controls/SimpleModal.tsx | 101 ++ .../src/main/js/components/controls/Tabs.css | 60 + .../src/main/js/components/controls/Tabs.tsx | 77 ++ .../src/main/js/components/controls/Toggle.css | 82 ++ .../src/main/js/components/controls/Toggle.tsx | 60 + .../src/main/js/components/controls/Toggler.tsx | 72 + .../src/main/js/components/controls/Tooltip.css | 134 ++ .../src/main/js/components/controls/Tooltip.tsx | 407 ++++++ .../main/js/components/controls/ValidationForm.tsx | 72 + .../js/components/controls/ValidationInput.tsx | 61 + .../js/components/controls/ValidationModal.tsx | 83 ++ .../controls/__tests__/ActionsDropdown-test.tsx | 91 ++ .../controls/__tests__/BackButton-test.tsx | 48 + .../__tests__/BoxedGroupAccordion-test.tsx | 52 + .../controls/__tests__/BoxedTabs-test.tsx | 69 + .../controls/__tests__/Checkbox-test.tsx | 115 ++ .../controls/__tests__/ClickEventBoundary-test.tsx | 49 + .../__tests__/ComponentReportActions-test.tsx | 2 +- .../controls/__tests__/ConfirmButton-test.tsx | 46 + .../controls/__tests__/ConfirmModal-test.tsx | 60 + .../controls/__tests__/DateInput-test.tsx | 2 +- .../controls/__tests__/DateRangeInput-test.tsx | 2 +- .../controls/__tests__/Dropdown-test.tsx | 120 ++ .../controls/__tests__/EscKeydownHandler-test.tsx | 46 + .../controls/__tests__/Favorite-test.tsx | 2 +- .../controls/__tests__/FavoriteButton-test.tsx | 54 + .../controls/__tests__/GlobalMessages-test.tsx | 78 ++ .../controls/__tests__/HelpTooltip-test.tsx | 62 + .../controls/__tests__/HomePageSelect-test.tsx | 4 +- .../__tests__/IdentityProviderLink-test.tsx | 43 + .../__tests__/InputValidationField-test.tsx | 44 + .../controls/__tests__/ListFooter-test.tsx | 57 + .../controls/__tests__/ModalButton-test.tsx | 41 + .../__tests__/ModalValidationField-test.tsx | 49 + .../__tests__/OutsideClickHandler-test.tsx | 74 + .../components/controls/__tests__/Radio-test.tsx | 52 + .../controls/__tests__/RadioCard-test.tsx | 59 + .../controls/__tests__/RadioToggle-test.tsx | 94 ++ .../controls/__tests__/ReloadButton-test.tsx | 48 + .../__tests__/ScreenPositionFixer-test.tsx | 95 ++ .../controls/__tests__/SearchBox-test.tsx | 90 ++ .../controls/__tests__/SearchSelect-test.tsx | 50 + .../controls/__tests__/SelectList-test.tsx | 148 ++ .../__tests__/SelectListListContainer-test.tsx | 44 + .../__tests__/SelectListListElement-test.tsx | 47 + .../controls/__tests__/SimpleModal-test.tsx | 65 + .../js/components/controls/__tests__/Tabs-test.tsx | 81 ++ .../components/controls/__tests__/Toggle-test.tsx | 43 + .../components/controls/__tests__/Toggler-test.tsx | 48 + .../components/controls/__tests__/Tooltip-test.tsx | 118 ++ .../controls/__tests__/ValidationForm-test.tsx | 47 + .../controls/__tests__/ValidationInput-test.tsx | 73 + .../controls/__tests__/ValidationModal-test.tsx | 73 + .../__snapshots__/ActionsDropdown-test.tsx.snap | 143 ++ .../__snapshots__/BackButton-test.tsx.snap | 46 + .../BoxedGroupAccordion-test.tsx.snap | 26 + .../__snapshots__/BoxedTabs-test.tsx.snap | 178 +++ .../__tests__/__snapshots__/Checkbox-test.tsx.snap | 22 + .../__snapshots__/ClickEventBoundary-test.tsx.snap | 14 + .../__snapshots__/ConfirmButton-test.tsx.snap | 20 + .../__snapshots__/ConfirmModal-test.tsx.snap | 81 ++ .../__snapshots__/EscKeydownHandler-test.tsx.snap | 7 + .../__snapshots__/FavoriteButton-test.tsx.snap | 65 + .../__snapshots__/GlobalMessages-test.tsx.snap | 212 +++ .../__snapshots__/HelpTooltip-test.tsx.snap | 53 + .../IdentityProviderLink-test.tsx.snap | 21 + .../InputValidationField-test.tsx.snap | 13 + .../__snapshots__/ListFooter-test.tsx.snap | 85 ++ .../ModalValidationField-test.tsx.snap | 73 + .../OutsideClickHandler-test.tsx.snap | 7 + .../__tests__/__snapshots__/Radio-test.tsx.snap | 29 + .../__snapshots__/RadioCard-test.tsx.snap | 172 +++ .../__snapshots__/RadioToggle-test.tsx.snap | 92 ++ .../__snapshots__/ReloadButton-test.tsx.snap | 46 + .../__snapshots__/SearchBox-test.tsx.snap | 37 + .../__snapshots__/SearchSelect-test.tsx.snap | 17 + .../__snapshots__/SelectList-test.tsx.snap | 558 ++++++++ .../SelectListListContainer-test.tsx.snap | 61 + .../SelectListListElement-test.tsx.snap | 41 + .../__snapshots__/SimpleModal-test.tsx.snap | 52 + .../__tests__/__snapshots__/Tabs-test.tsx.snap | 52 + .../__tests__/__snapshots__/Toggle-test.tsx.snap | 55 + .../__tests__/__snapshots__/Toggler-test.tsx.snap | 58 + .../__tests__/__snapshots__/Tooltip-test.tsx.snap | 40 + .../__snapshots__/ValidationForm-test.tsx.snap | 19 + .../__snapshots__/ValidationInput-test.tsx.snap | 98 ++ .../__snapshots__/ValidationModal-test.tsx.snap | 110 ++ .../__tests__/__snapshots__/buttons-test.tsx.snap | 31 + .../__snapshots__/clipboard-test.tsx.snap | 52 + .../components/controls/__tests__/buttons-test.tsx | 77 ++ .../controls/__tests__/clipboard-test.tsx | 102 ++ .../src/main/js/components/controls/buttons.css | 322 +++++ .../src/main/js/components/controls/buttons.tsx | 182 +++ .../src/main/js/components/controls/clipboard.tsx | 148 ++ .../js/components/docs/DocCollapsibleBlock.tsx | 2 +- .../src/main/js/components/docs/DocImg.tsx | 2 +- .../src/main/js/components/docs/DocLink.tsx | 2 +- .../main/js/components/docs/DocMarkdownBlock.tsx | 2 +- .../src/main/js/components/docs/DocToc.tsx | 2 +- .../src/main/js/components/docs/DocTooltipLink.tsx | 2 +- .../docs/__tests__/DocCollapsibleBlock-test.tsx | 2 +- .../docs/__tests__/DocMarkdownBlock-test.tsx | 4 +- .../js/components/docs/__tests__/DocToc-test.tsx | 2 +- .../src/main/js/components/facet/FacetHeader.tsx | 10 +- .../main/js/components/facet/ListStyleFacet.tsx | 14 +- .../js/components/facet/ListStyleFacetFooter.tsx | 4 +- .../js/components/facet/MultipleSelectionHint.tsx | 2 +- .../facet/__tests__/FacetHeader-test.tsx | 2 +- .../components/facet/__tests__/FacetItem-test.tsx | 2 +- .../facet/__tests__/ListStyleFacet-test.tsx | 2 +- .../facet/__tests__/ListStyleFacetFooter-test.tsx | 2 +- .../components/hoc/__tests__/whenLoggedIn-test.tsx | 4 +- .../hoc/__tests__/withKeyboardNavigation-test.tsx | 2 +- .../hoc/__tests__/withNotifications-test.tsx | 2 +- .../src/main/js/components/hoc/whenLoggedIn.tsx | 2 +- .../js/components/hoc/withKeyboardNavigation.tsx | 2 +- .../main/js/components/icons/AlertErrorIcon.tsx | 34 + .../main/js/components/icons/AlertSuccessIcon.tsx | 34 + .../src/main/js/components/icons/AlertWarnIcon.tsx | 34 + .../src/main/js/components/icons/ArrowIcon.tsx | 50 + .../src/main/js/components/icons/BackIcon.tsx | 32 + .../src/main/js/components/icons/BranchIcon.tsx | 34 + .../main/js/components/icons/BranchLikeIcon.tsx | 6 +- .../src/main/js/components/icons/BubblesIcon.tsx | 32 + .../src/main/js/components/icons/BugIcon.tsx | 36 + .../main/js/components/icons/BugTrackerIcon.tsx | 32 + .../main/js/components/icons/BulletListIcon.tsx | 32 + .../src/main/js/components/icons/CalendarIcon.tsx | 32 + .../main/js/components/icons/ChartLegendIcon.tsx | 43 + .../src/main/js/components/icons/CheckIcon.tsx | 32 + .../main/js/components/icons/ChevronDownIcon.tsx | 32 + .../main/js/components/icons/ChevronLeftIcon.tsx | 32 + .../main/js/components/icons/ChevronRightIcon.tsx | 32 + .../src/main/js/components/icons/ChevronUpIcon.tsx | 32 + .../src/main/js/components/icons/ChevronsIcon.tsx | 33 + .../src/main/js/components/icons/ClearIcon.tsx | 43 + .../src/main/js/components/icons/ClockIcon.tsx | 33 + .../src/main/js/components/icons/CodeSmellIcon.tsx | 32 + .../src/main/js/components/icons/CogIcon.tsx | 32 + .../src/main/js/components/icons/CollapseIcon.tsx | 32 + .../components/icons/ContinuousIntegrationIcon.tsx | 35 + .../src/main/js/components/icons/CopyIcon.tsx | 33 + .../src/main/js/components/icons/DeleteIcon.tsx | 32 + .../src/main/js/components/icons/DetachIcon.tsx | 32 + .../src/main/js/components/icons/DropdownIcon.tsx | 46 + .../src/main/js/components/icons/EditIcon.tsx | 32 + .../src/main/js/components/icons/EllipsisIcon.tsx | 32 + .../src/main/js/components/icons/ExpandIcon.tsx | 32 + .../main/js/components/icons/ExpandSnippetIcon.tsx | 48 + .../src/main/js/components/icons/FavoriteIcon.tsx | 44 + .../src/main/js/components/icons/FilterIcon.tsx | 32 + .../src/main/js/components/icons/GroupIcon.tsx | 36 + .../src/main/js/components/icons/HelpIcon.tsx | 42 + .../src/main/js/components/icons/HistoryIcon.tsx | 32 + .../src/main/js/components/icons/HomeIcon.tsx | 44 + .../src/main/js/components/icons/HouseIcon.tsx | 32 + .../src/main/js/components/icons/Icon.tsx | 81 ++ .../src/main/js/components/icons/InfoIcon.tsx | 32 + .../src/main/js/components/icons/IssueIcon.tsx | 44 + .../src/main/js/components/icons/IssueTypeIcon.tsx | 57 + .../src/main/js/components/icons/LightBulbIcon.tsx | 32 + .../src/main/js/components/icons/LinkIcon.tsx | 34 + .../src/main/js/components/icons/ListIcon.tsx | 32 + .../src/main/js/components/icons/LockIcon.tsx | 32 + .../js/components/icons/LongLivingBranchIcon.tsx | 36 + .../src/main/js/components/icons/MeasuresIcon.tsx | 29 + .../src/main/js/components/icons/MinimizeIcon.tsx | 32 + .../main/js/components/icons/NotificationIcon.tsx | 52 + .../components/icons/OnboardingAddMembersIcon.tsx | 44 + .../js/components/icons/OnboardingProjectIcon.tsx | 35 + .../js/components/icons/OnboardingTeamIcon.tsx | 35 + .../src/main/js/components/icons/OpenCloseIcon.tsx | 31 + .../src/main/js/components/icons/PendingIcon.tsx | 36 + .../src/main/js/components/icons/PinIcon.tsx | 32 + .../main/js/components/icons/PlusCircleIcon.tsx | 32 + .../src/main/js/components/icons/PlusIcon.tsx | 29 + .../main/js/components/icons/ProjectLinkIcon.tsx | 45 + .../main/js/components/icons/PullRequestIcon.tsx | 34 + .../src/main/js/components/icons/QualifierIcon.tsx | 185 +++ .../main/js/components/icons/RecommendedIcon.tsx | 32 + .../src/main/js/components/icons/RocketIcon.tsx | 32 + .../src/main/js/components/icons/RuleScopeIcon.tsx | 32 + .../src/main/js/components/icons/SCMIcon.tsx | 32 + .../src/main/js/components/icons/SearchIcon.tsx | 32 + .../js/components/icons/SecurityHotspotIcon.tsx | 32 + .../src/main/js/components/icons/SettingsIcon.tsx | 38 + .../src/main/js/components/icons/SeverityIcon.tsx | 107 ++ .../js/components/icons/ShortLivingBranchIcon.tsx | 36 + .../src/main/js/components/icons/SortAscIcon.tsx | 32 + .../src/main/js/components/icons/SortDescIcon.tsx | 32 + .../src/main/js/components/icons/StatusIcon.tsx | 106 ++ .../src/main/js/components/icons/TagsIcon.tsx | 32 + .../main/js/components/icons/TestStatusIcon.tsx | 89 ++ .../src/main/js/components/icons/TreeIcon.tsx | 32 + .../src/main/js/components/icons/TreemapIcon.tsx | 32 + .../src/main/js/components/icons/VisibleIcon.tsx | 32 + .../main/js/components/icons/VulnerabilityIcon.tsx | 32 + .../src/main/js/components/icons/WarningIcon.tsx | 34 + .../js/components/icons/__tests__/Icon-test.tsx | 34 + .../components/icons/__tests__/IssueIcon-test.tsx | 33 + .../icons/__tests__/IssueTypeIcon-test.tsx | 34 + .../icons/__tests__/TestStatusIcon-test.tsx | 33 + .../__tests__/__snapshots__/Icon-test.tsx.snap | 24 + .../__snapshots__/IssueIcon-test.tsx.snap | 9 + .../__snapshots__/IssueTypeIcon-test.tsx.snap | 26 + .../__snapshots__/TestStatusIcon-test.tsx.snap | 9 + .../src/main/js/components/intl/DateFormatter.tsx | 40 + .../src/main/js/components/intl/DateFromNow.tsx | 61 + .../main/js/components/intl/DateTimeFormatter.tsx | 43 + .../src/main/js/components/intl/TimeFormatter.tsx | 40 + .../js/components/intl/__mocks__/DateFromNow.tsx | 30 + .../intl/__tests__/DateFormatter-test.tsx | 35 + .../components/intl/__tests__/DateFromNow-test.tsx | 66 + .../intl/__tests__/DateTimeFormatter-test.tsx | 34 + .../intl/__tests__/TimeFormatter-test.tsx | 35 + .../__snapshots__/DateFormatter-test.tsx.snap | 23 + .../__snapshots__/DateFromNow-test.tsx.snap | 22 + .../__snapshots__/DateTimeFormatter-test.tsx.snap | 14 + .../__snapshots__/TimeFormatter-test.tsx.snap | 22 + .../src/main/js/components/issue/IssueView.tsx | 2 +- .../issue/components/IssueActionsBar.tsx | 2 +- .../js/components/issue/components/IssueAssign.tsx | 8 +- .../components/issue/components/IssueChangelog.tsx | 8 +- .../issue/components/IssueChangelogDiff.tsx | 4 +- .../issue/components/IssueCommentAction.tsx | 6 +- .../issue/components/IssueCommentLine.tsx | 10 +- .../components/issue/components/IssueMessage.tsx | 6 +- .../components/issue/components/IssueSeverity.tsx | 8 +- .../js/components/issue/components/IssueTags.tsx | 6 +- .../components/issue/components/IssueTitleBar.tsx | 8 +- .../issue/components/IssueTransition.tsx | 8 +- .../js/components/issue/components/IssueType.tsx | 10 +- .../issue/components/SimilarIssuesFilter.tsx | 10 +- .../components/__tests__/IssueAssign-test.tsx | 2 +- .../components/__tests__/IssueChangelog-test.tsx | 2 +- .../__tests__/IssueCommentAction-test.tsx | 2 +- .../components/__tests__/IssueCommentLine-test.tsx | 2 +- .../components/__tests__/IssueMessage-test.tsx | 4 +- .../components/__tests__/IssueSeverity-test.tsx | 2 +- .../issue/components/__tests__/IssueTags-test.tsx | 2 +- .../components/__tests__/IssueTransition-test.tsx | 2 +- .../issue/components/__tests__/IssueType-test.tsx | 2 +- .../js/components/issue/popups/ChangelogPopup.tsx | 8 +- .../components/issue/popups/CommentDeletePopup.tsx | 8 +- .../js/components/issue/popups/CommentPopup.tsx | 8 +- .../components/issue/popups/SetAssigneePopup.tsx | 6 +- .../components/issue/popups/SetIssueTagsPopup.tsx | 4 +- .../components/issue/popups/SetSeverityPopup.tsx | 6 +- .../components/issue/popups/SetTransitionPopup.tsx | 4 +- .../js/components/issue/popups/SetTypePopup.tsx | 6 +- .../components/issue/popups/SimilarIssuesPopup.tsx | 12 +- .../issue/popups/__tests__/ChangelogPopup-test.tsx | 2 +- .../popups/__tests__/CommentDeletePopup-test.tsx | 2 +- .../issue/popups/__tests__/CommentPopup-test.tsx | 2 +- .../popups/__tests__/SetAssigneePopup-test.tsx | 2 +- .../popups/__tests__/SetTransitionPopup-test.tsx | 6 +- .../src/main/js/components/lazyLoadComponent.tsx | 73 + .../src/main/js/components/measure/Measure.tsx | 8 +- .../main/js/components/shared/SeverityHelper.tsx | 4 +- .../src/main/js/components/shared/StatusHelper.tsx | 4 +- .../src/main/js/components/shared/TypeHelper.tsx | 4 +- .../src/main/js/components/tags/TagsList.tsx | 6 +- .../src/main/js/components/tags/TagsSelector.tsx | 2 +- server/sonar-web/src/main/js/components/theme.ts | 65 + .../js/components/tutorials/TutorialSelection.tsx | 2 +- .../tutorials/TutorialSelectionRenderer.tsx | 6 +- .../tutorials/__tests__/TutorialSelection-test.tsx | 6 +- .../__tests__/TutorialSelectionRenderer-test.tsx | 2 +- .../azure-pipelines/AzurePipelinesTutorial.tsx | 4 +- .../azure-pipelines/BranchAnalysisStepContent.tsx | 2 +- .../ExtensionInstallationStepContent.tsx | 2 +- .../azure-pipelines/JavaToolInstallation.tsx | 2 +- .../azure-pipelines/ServiceEndpointStepContent.tsx | 6 +- .../__tests__/AzurePipelinesTutorial-test.tsx | 4 +- .../__tests__/ServiceEndpointStepContent-test.tsx | 4 +- .../commands/AlertClassicEditor.tsx | 4 +- .../azure-pipelines/commands/ClangGCC.tsx | 4 +- .../azure-pipelines/commands/JavaGradle.tsx | 2 +- .../azure-pipelines/commands/JavaMaven.tsx | 2 +- .../commands/PrepareAnalysisCommand.tsx | 4 +- .../azure-pipelines/commands/PublishSteps.tsx | 4 +- .../BitbucketPipelinesTutorial.tsx | 2 +- .../bitbucket-pipelines/PreambuleYaml.tsx | 4 +- .../bitbucket-pipelines/RepositoryVariables.tsx | 6 +- .../js/components/tutorials/components/AllSet.tsx | 4 +- .../components/tutorials/components/AllSetStep.tsx | 2 +- .../tutorials/components/CompilationInfo.tsx | 4 +- .../tutorials/components/CreateYmlFile.tsx | 4 +- .../tutorials/components/EditTokenModal.tsx | 12 +- .../tutorials/components/FinishButton.tsx | 6 +- .../tutorials/components/LabelActionPair.tsx | 2 +- .../tutorials/components/LabelValuePair.tsx | 4 +- .../tutorials/components/RenderOptions.tsx | 4 +- .../tutorials/components/SentenceWithFilename.tsx | 2 +- .../components/SentenceWithHighlights.tsx | 2 +- .../tutorials/components/TokenStepGenerator.tsx | 4 +- .../tutorials/components/YamlFileStep.tsx | 2 +- .../components/__tests__/EditTokenModal-test.tsx | 2 +- .../tutorials/components/__tests__/Step-test.tsx | 2 +- .../github-action/GitHubActionTutorial.tsx | 2 +- .../tutorials/github-action/SecretStep.tsx | 6 +- .../tutorials/github-action/commands/CFamily.tsx | 2 +- .../tutorials/github-action/commands/Gradle.tsx | 4 +- .../tutorials/github-action/commands/JavaMaven.tsx | 4 +- .../gitlabci/EnvironmentVariablesStep.tsx | 6 +- .../tutorials/gitlabci/GitLabCITutorial.tsx | 2 +- .../tutorials/gitlabci/ProjectKeyStep.tsx | 6 +- .../components/tutorials/gitlabci/YmlFileStep.tsx | 4 +- .../tutorials/jenkins/JenkinsTutorial.tsx | 2 +- .../tutorials/jenkins/JenkinsfileStep.tsx | 4 +- .../tutorials/jenkins/MultiBranchPipelineStep.tsx | 6 +- .../components/tutorials/jenkins/PipelineStep.tsx | 6 +- .../tutorials/jenkins/PreRequisitesStep.tsx | 10 +- .../components/tutorials/jenkins/SelectAlmStep.tsx | 6 +- .../components/tutorials/jenkins/WebhookStep.tsx | 6 +- .../tutorials/jenkins/WebhookStepBitbucket.tsx | 4 +- .../tutorials/jenkins/WebhookStepGitLab.tsx | 2 +- .../tutorials/jenkins/WebhookStepGithub.tsx | 2 +- .../jenkins/__tests__/SelectAlmStep-test.tsx | 2 +- .../tutorials/jenkins/buildtool-steps/CFamilly.tsx | 2 +- .../CreateJenkinsfileBulletPoint.tsx | 4 +- .../tutorials/jenkins/buildtool-steps/DotNet.tsx | 2 +- .../buildtool-steps/DotNetPrereqsMSBuild.tsx | 6 +- .../buildtool-steps/DotNetPrereqsScanner.tsx | 6 +- .../components/tutorials/manual/BuildToolForm.tsx | 4 +- .../components/tutorials/manual/DoneNextSteps.tsx | 2 +- .../components/tutorials/manual/ManualTutorial.tsx | 2 +- .../tutorials/manual/ProjectAnalysisStep.tsx | 2 +- .../js/components/tutorials/manual/TokenStep.tsx | 14 +- .../tutorials/manual/__tests__/TokenStep-test.tsx | 7 +- .../tutorials/manual/commands/AnalysisCommand.tsx | 2 +- .../tutorials/manual/commands/DotNetCore.tsx | 4 +- .../tutorials/manual/commands/DotNetExecute.tsx | 2 +- .../tutorials/manual/commands/DotNetFramework.tsx | 2 +- .../manual/commands/DownloadBuildWrapper.tsx | 4 +- .../tutorials/manual/commands/DownloadScanner.tsx | 2 +- .../tutorials/manual/commands/ExecBuildWrapper.tsx | 2 +- .../tutorials/manual/commands/ExecScanner.tsx | 2 +- .../tutorials/manual/commands/JavaGradle.tsx | 2 +- .../tutorials/manual/commands/JavaMaven.tsx | 2 +- .../commands/__tests__/AnalysisCommand-test.tsx | 2 +- .../sonar-web/src/main/js/components/ui/Alert.tsx | 159 +++ .../src/main/js/components/ui/AutoEllipsis.tsx | 88 ++ .../sonar-web/src/main/js/components/ui/Avatar.tsx | 2 +- .../src/main/js/components/ui/ContextNavBar.css | 99 ++ .../src/main/js/components/ui/ContextNavBar.tsx | 33 + .../src/main/js/components/ui/CoverageRating.tsx | 4 +- .../src/main/js/components/ui/DeferredSpinner.css | 78 ++ .../src/main/js/components/ui/DeferredSpinner.tsx | 91 ++ .../src/main/js/components/ui/DismissableAlert.tsx | 10 +- .../main/js/components/ui/DuplicationsRating.css | 171 +++ .../main/js/components/ui/DuplicationsRating.tsx | 45 + .../src/main/js/components/ui/FilesCounter.tsx | 45 + .../src/main/js/components/ui/GenericAvatar.tsx | 61 + .../sonar-web/src/main/js/components/ui/Level.css | 82 ++ .../sonar-web/src/main/js/components/ui/Level.tsx | 49 + .../main/js/components/ui/MandatoryFieldMarker.tsx | 36 + .../components/ui/MandatoryFieldsExplanation.tsx | 39 + .../sonar-web/src/main/js/components/ui/NavBar.css | 50 + .../sonar-web/src/main/js/components/ui/NavBar.tsx | 77 ++ .../src/main/js/components/ui/NavBarTabs.css | 47 + .../src/main/js/components/ui/NavBarTabs.tsx | 36 + .../src/main/js/components/ui/NewsBox.css | 31 + .../src/main/js/components/ui/NewsBox.tsx | 50 + .../src/main/js/components/ui/PageActions.tsx | 57 + .../main/js/components/ui/PageShortcutsTooltip.tsx | 4 +- .../sonar-web/src/main/js/components/ui/Rating.css | 98 ++ .../sonar-web/src/main/js/components/ui/Rating.tsx | 61 + .../src/main/js/components/ui/SizeRating.css | 45 + .../src/main/js/components/ui/SizeRating.tsx | 59 + .../main/js/components/ui/__tests__/Alert-test.tsx | 62 + .../components/ui/__tests__/AutoEllipsis-test.tsx | 75 ++ .../ui/__tests__/DeferredSpinner-test.tsx | 73 + .../ui/__tests__/DismissableAlert-test.tsx | 8 +- .../components/ui/__tests__/FilesCounter-test.tsx | 30 + .../components/ui/__tests__/GenericAvatar-test.tsx | 27 + .../main/js/components/ui/__tests__/Level-test.tsx | 36 + .../ui/__tests__/MandatoryFieldMarker-test.tsx | 31 + .../__tests__/MandatoryFieldsExplanation-test.tsx | 33 + .../js/components/ui/__tests__/NavBar-test.tsx | 40 + .../js/components/ui/__tests__/NewsBox-test.tsx | 43 + .../components/ui/__tests__/PageActions-test.tsx | 32 + .../js/components/ui/__tests__/Rating-test.tsx | 41 + .../js/components/ui/__tests__/SizeRating-test.tsx | 34 + .../ui/__tests__/__snapshots__/Alert-test.tsx.snap | 207 +++ .../__snapshots__/AutoEllipsis-test.tsx.snap | 9 + .../__snapshots__/DeferredSpinner-test.tsx.snap | 87 ++ .../__snapshots__/FilesCounter-test.tsx.snap | 25 + .../__snapshots__/GenericAvatar-test.tsx.snap | 47 + .../ui/__tests__/__snapshots__/Level-test.tsx.snap | 43 + .../MandatoryFieldMarker-test.tsx.snap | 19 + .../MandatoryFieldsExplanation-test.tsx.snap | 43 + .../__tests__/__snapshots__/NavBar-test.tsx.snap | 64 + .../__tests__/__snapshots__/NewsBox-test.tsx.snap | 42 + .../__snapshots__/PageActions-test.tsx.snap | 103 ++ .../__tests__/__snapshots__/Rating-test.tsx.snap | 46 + .../__snapshots__/SizeRating-test.tsx.snap | 46 + .../__tests__/__snapshots__/popups-test.tsx.snap | 79 ++ .../js/components/ui/__tests__/popups-test.tsx | 132 ++ .../sonar-web/src/main/js/components/ui/popups.css | 288 ++++ .../sonar-web/src/main/js/components/ui/popups.tsx | 291 ++++ .../js/components/ui/update-center/MetaData.css | 101 ++ .../js/components/ui/update-center/MetaData.tsx | 121 ++ .../ui/update-center/MetaDataVersion.tsx | 98 ++ .../ui/update-center/MetaDataVersions.tsx | 84 ++ .../ui/update-center/__tests__/MetaData-test.tsx | 86 ++ .../__tests__/MetaDataVersion-test.tsx | 45 + .../__tests__/MetaDataVersions-test.tsx | 51 + .../__tests__/__snapshots__/MetaData-test.tsx.snap | 133 ++ .../__snapshots__/MetaDataVersion-test.tsx.snap | 113 ++ .../__snapshots__/MetaDataVersions-test.tsx.snap | 28 + .../update-center/mocks/update-center-metadata.ts | 57 + .../ui/update-center/update-center-metadata.ts | 48 + .../src/main/js/components/workspace/Workspace.tsx | 4 +- .../workspace/WorkspaceComponentTitle.tsx | 4 +- .../workspace/WorkspaceComponentViewer.tsx | 2 +- .../js/components/workspace/WorkspaceHeader.tsx | 14 +- .../js/components/workspace/WorkspaceNavItem.tsx | 2 +- .../components/workspace/WorkspaceRuleDetails.tsx | 2 +- .../js/components/workspace/WorkspaceRuleTitle.tsx | 2 +- .../workspace/__tests__/Workspace-test.tsx | 6 +- .../__tests__/WorkspaceComponentViewer-test.tsx | 2 +- .../workspace/__tests__/WorkspaceNavItem-test.tsx | 2 +- .../__tests__/WorkspaceRuleDetails-test.tsx | 2 +- .../__tests__/__snapshots__/query-test.ts.snap | 11 + .../src/main/js/helpers/__tests__/colors-test.ts | 50 + .../src/main/js/helpers/__tests__/dates-test.ts | 37 + .../main/js/helpers/__tests__/getHistory-test.ts | 29 + .../__tests__/handleRequiredAuthentication-test.ts | 32 + .../src/main/js/helpers/__tests__/init-test.ts | 91 ++ .../src/main/js/helpers/__tests__/l10n-test.ts | 174 ++- .../src/main/js/helpers/__tests__/measures-test.ts | 212 ++- .../src/main/js/helpers/__tests__/pages-test.ts | 51 + .../src/main/js/helpers/__tests__/path-test.ts | 128 ++ .../src/main/js/helpers/__tests__/query-test.ts | 104 ++ .../src/main/js/helpers/__tests__/ratings-test.ts | 114 ++ .../src/main/js/helpers/__tests__/request-test.ts | 349 +++++ .../main/js/helpers/__tests__/scrolling-test.ts | 219 +++ .../src/main/js/helpers/__tests__/strings-test.ts | 59 + .../src/main/js/helpers/__tests__/urls-test.ts | 72 + server/sonar-web/src/main/js/helpers/colors.ts | 50 + server/sonar-web/src/main/js/helpers/cookies.ts | 36 + server/sonar-web/src/main/js/helpers/csv.ts | 23 + server/sonar-web/src/main/js/helpers/dates.ts | 47 + server/sonar-web/src/main/js/helpers/editions.ts | 2 +- server/sonar-web/src/main/js/helpers/extensions.ts | 2 +- server/sonar-web/src/main/js/helpers/getHistory.ts | 36 + .../js/helpers/handleRequiredAuthentication.ts | 27 + server/sonar-web/src/main/js/helpers/init.ts | 88 ++ server/sonar-web/src/main/js/helpers/issues.ts | 8 +- server/sonar-web/src/main/js/helpers/keycodes.ts | 68 + server/sonar-web/src/main/js/helpers/l10n.ts | 98 +- server/sonar-web/src/main/js/helpers/measures.ts | 333 ++++- server/sonar-web/src/main/js/helpers/pages.ts | 57 + server/sonar-web/src/main/js/helpers/path.ts | 107 ++ server/sonar-web/src/main/js/helpers/periods.ts | 4 +- .../sonar-web/src/main/js/helpers/projectLinks.ts | 2 +- server/sonar-web/src/main/js/helpers/query.ts | 112 ++ server/sonar-web/src/main/js/helpers/ratings.ts | 60 + server/sonar-web/src/main/js/helpers/request.ts | 337 +++++ server/sonar-web/src/main/js/helpers/scrolling.ts | 197 +++ server/sonar-web/src/main/js/helpers/search.tsx | 33 + server/sonar-web/src/main/js/helpers/sonarlint.ts | 2 +- server/sonar-web/src/main/js/helpers/storage.ts | 48 + server/sonar-web/src/main/js/helpers/strings.ts | 426 ++++++ server/sonar-web/src/main/js/helpers/testUtils.ts | 163 +++ server/sonar-web/src/main/js/helpers/types.ts | 22 + server/sonar-web/src/main/js/helpers/urls.ts | 40 +- .../__snapshots__/lazyLoadComponent-test.tsx.snap | 36 - .../components/__tests__/getHistory-test.ts | 29 - .../__tests__/lazyLoadComponent-test.tsx | 57 - .../components/charts/AdvancedTimeline.css | 82 -- .../components/charts/AdvancedTimeline.tsx | 629 --------- .../sonar-ui-common/components/charts/BarChart.css | 28 - .../sonar-ui-common/components/charts/BarChart.tsx | 176 --- .../components/charts/BubbleChart.css | 56 - .../components/charts/BubbleChart.tsx | 390 ------ .../components/charts/ColorGradientLegend.css | 33 - .../components/charts/ColorGradientLegend.tsx | 133 -- .../components/charts/DonutChart.tsx | 89 -- .../components/charts/Histogram.css | 30 - .../components/charts/Histogram.tsx | 139 -- .../components/charts/LineChart.css | 69 - .../components/charts/LineChart.tsx | 199 --- .../sonar-ui-common/components/charts/TreeMap.css | 95 -- .../sonar-ui-common/components/charts/TreeMap.tsx | 116 -- .../components/charts/TreeMapRect.tsx | 145 -- .../components/charts/ZoomTimeLine.css | 46 - .../components/charts/ZoomTimeLine.tsx | 401 ------ .../charts/__tests__/AdvancedTimeline-test.tsx | 300 ----- .../components/charts/__tests__/BarChart-test.tsx | 73 - .../charts/__tests__/BubbleChart-test.tsx | 59 - .../charts/__tests__/ColorGradientLegend-test.tsx | 43 - .../charts/__tests__/DonutChart-test.tsx | 52 - .../components/charts/__tests__/Histogram-test.tsx | 68 - .../components/charts/__tests__/LineChart-test.tsx | 54 - .../components/charts/__tests__/TreeMap-test.tsx | 53 - .../charts/__tests__/ZoomTimeLine-test.tsx | 123 -- .../__snapshots__/AdvancedTimeline-test.tsx.snap | 1409 -------------------- .../__snapshots__/BubbleChart-test.tsx.snap | 187 --- .../ColorGradientLegend-test.tsx.snap | 220 --- .../__snapshots__/DonutChart-test.tsx.snap | 122 -- .../__snapshots__/Histogram-test.tsx.snap | 352 ----- .../__snapshots__/ZoomTimeLine-test.tsx.snap | 5 - .../components/controls/ActionsDropdown.tsx | 138 -- .../components/controls/BackButton.tsx | 72 - .../components/controls/BoxedGroupAccordion.tsx | 78 -- .../components/controls/BoxedTabs.tsx | 92 -- .../components/controls/Checkbox.css | 91 -- .../components/controls/Checkbox.tsx | 101 -- .../components/controls/ClickEventBoundary.tsx | 35 - .../components/controls/ConfirmButton.tsx | 58 - .../components/controls/ConfirmModal.tsx | 107 -- .../components/controls/DocumentClickHandler.tsx | 53 - .../components/controls/Dropdown.css | 34 - .../components/controls/Dropdown.tsx | 159 --- .../components/controls/EscKeydownHandler.tsx | 48 - .../components/controls/FavoriteButton.tsx | 53 - .../components/controls/GlobalMessages.tsx | 124 -- .../components/controls/HelpTooltip.css | 31 - .../components/controls/HelpTooltip.tsx | 66 - .../components/controls/IdentityProviderLink.css | 67 - .../components/controls/IdentityProviderLink.tsx | 63 - .../components/controls/InputValidationField.tsx | 52 - .../components/controls/ListFooter.tsx | 73 - .../sonar-ui-common/components/controls/Modal.css | 211 --- .../sonar-ui-common/components/controls/Modal.tsx | 76 -- .../components/controls/ModalButton.tsx | 80 -- .../components/controls/ModalValidationField.tsx | 49 - .../components/controls/OutsideClickHandler.tsx | 64 - .../sonar-ui-common/components/controls/Radio.css | 76 -- .../sonar-ui-common/components/controls/Radio.tsx | 56 - .../components/controls/RadioCard.css | 134 -- .../components/controls/RadioCard.tsx | 92 -- .../components/controls/RadioToggle.css | 73 - .../components/controls/RadioToggle.tsx | 74 - .../components/controls/ReloadButton.tsx | 63 - .../components/controls/ScreenPositionFixer.tsx | 117 -- .../components/controls/SearchBox.css | 104 -- .../components/controls/SearchBox.tsx | 176 --- .../components/controls/SearchSelect.tsx | 154 --- .../sonar-ui-common/components/controls/Select.css | 477 ------- .../sonar-ui-common/components/controls/Select.tsx | 72 - .../components/controls/SelectList.css | 59 - .../components/controls/SelectList.tsx | 189 --- .../controls/SelectListListContainer.tsx | 129 -- .../components/controls/SelectListListElement.tsx | 76 -- .../components/controls/SimpleModal.tsx | 101 -- .../sonar-ui-common/components/controls/Tabs.css | 60 - .../sonar-ui-common/components/controls/Tabs.tsx | 77 -- .../sonar-ui-common/components/controls/Toggle.css | 82 -- .../sonar-ui-common/components/controls/Toggle.tsx | 60 - .../components/controls/Toggler.tsx | 72 - .../components/controls/Tooltip.css | 134 -- .../components/controls/Tooltip.tsx | 407 ------ .../components/controls/ValidationForm.tsx | 72 - .../components/controls/ValidationInput.tsx | 61 - .../components/controls/ValidationModal.tsx | 83 -- .../controls/__tests__/ActionsDropdown-test.tsx | 91 -- .../controls/__tests__/BackButton-test.tsx | 48 - .../__tests__/BoxedGroupAccordion-test.tsx | 52 - .../controls/__tests__/BoxedTabs-test.tsx | 69 - .../controls/__tests__/Checkbox-test.tsx | 115 -- .../controls/__tests__/ClickEventBoundary-test.tsx | 49 - .../controls/__tests__/ConfirmButton-test.tsx | 46 - .../controls/__tests__/ConfirmModal-test.tsx | 60 - .../controls/__tests__/Dropdown-test.tsx | 120 -- .../controls/__tests__/EscKeydownHandler-test.tsx | 46 - .../controls/__tests__/FavoriteButton-test.tsx | 54 - .../controls/__tests__/GlobalMessages-test.tsx | 78 -- .../controls/__tests__/HelpTooltip-test.tsx | 62 - .../__tests__/IdentityProviderLink-test.tsx | 43 - .../__tests__/InputValidationField-test.tsx | 44 - .../controls/__tests__/ListFooter-test.tsx | 57 - .../controls/__tests__/ModalButton-test.tsx | 41 - .../__tests__/ModalValidationField-test.tsx | 49 - .../__tests__/OutsideClickHandler-test.tsx | 74 - .../components/controls/__tests__/Radio-test.tsx | 52 - .../controls/__tests__/RadioCard-test.tsx | 59 - .../controls/__tests__/RadioToggle-test.tsx | 94 -- .../controls/__tests__/ReloadButton-test.tsx | 48 - .../__tests__/ScreenPositionFixer-test.tsx | 95 -- .../controls/__tests__/SearchBox-test.tsx | 90 -- .../controls/__tests__/SearchSelect-test.tsx | 50 - .../controls/__tests__/SelectList-test.tsx | 148 -- .../__tests__/SelectListListContainer-test.tsx | 44 - .../__tests__/SelectListListElement-test.tsx | 47 - .../controls/__tests__/SimpleModal-test.tsx | 65 - .../components/controls/__tests__/Tabs-test.tsx | 81 -- .../components/controls/__tests__/Toggle-test.tsx | 43 - .../components/controls/__tests__/Toggler-test.tsx | 48 - .../components/controls/__tests__/Tooltip-test.tsx | 118 -- .../controls/__tests__/ValidationForm-test.tsx | 47 - .../controls/__tests__/ValidationInput-test.tsx | 73 - .../controls/__tests__/ValidationModal-test.tsx | 73 - .../__snapshots__/ActionsDropdown-test.tsx.snap | 143 -- .../__snapshots__/BackButton-test.tsx.snap | 46 - .../BoxedGroupAccordion-test.tsx.snap | 26 - .../__snapshots__/BoxedTabs-test.tsx.snap | 178 --- .../__tests__/__snapshots__/Checkbox-test.tsx.snap | 22 - .../__snapshots__/ClickEventBoundary-test.tsx.snap | 14 - .../__snapshots__/ConfirmButton-test.tsx.snap | 20 - .../__snapshots__/ConfirmModal-test.tsx.snap | 81 -- .../__snapshots__/EscKeydownHandler-test.tsx.snap | 7 - .../__snapshots__/FavoriteButton-test.tsx.snap | 65 - .../__snapshots__/GlobalMessages-test.tsx.snap | 212 --- .../__snapshots__/HelpTooltip-test.tsx.snap | 53 - .../IdentityProviderLink-test.tsx.snap | 21 - .../InputValidationField-test.tsx.snap | 13 - .../__snapshots__/ListFooter-test.tsx.snap | 85 -- .../ModalValidationField-test.tsx.snap | 73 - .../OutsideClickHandler-test.tsx.snap | 7 - .../__tests__/__snapshots__/Radio-test.tsx.snap | 29 - .../__snapshots__/RadioCard-test.tsx.snap | 172 --- .../__snapshots__/RadioToggle-test.tsx.snap | 92 -- .../__snapshots__/ReloadButton-test.tsx.snap | 46 - .../__snapshots__/SearchBox-test.tsx.snap | 37 - .../__snapshots__/SearchSelect-test.tsx.snap | 17 - .../__snapshots__/SelectList-test.tsx.snap | 558 -------- .../SelectListListContainer-test.tsx.snap | 61 - .../SelectListListElement-test.tsx.snap | 41 - .../__snapshots__/SimpleModal-test.tsx.snap | 52 - .../__tests__/__snapshots__/Tabs-test.tsx.snap | 52 - .../__tests__/__snapshots__/Toggle-test.tsx.snap | 55 - .../__tests__/__snapshots__/Toggler-test.tsx.snap | 58 - .../__tests__/__snapshots__/Tooltip-test.tsx.snap | 40 - .../__snapshots__/ValidationForm-test.tsx.snap | 19 - .../__snapshots__/ValidationInput-test.tsx.snap | 98 -- .../__snapshots__/ValidationModal-test.tsx.snap | 110 -- .../__tests__/__snapshots__/buttons-test.tsx.snap | 31 - .../__snapshots__/clipboard-test.tsx.snap | 52 - .../components/controls/__tests__/buttons-test.tsx | 77 -- .../controls/__tests__/clipboard-test.tsx | 102 -- .../components/controls/buttons.css | 322 ----- .../components/controls/buttons.tsx | 182 --- .../components/controls/clipboard.tsx | 148 -- .../components/icons/AlertErrorIcon.tsx | 34 - .../components/icons/AlertSuccessIcon.tsx | 34 - .../components/icons/AlertWarnIcon.tsx | 34 - .../sonar-ui-common/components/icons/ArrowIcon.tsx | 50 - .../sonar-ui-common/components/icons/BackIcon.tsx | 32 - .../components/icons/BranchIcon.tsx | 34 - .../components/icons/BubblesIcon.tsx | 32 - .../sonar-ui-common/components/icons/BugIcon.tsx | 36 - .../components/icons/BugTrackerIcon.tsx | 32 - .../components/icons/BulletListIcon.tsx | 32 - .../components/icons/CalendarIcon.tsx | 32 - .../components/icons/ChartLegendIcon.tsx | 43 - .../sonar-ui-common/components/icons/CheckIcon.tsx | 32 - .../components/icons/ChevronDownIcon.tsx | 32 - .../components/icons/ChevronLeftIcon.tsx | 32 - .../components/icons/ChevronRightIcon.tsx | 32 - .../components/icons/ChevronUpIcon.tsx | 32 - .../components/icons/ChevronsIcon.tsx | 33 - .../sonar-ui-common/components/icons/ClearIcon.tsx | 43 - .../sonar-ui-common/components/icons/ClockIcon.tsx | 33 - .../components/icons/CodeSmellIcon.tsx | 32 - .../sonar-ui-common/components/icons/CogIcon.tsx | 32 - .../components/icons/CollapseIcon.tsx | 32 - .../components/icons/ContinuousIntegrationIcon.tsx | 35 - .../sonar-ui-common/components/icons/CopyIcon.tsx | 33 - .../components/icons/DeleteIcon.tsx | 32 - .../components/icons/DetachIcon.tsx | 32 - .../components/icons/DropdownIcon.tsx | 46 - .../sonar-ui-common/components/icons/EditIcon.tsx | 32 - .../components/icons/EllipsisIcon.tsx | 32 - .../components/icons/ExpandIcon.tsx | 32 - .../components/icons/ExpandSnippetIcon.tsx | 48 - .../components/icons/FavoriteIcon.tsx | 44 - .../components/icons/FilterIcon.tsx | 32 - .../sonar-ui-common/components/icons/GroupIcon.tsx | 36 - .../sonar-ui-common/components/icons/HelpIcon.tsx | 42 - .../components/icons/HistoryIcon.tsx | 32 - .../sonar-ui-common/components/icons/HomeIcon.tsx | 44 - .../sonar-ui-common/components/icons/HouseIcon.tsx | 32 - .../js/sonar-ui-common/components/icons/Icon.tsx | 81 -- .../sonar-ui-common/components/icons/InfoIcon.tsx | 32 - .../sonar-ui-common/components/icons/IssueIcon.tsx | 44 - .../components/icons/IssueTypeIcon.tsx | 57 - .../components/icons/LightBulbIcon.tsx | 32 - .../sonar-ui-common/components/icons/LinkIcon.tsx | 34 - .../sonar-ui-common/components/icons/ListIcon.tsx | 32 - .../sonar-ui-common/components/icons/LockIcon.tsx | 32 - .../components/icons/LongLivingBranchIcon.tsx | 36 - .../components/icons/MeasuresIcon.tsx | 29 - .../components/icons/MinimizeIcon.tsx | 32 - .../components/icons/NotificationIcon.tsx | 52 - .../components/icons/OnboardingAddMembersIcon.tsx | 44 - .../components/icons/OnboardingProjectIcon.tsx | 35 - .../components/icons/OnboardingTeamIcon.tsx | 35 - .../components/icons/OpenCloseIcon.tsx | 31 - .../components/icons/PendingIcon.tsx | 36 - .../sonar-ui-common/components/icons/PinIcon.tsx | 32 - .../components/icons/PlusCircleIcon.tsx | 32 - .../sonar-ui-common/components/icons/PlusIcon.tsx | 29 - .../components/icons/ProjectLinkIcon.tsx | 45 - .../components/icons/PullRequestIcon.tsx | 34 - .../components/icons/QualifierIcon.tsx | 185 --- .../components/icons/RecommendedIcon.tsx | 32 - .../components/icons/RocketIcon.tsx | 32 - .../components/icons/RuleScopeIcon.tsx | 32 - .../sonar-ui-common/components/icons/SCMIcon.tsx | 32 - .../components/icons/SearchIcon.tsx | 32 - .../components/icons/SecurityHotspotIcon.tsx | 32 - .../components/icons/SettingsIcon.tsx | 38 - .../components/icons/SeverityIcon.tsx | 107 -- .../components/icons/ShortLivingBranchIcon.tsx | 36 - .../components/icons/SortAscIcon.tsx | 32 - .../components/icons/SortDescIcon.tsx | 32 - .../components/icons/StatusIcon.tsx | 106 -- .../sonar-ui-common/components/icons/TagsIcon.tsx | 32 - .../components/icons/TestStatusIcon.tsx | 89 -- .../sonar-ui-common/components/icons/TreeIcon.tsx | 32 - .../components/icons/TreemapIcon.tsx | 32 - .../components/icons/VisibleIcon.tsx | 32 - .../components/icons/VulnerabilityIcon.tsx | 32 - .../components/icons/WarningIcon.tsx | 34 - .../components/icons/__tests__/Icon-test.tsx | 34 - .../components/icons/__tests__/IssueIcon-test.tsx | 33 - .../icons/__tests__/IssueTypeIcon-test.tsx | 34 - .../icons/__tests__/TestStatusIcon-test.tsx | 33 - .../__tests__/__snapshots__/Icon-test.tsx.snap | 24 - .../__snapshots__/IssueIcon-test.tsx.snap | 9 - .../__snapshots__/IssueTypeIcon-test.tsx.snap | 26 - .../__snapshots__/TestStatusIcon-test.tsx.snap | 9 - .../components/intl/DateFormatter.tsx | 40 - .../components/intl/DateFromNow.tsx | 61 - .../components/intl/DateTimeFormatter.tsx | 43 - .../components/intl/TimeFormatter.tsx | 40 - .../components/intl/__mocks__/DateFromNow.tsx | 30 - .../intl/__tests__/DateFormatter-test.tsx | 35 - .../components/intl/__tests__/DateFromNow-test.tsx | 66 - .../intl/__tests__/DateTimeFormatter-test.tsx | 34 - .../intl/__tests__/TimeFormatter-test.tsx | 35 - .../__snapshots__/DateFormatter-test.tsx.snap | 23 - .../__snapshots__/DateFromNow-test.tsx.snap | 22 - .../__snapshots__/DateTimeFormatter-test.tsx.snap | 14 - .../__snapshots__/TimeFormatter-test.tsx.snap | 22 - .../components/lazyLoadComponent.tsx | 73 - .../main/js/sonar-ui-common/components/theme.ts | 65 - .../js/sonar-ui-common/components/ui/Alert.tsx | 159 --- .../sonar-ui-common/components/ui/AutoEllipsis.tsx | 88 -- .../components/ui/ContextNavBar.css | 99 -- .../components/ui/ContextNavBar.tsx | 33 - .../components/ui/DeferredSpinner.css | 78 -- .../components/ui/DeferredSpinner.tsx | 91 -- .../components/ui/DuplicationsRating.css | 171 --- .../components/ui/DuplicationsRating.tsx | 45 - .../sonar-ui-common/components/ui/FilesCounter.tsx | 45 - .../components/ui/GenericAvatar.tsx | 61 - .../js/sonar-ui-common/components/ui/Level.css | 82 -- .../js/sonar-ui-common/components/ui/Level.tsx | 49 - .../components/ui/MandatoryFieldMarker.tsx | 36 - .../components/ui/MandatoryFieldsExplanation.tsx | 39 - .../js/sonar-ui-common/components/ui/NavBar.css | 50 - .../js/sonar-ui-common/components/ui/NavBar.tsx | 77 -- .../sonar-ui-common/components/ui/NavBarTabs.css | 47 - .../sonar-ui-common/components/ui/NavBarTabs.tsx | 36 - .../js/sonar-ui-common/components/ui/NewsBox.css | 31 - .../js/sonar-ui-common/components/ui/NewsBox.tsx | 50 - .../sonar-ui-common/components/ui/PageActions.tsx | 57 - .../js/sonar-ui-common/components/ui/Rating.css | 98 -- .../js/sonar-ui-common/components/ui/Rating.tsx | 61 - .../sonar-ui-common/components/ui/SizeRating.css | 45 - .../sonar-ui-common/components/ui/SizeRating.tsx | 59 - .../components/ui/__tests__/Alert-test.tsx | 62 - .../components/ui/__tests__/AutoEllipsis-test.tsx | 75 -- .../ui/__tests__/DeferredSpinner-test.tsx | 73 - .../components/ui/__tests__/FilesCounter-test.tsx | 30 - .../components/ui/__tests__/GenericAvatar-test.tsx | 27 - .../components/ui/__tests__/Level-test.tsx | 36 - .../ui/__tests__/MandatoryFieldMarker-test.tsx | 31 - .../__tests__/MandatoryFieldsExplanation-test.tsx | 33 - .../components/ui/__tests__/NavBar-test.tsx | 40 - .../components/ui/__tests__/NewsBox-test.tsx | 43 - .../components/ui/__tests__/PageActions-test.tsx | 32 - .../components/ui/__tests__/Rating-test.tsx | 41 - .../components/ui/__tests__/SizeRating-test.tsx | 34 - .../ui/__tests__/__snapshots__/Alert-test.tsx.snap | 207 --- .../__snapshots__/AutoEllipsis-test.tsx.snap | 9 - .../__snapshots__/DeferredSpinner-test.tsx.snap | 87 -- .../__snapshots__/FilesCounter-test.tsx.snap | 25 - .../__snapshots__/GenericAvatar-test.tsx.snap | 47 - .../ui/__tests__/__snapshots__/Level-test.tsx.snap | 43 - .../MandatoryFieldMarker-test.tsx.snap | 19 - .../MandatoryFieldsExplanation-test.tsx.snap | 43 - .../__tests__/__snapshots__/NavBar-test.tsx.snap | 64 - .../__tests__/__snapshots__/NewsBox-test.tsx.snap | 42 - .../__snapshots__/PageActions-test.tsx.snap | 103 -- .../__tests__/__snapshots__/Rating-test.tsx.snap | 46 - .../__snapshots__/SizeRating-test.tsx.snap | 46 - .../__tests__/__snapshots__/popups-test.tsx.snap | 79 -- .../components/ui/__tests__/popups-test.tsx | 132 -- .../js/sonar-ui-common/components/ui/popups.css | 288 ---- .../js/sonar-ui-common/components/ui/popups.tsx | 291 ---- .../components/ui/update-center/MetaData.css | 101 -- .../components/ui/update-center/MetaData.tsx | 121 -- .../ui/update-center/MetaDataVersion.tsx | 98 -- .../ui/update-center/MetaDataVersions.tsx | 84 -- .../ui/update-center/__tests__/MetaData-test.tsx | 86 -- .../__tests__/MetaDataVersion-test.tsx | 45 - .../__tests__/MetaDataVersions-test.tsx | 51 - .../__tests__/__snapshots__/MetaData-test.tsx.snap | 133 -- .../__snapshots__/MetaDataVersion-test.tsx.snap | 113 -- .../__snapshots__/MetaDataVersions-test.tsx.snap | 28 - .../update-center/mocks/update-center-metadata.ts | 57 - .../ui/update-center/update-center-metadata.ts | 48 - .../main/js/sonar-ui-common/config/jest/CSSStub.js | 20 - .../js/sonar-ui-common/config/jest/FileStub.js | 20 - .../js/sonar-ui-common/config/jest/SetupEnzyme.js | 23 - .../js/sonar-ui-common/config/jest/SetupSUC.ts | 31 - .../config/jest/SetupTestEnvironment.js | 24 - .../js/sonar-ui-common/config/jest/testTheme.ts | 180 --- .../__tests__/__snapshots__/query-test.ts.snap | 11 - .../helpers/__tests__/colors-test.ts | 50 - .../helpers/__tests__/dates-test.ts | 37 - .../__tests__/handleRequiredAuthentication-test.ts | 32 - .../sonar-ui-common/helpers/__tests__/init-test.ts | 91 -- .../sonar-ui-common/helpers/__tests__/l10n-test.ts | 183 --- .../helpers/__tests__/measures-test.ts | 225 ---- .../helpers/__tests__/pages-test.ts | 51 - .../sonar-ui-common/helpers/__tests__/path-test.ts | 128 -- .../helpers/__tests__/query-test.ts | 104 -- .../helpers/__tests__/ratings-test.ts | 114 -- .../helpers/__tests__/request-test.ts | 349 ----- .../helpers/__tests__/scrolling-test.ts | 219 --- .../helpers/__tests__/strings-test.ts | 59 - .../sonar-ui-common/helpers/__tests__/urls-test.ts | 92 -- .../src/main/js/sonar-ui-common/helpers/colors.ts | 50 - .../src/main/js/sonar-ui-common/helpers/cookies.ts | 36 - .../src/main/js/sonar-ui-common/helpers/csv.ts | 23 - .../src/main/js/sonar-ui-common/helpers/dates.ts | 47 - .../main/js/sonar-ui-common/helpers/getHistory.ts | 36 - .../helpers/handleRequiredAuthentication.ts | 27 - .../src/main/js/sonar-ui-common/helpers/init.ts | 88 -- .../main/js/sonar-ui-common/helpers/keycodes.ts | 68 - .../src/main/js/sonar-ui-common/helpers/l10n.ts | 109 -- .../main/js/sonar-ui-common/helpers/measures.ts | 338 ----- .../src/main/js/sonar-ui-common/helpers/pages.ts | 57 - .../src/main/js/sonar-ui-common/helpers/path.ts | 107 -- .../src/main/js/sonar-ui-common/helpers/query.ts | 112 -- .../src/main/js/sonar-ui-common/helpers/ratings.ts | 60 - .../src/main/js/sonar-ui-common/helpers/request.ts | 337 ----- .../main/js/sonar-ui-common/helpers/scrolling.ts | 197 --- .../src/main/js/sonar-ui-common/helpers/search.tsx | 33 - .../src/main/js/sonar-ui-common/helpers/storage.ts | 48 - .../src/main/js/sonar-ui-common/helpers/strings.ts | 426 ------ .../main/js/sonar-ui-common/helpers/testUtils.ts | 163 --- .../src/main/js/sonar-ui-common/helpers/types.ts | 22 - .../src/main/js/sonar-ui-common/helpers/urls.ts | 79 -- server/sonar-web/src/main/js/types/extension.ts | 2 +- 1961 files changed, 33181 insertions(+), 33858 deletions(-) create mode 100644 server/sonar-web/src/main/js/components/__tests__/__snapshots__/lazyLoadComponent-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/__tests__/lazyLoadComponent-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/AdvancedTimeline.css create mode 100644 server/sonar-web/src/main/js/components/charts/AdvancedTimeline.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/BarChart.css create mode 100644 server/sonar-web/src/main/js/components/charts/BarChart.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/BubbleChart.css create mode 100644 server/sonar-web/src/main/js/components/charts/BubbleChart.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/ColorGradientLegend.css create mode 100644 server/sonar-web/src/main/js/components/charts/ColorGradientLegend.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/DonutChart.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/Histogram.css create mode 100644 server/sonar-web/src/main/js/components/charts/Histogram.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/LineChart.css create mode 100644 server/sonar-web/src/main/js/components/charts/LineChart.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/TreeMap.css create mode 100644 server/sonar-web/src/main/js/components/charts/TreeMap.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/TreeMapRect.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/ZoomTimeLine.css create mode 100644 server/sonar-web/src/main/js/components/charts/ZoomTimeLine.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/AdvancedTimeline-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/BarChart-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/BubbleChart-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/ColorGradientLegend-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/DonutChart-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/Histogram-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/LineChart-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/TreeMap-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/ZoomTimeLine-test.tsx create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/AdvancedTimeline-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/BubbleChart-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ColorGradientLegend-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/DonutChart-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/Histogram-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ZoomTimeLine-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/BackButton.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/BoxedGroupAccordion.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/BoxedTabs.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Checkbox.css create mode 100644 server/sonar-web/src/main/js/components/controls/Checkbox.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ClickEventBoundary.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ConfirmModal.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/DocumentClickHandler.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Dropdown.css create mode 100644 server/sonar-web/src/main/js/components/controls/Dropdown.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/EscKeydownHandler.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/FavoriteButton.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/GlobalMessages.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/HelpTooltip.css create mode 100644 server/sonar-web/src/main/js/components/controls/HelpTooltip.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/IdentityProviderLink.css create mode 100644 server/sonar-web/src/main/js/components/controls/IdentityProviderLink.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/InputValidationField.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ListFooter.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Modal.css create mode 100644 server/sonar-web/src/main/js/components/controls/Modal.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ModalButton.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ModalValidationField.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/OutsideClickHandler.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Radio.css create mode 100644 server/sonar-web/src/main/js/components/controls/Radio.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/RadioCard.css create mode 100644 server/sonar-web/src/main/js/components/controls/RadioCard.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/RadioToggle.css create mode 100644 server/sonar-web/src/main/js/components/controls/RadioToggle.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ReloadButton.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ScreenPositionFixer.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/SearchBox.css create mode 100644 server/sonar-web/src/main/js/components/controls/SearchBox.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/SearchSelect.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Select.css create mode 100644 server/sonar-web/src/main/js/components/controls/Select.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/SelectList.css create mode 100644 server/sonar-web/src/main/js/components/controls/SelectList.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/SelectListListElement.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/SimpleModal.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Tabs.css create mode 100644 server/sonar-web/src/main/js/components/controls/Tabs.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Toggle.css create mode 100644 server/sonar-web/src/main/js/components/controls/Toggle.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Toggler.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/Tooltip.css create mode 100644 server/sonar-web/src/main/js/components/controls/Tooltip.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ValidationForm.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ValidationInput.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/ValidationModal.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ActionsDropdown-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/BackButton-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/BoxedGroupAccordion-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/BoxedTabs-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/Checkbox-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ClickEventBoundary-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ConfirmButton-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ConfirmModal-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/Dropdown-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/EscKeydownHandler-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/FavoriteButton-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/GlobalMessages-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/HelpTooltip-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/IdentityProviderLink-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/InputValidationField-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ListFooter-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ModalButton-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ModalValidationField-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/OutsideClickHandler-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/Radio-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/RadioCard-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/RadioToggle-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ReloadButton-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ScreenPositionFixer-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/SearchBox-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/SearchSelect-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/SelectList-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/SelectListListContainer-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/SelectListListElement-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/SimpleModal-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/Tabs-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/Toggle-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/Toggler-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/Tooltip-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ValidationForm-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/ValidationModal-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ActionsDropdown-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BackButton-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedGroupAccordion-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedTabs-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Checkbox-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ClickEventBoundary-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmButton-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmModal-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/EscKeydownHandler-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/FavoriteButton-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/GlobalMessages-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/HelpTooltip-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/IdentityProviderLink-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/InputValidationField-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ListFooter-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ModalValidationField-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/OutsideClickHandler-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Radio-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioCard-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ReloadButton-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchBox-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchSelect-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectList-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListElement-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SimpleModal-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Tabs-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Toggle-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Toggler-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Tooltip-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ValidationForm-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ValidationInput-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ValidationModal-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/buttons-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/clipboard-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/buttons-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/__tests__/clipboard-test.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/buttons.css create mode 100644 server/sonar-web/src/main/js/components/controls/buttons.tsx create mode 100644 server/sonar-web/src/main/js/components/controls/clipboard.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/AlertErrorIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/AlertSuccessIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/AlertWarnIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/BackIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/BranchIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/BugIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/BugTrackerIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/BulletListIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/CalendarIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ChartLegendIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/CheckIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ChevronDownIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ChevronRightIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ClearIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ClockIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/CodeSmellIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/CogIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/CollapseIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ContinuousIntegrationIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/CopyIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/DeleteIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/DetachIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/DropdownIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/EditIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ExpandIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/FavoriteIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/FilterIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/GroupIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/HelpIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/HistoryIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/HomeIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/HouseIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/Icon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/InfoIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/IssueIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/IssueTypeIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/LinkIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ListIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/LockIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/MeasuresIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/MinimizeIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/OnboardingAddMembersIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/OnboardingProjectIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/OnboardingTeamIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/OpenCloseIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/PendingIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/PinIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/PlusCircleIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/PlusIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/PullRequestIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/RecommendedIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/RocketIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/SCMIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/SearchIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/SecurityHotspotIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/SettingsIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/SeverityIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/StatusIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/TagsIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/TreeIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/VulnerabilityIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/WarningIcon.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/Icon-test.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/IssueIcon-test.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/IssueTypeIcon-test.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/TestStatusIcon-test.tsx create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/Icon-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueIcon-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueTypeIcon-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/TestStatusIcon-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/intl/DateFormatter.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/DateFromNow.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/DateTimeFormatter.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/TimeFormatter.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/DateFormatter-test.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/DateFromNow-test.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/TimeFormatter-test.tsx create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFormatter-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFromNow-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateTimeFormatter-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/TimeFormatter-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/lazyLoadComponent.tsx create mode 100644 server/sonar-web/src/main/js/components/theme.ts create mode 100644 server/sonar-web/src/main/js/components/ui/Alert.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/ContextNavBar.css create mode 100644 server/sonar-web/src/main/js/components/ui/ContextNavBar.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/DeferredSpinner.css create mode 100644 server/sonar-web/src/main/js/components/ui/DeferredSpinner.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/DuplicationsRating.css create mode 100644 server/sonar-web/src/main/js/components/ui/DuplicationsRating.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/FilesCounter.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/GenericAvatar.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/Level.css create mode 100644 server/sonar-web/src/main/js/components/ui/Level.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/MandatoryFieldMarker.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/MandatoryFieldsExplanation.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/NavBar.css create mode 100644 server/sonar-web/src/main/js/components/ui/NavBar.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/NavBarTabs.css create mode 100644 server/sonar-web/src/main/js/components/ui/NavBarTabs.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/NewsBox.css create mode 100644 server/sonar-web/src/main/js/components/ui/NewsBox.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/PageActions.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/Rating.css create mode 100644 server/sonar-web/src/main/js/components/ui/Rating.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/SizeRating.css create mode 100644 server/sonar-web/src/main/js/components/ui/SizeRating.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/Alert-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/AutoEllipsis-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/DeferredSpinner-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/FilesCounter-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/GenericAvatar-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/Level-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldMarker-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldsExplanation-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/NavBar-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/NewsBox-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/PageActions-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/Rating-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/SizeRating-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/AutoEllipsis-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/DeferredSpinner-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/FilesCounter-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/GenericAvatar-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Level-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldMarker-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldsExplanation-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NavBar-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NewsBox-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/PageActions-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Rating-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/SizeRating-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/popups-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/__tests__/popups-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/popups.css create mode 100644 server/sonar-web/src/main/js/components/ui/popups.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaData.css create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaData.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersion.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersions.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/__tests__/MetaData-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/__tests__/MetaDataVersion-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/__tests__/MetaDataVersions-test.tsx create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/__tests__/__snapshots__/MetaData-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/__tests__/__snapshots__/MetaDataVersion-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/__tests__/__snapshots__/MetaDataVersions-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/mocks/update-center-metadata.ts create mode 100644 server/sonar-web/src/main/js/components/ui/update-center/update-center-metadata.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/__snapshots__/query-test.ts.snap create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/colors-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/dates-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/getHistory-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/handleRequiredAuthentication-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/init-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/pages-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/path-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/query-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/ratings-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/request-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/scrolling-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/__tests__/strings-test.ts create mode 100644 server/sonar-web/src/main/js/helpers/colors.ts create mode 100644 server/sonar-web/src/main/js/helpers/cookies.ts create mode 100644 server/sonar-web/src/main/js/helpers/csv.ts create mode 100644 server/sonar-web/src/main/js/helpers/dates.ts create mode 100644 server/sonar-web/src/main/js/helpers/getHistory.ts create mode 100644 server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts create mode 100644 server/sonar-web/src/main/js/helpers/init.ts create mode 100644 server/sonar-web/src/main/js/helpers/keycodes.ts create mode 100644 server/sonar-web/src/main/js/helpers/pages.ts create mode 100644 server/sonar-web/src/main/js/helpers/path.ts create mode 100644 server/sonar-web/src/main/js/helpers/query.ts create mode 100644 server/sonar-web/src/main/js/helpers/ratings.ts create mode 100644 server/sonar-web/src/main/js/helpers/request.ts create mode 100644 server/sonar-web/src/main/js/helpers/scrolling.ts create mode 100644 server/sonar-web/src/main/js/helpers/search.tsx create mode 100644 server/sonar-web/src/main/js/helpers/storage.ts create mode 100644 server/sonar-web/src/main/js/helpers/strings.ts create mode 100644 server/sonar-web/src/main/js/helpers/testUtils.ts create mode 100644 server/sonar-web/src/main/js/helpers/types.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/__tests__/__snapshots__/lazyLoadComponent-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/__tests__/getHistory-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/__tests__/lazyLoadComponent-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/AdvancedTimeline.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/AdvancedTimeline.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/BarChart.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/BarChart.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/BubbleChart.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/BubbleChart.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/ColorGradientLegend.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/ColorGradientLegend.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/DonutChart.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/Histogram.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/Histogram.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/LineChart.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/LineChart.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/TreeMap.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/TreeMap.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/TreeMapRect.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/ZoomTimeLine.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/ZoomTimeLine.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/AdvancedTimeline-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/BarChart-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/BubbleChart-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/ColorGradientLegend-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/DonutChart-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/Histogram-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/LineChart-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/TreeMap-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/ZoomTimeLine-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/__snapshots__/AdvancedTimeline-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/__snapshots__/BubbleChart-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/__snapshots__/ColorGradientLegend-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/__snapshots__/DonutChart-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/__snapshots__/Histogram-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/charts/__tests__/__snapshots__/ZoomTimeLine-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ActionsDropdown.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/BackButton.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/BoxedGroupAccordion.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/BoxedTabs.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Checkbox.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Checkbox.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ClickEventBoundary.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ConfirmButton.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ConfirmModal.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/DocumentClickHandler.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Dropdown.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Dropdown.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/EscKeydownHandler.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/FavoriteButton.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/GlobalMessages.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/HelpTooltip.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/HelpTooltip.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/IdentityProviderLink.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/IdentityProviderLink.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/InputValidationField.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ListFooter.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Modal.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Modal.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ModalButton.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ModalValidationField.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/OutsideClickHandler.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Radio.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Radio.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/RadioCard.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/RadioCard.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/RadioToggle.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/RadioToggle.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ReloadButton.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ScreenPositionFixer.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SearchBox.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SearchBox.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SearchSelect.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Select.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Select.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SelectList.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SelectList.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SelectListListContainer.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SelectListListElement.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/SimpleModal.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Tabs.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Tabs.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Toggle.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Toggle.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Toggler.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Tooltip.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/Tooltip.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ValidationForm.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ValidationInput.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/ValidationModal.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ActionsDropdown-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/BackButton-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/BoxedGroupAccordion-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/BoxedTabs-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/Checkbox-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ClickEventBoundary-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ConfirmButton-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ConfirmModal-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/Dropdown-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/EscKeydownHandler-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/FavoriteButton-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/GlobalMessages-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/HelpTooltip-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/IdentityProviderLink-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/InputValidationField-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ListFooter-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ModalButton-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ModalValidationField-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/OutsideClickHandler-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/Radio-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/RadioCard-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/RadioToggle-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ReloadButton-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ScreenPositionFixer-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/SearchBox-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/SearchSelect-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/SelectList-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/SelectListListContainer-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/SelectListListElement-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/SimpleModal-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/Tabs-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/Toggle-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/Toggler-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/Tooltip-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ValidationForm-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ValidationInput-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/ValidationModal-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ActionsDropdown-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/BackButton-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/BoxedGroupAccordion-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/BoxedTabs-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/Checkbox-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ClickEventBoundary-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ConfirmButton-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ConfirmModal-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/EscKeydownHandler-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/FavoriteButton-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/GlobalMessages-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/HelpTooltip-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/IdentityProviderLink-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/InputValidationField-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ListFooter-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ModalValidationField-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/OutsideClickHandler-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/Radio-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/RadioCard-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ReloadButton-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/SearchBox-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/SearchSelect-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/SelectList-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/SelectListListElement-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/SimpleModal-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/Tabs-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/Toggle-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/Toggler-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/Tooltip-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ValidationForm-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ValidationInput-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/ValidationModal-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/buttons-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/__snapshots__/clipboard-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/buttons-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/__tests__/clipboard-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/buttons.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/buttons.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/controls/clipboard.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/AlertErrorIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/AlertSuccessIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/AlertWarnIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ArrowIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/BackIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/BranchIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/BubblesIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/BugIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/BugTrackerIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/BulletListIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/CalendarIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ChartLegendIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/CheckIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ChevronDownIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ChevronLeftIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ChevronRightIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ChevronUpIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ChevronsIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ClearIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ClockIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/CodeSmellIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/CogIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/CollapseIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ContinuousIntegrationIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/CopyIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/DeleteIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/DetachIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/DropdownIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/EditIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/EllipsisIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ExpandIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ExpandSnippetIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/FavoriteIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/FilterIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/GroupIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/HelpIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/HistoryIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/HomeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/HouseIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/Icon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/InfoIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/IssueIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/IssueTypeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/LightBulbIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/LinkIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ListIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/LockIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/LongLivingBranchIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/MeasuresIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/MinimizeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/NotificationIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/OnboardingAddMembersIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/OnboardingProjectIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/OnboardingTeamIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/OpenCloseIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/PendingIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/PinIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/PlusCircleIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/PlusIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ProjectLinkIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/PullRequestIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/QualifierIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/RecommendedIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/RocketIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/RuleScopeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/SCMIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/SearchIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/SecurityHotspotIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/SettingsIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/SeverityIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/ShortLivingBranchIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/SortAscIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/SortDescIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/StatusIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/TagsIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/TestStatusIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/TreeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/TreemapIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/VisibleIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/VulnerabilityIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/WarningIcon.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/Icon-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/IssueIcon-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/IssueTypeIcon-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/TestStatusIcon-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/__snapshots__/Icon-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/__snapshots__/IssueIcon-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/__snapshots__/IssueTypeIcon-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/icons/__tests__/__snapshots__/TestStatusIcon-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/DateFormatter.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/DateFromNow.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/DateTimeFormatter.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/TimeFormatter.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__mocks__/DateFromNow.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/DateFormatter-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/DateFromNow-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/DateTimeFormatter-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/TimeFormatter-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/__snapshots__/DateFormatter-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/__snapshots__/DateFromNow-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/__snapshots__/DateTimeFormatter-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/intl/__tests__/__snapshots__/TimeFormatter-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/lazyLoadComponent.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/theme.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/Alert.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/AutoEllipsis.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/ContextNavBar.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/ContextNavBar.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/DeferredSpinner.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/DeferredSpinner.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/DuplicationsRating.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/DuplicationsRating.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/FilesCounter.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/GenericAvatar.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/Level.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/Level.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/MandatoryFieldMarker.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/MandatoryFieldsExplanation.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/NavBar.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/NavBar.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/NavBarTabs.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/NavBarTabs.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/NewsBox.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/NewsBox.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/PageActions.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/Rating.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/Rating.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/SizeRating.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/SizeRating.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/Alert-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/AutoEllipsis-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/DeferredSpinner-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/FilesCounter-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/GenericAvatar-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/Level-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/MandatoryFieldMarker-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/MandatoryFieldsExplanation-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/NavBar-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/NewsBox-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/PageActions-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/Rating-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/SizeRating-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/AutoEllipsis-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/DeferredSpinner-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/FilesCounter-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/GenericAvatar-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/Level-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/MandatoryFieldMarker-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/MandatoryFieldsExplanation-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/NavBar-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/NewsBox-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/PageActions-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/Rating-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/SizeRating-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/__snapshots__/popups-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/__tests__/popups-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/popups.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/popups.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/MetaData.css delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/MetaData.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/MetaDataVersion.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/MetaDataVersions.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/__tests__/MetaData-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/__tests__/MetaDataVersion-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/__tests__/MetaDataVersions-test.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/__tests__/__snapshots__/MetaData-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/__tests__/__snapshots__/MetaDataVersion-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/__tests__/__snapshots__/MetaDataVersions-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/mocks/update-center-metadata.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/components/ui/update-center/update-center-metadata.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/config/jest/CSSStub.js delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/config/jest/FileStub.js delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/config/jest/SetupEnzyme.js delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/config/jest/SetupSUC.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/config/jest/SetupTestEnvironment.js delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/config/jest/testTheme.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/__snapshots__/query-test.ts.snap delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/colors-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/dates-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/handleRequiredAuthentication-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/init-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/l10n-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/measures-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/pages-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/path-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/query-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/ratings-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/request-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/scrolling-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/strings-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/__tests__/urls-test.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/colors.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/cookies.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/csv.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/dates.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/getHistory.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/handleRequiredAuthentication.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/init.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/keycodes.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/l10n.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/measures.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/pages.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/path.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/query.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/ratings.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/request.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/scrolling.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/search.tsx delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/storage.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/strings.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/testUtils.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/types.ts delete mode 100644 server/sonar-web/src/main/js/sonar-ui-common/helpers/urls.ts (limited to 'server/sonar-web/src') diff --git a/server/sonar-web/src/main/js/api/alm-integrations.ts b/server/sonar-web/src/main/js/api/alm-integrations.ts index 7af1a28cd5f..d2849f70b8a 100644 --- a/server/sonar-web/src/main/js/api/alm-integrations.ts +++ b/server/sonar-web/src/main/js/api/alm-integrations.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { get, getJSON, parseError, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { get, getJSON, parseError, post, postJSON } from '../helpers/request'; import { AzureProject, AzureRepository, diff --git a/server/sonar-web/src/main/js/api/alm-settings.ts b/server/sonar-web/src/main/js/api/alm-settings.ts index 8e1751e5f49..e1ca7062e85 100644 --- a/server/sonar-web/src/main/js/api/alm-settings.ts +++ b/server/sonar-web/src/main/js/api/alm-settings.ts @@ -18,14 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { - get, - getJSON, - HttpStatus, - parseError, - parseJSON, - post -} from '../sonar-ui-common/helpers/request'; +import { get, getJSON, HttpStatus, parseError, parseJSON, post } from '../helpers/request'; import { AlmSettingsBindingDefinitions, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/api/application.ts b/server/sonar-web/src/main/js/api/application.ts index 0eeb3a569f1..42518728ba0 100644 --- a/server/sonar-web/src/main/js/api/application.ts +++ b/server/sonar-web/src/main/js/api/application.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; import { Application, ApplicationPeriod, ApplicationProject } from '../types/application'; import { Visibility } from '../types/component'; diff --git a/server/sonar-web/src/main/js/api/auth.ts b/server/sonar-web/src/main/js/api/auth.ts index f012a7bd381..8783eec3c3e 100644 --- a/server/sonar-web/src/main/js/api/auth.ts +++ b/server/sonar-web/src/main/js/api/auth.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { request } from '../sonar-ui-common/helpers/request'; +import { request } from '../helpers/request'; export function login(login: string, password: string): Promise { return request('/api/authentication/login') diff --git a/server/sonar-web/src/main/js/api/branches.ts b/server/sonar-web/src/main/js/api/branches.ts index 6068b643b60..119933c0dcc 100644 --- a/server/sonar-web/src/main/js/api/branches.ts +++ b/server/sonar-web/src/main/js/api/branches.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post } from '../sonar-ui-common/helpers/request'; +import { getJSON, post } from '../helpers/request'; import { Branch, PullRequest } from '../types/branch-like'; export function getBranches(project: string): Promise { diff --git a/server/sonar-web/src/main/js/api/ce.ts b/server/sonar-web/src/main/js/api/ce.ts index d4f3d15774a..7b612e2317f 100644 --- a/server/sonar-web/src/main/js/api/ce.ts +++ b/server/sonar-web/src/main/js/api/ce.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, RequestData } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, RequestData } from '../helpers/request'; import { IndexationStatus } from '../types/indexation'; import { Task, TaskWarning } from '../types/tasks'; diff --git a/server/sonar-web/src/main/js/api/component-report.ts b/server/sonar-web/src/main/js/api/component-report.ts index 1904c834053..1892928e607 100644 --- a/server/sonar-web/src/main/js/api/component-report.ts +++ b/server/sonar-web/src/main/js/api/component-report.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; +import { getJSON, post } from '../helpers/request'; import { getBaseUrl } from '../helpers/system'; -import { getJSON, post } from '../sonar-ui-common/helpers/request'; import { ComponentReportStatus } from '../types/component-report'; export function getReportStatus( diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index ec2f147b5af..6d719bceaeb 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON, RequestData } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON, RequestData } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; import { ComponentQualifier, TreeComponent, TreeComponentWithPath } from '../types/component'; diff --git a/server/sonar-web/src/main/js/api/favorites.ts b/server/sonar-web/src/main/js/api/favorites.ts index e26c51f1814..71c2e509107 100644 --- a/server/sonar-web/src/main/js/api/favorites.ts +++ b/server/sonar-web/src/main/js/api/favorites.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { getJSON, post } from '../sonar-ui-common/helpers/request'; +import { getJSON, post } from '../helpers/request'; export function getFavorites(): Promise { return getJSON('/api/favorites/search'); diff --git a/server/sonar-web/src/main/js/api/issue-filters.ts b/server/sonar-web/src/main/js/api/issue-filters.ts index 8795a2b1900..5ea1c882502 100644 --- a/server/sonar-web/src/main/js/api/issue-filters.ts +++ b/server/sonar-web/src/main/js/api/issue-filters.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { post } from '../sonar-ui-common/helpers/request'; +import { post } from '../helpers/request'; export function toggleIssueFilter(id: string): Promise { return post('/issues/toggle_fav', { id }); diff --git a/server/sonar-web/src/main/js/api/issues.ts b/server/sonar-web/src/main/js/api/issues.ts index 9b6f002166d..b590509351d 100644 --- a/server/sonar-web/src/main/js/api/issues.ts +++ b/server/sonar-web/src/main/js/api/issues.ts @@ -19,7 +19,7 @@ */ import throwGlobalError from '../app/utils/throwGlobalError'; import getCoverageStatus from '../components/SourceViewer/helpers/getCoverageStatus'; -import { getJSON, post, postJSON, RequestData } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON, RequestData } from '../helpers/request'; import { IssueResponse, RawIssuesResponse } from '../types/issues'; type FacetName = diff --git a/server/sonar-web/src/main/js/api/l10n.ts b/server/sonar-web/src/main/js/api/l10n.ts index 579af9e9f82..4440711bd7d 100644 --- a/server/sonar-web/src/main/js/api/l10n.ts +++ b/server/sonar-web/src/main/js/api/l10n.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; import { L10nBundleRequestParams, L10nBundleRequestResponse } from '../types/l10n'; export function fetchL10nBundle( diff --git a/server/sonar-web/src/main/js/api/languages.ts b/server/sonar-web/src/main/js/api/languages.ts index 595254caee7..603acf899ca 100644 --- a/server/sonar-web/src/main/js/api/languages.ts +++ b/server/sonar-web/src/main/js/api/languages.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; export function getLanguages(): Promise { return getJSON('/api/languages/list').then(r => r.languages, throwGlobalError); diff --git a/server/sonar-web/src/main/js/api/marketplace.ts b/server/sonar-web/src/main/js/api/marketplace.ts index bbc418631d7..5300259fc5f 100644 --- a/server/sonar-web/src/main/js/api/marketplace.ts +++ b/server/sonar-web/src/main/js/api/marketplace.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; export interface License { contactEmail: string; diff --git a/server/sonar-web/src/main/js/api/measures.ts b/server/sonar-web/src/main/js/api/measures.ts index 77f6c9e820d..482af37a61b 100644 --- a/server/sonar-web/src/main/js/api/measures.ts +++ b/server/sonar-web/src/main/js/api/measures.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; import { MeasuresAndMetaWithMetrics, diff --git a/server/sonar-web/src/main/js/api/metrics.ts b/server/sonar-web/src/main/js/api/metrics.ts index bb59e319c18..b6230b51b7e 100644 --- a/server/sonar-web/src/main/js/api/metrics.ts +++ b/server/sonar-web/src/main/js/api/metrics.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; export interface MetricsResponse { metrics: T.Metric[]; diff --git a/server/sonar-web/src/main/js/api/nav.ts b/server/sonar-web/src/main/js/api/nav.ts index b73f58f6ac1..8b89c9f4f89 100644 --- a/server/sonar-web/src/main/js/api/nav.ts +++ b/server/sonar-web/src/main/js/api/nav.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; type NavComponent = T.Omit; diff --git a/server/sonar-web/src/main/js/api/newCodePeriod.ts b/server/sonar-web/src/main/js/api/newCodePeriod.ts index 04363c339ee..60048a6fe0b 100644 --- a/server/sonar-web/src/main/js/api/newCodePeriod.ts +++ b/server/sonar-web/src/main/js/api/newCodePeriod.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post } from '../sonar-ui-common/helpers/request'; +import { getJSON, post } from '../helpers/request'; export function getNewCodePeriod(data?: { project?: string; diff --git a/server/sonar-web/src/main/js/api/notifications.ts b/server/sonar-web/src/main/js/api/notifications.ts index 0f314c75250..f6c3111c6a2 100644 --- a/server/sonar-web/src/main/js/api/notifications.ts +++ b/server/sonar-web/src/main/js/api/notifications.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post } from '../sonar-ui-common/helpers/request'; +import { getJSON, post } from '../helpers/request'; export function getNotifications(): Promise<{ channels: string[]; diff --git a/server/sonar-web/src/main/js/api/permissions.ts b/server/sonar-web/src/main/js/api/permissions.ts index a3f1eb716b8..f2a726ee1cc 100644 --- a/server/sonar-web/src/main/js/api/permissions.ts +++ b/server/sonar-web/src/main/js/api/permissions.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON, RequestData } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON, RequestData } from '../helpers/request'; import { BaseSearchProjectsParameters } from './components'; const PAGE_SIZE = 100; diff --git a/server/sonar-web/src/main/js/api/plugins.ts b/server/sonar-web/src/main/js/api/plugins.ts index 20bf5f1df19..4702a2c03ed 100644 --- a/server/sonar-web/src/main/js/api/plugins.ts +++ b/server/sonar-web/src/main/js/api/plugins.ts @@ -19,8 +19,8 @@ */ import { findLastIndex } from 'lodash'; import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post } from '../sonar-ui-common/helpers/request'; -import { isDefined } from '../sonar-ui-common/helpers/types'; +import { getJSON, post } from '../helpers/request'; +import { isDefined } from '../helpers/types'; import { AvailablePlugin, InstalledPlugin, diff --git a/server/sonar-web/src/main/js/api/projectActivity.ts b/server/sonar-web/src/main/js/api/projectActivity.ts index ae1c60fde51..4d12622b743 100644 --- a/server/sonar-web/src/main/js/api/projectActivity.ts +++ b/server/sonar-web/src/main/js/api/projectActivity.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON, RequestData } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON, RequestData } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; export function getProjectActivity( diff --git a/server/sonar-web/src/main/js/api/projectLinks.ts b/server/sonar-web/src/main/js/api/projectLinks.ts index 59db323b7cd..a77b313f144 100644 --- a/server/sonar-web/src/main/js/api/projectLinks.ts +++ b/server/sonar-web/src/main/js/api/projectLinks.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; export function getProjectLinks(projectKey: string): Promise { return getJSON('/api/project_links/search', { projectKey }).then(r => r.links, throwGlobalError); diff --git a/server/sonar-web/src/main/js/api/quality-gates.ts b/server/sonar-web/src/main/js/api/quality-gates.ts index 09d54d0d3b1..9c33f6b60e0 100644 --- a/server/sonar-web/src/main/js/api/quality-gates.ts +++ b/server/sonar-web/src/main/js/api/quality-gates.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; import { QualityGateApplicationStatus, QualityGateProjectStatus } from '../types/quality-gates'; diff --git a/server/sonar-web/src/main/js/api/quality-profiles.ts b/server/sonar-web/src/main/js/api/quality-profiles.ts index 008aab45ba8..551eb65e5c6 100644 --- a/server/sonar-web/src/main/js/api/quality-profiles.ts +++ b/server/sonar-web/src/main/js/api/quality-profiles.ts @@ -20,8 +20,8 @@ import { map } from 'lodash'; import throwGlobalError from '../app/utils/throwGlobalError'; import { Exporter, ProfileChangelogEvent } from '../apps/quality-profiles/types'; -import { csvEscape } from '../sonar-ui-common/helpers/csv'; -import { getJSON, post, postJSON, RequestData } from '../sonar-ui-common/helpers/request'; +import { csvEscape } from '../helpers/csv'; +import { getJSON, post, postJSON, RequestData } from '../helpers/request'; export interface ProfileActions { associateProjects?: boolean; diff --git a/server/sonar-web/src/main/js/api/rules.ts b/server/sonar-web/src/main/js/api/rules.ts index 4fd9b34b2e1..f5b966fc2eb 100644 --- a/server/sonar-web/src/main/js/api/rules.ts +++ b/server/sonar-web/src/main/js/api/rules.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; import { GetRulesAppResponse, SearchRulesResponse } from '../types/coding-rules'; export function getRulesApp(): Promise { diff --git a/server/sonar-web/src/main/js/api/security-hotspots.ts b/server/sonar-web/src/main/js/api/security-hotspots.ts index de4135d802f..ed6094e24f0 100644 --- a/server/sonar-web/src/main/js/api/security-hotspots.ts +++ b/server/sonar-web/src/main/js/api/security-hotspots.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post } from '../sonar-ui-common/helpers/request'; +import { getJSON, post } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; import { Hotspot, diff --git a/server/sonar-web/src/main/js/api/settings.ts b/server/sonar-web/src/main/js/api/settings.ts index a4ca10a5fc7..f4069b816ae 100644 --- a/server/sonar-web/src/main/js/api/settings.ts +++ b/server/sonar-web/src/main/js/api/settings.ts @@ -20,7 +20,7 @@ import { omitBy } from 'lodash'; import throwGlobalError from '../app/utils/throwGlobalError'; import { isCategoryDefinition } from '../apps/settings/utils'; -import { getJSON, post, postJSON, RequestData } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON, RequestData } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; import { SettingCategoryDefinition, SettingDefinition, SettingValue } from '../types/settings'; diff --git a/server/sonar-web/src/main/js/api/static.ts b/server/sonar-web/src/main/js/api/static.ts index 8377e101d58..26c2b958c37 100644 --- a/server/sonar-web/src/main/js/api/static.ts +++ b/server/sonar-web/src/main/js/api/static.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { checkStatus, request } from '../sonar-ui-common/helpers/request'; +import { checkStatus, request } from '../helpers/request'; export function getPluginStaticFileContent(pluginKey: string, staticFilePath: string) { return request(`/static/${pluginKey}/${staticFilePath}`) diff --git a/server/sonar-web/src/main/js/api/system.ts b/server/sonar-web/src/main/js/api/system.ts index fad5ff026dd..9adf55ea9dc 100644 --- a/server/sonar-web/src/main/js/api/system.ts +++ b/server/sonar-web/src/main/js/api/system.ts @@ -18,12 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { - getJSON, - post, - postJSON, - requestTryAndRepeatUntil -} from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON, requestTryAndRepeatUntil } from '../helpers/request'; import { SystemUpgrade } from '../types/system'; export function setLogLevel(level: string): Promise { diff --git a/server/sonar-web/src/main/js/api/time-machine.ts b/server/sonar-web/src/main/js/api/time-machine.ts index 0128a2e7e41..5ea6da6053f 100644 --- a/server/sonar-web/src/main/js/api/time-machine.ts +++ b/server/sonar-web/src/main/js/api/time-machine.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; import { BranchParameters } from '../types/branch-like'; interface TimeMachineResponse { diff --git a/server/sonar-web/src/main/js/api/user-tokens.ts b/server/sonar-web/src/main/js/api/user-tokens.ts index 76dec9b30c3..da711f55914 100644 --- a/server/sonar-web/src/main/js/api/user-tokens.ts +++ b/server/sonar-web/src/main/js/api/user-tokens.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; /** List tokens for given user login */ export function getTokens(login: string): Promise { diff --git a/server/sonar-web/src/main/js/api/user_groups.ts b/server/sonar-web/src/main/js/api/user_groups.ts index ea9326c6790..bbb8e95a5f8 100644 --- a/server/sonar-web/src/main/js/api/user_groups.ts +++ b/server/sonar-web/src/main/js/api/user_groups.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; export function searchUsersGroups(data: { f?: string; diff --git a/server/sonar-web/src/main/js/api/users.ts b/server/sonar-web/src/main/js/api/users.ts index a405707aaf9..9d8282ba5be 100644 --- a/server/sonar-web/src/main/js/api/users.ts +++ b/server/sonar-web/src/main/js/api/users.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; export function getCurrentUser(): Promise { return getJSON('/api/users/current'); diff --git a/server/sonar-web/src/main/js/api/web-api.ts b/server/sonar-web/src/main/js/api/web-api.ts index d55049e0cd4..c5bd4d8a535 100644 --- a/server/sonar-web/src/main/js/api/web-api.ts +++ b/server/sonar-web/src/main/js/api/web-api.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON } from '../helpers/request'; interface RawDomain { actions: T.WebApi.Action[]; diff --git a/server/sonar-web/src/main/js/api/webhooks.ts b/server/sonar-web/src/main/js/api/webhooks.ts index 8b000a8b2a5..0cb8b283a77 100644 --- a/server/sonar-web/src/main/js/api/webhooks.ts +++ b/server/sonar-web/src/main/js/api/webhooks.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import throwGlobalError from '../app/utils/throwGlobalError'; -import { getJSON, post, postJSON } from '../sonar-ui-common/helpers/request'; +import { getJSON, post, postJSON } from '../helpers/request'; export function createWebhook(data: { name: string; diff --git a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx index 4b30e7d04e5..655061e58ec 100644 --- a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx @@ -24,7 +24,7 @@ import { getSettingsNavigation } from '../../api/nav'; import { getPendingPlugins } from '../../api/plugins'; import { getSystemStatus, waitSystemUPStatus } from '../../api/system'; import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import { setAdminPages } from '../../store/appState'; import { getAppState, Store } from '../../store/rootReducer'; import { PendingPluginResult } from '../../types/plugins'; diff --git a/server/sonar-web/src/main/js/app/components/App.tsx b/server/sonar-web/src/main/js/app/components/App.tsx index 72aee72bc8f..adb046e0cc0 100644 --- a/server/sonar-web/src/main/js/app/components/App.tsx +++ b/server/sonar-web/src/main/js/app/components/App.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; import { fetchLanguages } from '../../store/rootActions'; import { getGlobalSettingValue, Store } from '../../store/rootReducer'; import KeyboardShortcutsModal from './KeyboardShortcutsModal'; diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index 604223f76f3..8453c7b8a62 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -33,8 +33,8 @@ import { isMainBranch, isPullRequest } from '../../helpers/branch-like'; +import { HttpStatus } from '../../helpers/request'; import { getPortfolioUrl } from '../../helpers/urls'; -import { HttpStatus } from '../../sonar-ui-common/helpers/request'; import { registerBranchStatus, requireAuthorization } from '../../store/rootActions'; import { ProjectAlmBindingConfigurationErrors, diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx index 797ba2121f3..0d2382b5034 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { Link } from 'react-router'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; export default function ComponentContainerNotFound() { return ( diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx index 54fdcb8cadd..12bf494a218 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { Link } from 'react-router'; import InstanceMessage from '../../components/common/InstanceMessage'; +import { Alert } from '../../components/ui/Alert'; import { getEdition } from '../../helpers/editions'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { EditionKey } from '../../types/editions'; import GlobalFooterBranding from './GlobalFooterBranding'; diff --git a/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx b/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx index 151b4bbbb88..37468141bb8 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { connect } from 'react-redux'; -import GlobalMessages from '../../sonar-ui-common/components/controls/GlobalMessages'; +import GlobalMessages from '../../components/controls/GlobalMessages'; import { closeGlobalMessage } from '../../store/globalMessages'; import { getGlobalMessages, Store } from '../../store/rootReducer'; diff --git a/server/sonar-web/src/main/js/app/components/KeyboardShortcutsModal.tsx b/server/sonar-web/src/main/js/app/components/KeyboardShortcutsModal.tsx index e09d096e57c..fe3025a71cd 100644 --- a/server/sonar-web/src/main/js/app/components/KeyboardShortcutsModal.tsx +++ b/server/sonar-web/src/main/js/app/components/KeyboardShortcutsModal.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import Modal from '../../components/controls/Modal'; +import { translate } from '../../helpers/l10n'; type Shortcuts = Array<{ category: string; diff --git a/server/sonar-web/src/main/js/app/components/NotFound.tsx b/server/sonar-web/src/main/js/app/components/NotFound.tsx index 12d0de6313b..810ede90f94 100644 --- a/server/sonar-web/src/main/js/app/components/NotFound.tsx +++ b/server/sonar-web/src/main/js/app/components/NotFound.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { Link } from 'react-router'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import SimpleContainer from './SimpleContainer'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/PluginRiskConsent.tsx b/server/sonar-web/src/main/js/app/components/PluginRiskConsent.tsx index 16ba03f36b4..fa61f086bbe 100644 --- a/server/sonar-web/src/main/js/app/components/PluginRiskConsent.tsx +++ b/server/sonar-web/src/main/js/app/components/PluginRiskConsent.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { setSimpleSettingValue } from '../../api/settings'; +import { Button } from '../../components/controls/buttons'; import { whenLoggedIn } from '../../components/hoc/whenLoggedIn'; import { Router, withRouter } from '../../components/hoc/withRouter'; +import { translate } from '../../helpers/l10n'; import { hasGlobalPermission } from '../../helpers/users'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import { Permissions } from '../../types/permissions'; import { RiskConsent } from '../../types/plugins'; import { SettingsKey } from '../../types/settings'; diff --git a/server/sonar-web/src/main/js/app/components/RecentHistory.ts b/server/sonar-web/src/main/js/app/components/RecentHistory.ts index 57f4b178105..ca2026544bd 100644 --- a/server/sonar-web/src/main/js/app/components/RecentHistory.ts +++ b/server/sonar-web/src/main/js/app/components/RecentHistory.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { get, remove, save } from '../../sonar-ui-common/helpers/storage'; +import { get, remove, save } from '../../helpers/storage'; const RECENT_HISTORY = 'sonar_recent_history'; const HISTORY_LIMIT = 10; diff --git a/server/sonar-web/src/main/js/app/components/ResetPassword.tsx b/server/sonar-web/src/main/js/app/components/ResetPassword.tsx index 759d8fbc644..2ae0a133426 100644 --- a/server/sonar-web/src/main/js/app/components/ResetPassword.tsx +++ b/server/sonar-web/src/main/js/app/components/ResetPassword.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import ResetPasswordForm from '../../components/common/ResetPasswordForm'; import { whenLoggedIn } from '../../components/hoc/whenLoggedIn'; +import { translate } from '../../helpers/l10n'; import { getBaseUrl } from '../../helpers/system'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import GlobalMessagesContainer from './GlobalMessagesContainer'; export interface ResetPasswordProps { diff --git a/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx b/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx index 00fa60d8ce7..9249a6c77ba 100644 --- a/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import NavBar from '../../sonar-ui-common/components/ui/NavBar'; +import NavBar from '../../components/ui/NavBar'; import { rawSizes } from '../theme'; import GlobalFooterContainer from './GlobalFooterContainer'; diff --git a/server/sonar-web/src/main/js/app/components/SimpleSessionsContainer.tsx b/server/sonar-web/src/main/js/app/components/SimpleSessionsContainer.tsx index 87891b13902..ea587d39212 100644 --- a/server/sonar-web/src/main/js/app/components/SimpleSessionsContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/SimpleSessionsContainer.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; import GlobalFooterContainer from './GlobalFooterContainer'; const PageTracker = lazyLoadComponent(() => import('./PageTracker')); diff --git a/server/sonar-web/src/main/js/app/components/StartupModal.tsx b/server/sonar-web/src/main/js/app/components/StartupModal.tsx index 4d7355d347d..c11ac083e29 100644 --- a/server/sonar-web/src/main/js/app/components/StartupModal.tsx +++ b/server/sonar-web/src/main/js/app/components/StartupModal.tsx @@ -22,11 +22,11 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { showLicense } from '../../api/marketplace'; import { Location, Router, withRouter } from '../../components/hoc/withRouter'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; +import { parseDate, toShortNotSoISOString } from '../../helpers/dates'; +import { hasMessage } from '../../helpers/l10n'; +import { get, save } from '../../helpers/storage'; import { isLoggedIn } from '../../helpers/users'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; -import { parseDate, toShortNotSoISOString } from '../../sonar-ui-common/helpers/dates'; -import { hasMessage } from '../../sonar-ui-common/helpers/l10n'; -import { get, save } from '../../sonar-ui-common/helpers/storage'; import { getAppState, getCurrentUser, Store } from '../../store/rootReducer'; import { EditionKey } from '../../types/editions'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx index 9cb60b143a0..4b94887e4f4 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx @@ -28,7 +28,7 @@ import { mockProjectAlmBindingConfigurationErrors } from '../../../helpers/mocks import { mockBranch, mockMainBranch, mockPullRequest } from '../../../helpers/mocks/branch-like'; import { mockTask } from '../../../helpers/mocks/tasks'; import { mockAppState, mockComponent, mockLocation, mockRouter } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { AlmKeys } from '../../../types/alm-settings'; import { ComponentQualifier } from '../../../types/component'; import { TaskStatuses } from '../../../types/tasks'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx index 13ebabbc7bc..3313ba1c0c4 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import Modal from '../../../components/controls/Modal'; import { mockEvent } from '../../../helpers/testMocks'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; import KeyboardShortcutsModal from '../KeyboardShortcutsModal'; let handle: void | (() => void); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx index 2a0ecde261c..03b69bb4578 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx @@ -20,8 +20,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { setSimpleSettingValue } from '../../../api/settings'; +import { Button } from '../../../components/controls/buttons'; import { mockLoggedInUser, mockRouter } from '../../../helpers/testMocks'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; import { PluginRiskConsent, PluginRiskConsentProps } from '../PluginRiskConsent'; jest.mock('../../../api/settings', () => ({ diff --git a/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx index 636aaccf7a6..cefe2bc1565 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { get, remove, save } from '../../../sonar-ui-common/helpers/storage'; +import { get, remove, save } from '../../../helpers/storage'; import RecentHistory, { History } from '../RecentHistory'; -jest.mock('../../../sonar-ui-common/helpers/storage', () => ({ +jest.mock('../../../helpers/storage', () => ({ get: jest.fn(), remove: jest.fn(), save: jest.fn() diff --git a/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx index 54c24c5eddb..e527440c46b 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx @@ -21,10 +21,10 @@ import * as differenceInDays from 'date-fns/difference_in_days'; import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; import { showLicense } from '../../../api/marketplace'; -import { toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { hasMessage } from '../../../sonar-ui-common/helpers/l10n'; -import { get, save } from '../../../sonar-ui-common/helpers/storage'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { toShortNotSoISOString } from '../../../helpers/dates'; +import { hasMessage } from '../../../helpers/l10n'; +import { get, save } from '../../../helpers/storage'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { EditionKey } from '../../../types/editions'; import { StartupModal } from '../StartupModal'; @@ -32,16 +32,16 @@ jest.mock('../../../api/marketplace', () => ({ showLicense: jest.fn().mockResolvedValue(undefined) })); -jest.mock('../../../sonar-ui-common/helpers/storage', () => ({ +jest.mock('../../../helpers/storage', () => ({ get: jest.fn(), save: jest.fn() })); -jest.mock('../../../sonar-ui-common/helpers/l10n', () => ({ +jest.mock('../../../helpers/l10n', () => ({ hasMessage: jest.fn().mockReturnValue(true) })); -jest.mock('../../../sonar-ui-common/helpers/dates', () => ({ +jest.mock('../../../helpers/dates', () => ({ parseDate: jest.fn().mockReturnValue('parsed-date'), toShortNotSoISOString: jest.fn().mockReturnValue('short-not-iso-date') })); diff --git a/server/sonar-web/src/main/js/app/components/a11y/A11ySkipTarget.tsx b/server/sonar-web/src/main/js/app/components/a11y/A11ySkipTarget.tsx index 7a459d0c863..59775b7e133 100644 --- a/server/sonar-web/src/main/js/app/components/a11y/A11ySkipTarget.tsx +++ b/server/sonar-web/src/main/js/app/components/a11y/A11ySkipTarget.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { A11yContext } from './A11yContext'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11yProvider-test.tsx b/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11yProvider-test.tsx index c3e3c139ac0..286c744b883 100644 --- a/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11yProvider-test.tsx +++ b/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11yProvider-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { A11yContextShape } from '../A11yContext'; import A11yProvider from '../A11yProvider'; diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx index f653b2eb91d..41d40dac55e 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { SuggestionsContext } from './SuggestionsContext'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx index 1b82118c952..b92ca5f00f9 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import HelpIcon from '../../../sonar-ui-common/components/icons/HelpIcon'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import HelpIcon from '../../../components/icons/HelpIcon'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; +import { translate } from '../../../helpers/l10n'; const EmbedDocsPopup = lazyLoadComponent(() => import('./EmbedDocsPopup')); diff --git a/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx b/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx index dd484df68e3..df39090fe02 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx @@ -19,16 +19,13 @@ */ import * as React from 'react'; import { createApplication } from '../../../api/application'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Radio from '../../../components/controls/Radio'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; import { ComponentQualifier, Visibility } from '../../../types/component'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx b/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx index 259e9b828f9..bf72c7e3e49 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx @@ -23,9 +23,8 @@ import { InjectedIntlProps, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { Location, Router, withRouter } from '../../../components/hoc/withRouter'; import { getExtensionStart } from '../../../helpers/extensions'; -import { getCurrentL10nBundle } from '../../../helpers/l10n'; +import { getCurrentL10nBundle, translate } from '../../../helpers/l10n'; import { getBaseUrl } from '../../../helpers/system'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { addGlobalErrorMessage } from '../../../store/globalMessages'; import { getCurrentUser, Store } from '../../../store/rootReducer'; import { ExtensionStartMethod } from '../../../types/extension'; diff --git a/server/sonar-web/src/main/js/app/components/extensions/__tests__/CreateApplicationForm-test.tsx b/server/sonar-web/src/main/js/app/components/extensions/__tests__/CreateApplicationForm-test.tsx index a44b8c61af6..c3710b42081 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/__tests__/CreateApplicationForm-test.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/__tests__/CreateApplicationForm-test.tsx @@ -20,9 +20,9 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { createApplication } from '../../../../api/application'; +import SimpleModal from '../../../../components/controls/SimpleModal'; import { mockEvent } from '../../../../helpers/testMocks'; -import SimpleModal from '../../../../sonar-ui-common/components/controls/SimpleModal'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { ComponentQualifier, Visibility } from '../../../../types/component'; import CreateApplicationForm from '../CreateApplicationForm'; diff --git a/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx b/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx index a5d652e4b27..efa1c487d63 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx @@ -21,7 +21,7 @@ import { mount } from 'enzyme'; import * as React from 'react'; import { getExtensionStart } from '../../../../helpers/extensions'; import { mockCurrentUser, mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { Extension } from '../Extension'; jest.mock('../../../../helpers/extensions', () => ({ diff --git a/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts b/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts index 173e0687dc6..cdbf12adf21 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts +++ b/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts @@ -19,17 +19,77 @@ */ import { FormattedMessage } from 'react-intl'; import NotFound from '../../../app/components/NotFound'; +import ActionsDropdown, { ActionsDropdownItem } from '../../../components/controls/ActionsDropdown'; +import BoxedTabs from '../../../components/controls/BoxedTabs'; +import { + Button, + EditButton, + ResetButtonLink, + SubmitButton +} from '../../../components/controls/buttons'; +import Checkbox from '../../../components/controls/Checkbox'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; +import Dropdown from '../../../components/controls/Dropdown'; import Favorite from '../../../components/controls/Favorite'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import HomePageSelect from '../../../components/controls/HomePageSelect'; +import ListFooter from '../../../components/controls/ListFooter'; +import Modal from '../../../components/controls/Modal'; +import Radio from '../../../components/controls/Radio'; +import RadioToggle from '../../../components/controls/RadioToggle'; +import ReloadButton from '../../../components/controls/ReloadButton'; +import SearchBox from '../../../components/controls/SearchBox'; +import SearchSelect from '../../../components/controls/SearchSelect'; +import Select from '../../../components/controls/Select'; +import SelectList, { SelectListFilter } from '../../../components/controls/SelectList'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import Tooltip from '../../../components/controls/Tooltip'; +import AlertErrorIcon from '../../../components/icons/AlertErrorIcon'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import AlertWarnIcon from '../../../components/icons/AlertWarnIcon'; +import BranchIcon from '../../../components/icons/BranchIcon'; import BranchLikeIcon from '../../../components/icons/BranchLikeIcon'; +import CheckIcon from '../../../components/icons/CheckIcon'; +import ClearIcon from '../../../components/icons/ClearIcon'; +import DetachIcon from '../../../components/icons/DetachIcon'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import HelpIcon from '../../../components/icons/HelpIcon'; +import LockIcon from '../../../components/icons/LockIcon'; +import PlusCircleIcon from '../../../components/icons/PlusCircleIcon'; +import PullRequestIcon from '../../../components/icons/PullRequestIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import SecurityHotspotIcon from '../../../components/icons/SecurityHotspotIcon'; +import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon'; +import DateFormatter from '../../../components/intl/DateFormatter'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; +import { Alert } from '../../../components/ui/Alert'; import CoverageRating from '../../../components/ui/CoverageRating'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import DuplicationsRating from '../../../components/ui/DuplicationsRating'; +import Level from '../../../components/ui/Level'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import Rating from '../../../components/ui/Rating'; import { getBranchLikeQuery, isBranch, isMainBranch, isPullRequest } from '../../../helpers/branch-like'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import * as measures from '../../../helpers/measures'; +import { + get, + getJSON, + getText, + omitNil, + parseError, + post, + postJSON, + postJSONBody, + request +} from '../../../helpers/request'; import { getStandards, renderCWECategory, @@ -42,71 +102,6 @@ import { getComponentSecurityHotspotsUrl, getRulesUrl } from '../../../helpers/urls'; -import ActionsDropdown, { - ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import BoxedTabs from '../../../sonar-ui-common/components/controls/BoxedTabs'; -import { - Button, - EditButton, - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import RadioToggle from '../../../sonar-ui-common/components/controls/RadioToggle'; -import ReloadButton from '../../../sonar-ui-common/components/controls/ReloadButton'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import SearchSelect from '../../../sonar-ui-common/components/controls/SearchSelect'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import SelectList, { - SelectListFilter -} from '../../../sonar-ui-common/components/controls/SelectList'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import AlertErrorIcon from '../../../sonar-ui-common/components/icons/AlertErrorIcon'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import AlertWarnIcon from '../../../sonar-ui-common/components/icons/AlertWarnIcon'; -import BranchIcon from '../../../sonar-ui-common/components/icons/BranchIcon'; -import CheckIcon from '../../../sonar-ui-common/components/icons/CheckIcon'; -import ClearIcon from '../../../sonar-ui-common/components/icons/ClearIcon'; -import DetachIcon from '../../../sonar-ui-common/components/icons/DetachIcon'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import HelpIcon from '../../../sonar-ui-common/components/icons/HelpIcon'; -import LockIcon from '../../../sonar-ui-common/components/icons/LockIcon'; -import PlusCircleIcon from '../../../sonar-ui-common/components/icons/PlusCircleIcon'; -import PullRequestIcon from '../../../sonar-ui-common/components/icons/PullRequestIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import SecurityHotspotIcon from '../../../sonar-ui-common/components/icons/SecurityHotspotIcon'; -import VulnerabilityIcon from '../../../sonar-ui-common/components/icons/VulnerabilityIcon'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import DuplicationsRating from '../../../sonar-ui-common/components/ui/DuplicationsRating'; -import Level from '../../../sonar-ui-common/components/ui/Level'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import Rating from '../../../sonar-ui-common/components/ui/Rating'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; -import { - get, - getJSON, - getText, - omitNil, - parseError, - post, - postJSON, - postJSONBody, - request -} from '../../../sonar-ui-common/helpers/request'; import addGlobalSuccessMessage from '../../utils/addGlobalSuccessMessage'; import throwGlobalError from '../../utils/throwGlobalError'; import A11ySkipTarget from '../a11y/A11ySkipTarget'; @@ -162,7 +157,7 @@ const exposeLibraries = () => { get: () => { // eslint-disable-next-line no-console console.warn('SonarMeasures usages are deprecated since SonarQube 8.7'); - return { ...measures, formatMeasure }; + return { ...measures }; } }); diff --git a/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationHelper.ts b/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationHelper.ts index 0514b7dcdf2..2fad17bcbb7 100644 --- a/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationHelper.ts +++ b/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationHelper.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { getIndexationStatus } from '../../../api/ce'; -import { get, remove, save } from '../../../sonar-ui-common/helpers/storage'; +import { get, remove, save } from '../../../helpers/storage'; import { IndexationStatus } from '../../../types/indexation'; const POLLING_INTERVAL_MS = 5000; diff --git a/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx b/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx index 2e6c7ff2abf..e7fd3e3c189 100644 --- a/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx +++ b/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { Alert, AlertProps } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert, AlertProps } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { IndexationNotificationType } from '../../../types/indexation'; import { TaskStatuses, TaskTypes } from '../../../types/tasks'; diff --git a/server/sonar-web/src/main/js/app/components/indexation/PageUnavailableDueToIndexation.tsx b/server/sonar-web/src/main/js/app/components/indexation/PageUnavailableDueToIndexation.tsx index ff868c7972d..5c43f41c660 100644 --- a/server/sonar-web/src/main/js/app/components/indexation/PageUnavailableDueToIndexation.tsx +++ b/server/sonar-web/src/main/js/app/components/indexation/PageUnavailableDueToIndexation.tsx @@ -22,8 +22,8 @@ import { FormattedMessage } from 'react-intl'; import withIndexationContext, { WithIndexationContextProps } from '../../../components/hoc/withIndexationContext'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; interface Props extends WithIndexationContextProps { pageContext?: PageContext; diff --git a/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx b/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx index b3170c43fab..82e53f3c821 100644 --- a/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx +++ b/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { getIndexationStatus } from '../../../../api/ce'; -import { get, remove, save } from '../../../../sonar-ui-common/helpers/storage'; +import { get, remove, save } from '../../../../helpers/storage'; import { IndexationStatus } from '../../../../types/indexation'; import IndexationNotificationHelper from '../IndexationNotificationHelper'; @@ -31,7 +31,7 @@ jest.mock('../../../../api/ce', () => ({ getIndexationStatus: jest.fn() })); -jest.mock('../../../../sonar-ui-common/helpers/storage', () => ({ +jest.mock('../../../../helpers/storage', () => ({ get: jest.fn(), remove: jest.fn(), save: jest.fn() diff --git a/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx b/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx index 1ac43095f55..37a77838362 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx @@ -20,9 +20,9 @@ import { last } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; +import QualifierIcon from '../../../../components/icons/QualifierIcon'; import { isMainBranch } from '../../../../helpers/branch-like'; import { getComponentOverviewUrl } from '../../../../helpers/urls'; -import QualifierIcon from '../../../../sonar-ui-common/components/icons/QualifierIcon'; import { BranchLike } from '../../../../types/branch-like'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx index 401c5ade6cf..a17b0b003cd 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import ContextNavBar from '../../../../sonar-ui-common/components/ui/ContextNavBar'; +import ContextNavBar from '../../../../components/ui/ContextNavBar'; import { ProjectAlmBindingConfigurationErrors, ProjectAlmBindingResponse diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx index 78928515063..a802c839259 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx @@ -22,9 +22,9 @@ import { FormattedMessage } from 'react-intl'; import { Link, WithRouterProps } from 'react-router'; import { STATUSES } from '../../../../apps/background-tasks/constants'; import { withRouter } from '../../../../components/hoc/withRouter'; +import { Alert } from '../../../../components/ui/Alert'; +import { hasMessage, translate } from '../../../../helpers/l10n'; import { getComponentBackgroundTaskUrl } from '../../../../helpers/urls'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { hasMessage, translate } from '../../../../sonar-ui-common/helpers/l10n'; import { Task, TaskStatuses } from '../../../../types/tasks'; import ComponentNavLicenseNotif from './ComponentNavLicenseNotif'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx index d2360840b55..28a8a51a725 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import { Link } from 'react-router'; import { isValidLicense } from '../../../../api/marketplace'; import { withAppState } from '../../../../components/hoc/withAppState'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { ComponentQualifier } from '../../../../types/component'; import { Task } from '../../../../types/tasks'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx index ba27c987edb..5ceeb6675e9 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx @@ -21,9 +21,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../../../apps/settings/components/AdditionalCategoryKeys'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import { getProjectSettingsUrl } from '../../../../helpers/urls'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; export interface ComponentNavProjectBindingErrorNotifProps { component: T.Component; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavWarnings.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavWarnings.tsx index 1e5929bcad3..f267db006dc 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavWarnings.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavWarnings.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { lazyLoadComponent } from '../../../../sonar-ui-common/components/lazyLoadComponent'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { lazyLoadComponent } from '../../../../components/lazyLoadComponent'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import { TaskWarning } from '../../../../types/tasks'; const AnalysisWarningsModal = lazyLoadComponent( diff --git a/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx b/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx index e5e4b138acf..3a7f2a4c454 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx @@ -21,11 +21,11 @@ import * as React from 'react'; import { connect } from 'react-redux'; import BranchStatus from '../../../../components/common/BranchStatus'; import HomePageSelect from '../../../../components/controls/HomePageSelect'; +import DetachIcon from '../../../../components/icons/DetachIcon'; +import DateTimeFormatter from '../../../../components/intl/DateTimeFormatter'; import { isBranch, isPullRequest } from '../../../../helpers/branch-like'; +import { translate } from '../../../../helpers/l10n'; import { isLoggedIn } from '../../../../helpers/users'; -import DetachIcon from '../../../../sonar-ui-common/components/icons/DetachIcon'; -import DateTimeFormatter from '../../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; import { getCurrentUser, Store } from '../../../../store/rootReducer'; import { BranchLike } from '../../../../types/branch-like'; import { ComponentQualifier } from '../../../../types/component'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx index 7df410dd26e..903fc7d885b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx @@ -20,15 +20,15 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link, LinkProps } from 'react-router'; +import Dropdown from '../../../../components/controls/Dropdown'; +import Tooltip from '../../../../components/controls/Tooltip'; import { withAppState } from '../../../../components/hoc/withAppState'; +import BulletListIcon from '../../../../components/icons/BulletListIcon'; +import DropdownIcon from '../../../../components/icons/DropdownIcon'; +import NavBarTabs from '../../../../components/ui/NavBarTabs'; import { getBranchLikeQuery, isPullRequest } from '../../../../helpers/branch-like'; +import { hasMessage, translate } from '../../../../helpers/l10n'; import { getPortfolioUrl, getProjectQueryUrl } from '../../../../helpers/urls'; -import Dropdown from '../../../../sonar-ui-common/components/controls/Dropdown'; -import Tooltip from '../../../../sonar-ui-common/components/controls/Tooltip'; -import BulletListIcon from '../../../../sonar-ui-common/components/icons/BulletListIcon'; -import DropdownIcon from '../../../../sonar-ui-common/components/icons/DropdownIcon'; -import NavBarTabs from '../../../../sonar-ui-common/components/ui/NavBarTabs'; -import { hasMessage, translate } from '../../../../sonar-ui-common/helpers/l10n'; import { BranchLike, BranchParameters } from '../../../../types/branch-like'; import { ComponentQualifier, isPortfolioLike } from '../../../../types/component'; import './Menu.css'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBgTaskNotif-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBgTaskNotif-test.tsx index cd069c5bc32..9c2ffae48bf 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBgTaskNotif-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBgTaskNotif-test.tsx @@ -20,15 +20,15 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { Alert } from '../../../../../components/ui/Alert'; +import { hasMessage } from '../../../../../helpers/l10n'; import { mockTask } from '../../../../../helpers/mocks/tasks'; import { mockComponent, mockLocation } from '../../../../../helpers/testMocks'; -import { Alert } from '../../../../../sonar-ui-common/components/ui/Alert'; -import { hasMessage } from '../../../../../sonar-ui-common/helpers/l10n'; import { Task, TaskStatuses, TaskTypes } from '../../../../../types/tasks'; import { ComponentNavBgTaskNotif } from '../ComponentNavBgTaskNotif'; -jest.mock('../../../../../sonar-ui-common/helpers/l10n', () => ({ - ...jest.requireActual('../../../../../sonar-ui-common/helpers/l10n'), +jest.mock('../../../../../helpers/l10n', () => ({ + ...jest.requireActual('../../../../../helpers/l10n'), hasMessage: jest.fn().mockReturnValue(true) })); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavLicenseNotif-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavLicenseNotif-test.tsx index dc63ca704a4..5a1439a4250 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavLicenseNotif-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavLicenseNotif-test.tsx @@ -21,12 +21,12 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { isValidLicense } from '../../../../../api/marketplace'; import { mockTask } from '../../../../../helpers/mocks/tasks'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { TaskStatuses } from '../../../../../types/tasks'; import { ComponentNavLicenseNotif } from '../ComponentNavLicenseNotif'; -jest.mock('../../../../../sonar-ui-common/helpers/l10n', () => ({ - ...jest.requireActual('../../../../../sonar-ui-common/helpers/l10n'), +jest.mock('../../../../../helpers/l10n', () => ({ + ...jest.requireActual('../../../../../helpers/l10n'), hasMessage: jest.fn().mockReturnValue(true) })); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx index c05cc8f8524..1f017226c57 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import Toggler from '../../../../../components/controls/Toggler'; import { withAppState } from '../../../../../components/hoc/withAppState'; -import Toggler from '../../../../../sonar-ui-common/components/controls/Toggler'; import { ProjectAlmBindingResponse } from '../../../../../types/alm-settings'; import { BranchLike } from '../../../../../types/branch-like'; import './BranchLikeNavigation.css'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx index 8add2010e16..8d8b3b7d837 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx @@ -20,13 +20,13 @@ import * as React from 'react'; import { Link } from 'react-router'; import DocumentationTooltip from '../../../../../components/common/DocumentationTooltip'; +import HelpTooltip from '../../../../../components/controls/HelpTooltip'; import BranchLikeIcon from '../../../../../components/icons/BranchLikeIcon'; +import DropdownIcon from '../../../../../components/icons/DropdownIcon'; +import PlusCircleIcon from '../../../../../components/icons/PlusCircleIcon'; import { getBranchLikeDisplayName } from '../../../../../helpers/branch-like'; +import { translate, translateWithParameters } from '../../../../../helpers/l10n'; import { getApplicationAdminUrl } from '../../../../../helpers/urls'; -import HelpTooltip from '../../../../../sonar-ui-common/components/controls/HelpTooltip'; -import DropdownIcon from '../../../../../sonar-ui-common/components/icons/DropdownIcon'; -import PlusCircleIcon from '../../../../../sonar-ui-common/components/icons/PlusCircleIcon'; -import { translate, translateWithParameters } from '../../../../../sonar-ui-common/helpers/l10n'; import { AlmKeys, ProjectAlmBindingResponse } from '../../../../../types/alm-settings'; import { BranchLike } from '../../../../../types/branch-like'; import { ComponentQualifier } from '../../../../../types/component'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLikeMergeInformation.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLikeMergeInformation.tsx index d4d4bbd58f6..96b5420edc0 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLikeMergeInformation.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLikeMergeInformation.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { isPullRequest } from '../../../../../helpers/branch-like'; -import { translate } from '../../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../../helpers/l10n'; import { BranchLike } from '../../../../../types/branch-like'; export interface CurrentBranchLikeMergeInformationProps { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx index b659a7d7dd8..eb2e08e8395 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx @@ -19,6 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import { DropdownOverlay } from '../../../../../components/controls/Dropdown'; +import SearchBox from '../../../../../components/controls/SearchBox'; import { Router, withRouter } from '../../../../../components/hoc/withRouter'; import { getBrancheLikesAsTree, @@ -26,11 +28,9 @@ import { isPullRequest, isSameBranchLike } from '../../../../../helpers/branch-like'; +import { KeyCodes } from '../../../../../helpers/keycodes'; +import { translate } from '../../../../../helpers/l10n'; import { getBranchLikeUrl } from '../../../../../helpers/urls'; -import { DropdownOverlay } from '../../../../../sonar-ui-common/components/controls/Dropdown'; -import SearchBox from '../../../../../sonar-ui-common/components/controls/SearchBox'; -import { KeyCodes } from '../../../../../sonar-ui-common/helpers/keycodes'; -import { translate } from '../../../../../sonar-ui-common/helpers/l10n'; import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like'; import { ComponentQualifier } from '../../../../../types/component'; import MenuItemList from './MenuItemList'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx index 0081d6e2107..7cc0592d4d5 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import BranchStatus from '../../../../../components/common/BranchStatus'; import BranchLikeIcon from '../../../../../components/icons/BranchLikeIcon'; import { getBranchLikeDisplayName, isMainBranch } from '../../../../../helpers/branch-like'; -import { translate } from '../../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../../helpers/l10n'; import { BranchLike } from '../../../../../types/branch-like'; export interface MenuItemProps { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx index 2cfeef45c33..cddc6aba4d8 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import HelpTooltip from '../../../../../components/controls/HelpTooltip'; import { getBranchLikeKey, isSameBranchLike } from '../../../../../helpers/branch-like'; -import HelpTooltip from '../../../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../../../sonar-ui-common/helpers/l10n'; -import { scrollToElement } from '../../../../../sonar-ui-common/helpers/scrolling'; -import { isDefined } from '../../../../../sonar-ui-common/helpers/types'; +import { translate } from '../../../../../helpers/l10n'; +import { scrollToElement } from '../../../../../helpers/scrolling'; +import { isDefined } from '../../../../../helpers/types'; import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like'; import MenuItem from './MenuItem'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/BranchLikeNavigation-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/BranchLikeNavigation-test.tsx index 0872ef3f49c..7f2f4b407e2 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/BranchLikeNavigation-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/BranchLikeNavigation-test.tsx @@ -19,10 +19,10 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import Toggler from '../../../../../../components/controls/Toggler'; import { mockSetOfBranchAndPullRequest } from '../../../../../../helpers/mocks/branch-like'; import { mockAppState, mockComponent } from '../../../../../../helpers/testMocks'; -import Toggler from '../../../../../../sonar-ui-common/components/controls/Toggler'; -import { click } from '../../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../../helpers/testUtils'; import { BranchLikeNavigation, BranchLikeNavigationProps } from '../BranchLikeNavigation'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/Menu-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/Menu-test.tsx index 5415fdfcf7a..a6268c83505 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/Menu-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/Menu-test.tsx @@ -20,14 +20,14 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { Link } from 'react-router'; +import SearchBox from '../../../../../../components/controls/SearchBox'; +import { KeyCodes } from '../../../../../../helpers/keycodes'; import { mockPullRequest, mockSetOfBranchAndPullRequest } from '../../../../../../helpers/mocks/branch-like'; import { mockComponent, mockRouter } from '../../../../../../helpers/testMocks'; -import SearchBox from '../../../../../../sonar-ui-common/components/controls/SearchBox'; -import { KeyCodes } from '../../../../../../sonar-ui-common/helpers/keycodes'; -import { click, mockEvent } from '../../../../../../sonar-ui-common/helpers/testUtils'; +import { click, mockEvent } from '../../../../../../helpers/testUtils'; import { Menu } from '../Menu'; import { MenuItemList } from '../MenuItemList'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/MenuItem-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/MenuItem-test.tsx index 28162225144..fb41672dbed 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/MenuItem-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/__tests__/MenuItem-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockMainBranch, mockPullRequest } from '../../../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../../../helpers/testMocks'; -import { click } from '../../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../../helpers/testUtils'; import { MenuItem, MenuItemProps } from '../MenuItem'; it('should render a main branch correctly', () => { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx index 058c16891a3..8652f40f275 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ChevronRightIcon from '../../../../../sonar-ui-common/components/icons/ChevronRightIcon'; +import ChevronRightIcon from '../../../../../components/icons/ChevronRightIcon'; export interface DrawerLinkProps

{ label: string; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx index af20df002ea..4369bc93b7b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx @@ -19,9 +19,9 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { ClearButton } from '../../../../../sonar-ui-common/components/controls/buttons'; -import EscKeydownHandler from '../../../../../sonar-ui-common/components/controls/EscKeydownHandler'; -import OutsideClickHandler from '../../../../../sonar-ui-common/components/controls/OutsideClickHandler'; +import { ClearButton } from '../../../../../components/controls/buttons'; +import EscKeydownHandler from '../../../../../components/controls/EscKeydownHandler'; +import OutsideClickHandler from '../../../../../components/controls/OutsideClickHandler'; import './InfoDrawer.css'; export interface InfoDrawerProps { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx index 30056b53285..5ecb1970b25 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import BackIcon from '../../../../../sonar-ui-common/components/icons/BackIcon'; -import { translate } from '../../../../../sonar-ui-common/helpers/l10n'; +import BackIcon from '../../../../../components/icons/BackIcon'; +import { translate } from '../../../../../helpers/l10n'; export interface InfoDrawerPageProps { children: React.ReactNode; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx index 106ca606cad..f322b691ee4 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import PrivacyBadgeContainer from '../../../../../components/common/PrivacyBadgeContainer'; -import { translate } from '../../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../../helpers/l10n'; import { ComponentQualifier } from '../../../../../types/component'; import DrawerLink from './DrawerLink'; import MetaKey from './meta/MetaKey'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformation-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformation-test.tsx index e9a3a5dc9b3..b6d8ff63be3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformation-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformation-test.tsx @@ -25,7 +25,7 @@ import { mockLoggedInUser, mockMetric } from '../../../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../../helpers/testUtils'; import { ProjectInformation } from '../ProjectInformation'; import { ProjectInformationPages } from '../ProjectInformationPages'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeButton.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeButton.tsx index 646eaa2d093..9bdf960e4aa 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeButton.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeButton.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { Button } from '../../../../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../../../../components/controls/buttons'; +import { translate } from '../../../../../../helpers/l10n'; import { BadgeType } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx index 59fefdbee99..f6406e91ea3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { fetchWebApi } from '../../../../../../api/web-api'; -import Select from '../../../../../../sonar-ui-common/components/controls/Select'; -import { getLocalizedMetricName, translate } from '../../../../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../../../../components/controls/Select'; +import { getLocalizedMetricName, translate } from '../../../../../../helpers/l10n'; import { BadgeColors, BadgeFormats, BadgeOptions, BadgeType } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx index 531d52cdfc6..f57119b9512 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import CodeSnippet from '../../../../../../components/common/CodeSnippet'; import { getBranchLikeQuery } from '../../../../../../helpers/branch-like'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../../../helpers/l10n'; import { BranchLike } from '../../../../../../types/branch-like'; import { MetricKey } from '../../../../../../types/metrics'; import BadgeButton from './BadgeButton'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeButton-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeButton-test.tsx index adf7877a87b..221e8c9dbd2 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeButton-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeButton-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../../../helpers/testUtils'; import BadgeButton from '../BadgeButton'; import { BadgeType } from '../utils'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/ProjectBadges-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/ProjectBadges-test.tsx index fb000f69621..4f1c3680392 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/ProjectBadges-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/ProjectBadges-test.tsx @@ -21,16 +21,13 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockBranch } from '../../../../../../../helpers/mocks/branch-like'; import { mockMetric } from '../../../../../../../helpers/testMocks'; -import { Location } from '../../../../../../../sonar-ui-common/helpers/urls'; +import { Location } from '../../../../../../../helpers/urls'; import { MetricKey } from '../../../../../../../types/metrics'; import ProjectBadges from '../ProjectBadges'; -jest.mock('../../../../../../../sonar-ui-common/helpers/urls', () => ({ - getHostUrl: () => 'host', - getPathUrlAsString: (l: Location) => l.pathname -})); - jest.mock('../../../../../../../helpers/urls', () => ({ + getHostUrl: () => 'host', + getPathUrlAsString: (l: Location) => l.pathname, getProjectUrl: () => ({ pathname: '/dashboard' } as Location) })); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/utils-test.ts b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/utils-test.ts index 9d6174facb4..263fb541de5 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/utils-test.ts @@ -17,11 +17,11 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { Location } from '../../../../../../../sonar-ui-common/helpers/urls'; +import { Location } from '../../../../../../../helpers/urls'; import { BadgeOptions, BadgeType, getBadgeSnippet, getBadgeUrl } from '../utils'; -jest.mock('../../../../../../../sonar-ui-common/helpers/urls', () => ({ - ...jest.requireActual('../../../../../../../sonar-ui-common/helpers/urls'), +jest.mock('../../../../../../../helpers/urls', () => ({ + ...jest.requireActual('../../../../../../../helpers/urls'), getHostUrl: () => 'host', getPathUrlAsString: (o: Location) => `host${o.pathname}?id=${o.query ? o.query.id : ''}&branch=${o.query ? o.query.branch : ''}` diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/utils.ts b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/utils.ts index 48266ab6df6..cb455dff6f1 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/utils.ts +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/utils.ts @@ -18,10 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { stringify } from 'querystring'; -import { getProjectUrl } from '../../../../../../helpers/urls'; -import { getLocalizedMetricName } from '../../../../../../sonar-ui-common/helpers/l10n'; -import { omitNil } from '../../../../../../sonar-ui-common/helpers/request'; -import { getHostUrl, getPathUrlAsString } from '../../../../../../sonar-ui-common/helpers/urls'; +import { getLocalizedMetricName } from '../../../../../../helpers/l10n'; +import { omitNil } from '../../../../../../helpers/request'; +import { getHostUrl, getPathUrlAsString, getProjectUrl } from '../../../../../../helpers/urls'; export type BadgeColors = 'white' | 'black' | 'orange'; export type BadgeFormats = 'md' | 'url'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaKey.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaKey.tsx index bfff750221c..32095324b20 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaKey.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaKey.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClipboardButton } from '../../../../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; +import { ClipboardButton } from '../../../../../../components/controls/clipboard'; +import { translate } from '../../../../../../helpers/l10n'; interface Props { componentKey: string; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx index d0b487b56ef..a8856725e8d 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { ClearButton } from '../../../../../../components/controls/buttons'; +import ProjectLinkIcon from '../../../../../../components/icons/ProjectLinkIcon'; import { getLinkName } from '../../../../../../helpers/projectLinks'; -import { ClearButton } from '../../../../../../sonar-ui-common/components/controls/buttons'; -import ProjectLinkIcon from '../../../../../../sonar-ui-common/components/icons/ProjectLinkIcon'; import isValidUri from '../../../../../utils/isValidUri'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx index c3a2366b538..0c6915d8dc1 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { getProjectLinks } from '../../../../../../api/projectLinks'; +import { translate } from '../../../../../../helpers/l10n'; import { orderLinks } from '../../../../../../helpers/projectLinks'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; import MetaLink from './MetaLink'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityGate.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityGate.tsx index 4e4fcba9894..f49859022ea 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityGate.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityGate.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import { translate } from '../../../../../../helpers/l10n'; import { getQualityGateUrl } from '../../../../../../helpers/urls'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; interface Props { qualityGate: { isDefault?: boolean; key: string; name: string }; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx index 25e44404e5c..fdbcfeb82fd 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx @@ -21,9 +21,9 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router'; import { searchRules } from '../../../../../../api/rules'; +import Tooltip from '../../../../../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../../../../../helpers/l10n'; import { getQualityProfileUrl } from '../../../../../../helpers/urls'; -import Tooltip from '../../../../../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../../../../sonar-ui-common/helpers/l10n'; import { getLanguages, Store } from '../../../../../../store/rootReducer'; interface StateProps { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx index 9475410037e..eb48b01b034 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import DrilldownLink from '../../../../../../components/shared/DrilldownLink'; -import SizeRating from '../../../../../../sonar-ui-common/components/ui/SizeRating'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure, localizeMetric } from '../../../../../../sonar-ui-common/helpers/measures'; +import SizeRating from '../../../../../../components/ui/SizeRating'; +import { translate } from '../../../../../../helpers/l10n'; +import { formatMeasure, localizeMetric } from '../../../../../../helpers/measures'; import { ComponentQualifier } from '../../../../../../types/component'; import { MetricKey } from '../../../../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx index 436e556e50a..5cd57a46e5b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { setApplicationTags, setProjectTags } from '../../../../../../api/components'; +import { ButtonLink } from '../../../../../../components/controls/buttons'; +import Dropdown from '../../../../../../components/controls/Dropdown'; import TagsList from '../../../../../../components/tags/TagsList'; -import { ButtonLink } from '../../../../../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../../../../../sonar-ui-common/components/controls/Dropdown'; -import { PopupPlacement } from '../../../../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; +import { PopupPlacement } from '../../../../../../components/ui/popups'; +import { translate } from '../../../../../../helpers/l10n'; import { ComponentQualifier } from '../../../../../../types/component'; import MetaTagsSelector from './MetaTagsSelector'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaLink-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaLink-test.tsx index 40cd393b23c..5b4a2933512 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaLink-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaLink-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { ClearButton } from '../../../../../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../../../../../sonar-ui-common/helpers/testUtils'; +import { ClearButton } from '../../../../../../../components/controls/buttons'; +import { click } from '../../../../../../../helpers/testUtils'; import MetaLink from '../MetaLink'; const DANGEROUS_LINK = { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx index 6ee4e139a51..79e9aff85da 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { searchRules } from '../../../../../../../api/rules'; import { mockLanguage, mockQualityProfile } from '../../../../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../../../helpers/testUtils'; import { MetaQualityProfiles } from '../MetaQualityProfiles'; jest.mock('../../../../../../../api/rules', () => { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx index d3ac66106ea..835b0bf5255 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx @@ -23,9 +23,9 @@ import { withNotifications, WithNotificationsProps } from '../../../../../../components/hoc/withNotifications'; -import { Alert } from '../../../../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../../../../components/ui/Alert'; +import DeferredSpinner from '../../../../../../components/ui/DeferredSpinner'; +import { translate } from '../../../../../../helpers/l10n'; interface Props { component: T.Component; diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx index 4d749f8d175..fb04e40f614 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; -import NavBar from '../../../../sonar-ui-common/components/ui/NavBar'; +import NavBar from '../../../../components/ui/NavBar'; import { getAppState, getCurrentUser, Store } from '../../../../store/rootReducer'; import { rawSizes } from '../../../theme'; import EmbedDocsPopupHelper from '../../embed-docs-modal/EmbedDocsPopupHelper'; diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.tsx index f6fc31230ee..1bd360c6a73 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../../helpers/l10n'; +import { getBaseUrl } from '../../../../helpers/urls'; import { getGlobalSettingValue, Store } from '../../../../store/rootReducer'; interface StateProps { diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx index 5c5ba5c5ebc..7ce047bc85a 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx @@ -21,10 +21,10 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link } from 'react-router'; import { isMySet } from '../../../../apps/issues/utils'; +import Dropdown from '../../../../components/controls/Dropdown'; +import DropdownIcon from '../../../../components/icons/DropdownIcon'; +import { translate } from '../../../../helpers/l10n'; import { getQualityGatesUrl } from '../../../../helpers/urls'; -import Dropdown from '../../../../sonar-ui-common/components/controls/Dropdown'; -import DropdownIcon from '../../../../sonar-ui-common/components/icons/DropdownIcon'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; import { ComponentQualifier } from '../../../../types/component'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx index 9620ba45a55..95a148fb1ee 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx @@ -19,12 +19,12 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import Dropdown from '../../../../components/controls/Dropdown'; import { Router, withRouter } from '../../../../components/hoc/withRouter'; import Avatar from '../../../../components/ui/Avatar'; +import { translate } from '../../../../helpers/l10n'; +import { getBaseUrl } from '../../../../helpers/urls'; import { isLoggedIn } from '../../../../helpers/users'; -import Dropdown from '../../../../sonar-ui-common/components/controls/Dropdown'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../../sonar-ui-common/helpers/urls'; import { rawSizes } from '../../../theme'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNav-test.tsx b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNav-test.tsx index 9804c9db9a7..b12247eeb24 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNav-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNav-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { GlobalNav, GlobalNavProps } from '../GlobalNav'; // Solve redux warning issue "No reducer provided for key": diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx index 80164dce4a3..664f80ee8e1 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx @@ -22,9 +22,9 @@ import { FormattedMessage } from 'react-intl'; import { cancelPendingPlugins } from '../../../../api/plugins'; import InstanceMessage from '../../../../components/common/InstanceMessage'; import RestartButton from '../../../../components/common/RestartButton'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../../components/controls/buttons'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import { PendingPluginResult } from '../../../../types/plugins'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx index 332a5d90ad2..0712fd67280 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx @@ -20,12 +20,12 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { IndexLink, Link } from 'react-router'; -import Dropdown from '../../../../sonar-ui-common/components/controls/Dropdown'; -import DropdownIcon from '../../../../sonar-ui-common/components/icons/DropdownIcon'; -import ContextNavBar from '../../../../sonar-ui-common/components/ui/ContextNavBar'; -import NavBarTabs from '../../../../sonar-ui-common/components/ui/NavBarTabs'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../../sonar-ui-common/helpers/urls'; +import Dropdown from '../../../../components/controls/Dropdown'; +import DropdownIcon from '../../../../components/icons/DropdownIcon'; +import ContextNavBar from '../../../../components/ui/ContextNavBar'; +import NavBarTabs from '../../../../components/ui/NavBarTabs'; +import { translate } from '../../../../helpers/l10n'; +import { getBaseUrl } from '../../../../helpers/urls'; import { AdminPageExtension } from '../../../../types/extension'; import { PendingPluginResult } from '../../../../types/plugins'; import { rawSizes } from '../../../theme'; diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SystemRestartNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/SystemRestartNotif.tsx index 00c4c0eb2fc..6a15b1bd9a5 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SystemRestartNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SystemRestartNotif.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import { getInstance } from '../../../../helpers/system'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; export default function SystemRestartNotif() { return ( diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/PendingPluginsActionNotif-test.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/PendingPluginsActionNotif-test.tsx index a2067e576e0..13b89b464d0 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/PendingPluginsActionNotif-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/PendingPluginsActionNotif-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../helpers/testUtils'; import PendingPluginsActionNotif from '../PendingPluginsActionNotif'; jest.mock('../../../../../api/plugins', () => ({ diff --git a/server/sonar-web/src/main/js/app/components/search/Search.tsx b/server/sonar-web/src/main/js/app/components/search/Search.tsx index f4b97fed26b..2804d3b0518 100644 --- a/server/sonar-web/src/main/js/app/components/search/Search.tsx +++ b/server/sonar-web/src/main/js/app/components/search/Search.tsx @@ -23,15 +23,15 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { withRouter, WithRouterProps } from 'react-router'; import { getSuggestions } from '../../../api/components'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import OutsideClickHandler from '../../../components/controls/OutsideClickHandler'; +import SearchBox from '../../../components/controls/SearchBox'; +import ClockIcon from '../../../components/icons/ClockIcon'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { scrollToElement } from '../../../helpers/scrolling'; import { getComponentOverviewUrl } from '../../../helpers/urls'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import OutsideClickHandler from '../../../sonar-ui-common/components/controls/OutsideClickHandler'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import ClockIcon from '../../../sonar-ui-common/components/icons/ClockIcon'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; import { ComponentQualifier } from '../../../types/component'; import RecentHistory from '../RecentHistory'; import './Search.css'; diff --git a/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx b/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx index bdec79fe411..373dc60c173 100644 --- a/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx +++ b/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import { Link } from 'react-router'; import { ComponentQualifier } from '../../../../js/types/component'; +import Tooltip from '../../../components/controls/Tooltip'; +import ClockIcon from '../../../components/icons/ClockIcon'; +import FavoriteIcon from '../../../components/icons/FavoriteIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { getComponentOverviewUrl } from '../../../helpers/urls'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import ClockIcon from '../../../sonar-ui-common/components/icons/ClockIcon'; -import FavoriteIcon from '../../../sonar-ui-common/components/icons/FavoriteIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; import { ComponentResult } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx b/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx index 6e5d82118a1..5b4d162e8d6 100644 --- a/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx +++ b/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import SearchShowMore from './SearchShowMore'; import { ComponentResult, More, Results, sortQualifiers } from './utils'; diff --git a/server/sonar-web/src/main/js/app/components/search/SearchShowMore.tsx b/server/sonar-web/src/main/js/app/components/search/SearchShowMore.tsx index e73846ebeb5..b1840372b12 100644 --- a/server/sonar-web/src/main/js/app/components/search/SearchShowMore.tsx +++ b/server/sonar-web/src/main/js/app/components/search/SearchShowMore.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; interface Props { allowMore: boolean; diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx b/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx index f786a336c16..d7ab82e39d1 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx @@ -20,7 +20,7 @@ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; import { mockRouter } from '../../../../helpers/testMocks'; -import { elementKeydown } from '../../../../sonar-ui-common/helpers/testUtils'; +import { elementKeydown } from '../../../../helpers/testUtils'; import { ComponentQualifier } from '../../../../types/component'; import { Search } from '../Search'; diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/SearchShowMore-test.tsx b/server/sonar-web/src/main/js/app/components/search/__tests__/SearchShowMore-test.tsx index db64602bebf..c8551171eb2 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/SearchShowMore-test.tsx +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/SearchShowMore-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import SearchShowMore from '../SearchShowMore'; it('should render', () => { diff --git a/server/sonar-web/src/main/js/app/index.ts b/server/sonar-web/src/main/js/app/index.ts index 7cc56e88bfa..cd7c28a8d01 100644 --- a/server/sonar-web/src/main/js/app/index.ts +++ b/server/sonar-web/src/main/js/app/index.ts @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { installExtensionsHandler, installWebAnalyticsHandler } from '../helpers/extensionsHandler'; +import SonarUiCommonInitializer from '../helpers/init'; import { loadL10nBundle } from '../helpers/l10n'; +import { parseJSON, request } from '../helpers/request'; import { getBaseUrl, getSystemStatus } from '../helpers/system'; -import SonarUiCommonInitializer from '../sonar-ui-common/helpers/init'; -import { parseJSON, request } from '../sonar-ui-common/helpers/request'; import './styles/sonar.css'; SonarUiCommonInitializer.setUrlContext(getBaseUrl()); diff --git a/server/sonar-web/src/main/js/app/utils/handleRequiredAuthorization.ts b/server/sonar-web/src/main/js/app/utils/handleRequiredAuthorization.ts index 8f827f27129..612af27086c 100644 --- a/server/sonar-web/src/main/js/app/utils/handleRequiredAuthorization.ts +++ b/server/sonar-web/src/main/js/app/utils/handleRequiredAuthorization.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import getHistory from '../../sonar-ui-common/helpers/getHistory'; +import getHistory from '../../helpers/getHistory'; import { requireAuthorization } from '../../store/appState'; import getStore from './getStore'; diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx index 7edda98c752..cad20bda7b1 100644 --- a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx +++ b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx @@ -61,9 +61,9 @@ import usersRoutes from '../../apps/users/routes'; import webAPIRoutes from '../../apps/web-api/routes'; import webhooksRoutes from '../../apps/webhooks/routes'; import withIndexationGuard from '../../components/hoc/withIndexationGuard'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; -import { ThemeProvider } from '../../sonar-ui-common/components/theme'; -import getHistory from '../../sonar-ui-common/helpers/getHistory'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; +import { ThemeProvider } from '../../components/theme'; +import getHistory from '../../helpers/getHistory'; import App from '../components/App'; import GlobalContainer from '../components/GlobalContainer'; import { PageContext } from '../components/indexation/PageUnavailableDueToIndexation'; diff --git a/server/sonar-web/src/main/js/app/utils/throwGlobalError.ts b/server/sonar-web/src/main/js/app/utils/throwGlobalError.ts index 811062e45a2..e0faf715a79 100644 --- a/server/sonar-web/src/main/js/app/utils/throwGlobalError.ts +++ b/server/sonar-web/src/main/js/app/utils/throwGlobalError.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { parseError } from '../../sonar-ui-common/helpers/request'; +import { parseError } from '../../helpers/request'; import { addGlobalErrorMessage } from '../../store/globalMessages'; import getStore from './getStore'; diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx index 869aecc4e12..56096b2673d 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx @@ -28,9 +28,9 @@ import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import withIndexationContext, { WithIndexationContextProps } from '../../../components/hoc/withIndexationContext'; +import { translate } from '../../../helpers/l10n'; +import { addWhitePageClass, removeWhitePageClass } from '../../../helpers/pages'; import { sanitizeString } from '../../../helpers/sanitize'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { addWhitePageClass, removeWhitePageClass } from '../../../sonar-ui-common/helpers/pages'; import { getAppState, getCurrentUser, diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx index ab8ece04b32..06c3895fda8 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import ReadMore from './ReadMore'; const link = '/documentation/user-guide/issues/'; diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx index 7ae2dd95bc8..dec68ff5227 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; const languages = [ { name: 'Java', url: 'https://redirect.sonarsource.com/plugins/java.html' }, diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx index 3a3ec8f27e0..5866a83a6db 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import ReadMore from './ReadMore'; const link = '/documentation/user-guide/clean-as-you-code/'; diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx index d071cfe88fc..c9d745e20f1 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; interface Props { count: number; diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx index a491da67517..f97c42ab4b0 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import ReadMore from './ReadMore'; const link = '/documentation/user-guide/quality-gates/'; diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx index f80bf8ee117..d2a97c43087 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BugIcon from '../../../sonar-ui-common/components/icons/BugIcon'; -import CodeSmellIcon from '../../../sonar-ui-common/components/icons/CodeSmellIcon'; -import SecurityHotspotIcon from '../../../sonar-ui-common/components/icons/SecurityHotspotIcon'; -import VulnerabilityIcon from '../../../sonar-ui-common/components/icons/VulnerabilityIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import BugIcon from '../../../components/icons/BugIcon'; +import CodeSmellIcon from '../../../components/icons/CodeSmellIcon'; +import SecurityHotspotIcon from '../../../components/icons/SecurityHotspotIcon'; +import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon'; +import { translate } from '../../../helpers/l10n'; export default function AboutQualityModel() { return ( diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx index a9db3de495e..bcbd9f92f57 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; const scanners = [ { diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx index b39e7230cf8..b756bdbf0d4 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import TagsIcon from '../../../components/icons/TagsIcon'; +import { translate } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import TagsIcon from '../../../sonar-ui-common/components/icons/TagsIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import ReadMore from './ReadMore'; const link = '/documentation/user-guide/rules/'; diff --git a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx index a7db1eb714d..7f3e3f06d03 100644 --- a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx @@ -19,12 +19,12 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import BugIcon from '../../../components/icons/BugIcon'; +import CodeSmellIcon from '../../../components/icons/CodeSmellIcon'; +import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getIssuesUrl } from '../../../helpers/urls'; -import BugIcon from '../../../sonar-ui-common/components/icons/BugIcon'; -import CodeSmellIcon from '../../../sonar-ui-common/components/icons/CodeSmellIcon'; -import VulnerabilityIcon from '../../../sonar-ui-common/components/icons/VulnerabilityIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; export interface EntryIssueTypesProps { bugs?: number; diff --git a/server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx b/server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx index e5cc42affa0..9cd05e74d7c 100644 --- a/server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { link: string; diff --git a/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx b/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx index d9949372460..56da775ca17 100644 --- a/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx @@ -21,13 +21,13 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { searchProjects } from '../../../../api/components'; import { getFacet } from '../../../../api/issues'; +import { addWhitePageClass, removeWhitePageClass } from '../../../../helpers/pages'; import { mockCurrentUser, mockLocation } from '../../../../helpers/testMocks'; -import { addWhitePageClass, removeWhitePageClass } from '../../../../sonar-ui-common/helpers/pages'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { AboutApp } from '../AboutApp'; import EntryIssueTypes from '../EntryIssueTypes'; -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addWhitePageClass: jest.fn(), removeWhitePageClass: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/about/routes.ts b/server/sonar-web/src/main/js/apps/about/routes.ts index 1efdc06f832..78799c787b0 100644 --- a/server/sonar-web/src/main/js/apps/about/routes.ts +++ b/server/sonar-web/src/main/js/apps/about/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { indexRoute: { component: lazyLoadComponent(() => import('./components/AboutApp')) } } diff --git a/server/sonar-web/src/main/js/apps/account/components/Account.tsx b/server/sonar-web/src/main/js/apps/account/components/Account.tsx index e4022fa52ba..2a8bd25fc0a 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Account.tsx +++ b/server/sonar-web/src/main/js/apps/account/components/Account.tsx @@ -22,8 +22,8 @@ import { Helmet } from 'react-helmet-async'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; -import handleRequiredAuthentication from '../../../sonar-ui-common/helpers/handleRequiredAuthentication'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; +import { translate } from '../../../helpers/l10n'; import '../account.css'; import Nav from './Nav'; import UserCard from './UserCard'; diff --git a/server/sonar-web/src/main/js/apps/account/components/Nav.tsx b/server/sonar-web/src/main/js/apps/account/components/Nav.tsx index 001cf6f025b..4ff6be433b1 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Nav.tsx +++ b/server/sonar-web/src/main/js/apps/account/components/Nav.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { IndexLink, Link } from 'react-router'; -import NavBarTabs from '../../../sonar-ui-common/components/ui/NavBarTabs'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import NavBarTabs from '../../../components/ui/NavBarTabs'; +import { translate } from '../../../helpers/l10n'; export default function Nav() { return ( diff --git a/server/sonar-web/src/main/js/apps/account/components/Security.tsx b/server/sonar-web/src/main/js/apps/account/components/Security.tsx index 8f06d4150f5..18a387913d0 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Security.tsx +++ b/server/sonar-web/src/main/js/apps/account/components/Security.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import ResetPasswordForm from '../../../components/common/ResetPasswordForm'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getCurrentUser, Store } from '../../../store/rootReducer'; import Tokens from './Tokens'; diff --git a/server/sonar-web/src/main/js/apps/account/components/Tokens.tsx b/server/sonar-web/src/main/js/apps/account/components/Tokens.tsx index 24132821d10..d195ce5e735 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Tokens.tsx +++ b/server/sonar-web/src/main/js/apps/account/components/Tokens.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import InstanceMessage from '../../../components/common/InstanceMessage'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import TokensForm from '../../users/components/TokensForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/account/components/__tests__/Account-test.tsx b/server/sonar-web/src/main/js/apps/account/components/__tests__/Account-test.tsx index 600e95053fa..fc0a840742a 100644 --- a/server/sonar-web/src/main/js/apps/account/components/__tests__/Account-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/components/__tests__/Account-test.tsx @@ -19,11 +19,11 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import handleRequiredAuthentication from '../../../../helpers/handleRequiredAuthentication'; import { mockCurrentUser } from '../../../../helpers/testMocks'; -import handleRequiredAuthentication from '../../../../sonar-ui-common/helpers/handleRequiredAuthentication'; import { Account } from '../Account'; -jest.mock('../../../../sonar-ui-common/helpers/handleRequiredAuthentication', () => ({ +jest.mock('../../../../helpers/handleRequiredAuthentication', () => ({ default: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.tsx b/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.tsx index 6f1dec2f624..22258c60a21 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { translate } from '../../../helpers/l10n'; import { isSonarCloud } from '../../../helpers/system'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import NotificationsList from './NotificationsList'; import SonarCloudNotifications from './SonarCloudNotifications'; diff --git a/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx b/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx index 88983c7c261..1e689e48a75 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx @@ -24,9 +24,9 @@ import { withNotifications, WithNotificationsProps } from '../../../components/hoc/withNotifications'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import GlobalNotifications from './GlobalNotifications'; import Projects from './Projects'; diff --git a/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.tsx b/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.tsx index cd91caeb8aa..1dce17fd8b7 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import { hasMessage, translate } from '../../../sonar-ui-common/helpers/l10n'; +import Checkbox from '../../../components/controls/Checkbox'; +import { hasMessage, translate } from '../../../helpers/l10n'; interface Props { onAdd: (n: T.Notification) => void; diff --git a/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx b/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx index f917be101ea..e8d335fc3f9 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx @@ -21,14 +21,11 @@ import * as classNames from 'classnames'; import { debounce } from 'lodash'; import * as React from 'react'; import { getSuggestions } from '../../../api/components'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import SearchBox from '../../../components/controls/SearchBox'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import { translate } from '../../../helpers/l10n'; interface Props { addedProjects: T.NotificationProject[]; diff --git a/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.tsx b/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.tsx index 688a6555f5b..3e749bda992 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BoxedGroupAccordion from '../../../sonar-ui-common/components/controls/BoxedGroupAccordion'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import BoxedGroupAccordion from '../../../components/controls/BoxedGroupAccordion'; +import { translate } from '../../../helpers/l10n'; import NotificationsList from './NotificationsList'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx b/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx index 91317b068e9..cd3e69acd19 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx @@ -19,9 +19,9 @@ */ import { groupBy, sortBy, uniqBy } from 'lodash'; import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import SearchBox from '../../../components/controls/SearchBox'; +import { translate } from '../../../helpers/l10n'; import ProjectModal from './ProjectModal'; import ProjectNotifications from './ProjectNotifications'; diff --git a/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx b/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx index bf1b4f084b5..d74356148e9 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Checkbox from '../../../components/controls/Checkbox'; +import { translate } from '../../../helpers/l10n'; import { getCurrentUserSetting, Store } from '../../../store/rootReducer'; import { setCurrentUserSetting } from '../../../store/users'; diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/NotificationsList-test.tsx b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/NotificationsList-test.tsx index 96487394db7..aec6528793e 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/NotificationsList-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/NotificationsList-test.tsx @@ -19,12 +19,12 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import Checkbox from '../../../../sonar-ui-common/components/controls/Checkbox'; -import { hasMessage } from '../../../../sonar-ui-common/helpers/l10n'; +import Checkbox from '../../../../components/controls/Checkbox'; +import { hasMessage } from '../../../../helpers/l10n'; import NotificationsList from '../NotificationsList'; -jest.mock('../../../../sonar-ui-common/helpers/l10n', () => ({ - ...jest.requireActual('../../../../sonar-ui-common/helpers/l10n'), +jest.mock('../../../../helpers/l10n', () => ({ + ...jest.requireActual('../../../../helpers/l10n'), hasMessage: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx index b67434ebe87..e8707186222 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx @@ -20,12 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getSuggestions } from '../../../../api/components'; -import { - change, - elementKeydown, - submit, - waitAndUpdate -} from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, elementKeydown, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import ProjectModal from '../ProjectModal'; jest.mock('../../../../api/components', () => ({ diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx index 03f125ca9b1..3ca37e8ac0b 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import Projects from '../Projects'; jest.mock('../../../../api/components', () => ({ diff --git a/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx b/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx index 36427183199..7eaa6093c49 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx +++ b/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import UserExternalIdentity from './UserExternalIdentity'; export interface ProfileProps { diff --git a/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.tsx b/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.tsx index 516b2b8c04a..822785ab572 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.tsx +++ b/server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { getIdentityProviders } from '../../../api/users'; import { colors } from '../../../app/theme'; -import { getTextColor } from '../../../sonar-ui-common/helpers/colors'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { getTextColor } from '../../../helpers/colors'; +import { getBaseUrl } from '../../../helpers/urls'; export interface UserExternalIdentityProps { user: T.LoggedInUser; diff --git a/server/sonar-web/src/main/js/apps/account/profile/__tests__/UserExternalIdentity-test.tsx b/server/sonar-web/src/main/js/apps/account/profile/__tests__/UserExternalIdentity-test.tsx index 92656791ea0..c854df2b9df 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/__tests__/UserExternalIdentity-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/profile/__tests__/UserExternalIdentity-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockLoggedInUser } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import UserExternalIdentity, { UserExternalIdentityProps } from '../UserExternalIdentity'; jest.mock('../../../../api/users', () => ({ diff --git a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx index 2fda699e227..36bc2a46a6e 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx @@ -20,12 +20,12 @@ import * as React from 'react'; import { Link } from 'react-router'; import MetaLink from '../../../app/components/nav/component/projectInformation/meta/MetaLink'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import Level from '../../../components/ui/Level'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { orderLinks } from '../../../helpers/projectLinks'; import { getProjectUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import Level from '../../../sonar-ui-common/components/ui/Level'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; interface Props { project: T.MyProject; diff --git a/server/sonar-web/src/main/js/apps/account/projects/Projects.tsx b/server/sonar-web/src/main/js/apps/account/projects/Projects.tsx index e60e529188c..8ec4500ade3 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/Projects.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/Projects.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import ListFooter from '../../../components/controls/ListFooter'; +import { translate } from '../../../helpers/l10n'; import ProjectCard from './ProjectCard'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx b/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx index dd3e5d4d270..3c737a10da0 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { getMyProjects } from '../../../api/components'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Projects from './Projects'; interface State { diff --git a/server/sonar-web/src/main/js/apps/account/projects/__tests__/Projects-test.tsx b/server/sonar-web/src/main/js/apps/account/projects/__tests__/Projects-test.tsx index 246673515dc..5adabac5bc0 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/__tests__/Projects-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/__tests__/Projects-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import ListFooter from '../../../../sonar-ui-common/components/controls/ListFooter'; +import ListFooter from '../../../../components/controls/ListFooter'; import ProjectCard from '../ProjectCard'; import Projects from '../Projects'; diff --git a/server/sonar-web/src/main/js/apps/account/routes.ts b/server/sonar-web/src/main/js/apps/account/routes.ts index 6c850464b22..99771d947e8 100644 --- a/server/sonar-web/src/main/js/apps/account/routes.ts +++ b/server/sonar-web/src/main/js/apps/account/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/application-console/ApplicationBranches.tsx b/server/sonar-web/src/main/js/apps/application-console/ApplicationBranches.tsx index f447f649b1e..47b1b8c572e 100644 --- a/server/sonar-web/src/main/js/apps/application-console/ApplicationBranches.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/ApplicationBranches.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import { translate } from '../../helpers/l10n'; import { Application } from '../../types/application'; import ApplicationProjectBranch from './ApplicationProjectBranch'; import CreateBranchForm from './CreateBranchForm'; diff --git a/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleApp.tsx b/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleApp.tsx index dc908a24db6..e35bbd4b2a6 100644 --- a/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleApp.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleApp.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { InjectedRouter } from 'react-router'; import { editApplication, getApplicationDetails, refreshApplication } from '../../api/application'; import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import { Application, ApplicationProject } from '../../types/application'; import ApplicationConsoleAppRenderer from './ApplicationConsoleAppRenderer'; import { ApplicationBranch } from './utils'; diff --git a/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleAppRenderer.tsx b/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleAppRenderer.tsx index 4b3319244d8..b12ee45bd08 100644 --- a/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/ApplicationConsoleAppRenderer.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import { translate } from '../../helpers/l10n'; import { Application, ApplicationProject } from '../../types/application'; import { Branch } from '../../types/branch-like'; import ApplicationBranches from './ApplicationBranches'; diff --git a/server/sonar-web/src/main/js/apps/application-console/ApplicationProjectBranch.tsx b/server/sonar-web/src/main/js/apps/application-console/ApplicationProjectBranch.tsx index bfc6edb8c39..dc96ed3aedd 100644 --- a/server/sonar-web/src/main/js/apps/application-console/ApplicationProjectBranch.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/ApplicationProjectBranch.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BranchIcon from '../../sonar-ui-common/components/icons/BranchIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import BranchIcon from '../../components/icons/BranchIcon'; +import { translate } from '../../helpers/l10n'; import { Application } from '../../types/application'; import BranchRowActions from './BranchRowActions'; import { ApplicationBranch } from './utils'; diff --git a/server/sonar-web/src/main/js/apps/application-console/ApplicationProjects.tsx b/server/sonar-web/src/main/js/apps/application-console/ApplicationProjects.tsx index ed48c688cea..d1cf0d1a682 100644 --- a/server/sonar-web/src/main/js/apps/application-console/ApplicationProjects.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/ApplicationProjects.tsx @@ -27,8 +27,8 @@ import { import SelectList, { SelectListFilter, SelectListSearchParams -} from '../../sonar-ui-common/components/controls/SelectList'; -import QualifierIcon from '../../sonar-ui-common/components/icons/QualifierIcon'; +} from '../../components/controls/SelectList'; +import QualifierIcon from '../../components/icons/QualifierIcon'; import { Application, ApplicationProject } from '../../types/application'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/application-console/BranchRowActions.tsx b/server/sonar-web/src/main/js/apps/application-console/BranchRowActions.tsx index 884c8010db5..c62245f90e2 100644 --- a/server/sonar-web/src/main/js/apps/application-console/BranchRowActions.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/BranchRowActions.tsx @@ -20,11 +20,9 @@ import { without } from 'lodash'; import * as React from 'react'; import { deleteApplicationBranch } from '../../api/application'; -import ActionsDropdown, { - ActionsDropdownItem -} from '../../sonar-ui-common/components/controls/ActionsDropdown'; -import ConfirmButton from '../../sonar-ui-common/components/controls/ConfirmButton'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import ActionsDropdown, { ActionsDropdownItem } from '../../components/controls/ActionsDropdown'; +import ConfirmButton from '../../components/controls/ConfirmButton'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { Application } from '../../types/application'; import CreateBranchForm from './CreateBranchForm'; import { ApplicationBranch } from './utils'; diff --git a/server/sonar-web/src/main/js/apps/application-console/BranchSelectItem.tsx b/server/sonar-web/src/main/js/apps/application-console/BranchSelectItem.tsx index 0f133fe0d91..439bc4d742c 100644 --- a/server/sonar-web/src/main/js/apps/application-console/BranchSelectItem.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/BranchSelectItem.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import BranchIcon from '../../sonar-ui-common/components/icons/BranchIcon'; +import Tooltip from '../../components/controls/Tooltip'; +import BranchIcon from '../../components/icons/BranchIcon'; export interface Option { label: string; diff --git a/server/sonar-web/src/main/js/apps/application-console/CreateBranchForm.tsx b/server/sonar-web/src/main/js/apps/application-console/CreateBranchForm.tsx index 17ccbc37106..8b25d018c77 100644 --- a/server/sonar-web/src/main/js/apps/application-console/CreateBranchForm.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/CreateBranchForm.tsx @@ -24,12 +24,12 @@ import { getApplicationDetails, updateApplicationBranch } from '../../api/application'; -import { ResetButtonLink, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons'; +import SimpleModal from '../../components/controls/SimpleModal'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../helpers/l10n'; import { Application, ApplicationProject } from '../../types/application'; import ProjectBranchRow from './ProjectBranchRow'; import { ApplicationBranch, SelectBranchOption } from './utils'; diff --git a/server/sonar-web/src/main/js/apps/application-console/EditForm.tsx b/server/sonar-web/src/main/js/apps/application-console/EditForm.tsx index 6634ed80a3a..6e1cd3f2033 100644 --- a/server/sonar-web/src/main/js/apps/application-console/EditForm.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/EditForm.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ResetButtonLink, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons'; +import SimpleModal from '../../components/controls/SimpleModal'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; import { Application } from '../../types/application'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/application-console/ProjectBranchRow.tsx b/server/sonar-web/src/main/js/apps/application-console/ProjectBranchRow.tsx index 9ac6938b6f9..746b1fb7609 100644 --- a/server/sonar-web/src/main/js/apps/application-console/ProjectBranchRow.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/ProjectBranchRow.tsx @@ -20,11 +20,11 @@ import { orderBy } from 'lodash'; import * as React from 'react'; import { getBranches } from '../../api/branches'; -import Checkbox from '../../sonar-ui-common/components/controls/Checkbox'; -import Select from '../../sonar-ui-common/components/controls/Select'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import QualifierIcon from '../../sonar-ui-common/components/icons/QualifierIcon'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; +import Checkbox from '../../components/controls/Checkbox'; +import Select from '../../components/controls/Select'; +import Tooltip from '../../components/controls/Tooltip'; +import QualifierIcon from '../../components/icons/QualifierIcon'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; import { ApplicationProject } from '../../types/application'; import BranchSelectItem from './BranchSelectItem'; import { ApplicationBranch, SelectBranchOption } from './utils'; diff --git a/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleApp-test.tsx b/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleApp-test.tsx index 67ad87d2417..f0e2a1c9bfa 100644 --- a/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleApp-test.tsx @@ -27,7 +27,7 @@ import { import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage'; import { mockApplication, mockApplicationProject } from '../../../helpers/mocks/application'; import { mockLocation, mockRouter } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { Application } from '../../../types/application'; import ApplicationConsoleApp from '../ApplicationConsoleApp'; diff --git a/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleRender-test.tsx b/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleRender-test.tsx index 1e0fa1c2290..da5952a1965 100644 --- a/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleRender-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationConsoleRender-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockApplication } from '../../../helpers/mocks/application'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import ApplicationConsoleAppRenderer, { ApplicationConsoleAppRendererProps } from '../ApplicationConsoleAppRenderer'; diff --git a/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationProjects-test.tsx b/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationProjects-test.tsx index 5832ae841a5..ded53e11350 100644 --- a/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationProjects-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/__tests__/ApplicationProjects-test.tsx @@ -24,11 +24,9 @@ import { getApplicationProjects, removeProjectFromApplication } from '../../../api/application'; +import SelectList, { SelectListFilter } from '../../../components/controls/SelectList'; import { mockApplication } from '../../../helpers/mocks/application'; -import SelectList, { - SelectListFilter -} from '../../../sonar-ui-common/components/controls/SelectList'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import ApplicationProjects from '../ApplicationProjects'; jest.mock('../../../api/application', () => ({ diff --git a/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx b/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx index a2ca0af6200..383dfc1cbba 100644 --- a/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getApplicationDetails } from '../../../api/application'; import { mockApplication, mockApplicationProject } from '../../../helpers/mocks/application'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { Application } from '../../../types/application'; import CreateBranchForm from '../CreateBranchForm'; diff --git a/server/sonar-web/src/main/js/apps/application-console/__tests__/EditForm-test.tsx b/server/sonar-web/src/main/js/apps/application-console/__tests__/EditForm-test.tsx index bcf6128fd31..d2b66b36351 100644 --- a/server/sonar-web/src/main/js/apps/application-console/__tests__/EditForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/__tests__/EditForm-test.tsx @@ -20,9 +20,9 @@ import { shallow } from 'enzyme'; import * as React from 'react'; +import SimpleModal from '../../../components/controls/SimpleModal'; import { mockApplication } from '../../../helpers/mocks/application'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { change, waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { change, waitAndUpdate } from '../../../helpers/testUtils'; import EditForm from '../EditForm'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/application-console/routes.ts b/server/sonar-web/src/main/js/apps/application-console/routes.ts index 7b34efc7ca0..47601e1a1d3 100644 --- a/server/sonar-web/src/main/js/apps/application-console/routes.ts +++ b/server/sonar-web/src/main/js/apps/application-console/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/application-settings/ApplicationSettingsApp.tsx b/server/sonar-web/src/main/js/apps/application-settings/ApplicationSettingsApp.tsx index dffd53076ed..a6c6617d2da 100644 --- a/server/sonar-web/src/main/js/apps/application-settings/ApplicationSettingsApp.tsx +++ b/server/sonar-web/src/main/js/apps/application-settings/ApplicationSettingsApp.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { getDefinitions, getValues, setSimpleSettingValue } from '../../api/settings'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; import { SettingCategoryDefinition, SettingsKey } from '../../types/settings'; import ReportFrequencyForm from './ReportFrequencyForm'; diff --git a/server/sonar-web/src/main/js/apps/application-settings/ReportFrequencyForm.tsx b/server/sonar-web/src/main/js/apps/application-settings/ReportFrequencyForm.tsx index 953875aee35..b2384ab7908 100644 --- a/server/sonar-web/src/main/js/apps/application-settings/ReportFrequencyForm.tsx +++ b/server/sonar-web/src/main/js/apps/application-settings/ReportFrequencyForm.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { Button, ResetButtonLink } from '../../components/controls/buttons'; +import Select from '../../components/controls/Select'; +import { translate } from '../../helpers/l10n'; import { sanitizeStringRestricted } from '../../helpers/sanitize'; -import { Button, ResetButtonLink } from '../../sonar-ui-common/components/controls/buttons'; -import Select from '../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import { SettingCategoryDefinition } from '../../types/settings'; export interface ReportFrequencyFormProps { diff --git a/server/sonar-web/src/main/js/apps/application-settings/__tests__/ApplicationSettingsApp-test.tsx b/server/sonar-web/src/main/js/apps/application-settings/__tests__/ApplicationSettingsApp-test.tsx index 8e1bee7ec4a..08a39bee4cc 100644 --- a/server/sonar-web/src/main/js/apps/application-settings/__tests__/ApplicationSettingsApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-settings/__tests__/ApplicationSettingsApp-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { setSimpleSettingValue } from '../../../api/settings'; import { mockComponent } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { SettingsKey } from '../../../types/settings'; import ApplicationSettingsApp from '../ApplicationSettingsApp'; diff --git a/server/sonar-web/src/main/js/apps/application-settings/__tests__/ReportFrequencyForm-test.tsx b/server/sonar-web/src/main/js/apps/application-settings/__tests__/ReportFrequencyForm-test.tsx index ed43a300e8c..7d91a1bf6ec 100644 --- a/server/sonar-web/src/main/js/apps/application-settings/__tests__/ReportFrequencyForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-settings/__tests__/ReportFrequencyForm-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { Button, ResetButtonLink } from '../../../components/controls/buttons'; +import Select from '../../../components/controls/Select'; import { mockDefinition } from '../../../helpers/mocks/settings'; -import { Button, ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Select from '../../../sonar-ui-common/components/controls/Select'; import ReportFrequencyForm, { ReportFrequencyFormProps } from '../ReportFrequencyForm'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/application-settings/routes.ts b/server/sonar-web/src/main/js/apps/application-settings/routes.ts index 59093a32169..e1f12d9d8ad 100644 --- a/server/sonar-web/src/main/js/apps/application-settings/routes.ts +++ b/server/sonar-web/src/main/js/apps/application-settings/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/audit-logs/components/AuditAppRenderer.tsx b/server/sonar-web/src/main/js/apps/audit-logs/components/AuditAppRenderer.tsx index a3afed7887d..07acfb5ce0d 100644 --- a/server/sonar-web/src/main/js/apps/audit-logs/components/AuditAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/audit-logs/components/AuditAppRenderer.tsx @@ -24,8 +24,8 @@ import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import DateRangeInput from '../../../components/controls/DateRangeInput'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Radio from '../../../components/controls/Radio'; +import { translate } from '../../../helpers/l10n'; import '../style.css'; import { HousekeepingPolicy, now, RangeOption } from '../utils'; import DownloadButton from './DownloadButton'; diff --git a/server/sonar-web/src/main/js/apps/audit-logs/components/DownloadButton.tsx b/server/sonar-web/src/main/js/apps/audit-logs/components/DownloadButton.tsx index 1e53ba65439..2b9c748d033 100644 --- a/server/sonar-web/src/main/js/apps/audit-logs/components/DownloadButton.tsx +++ b/server/sonar-web/src/main/js/apps/audit-logs/components/DownloadButton.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import { endOfDay, startOfDay, subDays } from 'date-fns'; import * as React from 'react'; +import { translate } from '../../../helpers/l10n'; import { getBaseUrl } from '../../../helpers/system'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import '../style.css'; import { now, RangeOption } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/audit-logs/components/__tests__/AuditApp-test.tsx b/server/sonar-web/src/main/js/apps/audit-logs/components/__tests__/AuditApp-test.tsx index ab66c6aba24..9e5278afb70 100644 --- a/server/sonar-web/src/main/js/apps/audit-logs/components/__tests__/AuditApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/audit-logs/components/__tests__/AuditApp-test.tsx @@ -20,7 +20,7 @@ import { subDays } from 'date-fns'; import { shallow } from 'enzyme'; import * as React from 'react'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { HousekeepingPolicy, RangeOption } from '../../utils'; import { AuditApp } from '../AuditApp'; import AuditAppRenderer from '../AuditAppRenderer'; diff --git a/server/sonar-web/src/main/js/apps/audit-logs/routes.ts b/server/sonar-web/src/main/js/apps/audit-logs/routes.ts index 31b4218a283..dfcad720660 100644 --- a/server/sonar-web/src/main/js/apps/audit-logs/routes.ts +++ b/server/sonar-web/src/main/js/apps/audit-logs/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/BackgroundTasks-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/BackgroundTasks-test.tsx index 3761e939f64..5ff2b86955b 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/BackgroundTasks-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/BackgroundTasks-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import Search from '../components/Search'; import { DEFAULT_FILTERS } from '../constants'; import { formatDuration } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx index 62e893f2e71..3c77ed5c9d0 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx @@ -29,9 +29,9 @@ import { } from '../../../api/ce'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import { Location, Router } from '../../../components/hoc/withRouter'; -import { toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { parseAsDate } from '../../../sonar-ui-common/helpers/query'; +import { toShortNotSoISOString } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; +import { parseAsDate } from '../../../helpers/query'; import { Task, TaskStatuses } from '../../../types/tasks'; import '../background-tasks.css'; import { CURRENTS, DEBOUNCE_DELAY, DEFAULT_FILTERS } from '../constants'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.tsx index 84ff9609ce3..1b69dff9494 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Checkbox from '../../../components/controls/Checkbox'; +import { translate } from '../../../helpers/l10n'; import { CURRENTS } from '../constants'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Footer.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Footer.tsx index bbda3058eae..b26cf54a9e5 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Footer.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Footer.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translateWithParameters } from '../../../helpers/l10n'; import { Task } from '../../../types/tasks'; const LIMIT = 1000; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Header.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Header.tsx index ae270f0866a..d41473530dc 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Header.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Header.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Workers from './Workers'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx index 70232ce3c6e..f80bedde87e 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function NoWorkersSupportPopup() { return ( diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx index b814c439548..3464678d9e0 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { getTask } from '../../../api/ce'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Modal from '../../../components/controls/Modal'; +import { translate } from '../../../helpers/l10n'; import { Task } from '../../../types/tasks'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx index 11e49e5296e..6650004bbb1 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import SearchBox from '../../../components/controls/SearchBox'; +import { translate } from '../../../helpers/l10n'; import { DEFAULT_FILTERS } from '../constants'; import { Query } from '../utils'; import CurrentsFilter from './CurrentsFilter'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx index 7e5cbec6300..353aa69fbf3 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { getTask } from '../../../api/ce'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Modal from '../../../components/controls/Modal'; +import { translate } from '../../../helpers/l10n'; import { Task } from '../../../types/tasks'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingCount.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingCount.tsx index fd9c216871c..5b167426352 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingCount.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingCount.tsx @@ -20,10 +20,10 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { colors } from '../../../app/theme'; -import { ClearButton } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ClearButton } from '../../../components/controls/buttons'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; import { getAppState, Store } from '../../../store/rootReducer'; export interface Props { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx index 61022dbc0f2..23d0b3b3294 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; // Do not display the pending time for values smaller than this threshold (in ms) const MIN_PENDING_TIME_THRESHOLD = 1000; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx index d4c6d436345..462a7df6879 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { translate } from '../../../helpers/l10n'; export interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx index 6d66537cbe2..3559243ffab 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { translate } from '../../../helpers/l10n'; import { TaskStatuses } from '../../../types/tasks'; import { STATUSES } from '../constants'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx index 4e243a1ef63..68f020ae66f 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx @@ -18,12 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ActionsDropdown, { - ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import ConfirmModal from '../../../sonar-ui-common/components/controls/ConfirmModal'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import ActionsDropdown, { ActionsDropdownItem } from '../../../components/controls/ActionsDropdown'; +import ConfirmModal from '../../../components/controls/ConfirmModal'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Task, TaskStatuses } from '../../../types/tasks'; import ScannerContext from './ScannerContext'; import Stacktrace from './Stacktrace'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx index d61a048b5c3..c5400768707 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx @@ -19,15 +19,15 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import BranchIcon from '../../../components/icons/BranchIcon'; +import PullRequestIcon from '../../../components/icons/PullRequestIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { getBranchUrl, getPortfolioUrl, getProjectUrl, getPullRequestUrl } from '../../../helpers/urls'; -import BranchIcon from '../../../sonar-ui-common/components/icons/BranchIcon'; -import PullRequestIcon from '../../../sonar-ui-common/components/icons/PullRequestIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; import { isPortfolioLike } from '../../../types/component'; import { Task } from '../../../types/tasks'; import TaskType from './TaskType'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.tsx index e717e76ddd3..146f2bbc3ed 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.tsx @@ -19,8 +19,8 @@ */ import * as differenceInDays from 'date-fns/difference_in_days'; import * as React from 'react'; -import TimeFormatter from '../../../sonar-ui-common/components/intl/TimeFormatter'; -import { isValidDate, parseDate } from '../../../sonar-ui-common/helpers/dates'; +import TimeFormatter from '../../../components/intl/TimeFormatter'; +import { isValidDate, parseDate } from '../../../helpers/dates'; interface Props { date?: string; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.tsx index ce2573709e0..805c7e108be 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDay.tsx @@ -19,8 +19,8 @@ */ import * as isSameDay from 'date-fns/is_same_day'; import * as React from 'react'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import DateFormatter from '../../../components/intl/DateFormatter'; +import { parseDate } from '../../../helpers/dates'; interface Props { submittedAt: string; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.tsx index bcf1a205df1..362bba11185 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import PendingIcon from '../../../sonar-ui-common/components/icons/PendingIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import PendingIcon from '../../../components/icons/PendingIcon'; +import { translate } from '../../../helpers/l10n'; import { TaskStatuses } from '../../../types/tasks'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskSubmitter.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskSubmitter.tsx index e0037630169..07703f34966 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskSubmitter.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskSubmitter.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { submitter?: string; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx index 2c0cc058a04..2d0e2a759c9 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { type: string; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.tsx index 19a08461d49..bc9d0898b4a 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Task as ITask } from '../../../types/tasks'; import Task from './Task'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx index e810c07b6f2..26f83abbfbf 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { translate } from '../../../helpers/l10n'; import { ALL_TYPES } from '../constants'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx index 030bf9de172..a9c5029025c 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx @@ -20,12 +20,12 @@ import * as React from 'react'; import { getWorkers } from '../../../api/ce'; import { colors } from '../../../app/theme'; -import { EditButton } from '../../../sonar-ui-common/components/controls/buttons'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import AlertWarnIcon from '../../../sonar-ui-common/components/icons/AlertWarnIcon'; -import PlusCircleIcon from '../../../sonar-ui-common/components/icons/PlusCircleIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { EditButton } from '../../../components/controls/buttons'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import Tooltip from '../../../components/controls/Tooltip'; +import AlertWarnIcon from '../../../components/icons/AlertWarnIcon'; +import PlusCircleIcon from '../../../components/icons/PlusCircleIcon'; +import { translate } from '../../../helpers/l10n'; import NoWorkersSupportPopup from './NoWorkersSupportPopup'; import WorkersForm from './WorkersForm'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx index 4a59103ab7a..0264513dd33 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx @@ -19,14 +19,11 @@ */ import * as React from 'react'; import { setWorkerCount } from '../../../api/ce'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import Select from '../../../components/controls/Select'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; const MAX_WORKERS = 10; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/BackgroundTasksApp-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/BackgroundTasksApp-test.tsx index 658fdb34c7f..0b62bedded7 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/BackgroundTasksApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/BackgroundTasksApp-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import BackgroundTasksApp from '../BackgroundTasksApp'; jest.mock('../../../../api/ce', () => ({ diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx index f2bffffd391..7c9a3d4871a 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockTask } from '../../../../helpers/mocks/tasks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { TaskTypes } from '../../../../types/tasks'; import ScannerContext from '../ScannerContext'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx index 89dc9bbe300..2d1246c57bb 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockTask } from '../../../../helpers/mocks/tasks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { TaskTypes } from '../../../../types/tasks'; import Stacktrace from '../Stacktrace'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/StatStillFailing-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/StatStillFailing-test.tsx index 5cb8a6c9325..a99de8ef5ef 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/StatStillFailing-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/StatStillFailing-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import StatStillFailing, { Props } from '../StatStillFailing'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskActions-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskActions-test.tsx index d2293f322fd..d49849cc957 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskActions-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockTask } from '../../../../helpers/mocks/tasks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { Task, TaskStatuses } from '../../../../types/tasks'; import TaskActions from '../TaskActions'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.tsx index c65e2ab12f5..cb12bf9107b 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import Workers from '../Workers'; it('renders', () => { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.tsx index fe7c50e9840..3e6d8f3737b 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.tsx @@ -24,7 +24,7 @@ jest.mock('../../../../api/ce', () => ({ import { shallow } from 'enzyme'; import * as React from 'react'; -import { submit } from '../../../../sonar-ui-common/helpers/testUtils'; +import { submit } from '../../../../helpers/testUtils'; import WorkersForm from '../WorkersForm'; it('changes select', () => { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/routes.ts b/server/sonar-web/src/main/js/apps/background-tasks/routes.ts index 9a9a94bf5b8..e8c7c4595b8 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/routes.ts +++ b/server/sonar-web/src/main/js/apps/background-tasks/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/utils.ts b/server/sonar-web/src/main/js/apps/background-tasks/utils.ts index 28a8cad3b12..f248c5eb0a8 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/utils.ts +++ b/server/sonar-web/src/main/js/apps/background-tasks/utils.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { toShortNotSoISOString } from '../../sonar-ui-common/helpers/dates'; +import { toShortNotSoISOString } from '../../helpers/dates'; import { Task, TaskStatuses } from '../../types/tasks'; import { ALL_TYPES, CURRENTS, STATUSES } from './constants'; diff --git a/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx b/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx index ec231e77c85..d59c0b9ee04 100644 --- a/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/change-admin-password/ChangeAdminPasswordAppRenderer.tsx @@ -19,13 +19,13 @@ */ import * as React from 'react'; import GlobalMessagesContainer from '../../app/components/GlobalMessagesContainer'; +import { SubmitButton } from '../../components/controls/buttons'; import { Location } from '../../components/hoc/withRouter'; -import { SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { getReturnUrl } from '../../sonar-ui-common/helpers/urls'; +import { Alert } from '../../components/ui/Alert'; +import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../helpers/l10n'; +import { getReturnUrl } from '../../helpers/urls'; import Unauthorized from '../sessions/components/Unauthorized'; import { DEFAULT_ADMIN_PASSWORD } from './constants'; diff --git a/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-test.tsx b/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-test.tsx index ea55b97f72a..1cd88813e6c 100644 --- a/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordApp-test.tsx @@ -22,7 +22,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { changePassword } from '../../../api/users'; import { mockLocation } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { getAppState, Store } from '../../../store/rootReducer'; import { ChangeAdminPasswordApp, mapStateToProps } from '../ChangeAdminPasswordApp'; import { DEFAULT_ADMIN_LOGIN, DEFAULT_ADMIN_PASSWORD } from '../constants'; diff --git a/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordAppRenderer-test.tsx b/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordAppRenderer-test.tsx index 399161ae2f4..49f89c9b4cf 100644 --- a/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordAppRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/change-admin-password/__tests__/ChangeAdminPasswordAppRenderer-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockLocation } from '../../../helpers/testMocks'; -import { change, submit } from '../../../sonar-ui-common/helpers/testUtils'; +import { change, submit } from '../../../helpers/testUtils'; import ChangeAdminPasswordAppRenderer, { ChangeAdminPasswordAppRendererProps } from '../ChangeAdminPasswordAppRenderer'; diff --git a/server/sonar-web/src/main/js/apps/code/components/AppCode.tsx b/server/sonar-web/src/main/js/apps/code/components/AppCode.tsx index 36819b2f463..cd2924e5c31 100644 --- a/server/sonar-web/src/main/js/apps/code/components/AppCode.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/AppCode.tsx @@ -26,10 +26,10 @@ import { connect } from 'react-redux'; import { InjectedRouter } from 'react-router'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; +import ListFooter from '../../../components/controls/ListFooter'; import { isPullRequest, isSameBranchLike } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; import { getCodeUrl, getProjectUrl } from '../../../helpers/urls'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { fetchBranchStatus, fetchMetrics } from '../../../store/rootActions'; import { getMetrics } from '../../../store/rootReducer'; import { BranchLike } from '../../../types/branch-like'; diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx index 3502c001f21..495009f47c0 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import { Link } from 'react-router'; import { colors } from '../../../app/theme'; +import BranchIcon from '../../../components/icons/BranchIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; -import BranchIcon from '../../../sonar-ui-common/components/icons/BranchIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; export function getTooltip(component: T.ComponentMeasure) { diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentPin.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentPin.tsx index 12cce663d48..34ac5a6e654 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentPin.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentPin.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import PinIcon from '../../../components/icons/PinIcon'; import { WorkspaceContextShape } from '../../../components/workspace/context'; -import PinIcon from '../../../sonar-ui-common/components/icons/PinIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentsEmpty.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentsEmpty.tsx index d6350db5d3e..cda7ee84c2a 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentsEmpty.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentsEmpty.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { canBePinned?: boolean; diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx index 5811d4f9dce..41830122e94 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { baseComponent?: T.ComponentMeasure; diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.tsx b/server/sonar-web/src/main/js/apps/code/components/Search.tsx index c2c0ae74b4b..00b51655ab1 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Search.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { getTree } from '../../../api/components'; +import SearchBox from '../../../components/controls/SearchBox'; import { Location, Router, withRouter } from '../../../components/hoc/withRouter'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/code/components/SourceViewerWrapper.tsx b/server/sonar-web/src/main/js/apps/code/components/SourceViewerWrapper.tsx index 159e3ae851b..874c5b3379f 100644 --- a/server/sonar-web/src/main/js/apps/code/components/SourceViewerWrapper.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/SourceViewerWrapper.tsx @@ -21,7 +21,7 @@ import { Location } from 'history'; import * as React from 'react'; import withKeyboardNavigation from '../../../components/hoc/withKeyboardNavigation'; import SourceViewer from '../../../components/SourceViewer/SourceViewer'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { scrollToElement } from '../../../helpers/scrolling'; import { BranchLike } from '../../../types/branch-like'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/code/components/__tests__/AppCode-test.tsx b/server/sonar-web/src/main/js/apps/code/components/__tests__/AppCode-test.tsx index 25000ff7955..beef71fc318 100644 --- a/server/sonar-web/src/main/js/apps/code/components/__tests__/AppCode-test.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/__tests__/AppCode-test.tsx @@ -26,7 +26,7 @@ import { mockIssue, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { ComponentQualifier } from '../../../../types/component'; import { loadMoreChildren, retrieveComponent } from '../../utils'; import { AppCode } from '../AppCode'; diff --git a/server/sonar-web/src/main/js/apps/code/routes.ts b/server/sonar-web/src/main/js/apps/code/routes.ts index 22ec4facb3d..f35e7d14861 100644 --- a/server/sonar-web/src/main/js/apps/code/routes.ts +++ b/server/sonar-web/src/main/js/apps/code/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx index 9bb7c49c2cd..0d2b133c77c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Profile as BaseProfile } from '../../../api/quality-profiles'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; +import { Button } from '../../../components/controls/buttons'; import ActivationFormModal from './ActivationFormModal'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx index 8c4abdf8c2b..e2611f72bb6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx @@ -20,17 +20,14 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { activateRule, Profile } from '../../../api/quality-profiles'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import Select from '../../../components/controls/Select'; import SeverityHelper from '../../../components/shared/SeverityHelper'; +import { Alert } from '../../../components/ui/Alert'; import { SEVERITIES } from '../../../helpers/constants'; +import { translate } from '../../../helpers/l10n'; import { sanitizeString } from '../../../helpers/sanitize'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { sortProfiles } from '../../quality-profiles/utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationSeverityFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationSeverityFacet.tsx index e231f359e66..7091bbadcc1 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationSeverityFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationSeverityFacet.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import SeverityHelper from '../../../components/shared/SeverityHelper'; import { SEVERITIES } from '../../../helpers/constants'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Facet, { BasicProps } from './Facet'; interface Props extends BasicProps { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx index 1093ec1076a..db8c6cbb9e5 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx @@ -29,19 +29,19 @@ import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import FiltersHeader from '../../../components/common/FiltersHeader'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; +import ListFooter from '../../../components/controls/ListFooter'; +import SearchBox from '../../../components/controls/SearchBox'; +import BackIcon from '../../../components/icons/BackIcon'; import '../../../components/search-navigator.css'; -import { isLoggedIn } from '../../../helpers/users'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import BackIcon from '../../../sonar-ui-common/components/icons/BackIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { addSideBarClass, addWhitePageClass, removeSideBarClass, removeWhitePageClass -} from '../../../sonar-ui-common/helpers/pages'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +} from '../../../helpers/pages'; +import { scrollToElement } from '../../../helpers/scrolling'; +import { isLoggedIn } from '../../../helpers/users'; import { getCurrentUser, getLanguages, Store } from '../../../store/rootReducer'; import { SecurityStandard } from '../../../types/security'; import { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/AvailableSinceFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/AvailableSinceFacet.tsx index 9849df84334..e52c20e49ff 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/AvailableSinceFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/AvailableSinceFacet.tsx @@ -22,8 +22,8 @@ import { InjectedIntlProps, injectIntl } from 'react-intl'; import DateInput from '../../../components/controls/DateInput'; import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; -import { longFormatterOption } from '../../../sonar-ui-common/components/intl/DateFormatter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { longFormatterOption } from '../../../components/intl/DateFormatter'; +import { translate } from '../../../helpers/l10n'; import { Query } from '../query'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx index 2b928e063e7..c1fa64a8758 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { Profile } from '../../../api/quality-profiles'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import Dropdown from '../../../components/controls/Dropdown'; +import Tooltip from '../../../components/controls/Tooltip'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate } from '../../../helpers/l10n'; import { Query } from '../query'; import BulkChangeModal from './BulkChangeModal'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx index 27a657d2910..b1c8f2e422e 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx @@ -19,15 +19,12 @@ */ import * as React from 'react'; import { bulkActivateRules, bulkDeactivateRules, Profile } from '../../../api/quality-profiles'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import Select from '../../../components/controls/Select'; +import { Alert } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { Query, serializeQuery } from '../query'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx index d525c9540bc..68b675fb99d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx @@ -20,22 +20,19 @@ import * as React from 'react'; import { createRule, updateRule } from '../../../api/rules'; import FormattingTips from '../../../components/common/FormattingTips'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import Select from '../../../components/controls/Select'; import SeverityHelper from '../../../components/shared/SeverityHelper'; import TypeHelper from '../../../components/shared/TypeHelper'; +import { Alert } from '../../../components/ui/Alert'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; import { RULE_STATUSES, RULE_TYPES, SEVERITIES } from '../../../helpers/constants'; +import { csvEscape } from '../../../helpers/csv'; +import { translate } from '../../../helpers/l10n'; import { sanitizeString } from '../../../helpers/sanitize'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { csvEscape } from '../../../sonar-ui-common/helpers/csv'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { latinize } from '../../../sonar-ui-common/helpers/strings'; +import { latinize } from '../../../helpers/strings'; interface Props { customRule?: T.RuleDetails; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/DefaultSeverityFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/DefaultSeverityFacet.tsx index 1b42a4965c8..276ef589db5 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/DefaultSeverityFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/DefaultSeverityFacet.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import SeverityHelper from '../../../components/shared/SeverityHelper'; import { SEVERITIES } from '../../../helpers/constants'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Facet, { BasicProps } from './Facet'; export default class DefaultSeverityFacet extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx index 373d2340bb7..c7bcd333d74 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx @@ -20,13 +20,13 @@ import * as classNames from 'classnames'; import { orderBy, sortBy, without } from 'lodash'; import * as React from 'react'; +import Tooltip from '../../../components/controls/Tooltip'; import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { FacetKey } from '../query'; export interface BasicProps { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/InheritanceFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/InheritanceFacet.tsx index 658e5d848a0..73c9b85d5cb 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/InheritanceFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/InheritanceFacet.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Facet, { BasicProps } from './Facet'; interface Props extends T.Omit { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/LanguageFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/LanguageFacet.tsx index c70d39ea969..b005291109c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/LanguageFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/LanguageFacet.tsx @@ -21,8 +21,8 @@ import { uniqBy } from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; +import { translate } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { getLanguages, Store } from '../../../store/rootReducer'; import { BasicProps } from './Facet'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx index 2f5cc731770..29a76efda9c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import PageCounter from '../../../components/common/PageCounter'; +import ReloadButton from '../../../components/controls/ReloadButton'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import PageShortcutsTooltip from '../../../components/ui/PageShortcutsTooltip'; -import ReloadButton from '../../../sonar-ui-common/components/controls/ReloadButton'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface PageActionsProps { loading: boolean; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx index 8892cd80498..b518f365076 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx @@ -26,7 +26,7 @@ import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { FacetKey, Query } from '../query'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RemoveExtendedDescriptionModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RemoveExtendedDescriptionModal.tsx index 7781deeea9c..92192e335c8 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RemoveExtendedDescriptionModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RemoveExtendedDescriptionModal.tsx @@ -18,12 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import { translate } from '../../../helpers/l10n'; interface Props { onCancel: () => void; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx index 2e73236dd8e..09198ba7b40 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import { Profile } from '../../../api/quality-profiles'; import { deleteRule, getRuleDetails, updateRule } from '../../../api/rules'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Activation, Query } from '../query'; import CustomRuleButton from './CustomRuleButton'; import RuleDetailsCustomRules from './RuleDetailsCustomRules'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx index 353d58206b7..7acce41dcb1 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx @@ -21,12 +21,12 @@ import { sortBy } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; import { deleteRule, searchRules } from '../../../api/rules'; +import { Button } from '../../../components/controls/buttons'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; import SeverityHelper from '../../../components/shared/SeverityHelper'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getRuleUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import CustomRuleButton from './CustomRuleButton'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx index 30b6259edd8..79eb7b4007a 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { updateRule } from '../../../api/rules'; import FormattingTips from '../../../components/common/FormattingTips'; +import { Button, ResetButtonLink } from '../../../components/controls/buttons'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { sanitizeString } from '../../../helpers/sanitize'; -import { Button, ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import RemoveExtendedDescriptionModal from './RemoveExtendedDescriptionModal'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx index 391a5f98ebb..af2f02e39ab 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx @@ -20,12 +20,12 @@ import * as React from 'react'; import { Link } from 'react-router'; import { getFacet } from '../../../api/issues'; +import Tooltip from '../../../components/controls/Tooltip'; import { withAppState } from '../../../components/hoc/withAppState'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getIssuesUrl } from '../../../helpers/urls'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; interface Props { appState: Pick; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx index 15a278f7d77..aa1a09e4e84 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx @@ -19,18 +19,18 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Dropdown from '../../../components/controls/Dropdown'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import Tooltip from '../../../components/controls/Tooltip'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import LinkIcon from '../../../components/icons/LinkIcon'; +import DateFormatter from '../../../components/intl/DateFormatter'; import SeverityHelper from '../../../components/shared/SeverityHelper'; import TagsList from '../../../components/tags/TagsList'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getRuleUrl } from '../../../helpers/urls'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import LinkIcon from '../../../sonar-ui-common/components/icons/LinkIcon'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import { Query } from '../query'; import RuleDetailsTagsPopup from './RuleDetailsTagsPopup'; import SimilarRulesFilter from './SimilarRulesFilter'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsParameters.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsParameters.tsx index 92550c4fe7f..58ff41b223a 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsParameters.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsParameters.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { translate } from '../../../helpers/l10n'; import { sanitizeString } from '../../../helpers/sanitize'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { params: T.RuleParameter[]; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx index efc76ea8022..5155a3d0dbf 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx @@ -22,12 +22,12 @@ import * as React from 'react'; import { Link } from 'react-router'; import { activateRule, deactivateRule, Profile } from '../../../api/quality-profiles'; import InstanceMessage from '../../../components/common/InstanceMessage'; +import { Button } from '../../../components/controls/buttons'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; +import Tooltip from '../../../components/controls/Tooltip'; import SeverityHelper from '../../../components/shared/SeverityHelper'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getQualityProfileUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import BuiltInQualityProfileBadge from '../../quality-profiles/components/BuiltInQualityProfileBadge'; import ActivationButton from './ActivationButton'; import RuleInheritanceIcon from './RuleInheritanceIcon'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx index 84eb004c731..bc86033feed 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx @@ -21,14 +21,14 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link } from 'react-router'; import { deactivateRule, Profile } from '../../../api/quality-profiles'; +import { Button } from '../../../components/controls/buttons'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; +import Tooltip from '../../../components/controls/Tooltip'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import SeverityIcon from '../../../components/icons/SeverityIcon'; import TagsList from '../../../components/tags/TagsList'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getRuleUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import SeverityIcon from '../../../sonar-ui-common/components/icons/SeverityIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import { Activation, Query } from '../query'; import ActivationButton from './ActivationButton'; import RuleInheritanceIcon from './RuleInheritanceIcon'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx index 7ea00019d85..c859875597c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx @@ -18,13 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import Dropdown from '../../../components/controls/Dropdown'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import FilterIcon from '../../../components/icons/FilterIcon'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import TagsIcon from '../../../components/icons/TagsIcon'; import SeverityHelper from '../../../components/shared/SeverityHelper'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import FilterIcon from '../../../sonar-ui-common/components/icons/FilterIcon'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import TagsIcon from '../../../sonar-ui-common/components/icons/TagsIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Query } from '../query'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/StatusFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/StatusFacet.tsx index 925b1388ada..6c2af134a4d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/StatusFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/StatusFacet.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { RULE_STATUSES } from '../../../helpers/constants'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Facet, { BasicProps } from './Facet'; export default class StatusFacet extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/TagFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/TagFacet.tsx index 4bcf519f029..5e0a9607f97 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/TagFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/TagFacet.tsx @@ -22,9 +22,9 @@ import * as React from 'react'; import { getRuleTags } from '../../../api/rules'; import { colors } from '../../../app/theme'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; -import TagsIcon from '../../../sonar-ui-common/components/icons/TagsIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; +import TagsIcon from '../../../components/icons/TagsIcon'; +import { translate } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { BasicProps } from './Facet'; export default class TagFacet extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx index 49921d9d0cb..7cd1a8bcc19 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { translate } from '../../../helpers/l10n'; import Facet, { BasicProps } from './Facet'; interface Props extends T.Omit { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/TypeFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/TypeFacet.tsx index e273e25e4c5..c4e0a93895d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/TypeFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/TypeFacet.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import { translate } from '../../../helpers/l10n'; import Facet, { BasicProps } from './Facet'; export default class TypeFacet extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/App-test.tsx index b39bc080690..cd2df7079ef 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/App-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { getRulesApp } from '../../../../api/rules'; import ScreenPositionHelper from '../../../../components/common/ScreenPositionHelper'; import { mockCurrentUser, mockLocation, mockRouter, mockRule } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { App } from '../App'; jest.mock('../../../../components/common/ScreenPositionHelper'); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/BulkChangeModal-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/BulkChangeModal-test.tsx index 4e3c064db71..7acce61a5a3 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/BulkChangeModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/BulkChangeModal-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { bulkActivateRules, bulkDeactivateRules } from '../../../../api/quality-profiles'; import { mockLanguage, mockQualityProfile } from '../../../../helpers/testMocks'; -import { submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { submit, waitAndUpdate } from '../../../../helpers/testUtils'; import { Query } from '../../query'; import BulkChangeModal from '../BulkChangeModal'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/CustomRuleFormModal-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/CustomRuleFormModal-test.tsx index bb28f3434df..4f076b7bdb4 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/CustomRuleFormModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/CustomRuleFormModal-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { createRule } from '../../../../api/rules'; import { mockRule, mockRuleDetailsParameter } from '../../../../helpers/testMocks'; -import { submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { submit, waitAndUpdate } from '../../../../helpers/testUtils'; import CustomRuleFormModal from '../CustomRuleFormModal'; jest.mock('../../../../api/rules', () => ({ createRule: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetails-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetails-test.tsx index fb2bd90d25c..2bda64184fe 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetails-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetails-test.tsx @@ -22,7 +22,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { deleteRule, getRuleDetails, updateRule } from '../../../../api/rules'; import { mockQualityProfile } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import RuleDetails from '../RuleDetails'; jest.mock('../../../../api/rules', () => { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsDescription-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsDescription-test.tsx index ce3a71620b7..783583d9f57 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsDescription-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsDescription-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change, click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, click, waitAndUpdate } from '../../../../helpers/testUtils'; import RuleDetailsDescription from '../RuleDetailsDescription'; jest.mock('../../../../api/rules', () => ({ diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx index 4f190d2b1e8..9449ed474b2 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getFacet } from '../../../../api/issues'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { RuleDetailsIssues } from '../RuleDetailsIssues'; jest.mock('../../../../api/issues', () => ({ diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleListItem-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleListItem-test.tsx index e797688f02c..93e3f7644b0 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleListItem-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleListItem-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { Link } from 'react-router'; import { deactivateRule } from '../../../../api/quality-profiles'; import { mockEvent, mockQualityProfile, mockRule } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import RuleListItem from '../RuleListItem'; jest.mock('../../../../api/quality-profiles', () => ({ diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/SimilarRulesFilter-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/SimilarRulesFilter-test.tsx index 6a8a72b21e1..0faa5974d59 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/SimilarRulesFilter-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/SimilarRulesFilter-test.tsx @@ -20,7 +20,7 @@ import { mount, shallow } from 'enzyme'; import * as React from 'react'; import { mockRule } from '../../../../helpers/testMocks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import SimilarRulesFilter from '../SimilarRulesFilter'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/query.ts b/server/sonar-web/src/main/js/apps/coding-rules/query.ts index 7901b506d51..b851a8a2369 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/query.ts +++ b/server/sonar-web/src/main/js/apps/coding-rules/query.ts @@ -29,7 +29,7 @@ import { serializeOptionalBoolean, serializeString, serializeStringArray -} from '../../sonar-ui-common/helpers/query'; +} from '../../helpers/query'; export interface Query { activation: boolean | undefined; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/routes.ts b/server/sonar-web/src/main/js/apps/coding-rules/routes.ts index 6f05b29713c..8049584924b 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/routes.ts +++ b/server/sonar-web/src/main/js/apps/coding-rules/routes.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { RedirectFunction, RouterState } from 'react-router'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; import { parseQuery, serializeQuery } from './query'; function parseHash(hash: string): T.RawQuery { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx index 3a863ca651c..bed13ccc0d4 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx @@ -34,13 +34,13 @@ import { getLocalizedMetricDomain, translate, translateWithParameters -} from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../helpers/l10n'; import { addSideBarClass, addWhitePageClass, removeSideBarClass, removeWhitePageClass -} from '../../../sonar-ui-common/helpers/pages'; +} from '../../../helpers/pages'; import { fetchBranchStatus } from '../../../store/rootActions'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/Breadcrumb.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/Breadcrumb.tsx index db4329c32ec..21e4aa10259 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/Breadcrumb.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/Breadcrumb.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { collapsePath, limitComponentName } from '../../../sonar-ui-common/helpers/path'; +import Tooltip from '../../../components/controls/Tooltip'; +import { collapsePath, limitComponentName } from '../../../helpers/path'; interface Props { canBrowse: boolean; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx index aac8157b802..b221e826bed 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx @@ -21,16 +21,12 @@ import * as classNames from 'classnames'; import * as differenceInDays from 'date-fns/difference_in_days'; import * as React from 'react'; import { InjectedIntlProps, injectIntl } from 'react-intl'; +import Tooltip from '../../../components/controls/Tooltip'; +import DateFormatter, { longFormatterOption } from '../../../components/intl/DateFormatter'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import DateTimeFormatter, { formatterOption } from '../../../components/intl/DateTimeFormatter'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getPeriodDate, getPeriodLabel } from '../../../helpers/periods'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DateFormatter, { - longFormatterOption -} from '../../../sonar-ui-common/components/intl/DateFormatter'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import DateTimeFormatter, { - formatterOption -} from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx index 610d6ada0a2..cbae3063422 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx @@ -23,13 +23,13 @@ import { getComponentTree } from '../../../api/components'; import { getMeasures } from '../../../api/measures'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import SourceViewer from '../../../components/SourceViewer/SourceViewer'; +import PageActions from '../../../components/ui/PageActions'; import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; +import { RequestData } from '../../../helpers/request'; +import { scrollToElement } from '../../../helpers/scrolling'; import { getProjectUrl } from '../../../helpers/urls'; -import PageActions from '../../../sonar-ui-common/components/ui/PageActions'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { RequestData } from '../../../sonar-ui-common/helpers/request'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; import { complementary } from '../config/complementary'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx index 2f36734282a..ba7fe34c55f 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx @@ -20,13 +20,13 @@ import * as React from 'react'; import { Link } from 'react-router'; import LanguageDistributionContainer from '../../../components/charts/LanguageDistributionContainer'; +import Tooltip from '../../../components/controls/Tooltip'; +import HistoryIcon from '../../../components/icons/HistoryIcon'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; import Measure from '../../../components/measure/Measure'; +import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; import { getMeasureHistoryUrl } from '../../../helpers/urls'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import HistoryIcon from '../../../sonar-ui-common/components/icons/HistoryIcon'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { getLocalizedMetricName, translate } from '../../../sonar-ui-common/helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { hasFullMeasures } from '../utils'; import LeakPeriodLegend from './LeakPeriodLegend'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx index a2a31fc87ff..177ab2f06a1 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx @@ -21,9 +21,9 @@ import * as React from 'react'; import { getComponentLeaves } from '../../../api/components'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import SourceViewer from '../../../components/SourceViewer/SourceViewer'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import PageActions from '../../../components/ui/PageActions'; import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import PageActions from '../../../sonar-ui-common/components/ui/PageActions'; import { BranchLike } from '../../../types/branch-like'; import BubbleChart from '../drilldown/BubbleChart'; import { enhanceComponent, getBubbleMetrics, hasFullMeasures, isFileType } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureViewSelect.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureViewSelect.tsx index e82e820f1ed..c6860eb3066 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureViewSelect.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureViewSelect.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import ListIcon from '../../../sonar-ui-common/components/icons/ListIcon'; -import TreeIcon from '../../../sonar-ui-common/components/icons/TreeIcon'; -import TreemapIcon from '../../../sonar-ui-common/components/icons/TreemapIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import ListIcon from '../../../components/icons/ListIcon'; +import TreeIcon from '../../../components/icons/TreeIcon'; +import TreemapIcon from '../../../components/icons/TreemapIcon'; +import { translate } from '../../../helpers/l10n'; import { hasList, hasTree, hasTreemap, View } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresEmpty.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresEmpty.tsx index 3751c12cfa9..aac47222423 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresEmpty.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresEmpty.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function MeasuresEmpty() { return ( diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/App-test.tsx index 04aa3fef23c..9c9ae1d407e 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/App-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { getMeasuresWithPeriod } from '../../../../api/measures'; import { mockMainBranch, mockPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockComponent, mockIssue, mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { App } from '../App'; jest.mock('../../../../api/metrics', () => ({ diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx index 6619b9780ce..a33f26ff8a4 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx @@ -20,7 +20,7 @@ import { mount } from 'enzyme'; import * as React from 'react'; import { getBreadcrumbs } from '../../../../api/components'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import Breadcrumbs from '../Breadcrumbs'; jest.mock('../../../../api/components', () => ({ diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/MeasureContent-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/MeasureContent-test.tsx index 7929da4d7ab..d89eb1f0c04 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/MeasureContent-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/MeasureContent-test.tsx @@ -20,12 +20,12 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getComponentTree } from '../../../../api/components'; +import { scrollToElement } from '../../../../helpers/scrolling'; import { mockComponentMeasure, mockRouter } from '../../../../helpers/testMocks'; -import { scrollToElement } from '../../../../sonar-ui-common/helpers/scrolling'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import MeasureContent from '../MeasureContent'; -jest.mock('../../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../../helpers/scrolling', () => ({ scrollToElement: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx index 23c066ca5a6..14997bd80e2 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx @@ -18,19 +18,18 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import OriginalBubbleChart from '../../../components/charts/BubbleChart'; import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import { RATING_COLORS } from '../../../helpers/constants'; -import { isDiffMetric } from '../../../helpers/measures'; -import OriginalBubbleChart from '../../../sonar-ui-common/components/charts/BubbleChart'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; import { getLocalizedMetricDomain, getLocalizedMetricName, translate, translateWithParameters -} from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; +} from '../../../helpers/l10n'; +import { formatMeasure, isDiffMetric } from '../../../helpers/measures'; +import { isDefined } from '../../../helpers/types'; import { getBubbleMetrics, getBubbleYDomain, isProjectOverview } from '../utils'; import EmptyResult from './EmptyResult'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx index f410a120ae1..7a5e0cf70d5 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx @@ -19,18 +19,18 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import BranchIcon from '../../../components/icons/BranchIcon'; +import LinkIcon from '../../../components/icons/LinkIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { translate } from '../../../helpers/l10n'; +import { isDiffMetric } from '../../../helpers/measures'; +import { splitPath } from '../../../helpers/path'; import { getBranchLikeUrl, getComponentDrilldownUrlWithSelection, getComponentSecurityHotspotsUrl, getProjectUrl } from '../../../helpers/urls'; -import BranchIcon from '../../../sonar-ui-common/components/icons/BranchIcon'; -import LinkIcon from '../../../sonar-ui-common/components/icons/LinkIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { isDiffMetric } from '../../../sonar-ui-common/helpers/measures'; -import { splitPath } from '../../../sonar-ui-common/helpers/path'; import { BranchLike } from '../../../types/branch-like'; import { isFileType, isSecurityReviewMetric, View } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx index b4d57ed0f38..1bd16bccfbe 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { getLocalizedMetricName } from '../../../sonar-ui-common/helpers/l10n'; +import { getLocalizedMetricName } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { complementary } from '../config/complementary'; import { View } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/EmptyResult.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/EmptyResult.tsx index 3b090019e4b..2b20d03f5ad 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/EmptyResult.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/EmptyResult.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function EmptyResult() { return

{translate('no_results')}
; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx index 89a81414891..828bad17a29 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx @@ -20,13 +20,12 @@ import * as key from 'keymaster'; import { throttle } from 'lodash'; import * as React from 'react'; -import { isDiffMetric, isPeriodBestValue } from '../../../helpers/measures'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { Button } from '../../../components/controls/buttons'; +import ListFooter from '../../../components/controls/ListFooter'; +import { Alert } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure, isDiffMetric, isPeriodBestValue } from '../../../helpers/measures'; +import { scrollToElement } from '../../../helpers/scrolling'; import { BranchLike } from '../../../types/branch-like'; import { View } from '../utils'; import ComponentsList from './ComponentsList'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx index 82da04be4cf..13a4b4b30f5 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx @@ -22,17 +22,12 @@ import * as React from 'react'; import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; import { colors } from '../../../app/theme'; import ColorBoxLegend from '../../../components/charts/ColorBoxLegend'; -import { isDiffMetric } from '../../../helpers/measures'; -import ColorGradientLegend from '../../../sonar-ui-common/components/charts/ColorGradientLegend'; -import TreeMap, { TreeMapItem } from '../../../sonar-ui-common/components/charts/TreeMap'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { - getLocalizedMetricName, - translate, - translateWithParameters -} from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; +import ColorGradientLegend from '../../../components/charts/ColorGradientLegend'; +import TreeMap, { TreeMapItem } from '../../../components/charts/TreeMap'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { getLocalizedMetricName, translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure, isDiffMetric } from '../../../helpers/measures'; +import { isDefined } from '../../../helpers/types'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; import EmptyResult from './EmptyResult'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx index c8865973cf7..7c1eca4cf52 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx @@ -20,8 +20,8 @@ import { shallow } from 'enzyme'; import { keyBy } from 'lodash'; import * as React from 'react'; +import OriginalBubbleChart from '../../../../components/charts/BubbleChart'; import { mockComponentMeasure, mockMeasure, mockMetric } from '../../../../helpers/testMocks'; -import OriginalBubbleChart from '../../../../sonar-ui-common/components/charts/BubbleChart'; import { MetricKey } from '../../../../types/metrics'; import { enhanceComponent } from '../../utils'; import BubbleChart from '../BubbleChart'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/routes.ts b/server/sonar-web/src/main/js/apps/component-measures/routes.ts index c48f0b4124a..f2ab6f28106 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/routes.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/routes.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { RedirectFunction, RouterState } from 'react-router'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx index 9062d191a44..ea1fdfb9823 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx @@ -22,14 +22,14 @@ import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; -import BubblesIcon from '../../../sonar-ui-common/components/icons/BubblesIcon'; +import BubblesIcon from '../../../components/icons/BubblesIcon'; import { getLocalizedCategoryMetricName, getLocalizedMetricDomain, getLocalizedMetricName, hasMessage, translate -} from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../helpers/l10n'; import { addMeasureCategories, filterMeasures, diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/ProjectOverviewFacet.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/ProjectOverviewFacet.tsx index 36370960da3..850474afb20 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/ProjectOverviewFacet.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/ProjectOverviewFacet.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import FacetBox from '../../../components/facet/FacetBox'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { onChange: (metric: string) => void; diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx index 00fe2d3c82b..f2e9f491c1e 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { groupByDomains, KNOWN_DOMAINS, PROJECT_OVERVEW, Query } from '../utils'; import DomainFacet from './DomainFacet'; import ProjectOverviewFacet from './ProjectOverviewFacet'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/utils.ts b/server/sonar-web/src/main/js/apps/component-measures/utils.ts index d3c38415b3b..d2e7763e86b 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/utils.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/utils.ts @@ -20,9 +20,9 @@ import { groupBy, memoize, sortBy, toPairs } from 'lodash'; import { enhanceMeasure } from '../../components/measure/utils'; import { isBranch, isPullRequest } from '../../helpers/branch-like'; +import { getLocalizedMetricName } from '../../helpers/l10n'; import { getDisplayMetrics, isDiffMetric } from '../../helpers/measures'; -import { getLocalizedMetricName } from '../../sonar-ui-common/helpers/l10n'; -import { cleanQuery, parseAsString, serializeString } from '../../sonar-ui-common/helpers/query'; +import { cleanQuery, parseAsString, serializeString } from '../../helpers/query'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { MetricKey } from '../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/create/project/AzurePersonalAccessTokenForm.tsx b/server/sonar-web/src/main/js/apps/create/project/AzurePersonalAccessTokenForm.tsx index bb0c910676d..0c9e026776f 100644 --- a/server/sonar-web/src/main/js/apps/create/project/AzurePersonalAccessTokenForm.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/AzurePersonalAccessTokenForm.tsx @@ -20,11 +20,11 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import ValidationInput from '../../../sonar-ui-common/components/controls/ValidationInput'; -import DetachIcon from '../../../sonar-ui-common/components/icons/DetachIcon'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { SubmitButton } from '../../../components/controls/buttons'; +import ValidationInput from '../../../components/controls/ValidationInput'; +import DetachIcon from '../../../components/icons/DetachIcon'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { AlmSettingsInstance } from '../../../types/alm-settings'; export interface AzurePersonalAccessTokenFormProps { diff --git a/server/sonar-web/src/main/js/apps/create/project/AzureProjectAccordion.tsx b/server/sonar-web/src/main/js/apps/create/project/AzureProjectAccordion.tsx index 26deef49616..27fc44d2a5d 100644 --- a/server/sonar-web/src/main/js/apps/create/project/AzureProjectAccordion.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/AzureProjectAccordion.tsx @@ -22,14 +22,14 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { colors } from '../../../app/theme'; +import BoxedGroupAccordion from '../../../components/controls/BoxedGroupAccordion'; +import ListFooter from '../../../components/controls/ListFooter'; +import Radio from '../../../components/controls/Radio'; +import CheckIcon from '../../../components/icons/CheckIcon'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; -import BoxedGroupAccordion from '../../../sonar-ui-common/components/controls/BoxedGroupAccordion'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import CheckIcon from '../../../sonar-ui-common/components/icons/CheckIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { AzureProject, AzureRepository } from '../../../types/alm-integration'; import { CreateProjectModes } from './types'; diff --git a/server/sonar-web/src/main/js/apps/create/project/AzureProjectCreateRenderer.tsx b/server/sonar-web/src/main/js/apps/create/project/AzureProjectCreateRenderer.tsx index 200a39df833..b68f7eadd96 100644 --- a/server/sonar-web/src/main/js/apps/create/project/AzureProjectCreateRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/AzureProjectCreateRenderer.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { Button } from '../../../components/controls/buttons'; +import SearchBox from '../../../components/controls/SearchBox'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { AzureProject, AzureRepository } from '../../../types/alm-integration'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; import AzurePersonalAccessTokenForm from './AzurePersonalAccessTokenForm'; diff --git a/server/sonar-web/src/main/js/apps/create/project/AzureProjectsList.tsx b/server/sonar-web/src/main/js/apps/create/project/AzureProjectsList.tsx index 9cc222d1636..ffe2f5f01b3 100644 --- a/server/sonar-web/src/main/js/apps/create/project/AzureProjectsList.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/AzureProjectsList.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import ListFooter from '../../../components/controls/ListFooter'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { AzureProject, AzureRepository } from '../../../types/alm-integration'; import AzureProjectAccordion from './AzureProjectAccordion'; import { CreateProjectModes } from './types'; diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudProjectCreateRender.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudProjectCreateRender.tsx index 41c342bdcf0..33de2a91863 100644 --- a/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudProjectCreateRender.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudProjectCreateRender.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { BitbucketCloudRepository } from '../../../types/alm-integration'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; import BitbucketCloudSearchForm from './BitbucketCloudSearchForm'; diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudSearchForm.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudSearchForm.tsx index 18239e73af1..5e2c6e82c97 100644 --- a/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudSearchForm.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketCloudSearchForm.tsx @@ -20,17 +20,17 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Button } from '../../../components/controls/buttons'; +import SearchBox from '../../../components/controls/SearchBox'; +import Tooltip from '../../../components/controls/Tooltip'; +import CheckIcon from '../../../components/icons/CheckIcon'; +import DetachIcon from '../../../components/icons/DetachIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getProjectUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import CheckIcon from '../../../sonar-ui-common/components/icons/CheckIcon'; -import DetachIcon from '../../../sonar-ui-common/components/icons/DetachIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; import { BitbucketCloudRepository } from '../../../types/alm-integration'; import { ComponentQualifier } from '../../../types/component'; import { CreateProjectModes } from './types'; diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketImportRepositoryForm.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketImportRepositoryForm.tsx index 2f1c1d22bf3..a2cf267b2a1 100644 --- a/server/sonar-web/src/main/js/apps/create/project/BitbucketImportRepositoryForm.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketImportRepositoryForm.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import SearchBox from '../../../components/controls/SearchBox'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { BitbucketProject, BitbucketProjectRepositories, diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectAccordion.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectAccordion.tsx index dcc00be8cff..0d3f65ecdd9 100644 --- a/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectAccordion.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectAccordion.tsx @@ -22,12 +22,12 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { colors } from '../../../app/theme'; +import BoxedGroupAccordion from '../../../components/controls/BoxedGroupAccordion'; +import Radio from '../../../components/controls/Radio'; +import CheckIcon from '../../../components/icons/CheckIcon'; +import { Alert } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; -import BoxedGroupAccordion from '../../../sonar-ui-common/components/controls/BoxedGroupAccordion'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import CheckIcon from '../../../sonar-ui-common/components/icons/CheckIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import { BitbucketProject, BitbucketRepository } from '../../../types/alm-integration'; import { CreateProjectModes } from './types'; diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectCreateRenderer.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectCreateRenderer.tsx index 83554586735..118753f0ad2 100644 --- a/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectCreateRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketProjectCreateRenderer.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { Button } from '../../../components/controls/buttons'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { BitbucketProject, BitbucketProjectRepositories, diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketRepositories.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketRepositories.tsx index de3c1324d18..00b023c59a3 100644 --- a/server/sonar-web/src/main/js/apps/create/project/BitbucketRepositories.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketRepositories.tsx @@ -19,8 +19,8 @@ */ import { uniq, without } from 'lodash'; import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import { BitbucketProject, BitbucketProjectRepositories, diff --git a/server/sonar-web/src/main/js/apps/create/project/BitbucketSearchResults.tsx b/server/sonar-web/src/main/js/apps/create/project/BitbucketSearchResults.tsx index bf441e280ec..523e42d6bf1 100644 --- a/server/sonar-web/src/main/js/apps/create/project/BitbucketSearchResults.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/BitbucketSearchResults.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { BitbucketProject, BitbucketRepository } from '../../../types/alm-integration'; import BitbucketProjectAccordion from './BitbucketProjectAccordion'; diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx index 9f89d514d6c..f3193c44ce8 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx @@ -20,10 +20,10 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { withAppState } from '../../../components/hoc/withAppState'; -import ChevronsIcon from '../../../sonar-ui-common/components/icons/ChevronsIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import ChevronsIcon from '../../../components/icons/ChevronsIcon'; +import { Alert } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { AlmKeys } from '../../../types/alm-settings'; import { CreateProjectModes } from './types'; diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx index f91c074812a..de750967d72 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx @@ -24,8 +24,8 @@ import { getAlmSettings } from '../../../api/alm-settings'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn'; import { withAppState } from '../../../components/hoc/withAppState'; +import { translate } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; import AlmBindingDefinitionForm from '../../settings/components/almIntegration/AlmBindingDefinitionForm'; import AzureProjectCreate from './AzureProjectCreate'; diff --git a/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreate.tsx b/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreate.tsx index 7a404c935e9..f49167e7ecc 100644 --- a/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreate.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreate.tsx @@ -26,7 +26,7 @@ import { getGithubRepositories, importGithubRepository } from '../../../api/alm-integrations'; -import { getHostUrl } from '../../../sonar-ui-common/helpers/urls'; +import { getHostUrl } from '../../../helpers/urls'; import { GithubOrganization, GithubRepository } from '../../../types/alm-integration'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; import GitHubProjectCreateRenderer from './GitHubProjectCreateRenderer'; diff --git a/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx b/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx index 2a6bf0edcbb..70113cbccbb 100644 --- a/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx @@ -21,18 +21,18 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { colors } from '../../../app/theme'; +import { Button } from '../../../components/controls/buttons'; +import ListFooter from '../../../components/controls/ListFooter'; +import Radio from '../../../components/controls/Radio'; +import SearchBox from '../../../components/controls/SearchBox'; +import SearchSelect from '../../../components/controls/SearchSelect'; +import CheckIcon from '../../../components/icons/CheckIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { getBaseUrl } from '../../../helpers/system'; import { getProjectUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import SearchSelect from '../../../sonar-ui-common/components/controls/SearchSelect'; -import CheckIcon from '../../../sonar-ui-common/components/icons/CheckIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { GithubOrganization, GithubRepository } from '../../../types/alm-integration'; import { ComponentQualifier } from '../../../types/component'; import CreateProjectPageHeader from './CreateProjectPageHeader'; diff --git a/server/sonar-web/src/main/js/apps/create/project/GitlabProjectCreateRenderer.tsx b/server/sonar-web/src/main/js/apps/create/project/GitlabProjectCreateRenderer.tsx index 26025cc6e76..cc63fc2a66a 100644 --- a/server/sonar-web/src/main/js/apps/create/project/GitlabProjectCreateRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/GitlabProjectCreateRenderer.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { GitlabProject } from '../../../types/alm-integration'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; import CreateProjectPageHeader from './CreateProjectPageHeader'; diff --git a/server/sonar-web/src/main/js/apps/create/project/GitlabProjectSelectionForm.tsx b/server/sonar-web/src/main/js/apps/create/project/GitlabProjectSelectionForm.tsx index fb9a6b5a045..017dc9cb6a3 100644 --- a/server/sonar-web/src/main/js/apps/create/project/GitlabProjectSelectionForm.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/GitlabProjectSelectionForm.tsx @@ -20,17 +20,17 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Button } from '../../../components/controls/buttons'; +import ListFooter from '../../../components/controls/ListFooter'; +import SearchBox from '../../../components/controls/SearchBox'; +import Tooltip from '../../../components/controls/Tooltip'; +import CheckIcon from '../../../components/icons/CheckIcon'; +import DetachIcon from '../../../components/icons/DetachIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import CheckIcon from '../../../sonar-ui-common/components/icons/CheckIcon'; -import DetachIcon from '../../../sonar-ui-common/components/icons/DetachIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { GitlabProject } from '../../../types/alm-integration'; import { ComponentQualifier } from '../../../types/component'; import { CreateProjectModes } from './types'; diff --git a/server/sonar-web/src/main/js/apps/create/project/ManualProjectCreate.tsx b/server/sonar-web/src/main/js/apps/create/project/ManualProjectCreate.tsx index 5150e25d1f9..78197388ac8 100644 --- a/server/sonar-web/src/main/js/apps/create/project/ManualProjectCreate.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/ManualProjectCreate.tsx @@ -22,13 +22,13 @@ import { debounce } from 'lodash'; import * as React from 'react'; import { createProject, doesComponentExists } from '../../../api/components'; import ProjectKeyInput from '../../../components/common/ProjectKeyInput'; +import { SubmitButton } from '../../../components/controls/buttons'; +import ValidationInput from '../../../components/controls/ValidationInput'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; import { PROJECT_KEY_INVALID_CHARACTERS, validateProjectKey } from '../../../helpers/projects'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import ValidationInput from '../../../sonar-ui-common/components/controls/ValidationInput'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { ProjectKeyValidationResult } from '../../../types/component'; import { PROJECT_NAME_MAX_LEN } from './constants'; import CreateProjectPageHeader from './CreateProjectPageHeader'; diff --git a/server/sonar-web/src/main/js/apps/create/project/PersonalAccessTokenForm.tsx b/server/sonar-web/src/main/js/apps/create/project/PersonalAccessTokenForm.tsx index 6f82c135653..b452c0f096e 100644 --- a/server/sonar-web/src/main/js/apps/create/project/PersonalAccessTokenForm.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/PersonalAccessTokenForm.tsx @@ -24,12 +24,12 @@ import { checkPersonalAccessTokenIsValid, setAlmPersonalAccessToken } from '../../../api/alm-integrations'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import ValidationInput from '../../../sonar-ui-common/components/controls/ValidationInput'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { SubmitButton } from '../../../components/controls/buttons'; +import ValidationInput from '../../../components/controls/ValidationInput'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/create/project/WrongBindingCountAlert.tsx b/server/sonar-web/src/main/js/apps/create/project/WrongBindingCountAlert.tsx index d60551a35f4..6b90db1870c 100644 --- a/server/sonar-web/src/main/js/apps/create/project/WrongBindingCountAlert.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/WrongBindingCountAlert.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { getGlobalSettingsUrl } from '../../../helpers/urls'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { AlmKeys } from '../../../types/alm-settings'; import { ALM_INTEGRATION } from '../../settings/components/AdditionalCategoryKeys'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzurePersonalAccessTokenForm-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzurePersonalAccessTokenForm-test.tsx index 51740e63712..430ce61f194 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzurePersonalAccessTokenForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzurePersonalAccessTokenForm-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { SubmitButton } from '../../../../components/controls/buttons'; import { mockAlmSettingsInstance } from '../../../../helpers/mocks/alm-settings'; -import { SubmitButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import { change, submit } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, submit } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import AzurePersonalAccessTokenForm, { AzurePersonalAccessTokenFormProps diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectAccordion-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectAccordion-test.tsx index d75707cb429..b8bb15db7ca 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectAccordion-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectAccordion-test.tsx @@ -19,10 +19,10 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import BoxedGroupAccordion from '../../../../components/controls/BoxedGroupAccordion'; +import Radio from '../../../../components/controls/Radio'; import { mockAzureProject, mockAzureRepository } from '../../../../helpers/mocks/alm-integrations'; import { mockEvent } from '../../../../helpers/testMocks'; -import BoxedGroupAccordion from '../../../../sonar-ui-common/components/controls/BoxedGroupAccordion'; -import Radio from '../../../../sonar-ui-common/components/controls/Radio'; import AzureProjectAccordion, { AzureProjectAccordionProps } from '../AzureProjectAccordion'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectCreate-test.tsx index bac8a0b607c..0eb6e607900 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectCreate-test.tsx @@ -31,7 +31,7 @@ import { import { mockAzureProject, mockAzureRepository } from '../../../../helpers/mocks/alm-integrations'; import { mockAlmSettingsInstance } from '../../../../helpers/mocks/alm-settings'; import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import AzureProjectCreate from '../AzureProjectCreate'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectsList-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectsList-test.tsx index 45871211fb2..88d9c64f297 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectsList-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/AzureProjectsList-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import ListFooter from '../../../../components/controls/ListFooter'; import { mockAzureProject, mockAzureRepository } from '../../../../helpers/mocks/alm-integrations'; -import ListFooter from '../../../../sonar-ui-common/components/controls/ListFooter'; import AzureProjectAccordion from '../AzureProjectAccordion'; import AzureProjectsList, { AzureProjectsListProps } from '../AzureProjectsList'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloudProjectCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloudProjectCreate-test.tsx index c06c5a9c675..e7c3392d8c3 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloudProjectCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketCloudProjectCreate-test.tsx @@ -26,7 +26,7 @@ import { import { mockBitbucketCloudRepository } from '../../../../helpers/mocks/alm-integrations'; import { mockBitbucketCloudAlmSettingsInstance } from '../../../../helpers/mocks/alm-settings'; import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import BitbucketCloudProjectCreate, { BITBUCKET_CLOUD_PROJECTS_PAGESIZE } from '../BitbucketCloudProjectCreate'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketImportRepositoryForm-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketImportRepositoryForm-test.tsx index 9fd4b31172e..78eb0991520 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketImportRepositoryForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketImportRepositoryForm-test.tsx @@ -20,12 +20,12 @@ import { shallow } from 'enzyme'; import * as React from 'react'; +import SearchBox from '../../../../components/controls/SearchBox'; import { mockBitbucketProject, mockBitbucketRepository } from '../../../../helpers/mocks/alm-integrations'; -import SearchBox from '../../../../sonar-ui-common/components/controls/SearchBox'; -import { change } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change } from '../../../../helpers/testUtils'; import BitbucketImportRepositoryForm, { BitbucketImportRepositoryFormProps } from '../BitbucketImportRepositoryForm'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectAccordion-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectAccordion-test.tsx index 8d1f7062a79..a07d8e41e2e 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectAccordion-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectAccordion-test.tsx @@ -20,11 +20,11 @@ import { shallow } from 'enzyme'; import * as React from 'react'; +import Radio from '../../../../components/controls/Radio'; import { mockBitbucketProject, mockBitbucketRepository } from '../../../../helpers/mocks/alm-integrations'; -import Radio from '../../../../sonar-ui-common/components/controls/Radio'; import BitbucketProjectAccordion, { BitbucketProjectAccordionProps } from '../BitbucketProjectAccordion'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectCreate-test.tsx index bd13b29af8f..9f2a741277b 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketProjectCreate-test.tsx @@ -31,7 +31,7 @@ import { } from '../../../../helpers/mocks/alm-integrations'; import { mockAlmSettingsInstance } from '../../../../helpers/mocks/alm-settings'; import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import BitbucketProjectCreate from '../BitbucketProjectCreate'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketRepositories-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketRepositories-test.tsx index 49a5236e56c..bd3a568d303 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketRepositories-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/BitbucketRepositories-test.tsx @@ -24,7 +24,7 @@ import { mockBitbucketProject, mockBitbucketRepository } from '../../../../helpers/mocks/alm-integrations'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import BitbucketProjectAccordion from '../BitbucketProjectAccordion'; import BitbucketRepositories, { BitbucketRepositoriesProps } from '../BitbucketRepositories'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectModeSelection-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectModeSelection-test.tsx index 7dc3b94019d..c8aa9932ad1 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectModeSelection-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectModeSelection-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import { CreateProjectModeSelection, diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx index ca4d3f3337f..62f74b97143 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getAlmSettings } from '../../../../api/alm-settings'; import { mockLocation, mockLoggedInUser, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import AlmBindingDefinitionForm from '../../../settings/components/almIntegration/AlmBindingDefinitionForm'; import CreateProjectModeSelection from '../CreateProjectModeSelection'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreate-test.tsx index a8647296957..108ef10c24d 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreate-test.tsx @@ -28,7 +28,7 @@ import { import { mockGitHubRepository } from '../../../../helpers/mocks/alm-integrations'; import { mockAlmSettingsInstance } from '../../../../helpers/mocks/alm-settings'; import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import GitHubProjectCreate from '../GitHubProjectCreate'; jest.mock('../../../../api/alm-integrations', () => ({ diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreateRenderer-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreateRenderer-test.tsx index 997c309ee5e..093dd35b56d 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreateRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitHubProjectCreateRenderer-test.tsx @@ -19,10 +19,10 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import Radio from '../../../../components/controls/Radio'; +import SearchBox from '../../../../components/controls/SearchBox'; +import SearchSelect from '../../../../components/controls/SearchSelect'; import { mockGitHubRepository } from '../../../../helpers/mocks/alm-integrations'; -import Radio from '../../../../sonar-ui-common/components/controls/Radio'; -import SearchBox from '../../../../sonar-ui-common/components/controls/SearchBox'; -import SearchSelect from '../../../../sonar-ui-common/components/controls/SearchSelect'; import { GithubOrganization } from '../../../../types/alm-integration'; import GitHubProjectCreateRenderer, { GitHubProjectCreateRendererProps diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectCreate-test.tsx index 56bfc8ef52f..33ae0d2925b 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectCreate-test.tsx @@ -23,7 +23,7 @@ import { getGitlabProjects, importGitlabProject } from '../../../../api/alm-inte import { mockGitlabProject } from '../../../../helpers/mocks/alm-integrations'; import { mockAlmSettingsInstance } from '../../../../helpers/mocks/alm-settings'; import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import GitlabProjectCreate from '../GitlabProjectCreate'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectSelectionForm-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectSelectionForm-test.tsx index 446508109ef..7298101bcc2 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectSelectionForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/GitlabProjectSelectionForm-test.tsx @@ -19,10 +19,10 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { Button } from '../../../../components/controls/buttons'; +import ListFooter from '../../../../components/controls/ListFooter'; +import SearchBox from '../../../../components/controls/SearchBox'; import { mockGitlabProject } from '../../../../helpers/mocks/alm-integrations'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import ListFooter from '../../../../sonar-ui-common/components/controls/ListFooter'; -import SearchBox from '../../../../sonar-ui-common/components/controls/SearchBox'; import GitlabProjectSelectionForm, { GitlabProjectSelectionFormProps } from '../GitlabProjectSelectionForm'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/ManualProjectCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/ManualProjectCreate-test.tsx index 42417a3c2dc..c3b8464f870 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/ManualProjectCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/ManualProjectCreate-test.tsx @@ -22,11 +22,11 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { createProject, doesComponentExists } from '../../../../api/components'; import ProjectKeyInput from '../../../../components/common/ProjectKeyInput'; +import { SubmitButton } from '../../../../components/controls/buttons'; +import ValidationInput from '../../../../components/controls/ValidationInput'; import { validateProjectKey } from '../../../../helpers/projects'; import { mockEvent } from '../../../../helpers/testMocks'; -import { SubmitButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import ValidationInput from '../../../../sonar-ui-common/components/controls/ValidationInput'; -import { change, submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import { ProjectKeyValidationResult } from '../../../../types/component'; import { PROJECT_NAME_MAX_LEN } from '../constants'; import ManualProjectCreate from '../ManualProjectCreate'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/PersonalAccessTokenForm-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/PersonalAccessTokenForm-test.tsx index 082039b0a93..4f273e2dfd1 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/PersonalAccessTokenForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/PersonalAccessTokenForm-test.tsx @@ -23,12 +23,12 @@ import { checkPersonalAccessTokenIsValid, setAlmPersonalAccessToken } from '../../../../api/alm-integrations'; +import { SubmitButton } from '../../../../components/controls/buttons'; import { mockAlmSettingsInstance, mockBitbucketCloudAlmSettingsInstance } from '../../../../helpers/mocks/alm-settings'; -import { SubmitButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import { change, submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import PersonalAccessTokenForm from '../PersonalAccessTokenForm'; diff --git a/server/sonar-web/src/main/js/apps/documentation/components/App.tsx b/server/sonar-web/src/main/js/apps/documentation/components/App.tsx index a8d8423fb78..c7847f7656c 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/App.tsx @@ -28,11 +28,11 @@ import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import NotFound from '../../../app/components/NotFound'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; import DocMarkdownBlock from '../../../components/docs/DocMarkdownBlock'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { ParsedContent, separateFrontMatter } from '../../../helpers/markdown'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { addSideBarClass, removeSideBarClass } from '../../../sonar-ui-common/helpers/pages'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; +import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages'; +import { isDefined } from '../../../helpers/types'; import { InstalledPlugin, PluginType } from '../../../types/plugins'; import { getUrlsList } from '../navTreeUtils'; import getPages from '../pages'; diff --git a/server/sonar-web/src/main/js/apps/documentation/components/MenuBlock.tsx b/server/sonar-web/src/main/js/apps/documentation/components/MenuBlock.tsx index 2ad79cbcf6c..fb51d62654e 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/MenuBlock.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/MenuBlock.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import { DocNavigationItem, DocsNavigationBlock } from 'Docs/@types/types'; import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import OpenCloseIcon from '../../../sonar-ui-common/components/icons/OpenCloseIcon'; +import { ButtonLink } from '../../../components/controls/buttons'; +import OpenCloseIcon from '../../../components/icons/OpenCloseIcon'; import { isDocsNavigationBlock } from '../navTreeUtils'; import { DocumentationEntry, getNodeFromUrl } from '../utils'; import { MenuItem } from './MenuItem'; diff --git a/server/sonar-web/src/main/js/apps/documentation/components/MenuExternalLink.tsx b/server/sonar-web/src/main/js/apps/documentation/components/MenuExternalLink.tsx index cc92fa60f99..5eb1d5de655 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/MenuExternalLink.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/MenuExternalLink.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import DetachIcon from '../../../sonar-ui-common/components/icons/DetachIcon'; +import DetachIcon from '../../../components/icons/DetachIcon'; interface Props { title: string; diff --git a/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx b/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx index 23b19e45a08..4ec73f848d3 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx @@ -21,7 +21,7 @@ import { DocNavigationItem } from 'Docs/@types/types'; import { sortBy } from 'lodash'; import lunr, { LunrBuilder, LunrIndex, LunrToken } from 'lunr'; import * as React from 'react'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; +import { isDefined } from '../../../helpers/types'; import { getUrlsList } from '../navTreeUtils'; import { DocumentationEntry } from '../utils'; import SearchResultEntry from './SearchResultEntry'; diff --git a/server/sonar-web/src/main/js/apps/documentation/components/Sidebar.tsx b/server/sonar-web/src/main/js/apps/documentation/components/Sidebar.tsx index 869f0b7f22c..69cae6bc2f8 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/Sidebar.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/Sidebar.tsx @@ -19,7 +19,7 @@ */ import { DocNavigationItem } from 'Docs/@types/types'; import * as React from 'react'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; +import SearchBox from '../../../components/controls/SearchBox'; import { DocumentationEntry } from '../utils'; import Menu from './Menu'; import SearchResults from './SearchResults'; diff --git a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx index f48ac2be598..1c18bcb3437 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { addSideBarClass, removeSideBarClass } from '../../../../sonar-ui-common/helpers/pages'; -import { request } from '../../../../sonar-ui-common/helpers/request'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { addSideBarClass, removeSideBarClass } from '../../../../helpers/pages'; +import { request } from '../../../../helpers/request'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { InstalledPlugin } from '../../../../types/plugins'; import getPages from '../../pages'; import App from '../App'; @@ -51,12 +51,12 @@ jest.mock('Docs/../static/SonarQubeNavigationTree.json', () => ({ ] })); -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addSideBarClass: jest.fn(), removeSideBarClass: jest.fn() })); -jest.mock('../../../../sonar-ui-common/helpers/request', () => { +jest.mock('../../../../helpers/request', () => { const { mockDocumentationMarkdown } = jest.requireActual('../../../../helpers/testMocks'); return { request: jest.fn(() => ({ diff --git a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/MenuBlock-test.tsx b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/MenuBlock-test.tsx index a2b0ed72248..22e19b5b9a5 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/MenuBlock-test.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/MenuBlock-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import MenuBlock from '../MenuBlock'; it('should render a closed menu block', () => { diff --git a/server/sonar-web/src/main/js/apps/documentation/routes.ts b/server/sonar-web/src/main/js/apps/documentation/routes.ts index 76cfc03421d..7b420fd6754 100644 --- a/server/sonar-web/src/main/js/apps/documentation/routes.ts +++ b/server/sonar-web/src/main/js/apps/documentation/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const App = lazyLoadComponent(() => import(/* webpackChunkName: "docs" */ './components/App')); diff --git a/server/sonar-web/src/main/js/apps/groups/components/App.tsx b/server/sonar-web/src/main/js/apps/groups/components/App.tsx index 01eb3dada9f..efa8eeb4429 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/App.tsx @@ -21,10 +21,10 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { createGroup, deleteGroup, searchUsersGroups, updateGroup } from '../../../api/user_groups'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { omitNil } from '../../../sonar-ui-common/helpers/request'; +import ListFooter from '../../../components/controls/ListFooter'; +import SearchBox from '../../../components/controls/SearchBox'; +import { translate } from '../../../helpers/l10n'; +import { omitNil } from '../../../helpers/request'; import DeleteForm from './DeleteForm'; import Form from './Form'; import Header from './Header'; diff --git a/server/sonar-web/src/main/js/apps/groups/components/DeleteForm.tsx b/server/sonar-web/src/main/js/apps/groups/components/DeleteForm.tsx index 4ba75a1e023..bae62700da5 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/DeleteForm.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/DeleteForm.tsx @@ -18,13 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Props { group: T.Group; diff --git a/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx b/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx index dd8dc1cd57d..59f29c29d74 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonIcon } from '../../../sonar-ui-common/components/controls/buttons'; -import BulletListIcon from '../../../sonar-ui-common/components/icons/BulletListIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonIcon } from '../../../components/controls/buttons'; +import BulletListIcon from '../../../components/icons/BulletListIcon'; +import { translate } from '../../../helpers/l10n'; import EditMembersModal from './EditMembersModal'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/groups/components/EditMembersModal.tsx b/server/sonar-web/src/main/js/apps/groups/components/EditMembersModal.tsx index 462aac441ab..619ffe94e34 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/EditMembersModal.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/EditMembersModal.tsx @@ -20,13 +20,13 @@ import { find, without } from 'lodash'; import * as React from 'react'; import { addUserToGroup, getUsersInGroup, removeUserFromGroup } from '../../../api/user_groups'; -import { ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; +import { ResetButtonLink } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; import SelectList, { SelectListFilter, SelectListSearchParams -} from '../../../sonar-ui-common/components/controls/SelectList'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/SelectList'; +import { translate } from '../../../helpers/l10n'; interface Props { group: T.Group; diff --git a/server/sonar-web/src/main/js/apps/groups/components/Form.tsx b/server/sonar-web/src/main/js/apps/groups/components/Form.tsx index 2796e308e59..2efab620f3e 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/Form.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/Form.tsx @@ -18,15 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; interface Props { confirmButtonText: string; diff --git a/server/sonar-web/src/main/js/apps/groups/components/Header.tsx b/server/sonar-web/src/main/js/apps/groups/components/Header.tsx index 6aba69becfb..6a9a1f5e742 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/Header.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/Header.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import Form from './Form'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/groups/components/List.tsx b/server/sonar-web/src/main/js/apps/groups/components/List.tsx index 7ad06d1d1ee..789811564c1 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/List.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/List.tsx @@ -19,7 +19,7 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import ListItem from './ListItem'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/groups/components/ListItem.tsx b/server/sonar-web/src/main/js/apps/groups/components/ListItem.tsx index 59ceb8493b4..4e90fd62a63 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/ListItem.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/ListItem.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import ActionsDropdown, { ActionsDropdownDivider, ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/ActionsDropdown'; +import { translate } from '../../../helpers/l10n'; import EditMembers from './EditMembers'; export interface ListItemProps { diff --git a/server/sonar-web/src/main/js/apps/groups/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/groups/components/__tests__/App-test.tsx index efeed575ab9..b0d1846560f 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/__tests__/App-test.tsx @@ -26,7 +26,7 @@ import { updateGroup } from '../../../../api/user_groups'; import { mockGroup } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import App from '../App'; jest.mock('../../../../api/user_groups', () => ({ diff --git a/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembers-test.tsx b/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembers-test.tsx index f27db315de8..7258b78ab27 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembers-test.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembers-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import EditMembers from '../EditMembers'; it('should edit members', () => { diff --git a/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembersModal-test.tsx b/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembersModal-test.tsx index d6e7096c8a6..86c8408460e 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembersModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/__tests__/EditMembersModal-test.tsx @@ -20,10 +20,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { addUserToGroup, getUsersInGroup, removeUserFromGroup } from '../../../../api/user_groups'; -import SelectList, { - SelectListFilter -} from '../../../../sonar-ui-common/components/controls/SelectList'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import SelectList, { SelectListFilter } from '../../../../components/controls/SelectList'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import EditMembersModal from '../EditMembersModal'; const group = { id: 1, name: 'foo', membersCount: 1 }; diff --git a/server/sonar-web/src/main/js/apps/groups/components/__tests__/Form-test.tsx b/server/sonar-web/src/main/js/apps/groups/components/__tests__/Form-test.tsx index 65c62164219..367f2d7d897 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/__tests__/Form-test.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/__tests__/Form-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change, click, submit } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, click, submit } from '../../../../helpers/testUtils'; import Form from '../Form'; it('should render form', async () => { diff --git a/server/sonar-web/src/main/js/apps/groups/components/__tests__/Header-test.tsx b/server/sonar-web/src/main/js/apps/groups/components/__tests__/Header-test.tsx index e22d914d748..ef620eece6d 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/__tests__/Header-test.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/__tests__/Header-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import Header from '../Header'; it('should create new group', () => { diff --git a/server/sonar-web/src/main/js/apps/groups/routes.ts b/server/sonar-web/src/main/js/apps/groups/routes.ts index f57b5528d59..3056655f8ba 100644 --- a/server/sonar-web/src/main/js/apps/groups/routes.ts +++ b/server/sonar-web/src/main/js/apps/groups/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts index 6f69f84b739..50109797506 100644 --- a/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { scrollToElement } from '../../../helpers/scrolling'; import { SecurityStandard } from '../../../types/security'; import { scrollToIssue, @@ -26,7 +26,7 @@ import { shouldOpenStandardsFacet } from '../utils'; -jest.mock('../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../helpers/scrolling', () => ({ scrollToElement: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.tsx b/server/sonar-web/src/main/js/apps/issues/components/App.tsx index afb752b00c2..a3d1cae7da1 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/App.tsx @@ -27,29 +27,29 @@ import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import EmptySearch from '../../../components/common/EmptySearch'; import FiltersHeader from '../../../components/common/FiltersHeader'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; +import { Button } from '../../../components/controls/buttons'; +import Checkbox from '../../../components/controls/Checkbox'; +import ListFooter from '../../../components/controls/ListFooter'; import { Location, Router } from '../../../components/hoc/withRouter'; import '../../../components/search-navigator.css'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { fillBranchLike, getBranchLikeQuery, isPullRequest, isSameBranchLike } from '../../../helpers/branch-like'; -import { isSonarCloud } from '../../../helpers/system'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import handleRequiredAuthentication from '../../../sonar-ui-common/helpers/handleRequiredAuthentication'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { addSideBarClass, addWhitePageClass, removeSideBarClass, removeWhitePageClass -} from '../../../sonar-ui-common/helpers/pages'; -import { serializeDate } from '../../../sonar-ui-common/helpers/query'; +} from '../../../helpers/pages'; +import { serializeDate } from '../../../helpers/query'; +import { isSonarCloud } from '../../../helpers/system'; import { BranchLike } from '../../../types/branch-like'; import { Facet, diff --git a/server/sonar-web/src/main/js/apps/issues/components/AppContainer.tsx b/server/sonar-web/src/main/js/apps/issues/components/AppContainer.tsx index 551b7ebcd42..b6762016283 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/AppContainer.tsx @@ -20,8 +20,8 @@ import { connect } from 'react-redux'; import { searchIssues } from '../../../api/issues'; import { withRouter } from '../../../components/hoc/withRouter'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; import { parseIssueFromResponse } from '../../../helpers/issues'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; import { fetchBranchStatus } from '../../../store/rootActions'; import { getCurrentUser, Store } from '../../../store/rootReducer'; import { FetchIssuesPromise } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx index 70c3ceaae8a..0445c130997 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx @@ -23,23 +23,20 @@ import { FormattedMessage } from 'react-intl'; import { bulkChangeIssues, searchIssueTags } from '../../../api/issues'; import throwGlobalError from '../../../app/utils/throwGlobalError'; import FormattingTips from '../../../components/common/FormattingTips'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Checkbox from '../../../components/controls/Checkbox'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import Modal from '../../../components/controls/Modal'; +import Radio from '../../../components/controls/Radio'; +import SearchSelect from '../../../components/controls/SearchSelect'; +import Select from '../../../components/controls/Select'; +import Tooltip from '../../../components/controls/Tooltip'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; import SeverityHelper from '../../../components/shared/SeverityHelper'; +import { Alert } from '../../../components/ui/Alert'; import Avatar from '../../../components/ui/Avatar'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { isLoggedIn, isUserActive } from '../../../helpers/users'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import SearchSelect from '../../../sonar-ui-common/components/controls/SearchSelect'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import { searchAssignees } from '../utils'; interface AssigneeOption { diff --git a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx index af8072af9b9..8328b94727d 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { collapsePath, limitComponentName } from '../../../sonar-ui-common/helpers/path'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { translateWithParameters } from '../../../helpers/l10n'; +import { collapsePath, limitComponentName } from '../../../helpers/path'; import { getSelectedLocation } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx index b01cb385fae..f66ec913dee 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import PageCounter from '../../../components/common/PageCounter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { current: number | undefined; diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx index 6209307c532..f09aea4e498 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import SourceViewer from '../../../components/SourceViewer/SourceViewer'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { scrollToElement } from '../../../helpers/scrolling'; import { BranchLike } from '../../../types/branch-like'; import CrossComponentSourceViewer from '../crossComponentSourceViewer/CrossComponentSourceViewer'; import { getLocations, getSelectedLocation } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/components/MyIssuesFilter.tsx b/server/sonar-web/src/main/js/apps/issues/components/MyIssuesFilter.tsx index c20291bf6ef..e008f7d901e 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/MyIssuesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/MyIssuesFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; interface Props { myIssues: boolean; diff --git a/server/sonar-web/src/main/js/apps/issues/components/NoIssues.tsx b/server/sonar-web/src/main/js/apps/issues/components/NoIssues.tsx index 79f3a88cc80..88b98c6cea9 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/NoIssues.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/NoIssues.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import '../../../components/common/EmptySearch.css'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function NoIssues() { return ( diff --git a/server/sonar-web/src/main/js/apps/issues/components/NoMyIssues.tsx b/server/sonar-web/src/main/js/apps/issues/components/NoMyIssues.tsx index 3d1e351fb65..8045effe49c 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/NoMyIssues.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/NoMyIssues.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import '../../../components/common/EmptySearch.css'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function NoMyIssues() { return ( diff --git a/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx index 0c9f4c35adc..9437e70468b 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import HomePageSelect from '../../../components/controls/HomePageSelect'; import PageShortcutsTooltip from '../../../components/ui/PageShortcutsTooltip'; +import { translate } from '../../../helpers/l10n'; import { isSonarCloud } from '../../../helpers/system'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import IssuesCounter from './IssuesCounter'; import TotalEffort from './TotalEffort'; diff --git a/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx b/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx index c03300e4a7a..18f5dc98f8e 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; export default function TotalEffort({ effort }: { effort: number }) { return ( diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/issues/components/__tests__/App-test.tsx index bd629cc8ff2..96dfacafa71 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/App-test.tsx @@ -20,7 +20,15 @@ import { shallow } from 'enzyme'; import * as key from 'keymaster'; import * as React from 'react'; +import handleRequiredAuthentication from '../../../../helpers/handleRequiredAuthentication'; +import { KeyCodes } from '../../../../helpers/keycodes'; import { mockPullRequest } from '../../../../helpers/mocks/branch-like'; +import { + addSideBarClass, + addWhitePageClass, + removeSideBarClass, + removeWhitePageClass +} from '../../../../helpers/pages'; import { mockComponent, mockCurrentUser, @@ -30,15 +38,7 @@ import { mockLoggedInUser, mockRouter } from '../../../../helpers/testMocks'; -import handleRequiredAuthentication from '../../../../sonar-ui-common/helpers/handleRequiredAuthentication'; -import { KeyCodes } from '../../../../sonar-ui-common/helpers/keycodes'; -import { - addSideBarClass, - addWhitePageClass, - removeSideBarClass, - removeWhitePageClass -} from '../../../../sonar-ui-common/helpers/pages'; -import { KEYCODE_MAP, keydown, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { KEYCODE_MAP, keydown, waitAndUpdate } from '../../../../helpers/testUtils'; import { disableLocationsNavigator, enableLocationsNavigator, @@ -50,14 +50,14 @@ import { import App from '../App'; import BulkChangeModal from '../BulkChangeModal'; -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addSideBarClass: jest.fn(), addWhitePageClass: jest.fn(), removeSideBarClass: jest.fn(), removeWhitePageClass: jest.fn() })); -jest.mock('../../../../sonar-ui-common/helpers/handleRequiredAuthentication', () => ({ +jest.mock('../../../../helpers/handleRequiredAuthentication', () => ({ default: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/BulkChangeModal-test.tsx b/server/sonar-web/src/main/js/apps/issues/components/__tests__/BulkChangeModal-test.tsx index 11bd8a3e0b8..e24612c56e0 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/BulkChangeModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/BulkChangeModal-test.tsx @@ -20,10 +20,10 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { searchIssueTags } from '../../../../api/issues'; +import { SubmitButton } from '../../../../components/controls/buttons'; +import Select from '../../../../components/controls/Select'; import { mockIssue } from '../../../../helpers/testMocks'; -import { SubmitButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; -import { change, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, waitAndUpdate } from '../../../../helpers/testUtils'; import BulkChangeModal, { MAX_PAGE_SIZE } from '../BulkChangeModal'; jest.mock('../../../../api/issues', () => ({ diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesList-test.tsx b/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesList-test.tsx index 5695ad06edf..dfbc6b4aaa2 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesList-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesList-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockIssue } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import IssuesList from '../IssuesList'; it('should render correctly', async () => { diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocationBadge.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocationBadge.tsx index b158295fa0c..c7303a7b17c 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocationBadge.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocationBadge.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import LocationIndex from '../../../components/common/LocationIndex'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; interface Props { count: number; diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocations.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocations.tsx index 37f17877ccc..fe1b4cfad28 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocations.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocations.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; +import { Button } from '../../../components/controls/buttons'; import ConciseIssueLocationBadge from './ConciseIssueLocationBadge'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesList.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesList.tsx index 7f9449008ce..77058d1e9b4 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesList.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesList.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { scrollToElement } from '../../../helpers/scrolling'; import ConciseIssue from './ConciseIssue'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesListHeader.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesListHeader.tsx index 305dc312cc8..5366fb57553 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesListHeader.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import BackButton from '../../../components/controls/BackButton'; import PageShortcutsTooltip from '../../../components/ui/PageShortcutsTooltip'; -import BackButton from '../../../sonar-ui-common/components/controls/BackButton'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface ConciseIssuesListHeaderProps { displayBackButton: boolean; diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/CrossFileLocationsNavigator.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/CrossFileLocationsNavigator.tsx index 1131f60d157..09d1a4db6d7 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/CrossFileLocationsNavigator.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/CrossFileLocationsNavigator.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { collapsePath } from '../../../sonar-ui-common/helpers/path'; +import { translateWithParameters } from '../../../helpers/l10n'; +import { collapsePath } from '../../../helpers/path'; import ConciseIssueLocationsNavigatorLocation from './ConciseIssueLocationsNavigatorLocation'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueBox-test.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueBox-test.tsx index 785a0fc8232..a4d34126b6e 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueBox-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueBox-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockIssue } from '../../../../helpers/testMocks'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import ConciseIssueBox from '../ConciseIssueBox'; it('should render correctly', async () => { diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/CrossFileLocationsNavigator-test.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/CrossFileLocationsNavigator-test.tsx index 355e480b2ed..dd7a5f92199 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/CrossFileLocationsNavigator-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/CrossFileLocationsNavigator-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockFlowLocation } from '../../../../helpers/testMocks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import CrossFileLocationsNavigator from '../CrossFileLocationsNavigator'; const location1: T.FlowLocation = { diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx index 827372f88ad..a08ec46fa94 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; const CrossComponentSourceViewer = lazyLoadComponent( () => import(/* webpackPrefetch: true */ './CrossComponentSourceViewerWrapper'), diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewerWrapper.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewerWrapper.tsx index 8159080a98a..4b23e381d76 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewerWrapper.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewerWrapper.tsx @@ -33,11 +33,11 @@ import { issuesByComponentAndLine } from '../../../components/SourceViewer/helpers/indexing'; import { SourceViewerContext } from '../../../components/SourceViewer/SourceViewerContext'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { WorkspaceContext } from '../../../components/workspace/context'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import ComponentSourceSnippetGroupViewer from './ComponentSourceSnippetGroupViewer'; import { groupLocationsByComponent } from './utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx index b43ae9943ac..2d14573f536 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx @@ -19,6 +19,7 @@ */ import classNames from 'classnames'; import * as React from 'react'; +import ExpandSnippetIcon from '../../../components/icons/ExpandSnippetIcon'; import Line from '../../../components/SourceViewer/components/Line'; import { symbolsByLine } from '../../../components/SourceViewer/helpers/indexing'; import { getSecondaryIssueLocationsForLine } from '../../../components/SourceViewer/helpers/issueLocations'; @@ -27,9 +28,8 @@ import { optimizeLocationMessage, optimizeSelectedIssue } from '../../../components/SourceViewer/helpers/lines'; -import ExpandSnippetIcon from '../../../sonar-ui-common/components/icons/ExpandSnippetIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { scrollHorizontally } from '../../../sonar-ui-common/helpers/scrolling'; +import { translate } from '../../../helpers/l10n'; +import { scrollHorizontally } from '../../../helpers/scrolling'; import { BranchLike } from '../../../types/branch-like'; import './SnippetViewer.css'; import { inSnippet, LINES_BELOW_ISSUE } from './utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/ComponentSourceSnippetGroupViewer-test.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/ComponentSourceSnippetGroupViewer-test.tsx index b70c1779de4..899005fdf8d 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/ComponentSourceSnippetGroupViewer-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/ComponentSourceSnippetGroupViewer-test.tsx @@ -30,7 +30,7 @@ import { mockSourceLine, mockSourceViewerFile } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import ComponentSourceSnippetGroupViewer from '../ComponentSourceSnippetGroupViewer'; import SnippetViewer from '../SnippetViewer'; diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewerWrapper-test.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewerWrapper-test.tsx index e1385d49a63..89888878eb8 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewerWrapper-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewerWrapper-test.tsx @@ -28,7 +28,7 @@ import { mockSourceLine, mockSourceViewerFile } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import CrossComponentSourceViewerWrapper from '../CrossComponentSourceViewerWrapper'; jest.mock('../../../../api/issues', () => { diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx index 1bc3d76f177..3dce088da85 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx @@ -21,11 +21,11 @@ import { mount, shallow } from 'enzyme'; import { range } from 'lodash'; import * as React from 'react'; import { mockMainBranch } from '../../../../helpers/mocks/branch-like'; +import { scrollHorizontally } from '../../../../helpers/scrolling'; import { mockIssue, mockSourceLine, mockSourceViewerFile } from '../../../../helpers/testMocks'; -import { scrollHorizontally } from '../../../../sonar-ui-common/helpers/scrolling'; import SnippetViewer from '../SnippetViewer'; -jest.mock('../../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../../helpers/scrolling', () => ({ scrollHorizontally: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/issues/redirects.ts b/server/sonar-web/src/main/js/apps/issues/redirects.ts index 83671dcf33b..35cc0eebc6b 100644 --- a/server/sonar-web/src/main/js/apps/issues/redirects.ts +++ b/server/sonar-web/src/main/js/apps/issues/redirects.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { Location } from '../../sonar-ui-common/helpers/urls'; +import { Location } from '../../helpers/urls'; import { areMyIssuesSelected, parseQuery, serializeQuery } from './utils'; function parseHash(hash: string) { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx index 3904b0a5cfe..20154382029 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx @@ -21,9 +21,9 @@ import { omit, sortBy, without } from 'lodash'; import * as React from 'react'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; import Avatar from '../../../components/ui/Avatar'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { isUserActive } from '../../../helpers/users'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; import { Facet } from '../../../types/issues'; import { Query, searchAssignees } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx index bcedd8f2eb3..465395d1b79 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx @@ -21,8 +21,8 @@ import { omit } from 'lodash'; import * as React from 'react'; import { searchIssueAuthors } from '../../../api/issues'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; +import { translate } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { Facet } from '../../../types/issues'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx index db082f4d93e..a39c65adc52 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx @@ -21,19 +21,19 @@ import * as isSameDay from 'date-fns/is_same_day'; import { max } from 'lodash'; import * as React from 'react'; import { InjectedIntlProps, injectIntl } from 'react-intl'; +import BarChart from '../../../components/charts/BarChart'; import DateRangeInput from '../../../components/controls/DateRangeInput'; import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; -import BarChart from '../../../sonar-ui-common/components/charts/BarChart'; -import { longFormatterOption } from '../../../sonar-ui-common/components/intl/DateFormatter'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; +import { longFormatterOption } from '../../../components/intl/DateFormatter'; +import DateFromNow from '../../../components/intl/DateFromNow'; import DateTimeFormatter, { formatterOption as dateTimeFormatterOption -} from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +} from '../../../components/intl/DateTimeFormatter'; +import { parseDate } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { isPortfolioLike } from '../../../types/component'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx index cca8822e56f..650557aafa9 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx @@ -21,11 +21,11 @@ import { omit } from 'lodash'; import * as React from 'react'; import { getDirectories } from '../../../api/components'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { collapsePath } from '../../../sonar-ui-common/helpers/path'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; +import { translate } from '../../../helpers/l10n'; +import { collapsePath } from '../../../helpers/path'; +import { highlightTerm } from '../../../helpers/search'; import { BranchLike } from '../../../types/branch-like'; import { TreeComponentWithPath } from '../../../types/component'; import { Facet } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx index b2c6a8d5d3e..b390d5c4d36 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx @@ -21,12 +21,12 @@ import { omit } from 'lodash'; import * as React from 'react'; import { getFiles } from '../../../api/components'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { collapsePath, splitPath } from '../../../sonar-ui-common/helpers/path'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; +import { translate } from '../../../helpers/l10n'; +import { collapsePath, splitPath } from '../../../helpers/path'; +import { highlightTerm } from '../../../helpers/search'; +import { isDefined } from '../../../helpers/types'; import { BranchLike } from '../../../types/branch-like'; import { TreeComponentWithPath } from '../../../types/component'; import { Facet } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx index 1109b5dbcaf..a898a622af5 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx @@ -21,8 +21,8 @@ import { omit, uniqBy } from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; +import { translate } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { getLanguages, Store } from '../../../store/rootReducer'; import { Facet, ReferencedLanguage } from '../../../types/issues'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx index 31442815910..4738c61842d 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx @@ -21,9 +21,9 @@ import { omit } from 'lodash'; import * as React from 'react'; import { getTree, searchProjects } from '../../../api/components'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { translate } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { ComponentQualifier } from '../../../types/component'; import { Facet, ReferencedComponent } from '../../../types/issues'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx index 157a604fa3b..3d471491686 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx @@ -24,7 +24,7 @@ import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { formatFacetStat, Query } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx index b962c161c69..61d48932cfa 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx @@ -21,7 +21,7 @@ import { omit } from 'lodash'; import * as React from 'react'; import { searchRules } from '../../../api/rules'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Facet, ReferencedRule } from '../../../types/issues'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ScopeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ScopeFacet.tsx index a7c58981a29..44d3e34dc85 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ScopeFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ScopeFacet.tsx @@ -24,9 +24,9 @@ import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { SOURCE_SCOPES } from '../../../helpers/constants'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { formatFacetStat, Query } from '../utils'; export interface ScopeFacetProps { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx index 3a9ccae6834..e607e0bf9b9 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx @@ -25,7 +25,7 @@ import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; import SeverityHelper from '../../../components/shared/SeverityHelper'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { formatFacetStat, Query } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx index c779e26ed28..ae087df51be 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx @@ -25,6 +25,8 @@ import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; +import { translate } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { getStandards, renderCWECategory, @@ -32,8 +34,6 @@ import { renderSansTop25Category, renderSonarSourceSecurityCategory } from '../../../helpers/security-standard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; import { Facet } from '../../../types/issues'; import { SecurityStandard, Standards, StandardType } from '../../../types/security'; import { formatFacetStat, Query, STANDARDS } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx index 80bac60b2c7..ebf1fa97c75 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx @@ -25,7 +25,7 @@ import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; import StatusHelper from '../../../components/shared/StatusHelper'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { formatFacetStat, Query } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx index 1894d6400ca..dd3cb484862 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx @@ -22,9 +22,9 @@ import * as React from 'react'; import { searchIssueTags } from '../../../api/issues'; import { colors } from '../../../app/theme'; import ListStyleFacet from '../../../components/facet/ListStyleFacet'; -import TagsIcon from '../../../sonar-ui-common/components/icons/TagsIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { highlightTerm } from '../../../sonar-ui-common/helpers/search'; +import TagsIcon from '../../../components/icons/TagsIcon'; +import { translate } from '../../../helpers/l10n'; +import { highlightTerm } from '../../../helpers/search'; import { Facet } from '../../../types/issues'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx index 41e620607c8..057d954e2de 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx @@ -24,9 +24,9 @@ import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; import { ISSUE_TYPES } from '../../../helpers/constants'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { formatFacetStat, Query } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StandardFacet-test.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StandardFacet-test.tsx index 132f351a353..a3307f02033 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StandardFacet-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StandardFacet-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getStandards } from '../../../../helpers/security-standard'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { Query } from '../../utils'; import StandardFacet from '../StandardFacet'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StatusFacet-test.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StatusFacet-test.tsx index e048b364172..8672da77b5b 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StatusFacet-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StatusFacet-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import StatusFacet from '../StatusFacet'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/TypeFacet-test.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/TypeFacet-test.tsx index 75b67261e59..c391a46a3c5 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/TypeFacet-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/TypeFacet-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import TypeFacet from '../TypeFacet'; it('should render open by default', () => { diff --git a/server/sonar-web/src/main/js/apps/issues/utils.ts b/server/sonar-web/src/main/js/apps/issues/utils.ts index 0ebb14e37bf..68097880f43 100644 --- a/server/sonar-web/src/main/js/apps/issues/utils.ts +++ b/server/sonar-web/src/main/js/apps/issues/utils.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { searchUsers } from '../../api/users'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import { formatMeasure } from '../../helpers/measures'; import { cleanQuery, parseAsArray, @@ -29,9 +29,9 @@ import { serializeDateShort, serializeString, serializeStringArray -} from '../../sonar-ui-common/helpers/query'; -import { scrollToElement } from '../../sonar-ui-common/helpers/scrolling'; -import { get, save } from '../../sonar-ui-common/helpers/storage'; +} from '../../helpers/query'; +import { scrollToElement } from '../../helpers/scrolling'; +import { get, save } from '../../helpers/storage'; import { Facet, RawFacet } from '../../types/issues'; import { SecurityStandard, StandardType } from '../../types/security'; diff --git a/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx b/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx index 465ab30cf86..82b66453860 100644 --- a/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx @@ -23,12 +23,12 @@ import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import { getMigrationStatus, getSystemStatus, migrateDatabase } from '../../../api/system'; import InstanceMessage from '../../../components/common/InstanceMessage'; +import { Button } from '../../../components/controls/buttons'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import TimeFormatter from '../../../components/intl/TimeFormatter'; +import { translate } from '../../../helpers/l10n'; import { isSonarCloud } from '../../../helpers/system'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import TimeFormatter from '../../../sonar-ui-common/components/intl/TimeFormatter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl, getReturnUrl } from '../../../sonar-ui-common/helpers/urls'; +import { getBaseUrl, getReturnUrl } from '../../../helpers/urls'; import '../styles.css'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/App-test.tsx index f51b1d9c632..1d70f408329 100644 --- a/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/App-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import App from '../App'; jest.mock('../../../../api/system', () => ({ diff --git a/server/sonar-web/src/main/js/apps/maintenance/routes.tsx b/server/sonar-web/src/main/js/apps/maintenance/routes.tsx index 80881819f79..4e784ecc664 100644 --- a/server/sonar-web/src/main/js/apps/maintenance/routes.tsx +++ b/server/sonar-web/src/main/js/apps/maintenance/routes.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { IndexRoute } from 'react-router'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; export const maintenanceRoutes = ( import('./components/MaintenanceAppContainer'))} /> diff --git a/server/sonar-web/src/main/js/apps/marketplace/App.tsx b/server/sonar-web/src/main/js/apps/marketplace/App.tsx index 24e4a7595d5..9178dac6fcb 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx @@ -31,9 +31,9 @@ import { import { getValues, setSimpleSettingValue } from '../../api/settings'; import Suggestions from '../../app/components/embed-docs-modal/Suggestions'; import { Location, Router, withRouter } from '../../components/hoc/withRouter'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../components/ui/Alert'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; import { EditionKey } from '../../types/editions'; import { PendingPluginResult, Plugin, RiskConsent } from '../../types/plugins'; import { SettingsKey } from '../../types/settings'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/Footer.tsx b/server/sonar-web/src/main/js/apps/marketplace/Footer.tsx index bec229d6cdd..de51e9f7b76 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/Footer.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/Footer.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { translateWithParameters } from '../../helpers/l10n'; interface Props { total: number; diff --git a/server/sonar-web/src/main/js/apps/marketplace/Header.tsx b/server/sonar-web/src/main/js/apps/marketplace/Header.tsx index 262f5a9ade2..75fe2b42d75 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/Header.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/Header.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import { EditionKey } from '../../types/editions'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/marketplace/Search.tsx b/server/sonar-web/src/main/js/apps/marketplace/Search.tsx index 71e2adf9eef..91ceb0421d3 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/Search.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/Search.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioToggle from '../../sonar-ui-common/components/controls/RadioToggle'; -import SearchBox from '../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import RadioToggle from '../../components/controls/RadioToggle'; +import SearchBox from '../../components/controls/SearchBox'; +import { translate } from '../../helpers/l10n'; import { Query } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/marketplace/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/marketplace/__tests__/App-test.tsx index b54164224d2..655e003aca6 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/__tests__/App-test.tsx @@ -27,7 +27,7 @@ import { } from '../../../api/plugins'; import { getValues, setSimpleSettingValue } from '../../../api/settings'; import { mockLocation, mockRouter } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { EditionKey } from '../../../types/editions'; import { RiskConsent } from '../../../types/plugins'; import { SettingsKey } from '../../../types/settings'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx index f811f261c2b..b55fdc6dd51 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx @@ -21,9 +21,9 @@ import tooltipDCE from 'Docs/tooltips/editions/datacenter.md'; import tooltipDE from 'Docs/tooltips/editions/developer.md'; import tooltipEE from 'Docs/tooltips/editions/enterprise.md'; import * as React from 'react'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; import { getEditionUrl } from '../../../helpers/editions'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Edition, EditionKey } from '../../../types/editions'; const DocMarkdownBlock = lazyLoadComponent( diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx index 6fd515a3471..d1148c40f10 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { translate } from '../../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx index a705f43ff03..ce3c9f87ad5 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { installPlugin, uninstallPlugin, updatePlugin } from '../../../api/plugins'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import CheckIcon from '../../../sonar-ui-common/components/icons/CheckIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import Checkbox from '../../../components/controls/Checkbox'; +import Tooltip from '../../../components/controls/Tooltip'; +import CheckIcon from '../../../components/icons/CheckIcon'; +import { translate } from '../../../helpers/l10n'; import { isAvailablePlugin, isInstalledPlugin, Plugin } from '../../../types/plugins'; import PluginUpdateButton from './PluginUpdateButton'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx index 318ce5c98e4..5730cbb875d 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translateWithParameters } from '../../../helpers/l10n'; import { AvailablePlugin, InstalledPlugin } from '../../../types/plugins'; import PluginChangeLogButton from './PluginChangeLogButton'; import PluginDescription from './PluginDescription'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLog.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLog.tsx index f3d14fa3a1f..879cb0021dd 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLog.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLog.tsx @@ -19,7 +19,7 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Release, Update } from '../../../types/plugins'; import PluginChangeLogItem from './PluginChangeLogItem'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogButton.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogButton.tsx index a2952406bb0..5b06bd8c3bd 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogButton.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogButton.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import EllipsisIcon from '../../../sonar-ui-common/components/icons/EllipsisIcon'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Dropdown from '../../../components/controls/Dropdown'; +import EllipsisIcon from '../../../components/icons/EllipsisIcon'; import { Release, Update } from '../../../types/plugins'; import PluginChangeLog from './PluginChangeLog'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogItem.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogItem.tsx index 25f904fe26d..bd1d195243e 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogItem.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogItem.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import DateFormatter from '../../../components/intl/DateFormatter'; +import { translate } from '../../../helpers/l10n'; import { Release, Update } from '../../../types/plugins'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx index 11bb65ad80c..67f8ce8a96a 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { InstalledPlugin } from '../../../types/plugins'; import PluginDescription from './PluginDescription'; import PluginLicense from './PluginLicense'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx index 0aa2329b7eb..40fb77988e5 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; interface Props { license?: string; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginOrganization.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginOrganization.tsx index 5bcceb6fe14..6c5e333f365 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginOrganization.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginOrganization.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Plugin } from '../../../types/plugins'; export interface PluginOrganizationProps { diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginRiskConsentBox.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginRiskConsentBox.tsx index be572709c35..a470a3e5be0 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginRiskConsentBox.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginRiskConsentBox.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import { EditionKey } from '../../../types/editions'; import { RiskConsent } from '../../../types/plugins'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginStatus.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginStatus.tsx index 0ec951648f9..37edbfe9621 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginStatus.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginStatus.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Plugin } from '../../../types/plugins'; import PluginActions from './PluginActions'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx index 9925ab9f114..ad4af39d0a2 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Update } from '../../../types/plugins'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx index 9af6f0f22b7..51a828be59b 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; import { Release, Update } from '../../../types/plugins'; import PluginChangeLogButton from './PluginChangeLogButton'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdates.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdates.tsx index 25a431ebea7..9c9184239c4 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdates.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdates.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Update } from '../../../types/plugins'; import PluginUpdateItem from './PluginUpdateItem'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUrls.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUrls.tsx index ad17d28ed8c..3fcf13c7c64 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUrls.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUrls.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Plugin } from '../../../types/plugins'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/marketplace/routes.ts b/server/sonar-web/src/main/js/apps/marketplace/routes.ts index 2d6991b424c..1e23fd6a9ce 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/routes.ts +++ b/server/sonar-web/src/main/js/apps/marketplace/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/marketplace/utils.ts b/server/sonar-web/src/main/js/apps/marketplace/utils.ts index a6e139d6fe6..d6a75278316 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/utils.ts +++ b/server/sonar-web/src/main/js/apps/marketplace/utils.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { memoize } from 'lodash'; -import { cleanQuery, parseAsString, serializeString } from '../../sonar-ui-common/helpers/query'; +import { cleanQuery, parseAsString, serializeString } from '../../helpers/query'; import { Plugin } from '../../types/plugins'; export interface Query { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx index f8baa938ff9..163d39c564e 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx @@ -27,9 +27,9 @@ import { splitSeriesInGraphs } from '../../../components/activity-graph/utils'; import ActivityLink from '../../../components/common/ActivityLink'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { parseDate } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { GraphType, MeasureHistory } from '../../../types/project-activity'; import Analysis from './Analysis'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx b/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx index a263f8ff8be..80a7a6274b7 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx @@ -19,8 +19,8 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; +import { translate } from '../../../helpers/l10n'; import { ComponentQualifier } from '../../../types/component'; import Event from './Event'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx b/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx index 7639d46ed66..9ff6b737c46 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import { translateWithParameters } from '../../../helpers/l10n'; import { ApplicationPeriod } from '../../../types/application'; export interface ApplicationLeakPeriodInfoProps { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx index 7ab24817f18..9ab00c04736 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx @@ -35,13 +35,13 @@ import { isMainBranch, isSameBranchLike } from '../../../helpers/branch-like'; +import { parseDate, toNotSoISOString } from '../../../helpers/dates'; import { enhanceConditionWithMeasure, enhanceMeasuresWithMetrics } from '../../../helpers/measures'; import { extractStatusConditionsFromApplicationStatusChildProject, extractStatusConditionsFromProjectStatus } from '../../../helpers/qualityGates'; -import { parseDate, toNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; +import { isDefined } from '../../../helpers/types'; import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; import { ApplicationPeriod } from '../../../types/application'; import { Branch, BranchLike } from '../../../types/branch-like'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx index 558e456b6da..d537f7d5d7a 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; import { ApplicationPeriod } from '../../../types/application'; import { Branch } from '../../../types/branch-like'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/DebtValue.tsx b/server/sonar-web/src/main/js/apps/overview/branches/DebtValue.tsx index 49c2783c4a4..abf286bd08f 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/DebtValue.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/DebtValue.tsx @@ -20,9 +20,8 @@ import * as React from 'react'; import { getLeakValue } from '../../../components/measure/utils'; import DrilldownLink from '../../../components/shared/DrilldownLink'; -import { findMeasure, localizeMetric } from '../../../helpers/measures'; -import { getLocalizedMetricName, translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; +import { findMeasure, formatMeasure, localizeMetric } from '../../../helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/DrilldownMeasureValue.tsx b/server/sonar-web/src/main/js/apps/overview/branches/DrilldownMeasureValue.tsx index f0fd35e6f18..c30a0ca7f04 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/DrilldownMeasureValue.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/DrilldownMeasureValue.tsx @@ -19,9 +19,8 @@ */ import * as React from 'react'; import DrilldownLink from '../../../components/shared/DrilldownLink'; -import { findMeasure } from '../../../helpers/measures'; -import { getLocalizedMetricName } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { getLocalizedMetricName } from '../../../helpers/l10n'; +import { findMeasure, formatMeasure } from '../../../helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/Event.tsx b/server/sonar-web/src/main/js/apps/overview/branches/Event.tsx index 18db26b01e8..ce8440b6d3e 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/Event.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/Event.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import Level from '../../../sonar-ui-common/components/ui/Level'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Level from '../../../components/ui/Level'; +import { translate } from '../../../helpers/l10n'; import { isDefinitionChangeEvent } from '../../projectActivity/components/DefinitionChangeEventInner'; import { isRichQualityGateEvent } from '../../projectActivity/components/RichQualityGateEventInner'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx b/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx index eec07932cf1..704d09759bb 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx @@ -22,8 +22,8 @@ import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; import DismissableAlert from '../../../components/ui/DismissableAlert'; +import { translate } from '../../../helpers/l10n'; import { isLoggedIn } from '../../../helpers/users'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; import { ComponentQualifier } from '../../../types/component'; import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../settings/components/AdditionalCategoryKeys'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanel.tsx index 651c9cb83a9..4edc3cba36b 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanel.tsx @@ -19,12 +19,11 @@ */ import * as React from 'react'; import { rawSizes } from '../../../app/theme'; +import BoxedTabs from '../../../components/controls/BoxedTabs'; import ComponentReportActions from '../../../components/controls/ComponentReportActions'; -import { findMeasure } from '../../../helpers/measures'; -import BoxedTabs from '../../../sonar-ui-common/components/controls/BoxedTabs'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { isDiffMetric } from '../../../sonar-ui-common/helpers/measures'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { findMeasure, isDiffMetric } from '../../../helpers/measures'; import { ApplicationPeriod } from '../../../types/application'; import { Branch } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelIssueMeasureRow.tsx b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelIssueMeasureRow.tsx index 5bf789f78d2..a4abcbd51a2 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelIssueMeasureRow.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelIssueMeasureRow.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { IssueType } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx index 83a822f2463..e02240a9760 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { Branch } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx b/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx index 2a330b66f61..3c03e6fe6c5 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { Alert } from '../../../components/ui/Alert'; import { getBranchLikeDisplayName, isMainBranch } from '../../../helpers/branch-like'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/ProjectLeakPeriodInfo.tsx b/server/sonar-web/src/main/js/apps/overview/branches/ProjectLeakPeriodInfo.tsx index 136f545b5cd..8c47ec3485d 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/ProjectLeakPeriodInfo.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/ProjectLeakPeriodInfo.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { InjectedIntl, injectIntl } from 'react-intl'; +import { longFormatterOption } from '../../../components/intl/DateFormatter'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import { formatterOption } from '../../../components/intl/DateTimeFormatter'; +import { translateWithParameters } from '../../../helpers/l10n'; import { getPeriodDate, getPeriodLabel } from '../../../helpers/periods'; -import { longFormatterOption } from '../../../sonar-ui-common/components/intl/DateFormatter'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import { formatterOption } from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; export interface ProjectLeakPeriodInfoProps { intl: Pick; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx index e63a9f7a16a..9ca24fceeab 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx @@ -19,10 +19,10 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { QualityGateStatus } from '../../../types/quality-gates'; import QualityGatePanelSection from './QualityGatePanelSection'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx index b763442d58b..5a557597687 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { translate } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { QualityGateStatus } from '../../../types/quality-gates'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx index ea833f31b44..01840022a22 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx @@ -20,9 +20,8 @@ import * as React from 'react'; import { getLeakValue } from '../../../components/measure/utils'; import CoverageRating from '../../../components/ui/CoverageRating'; -import { findMeasure } from '../../../helpers/measures'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { findMeasure, formatMeasure } from '../../../helpers/measures'; import { MetricKey } from '../../../types/metrics'; export interface SecurityHotspotsReviewedProps { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-test.tsx index 8e8b5bee578..a3c48202045 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-test.tsx @@ -20,6 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import GraphsHistory from '../../../../components/activity-graph/GraphsHistory'; +import { parseDate } from '../../../../helpers/dates'; import { mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockAnalysis, @@ -28,7 +29,6 @@ import { mockMeasure, mockMetric } from '../../../../helpers/testMocks'; -import { parseDate } from '../../../../sonar-ui-common/helpers/dates'; import { GraphType } from '../../../../types/project-activity'; import { ActivityPanel, ActivityPanelProps } from '../ActivityPanel'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ApplicationLeakPeriodInfo-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ApplicationLeakPeriodInfo-test.tsx index 6a6df76ed46..375247c368d 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ApplicationLeakPeriodInfo-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ApplicationLeakPeriodInfo-test.tsx @@ -25,7 +25,7 @@ import { ApplicationLeakPeriodInfoProps } from '../ApplicationLeakPeriodInfo'; -jest.mock('../../../../sonar-ui-common/components/intl/DateFromNow'); +jest.mock('../../../../components/intl/DateFromNow'); it('renders correctly', () => { const wrapper = shallowRender(); diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-test.tsx index e046e01e7cf..aa390cbc15f 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-test.tsx @@ -29,17 +29,17 @@ import { } from '../../../../api/quality-gates'; import { getAllTimeMachineData } from '../../../../api/time-machine'; import { getActivityGraph, saveActivityGraph } from '../../../../components/activity-graph/utils'; +import { isDiffMetric } from '../../../../helpers/measures'; import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockAnalysis, mockComponent } from '../../../../helpers/testMocks'; -import { isDiffMetric } from '../../../../sonar-ui-common/helpers/measures'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { ComponentQualifier } from '../../../../types/component'; import { MetricKey } from '../../../../types/metrics'; import { GraphType } from '../../../../types/project-activity'; import BranchOverview, { BRANCH_OVERVIEW_ACTIVITY_GRAPH, NO_CI_DETECTED } from '../BranchOverview'; import BranchOverviewRenderer from '../BranchOverviewRenderer'; -jest.mock('../../../../sonar-ui-common/helpers/dates', () => ({ +jest.mock('../../../../helpers/dates', () => ({ parseDate: jest.fn(date => `PARSED:${date}`), toNotSoISOString: jest.fn(date => date) })); diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/MeasuresPanel-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/MeasuresPanel-test.tsx index 2fb9aaaaa3a..de04ea274c8 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/MeasuresPanel-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/MeasuresPanel-test.tsx @@ -19,6 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import BoxedTabs from '../../../../components/controls/BoxedTabs'; import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockComponent, @@ -26,7 +27,6 @@ import { mockMetric, mockPeriod } from '../../../../helpers/testMocks'; -import BoxedTabs from '../../../../sonar-ui-common/components/controls/BoxedTabs'; import { ComponentQualifier } from '../../../../types/component'; import { MetricKey } from '../../../../types/metrics'; import { MeasuresPanel, MeasuresPanelProps, MeasuresPanelTabs } from '../MeasuresPanel'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/App.tsx b/server/sonar-web/src/main/js/apps/overview/components/App.tsx index 093d5412636..e16b7599eb3 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/App.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import { withAppState } from '../../../components/hoc/withAppState'; import { Router, withRouter } from '../../../components/hoc/withRouter'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; import { isPullRequest } from '../../../helpers/branch-like'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; import { BranchLike } from '../../../types/branch-like'; import { isPortfolioLike } from '../../../types/component'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx index 083ee35ccef..0008d78886f 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx @@ -21,10 +21,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import TutorialSelection from '../../../components/tutorials/TutorialSelection'; +import { Alert } from '../../../components/ui/Alert'; import { getBranchLikeDisplayName, isBranch, isMainBranch } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; import { isLoggedIn } from '../../../helpers/users'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { getCurrentUser, Store } from '../../../store/rootReducer'; import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; import { BranchLike } from '../../../types/branch-like'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/IssueLabel.tsx b/server/sonar-web/src/main/js/apps/overview/components/IssueLabel.tsx index 425bad16d02..8a9db10118b 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/IssueLabel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/IssueLabel.tsx @@ -19,13 +19,12 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import { getLeakValue } from '../../../components/measure/utils'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import { findMeasure } from '../../../helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { findMeasure, formatMeasure, localizeMetric } from '../../../helpers/measures'; import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure, localizeMetric } from '../../../sonar-ui-common/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { IssueType } from '../../../types/issues'; import { getIssueIconClass, getIssueMetricKey } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx b/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx index 3ded99b2125..ec85ad822ee 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import Tooltip from '../../../components/controls/Tooltip'; import { getLeakValue, getRatingTooltip } from '../../../components/measure/utils'; import DrilldownLink from '../../../components/shared/DrilldownLink'; +import Rating from '../../../components/ui/Rating'; import { findMeasure } from '../../../helpers/measures'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import Rating from '../../../sonar-ui-common/components/ui/Rating'; import { BranchLike } from '../../../types/branch-like'; import { IssueType } from '../../../types/issues'; import { getIssueRatingMetricKey, getIssueRatingName } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.tsx b/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.tsx index 58b4a91df86..25cb9953f1e 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.tsx @@ -20,16 +20,12 @@ import * as differenceInDays from 'date-fns/difference_in_days'; import * as React from 'react'; import { InjectedIntlProps, injectIntl } from 'react-intl'; +import Tooltip from '../../../components/controls/Tooltip'; +import DateFormatter, { longFormatterOption } from '../../../components/intl/DateFormatter'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import DateTimeFormatter, { formatterOption } from '../../../components/intl/DateTimeFormatter'; +import { translateWithParameters } from '../../../helpers/l10n'; import { getPeriodDate, getPeriodLabel } from '../../../helpers/periods'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DateFormatter, { - longFormatterOption -} from '../../../sonar-ui-common/components/intl/DateFormatter'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import DateTimeFormatter, { - formatterOption -} from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; interface Props { period: T.Period; diff --git a/server/sonar-web/src/main/js/apps/overview/components/MeasurementLabel.tsx b/server/sonar-web/src/main/js/apps/overview/components/MeasurementLabel.tsx index 2b1152839b8..5e968b8b893 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/MeasurementLabel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/MeasurementLabel.tsx @@ -21,9 +21,8 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { getLeakValue } from '../../../components/measure/utils'; import DrilldownLink from '../../../components/shared/DrilldownLink'; -import { findMeasure } from '../../../helpers/measures'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { findMeasure, formatMeasure } from '../../../helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { getMeasurementIconClass, diff --git a/server/sonar-web/src/main/js/apps/overview/components/QualityGateCondition.tsx b/server/sonar-web/src/main/js/apps/overview/components/QualityGateCondition.tsx index e172060331d..ee795179407 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/QualityGateCondition.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/QualityGateCondition.tsx @@ -20,15 +20,17 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link } from 'react-router'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; import Measure from '../../../components/measure/Measure'; import DrilldownLink from '../../../components/shared/DrilldownLink'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import { isDiffMetric } from '../../../helpers/measures'; -import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl } from '../../../helpers/urls'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; -import { Location } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure, isDiffMetric } from '../../../helpers/measures'; +import { + getComponentIssuesUrl, + getComponentSecurityHotspotsUrl, + Location +} from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { IssueType } from '../../../types/issues'; import { MetricKey } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/QualityGateConditions.tsx b/server/sonar-web/src/main/js/apps/overview/components/QualityGateConditions.tsx index 8ad441eb601..77e6323bb87 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/QualityGateConditions.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/QualityGateConditions.tsx @@ -19,9 +19,9 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import ChevronDownIcon from '../../../sonar-ui-common/components/icons/ChevronDownIcon'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import ChevronDownIcon from '../../../components/icons/ChevronDownIcon'; +import { translateWithParameters } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import QualityGateCondition from './QualityGateCondition'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/QualityGateConditions-test.tsx b/server/sonar-web/src/main/js/apps/overview/components/__tests__/QualityGateConditions-test.tsx index 1e94ca8bc7a..085fd38ac87 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/QualityGateConditions-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/QualityGateConditions-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockQualityGateStatusConditionEnhanced } from '../../../../helpers/mocks/quality-gates'; import { mockComponent } from '../../../../helpers/testMocks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { QualityGateStatusConditionEnhanced } from '../../../../types/quality-gates'; import { QualityGateConditions, QualityGateConditionsProps } from '../QualityGateConditions'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/AfterMergeEstimate.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/AfterMergeEstimate.tsx index a3cafb9f453..b8700b07878 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/AfterMergeEstimate.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/AfterMergeEstimate.tsx @@ -19,9 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { findMeasure } from '../../../helpers/measures'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { findMeasure, formatMeasure } from '../../../helpers/measures'; import { getMeasurementAfterMergeMetricKey, MeasurementType } from '../utils'; export interface AfterMergeEstimateProps { diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/LargeQualityGateBadge.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/LargeQualityGateBadge.tsx index 9374b9efd2b..83296254c49 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/LargeQualityGateBadge.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/LargeQualityGateBadge.tsx @@ -22,10 +22,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { colors } from '../../../app/theme'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import HelpIcon from '../../../components/icons/HelpIcon'; +import { translate } from '../../../helpers/l10n'; import { getQualityGatesUrl, getQualityGateUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import HelpIcon from '../../../sonar-ui-common/components/icons/HelpIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { component: T.Component; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx index 64597fa2e88..b009e4eb519 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx @@ -22,12 +22,12 @@ import { differenceBy, uniq } from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { getMeasuresWithMetrics } from '../../../api/measures'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { Alert } from '../../../components/ui/Alert'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; import { enhanceConditionWithMeasure, enhanceMeasuresWithMetrics } from '../../../helpers/measures'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; +import { isDefined } from '../../../helpers/types'; import { fetchBranchStatus } from '../../../store/rootActions'; import { getBranchStatusByBranchLike, Store } from '../../../store/rootReducer'; import { BranchLike, PullRequest } from '../../../types/branch-like'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-test.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-test.tsx index 75036f41570..24983be18c3 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-test.tsx @@ -23,7 +23,7 @@ import { getMeasuresWithMetrics } from '../../../../api/measures'; import { mockPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockQualityGateStatusCondition } from '../../../../helpers/mocks/quality-gates'; import { mockComponent } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { PR_METRICS } from '../../utils'; import { PullRequestOverview } from '../PullRequestOverview'; diff --git a/server/sonar-web/src/main/js/apps/overview/routes.ts b/server/sonar-web/src/main/js/apps/overview/routes.ts index f57b5528d59..3056655f8ba 100644 --- a/server/sonar-web/src/main/js/apps/overview/routes.ts +++ b/server/sonar-web/src/main/js/apps/overview/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/overview/utils.ts b/server/sonar-web/src/main/js/apps/overview/utils.ts index 3a90a2c5433..9951b2d807a 100644 --- a/server/sonar-web/src/main/js/apps/overview/utils.ts +++ b/server/sonar-web/src/main/js/apps/overview/utils.ts @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import CoverageRating from '../../components/ui/CoverageRating'; +import DuplicationsRating from '../../components/ui/DuplicationsRating'; import { ISSUETYPE_METRIC_KEYS_MAP } from '../../helpers/issues'; -import DuplicationsRating from '../../sonar-ui-common/components/ui/DuplicationsRating'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import { IssueType } from '../../types/issues'; import { MetricKey } from '../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.tsx index b98ab8e2ad0..4a2c0629eb5 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.tsx @@ -24,12 +24,10 @@ import { setDefaultPermissionTemplate, updatePermissionTemplate } from '../../../api/permissions'; +import ActionsDropdown, { ActionsDropdownItem } from '../../../components/controls/ActionsDropdown'; import { Router, withRouter } from '../../../components/hoc/withRouter'; -import ActionsDropdown, { - ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { translate } from '../../../helpers/l10n'; import { PERMISSION_TEMPLATES_PATH } from '../utils'; import DeleteForm from './DeleteForm'; import Form from './Form'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/App.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/App.tsx index d3d41a26ac8..1502c621064 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/App.tsx @@ -23,7 +23,7 @@ import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { getPermissionTemplates } from '../../../api/permissions'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getAppState, Store } from '../../../store/rootReducer'; import '../../permissions/styles.css'; import { mergeDefaultsToTemplates, mergePermissionsToTemplates, sortPermissions } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.tsx index 862c5e7f212..6989f2ac20d 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.tsx @@ -19,7 +19,7 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Props { template: T.PermissionTemplate; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/DeleteForm.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/DeleteForm.tsx index 3897b635b6d..e7ccb518868 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/DeleteForm.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/DeleteForm.tsx @@ -18,13 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Form.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Form.tsx index aa8595b7e59..448f2fb0e9c 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Form.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Form.tsx @@ -18,15 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; interface Props { confirmButtonText: string; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx index ec53e638978..0aa8f5f599a 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { createPermissionTemplate } from '../../../api/permissions'; +import { Button } from '../../../components/controls/buttons'; import { Router, withRouter } from '../../../components/hoc/withRouter'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { PERMISSION_TEMPLATES_PATH } from '../utils'; import Form from './Form'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx index 4bd8c9de9fb..398a06773bb 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Header from './Header'; import List from './List'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx index 4962e65d652..3ce076cdb3e 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import InstanceMessage from '../../../components/common/InstanceMessage'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; interface Props { permissions: T.Permission[]; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx index b7989446ecc..da8c2dfcbe6 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { translate } from '../../../helpers/l10n'; import { isSonarCloud } from '../../../helpers/system'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { permission: { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx index ffc9ea631d9..a865e508377 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import * as api from '../../../api/permissions'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import HoldersList from '../../permissions/shared/components/HoldersList'; import SearchForm from '../../permissions/shared/components/SearchForm'; import { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.tsx index cf1a984d98b..c0cb3b92d3d 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { PERMISSION_TEMPLATES_PATH } from '../utils'; import ActionsCell from './ActionsCell'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/App-test.tsx index c9d7874a0c6..1acd6aa4b45 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/App-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockLocation } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { App } from '../App'; jest.mock('../../../../api/permissions', () => ({ diff --git a/server/sonar-web/src/main/js/apps/permission-templates/routes.ts b/server/sonar-web/src/main/js/apps/permission-templates/routes.ts index f57b5528d59..3056655f8ba 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/routes.ts +++ b/server/sonar-web/src/main/js/apps/permission-templates/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/permissions/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/permissions/__tests__/utils-test.ts index 4e4e8e14aaf..5c6a1f128a9 100644 --- a/server/sonar-web/src/main/js/apps/permissions/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/permissions/__tests__/utils-test.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import SonarUiCommonInitializer from '../../../helpers/init'; import { isSonarCloud } from '../../../helpers/system'; -import SonarUiCommonInitializer from '../../../sonar-ui-common/helpers/init'; import { convertToPermissionDefinitions } from '../utils'; jest.mock('../../../helpers/system', () => ({ isSonarCloud: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx index d0fb680c306..fa35299f732 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; -import ListFooter from '../../../../sonar-ui-common/components/controls/ListFooter'; +import ListFooter from '../../../../components/controls/ListFooter'; import { getAppState, Store } from '../../../../store/rootReducer'; import { ComponentQualifier } from '../../../../types/component'; import HoldersList from '../../shared/components/HoldersList'; diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx index 76e179beddc..d500c870b98 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import * as api from '../../../../api/permissions'; import Suggestions from '../../../../app/components/embed-docs-modal/Suggestions'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import '../../styles.css'; import AllHoldersList from './AllHoldersList'; import PageHeader from './PageHeader'; diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.tsx index 7070b894147..880fea2f6f3 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/PageHeader.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; interface Props { loading?: boolean; diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/App-test.tsx index f0ae1af06b5..cf4c3c4a62a 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/App-test.tsx @@ -25,7 +25,7 @@ import { revokePermissionFromGroup, revokePermissionFromUser } from '../../../../../api/permissions'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import App from '../App'; jest.mock('../../../../../api/permissions', () => ({ diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/AllHoldersList.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/AllHoldersList.tsx index 9b0dfbd031e..f082f4702be 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/AllHoldersList.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/AllHoldersList.tsx @@ -19,7 +19,7 @@ */ import { without } from 'lodash'; import * as React from 'react'; -import ListFooter from '../../../../sonar-ui-common/components/controls/ListFooter'; +import ListFooter from '../../../../components/controls/ListFooter'; import HoldersList from '../../shared/components/HoldersList'; import SearchForm from '../../shared/components/SearchForm'; import { convertToPermissionDefinitions, PERMISSIONS_ORDER_BY_QUALIFIER } from '../../utils'; diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx index 8705a95c47f..9b3fa2b5df4 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import * as api from '../../../../api/permissions'; import VisibilitySelector from '../../../../components/common/VisibilitySelector'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import '../../styles.css'; import AllHoldersList from './AllHoldersList'; import PageHeader from './PageHeader'; diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/ApplyTemplate.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/ApplyTemplate.tsx index 8aa7313009f..39870d6a2a0 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/ApplyTemplate.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/ApplyTemplate.tsx @@ -19,17 +19,14 @@ */ import * as React from 'react'; import { applyTemplateToProject, getPermissionTemplates } from '../../../../api/permissions'; -import { - ResetButtonLink, - SubmitButton -} from '../../../../sonar-ui-common/components/controls/buttons'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; -import SimpleModal from '../../../../sonar-ui-common/components/controls/SimpleModal'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../../components/controls/buttons'; +import Select from '../../../../components/controls/Select'; +import SimpleModal from '../../../../components/controls/SimpleModal'; +import { Alert } from '../../../../components/ui/Alert'; +import DeferredSpinner from '../../../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../../components/ui/MandatoryFieldsExplanation'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; interface Props { onApply?: () => void; diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx index 34163a4a2f3..242eebafe26 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../../components/controls/buttons'; +import { translate } from '../../../../helpers/l10n'; import { isApplication, isPortfolioLike } from '../../../../types/component'; import ApplyTemplate from './ApplyTemplate'; diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/PublicProjectDisclaimer.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/PublicProjectDisclaimer.tsx index fe2ea04d20b..69511f549c5 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/PublicProjectDisclaimer.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/PublicProjectDisclaimer.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ConfirmModal from '../../../../sonar-ui-common/components/controls/ConfirmModal'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import ConfirmModal from '../../../../components/controls/ConfirmModal'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; interface Props { component: { diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/App-test.tsx index a3e6666f277..bdb76b8563b 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/App-test.tsx @@ -26,7 +26,7 @@ import { revokePermissionFromUser } from '../../../../../api/permissions'; import { mockComponent } from '../../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import App from '../App'; jest.mock('../../../../../api/permissions', () => ({ diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/ApplyTemplate-test.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/ApplyTemplate-test.tsx index a156c334d54..9d10298af54 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/ApplyTemplate-test.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/ApplyTemplate-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import ApplyTemplate from '../ApplyTemplate'; jest.mock('../../../../../api/permissions', () => ({ diff --git a/server/sonar-web/src/main/js/apps/permissions/routes.ts b/server/sonar-web/src/main/js/apps/permissions/routes.ts index 2120a3ff088..3b5d67fd0cb 100644 --- a/server/sonar-web/src/main/js/apps/permissions/routes.ts +++ b/server/sonar-web/src/main/js/apps/permissions/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; export const globalPermissionsRoutes = [ { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx index fc3705a020f..98c52700247 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx @@ -19,7 +19,7 @@ */ import { without } from 'lodash'; import * as React from 'react'; -import GroupIcon from '../../../../sonar-ui-common/components/icons/GroupIcon'; +import GroupIcon from '../../../../components/icons/GroupIcon'; import { isPermissionDefinitionGroup } from '../../utils'; import PermissionCell from './PermissionCell'; diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx index 4bc8839db4c..bcce4e0b0b7 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx @@ -19,7 +19,7 @@ */ import { partition, sortBy } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { isPermissionDefinitionGroup } from '../../utils'; import GroupHolder from './GroupHolder'; import PermissionHeader from './PermissionHeader'; diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionCell.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionCell.tsx index 67d1959b0b8..bd685933967 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionCell.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionCell.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Checkbox from '../../../../sonar-ui-common/components/controls/Checkbox'; +import Checkbox from '../../../../components/controls/Checkbox'; import { isPermissionDefinitionGroup } from '../../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionHeader.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionHeader.tsx index ae4c61116fa..4e749d59660 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionHeader.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionHeader.tsx @@ -20,10 +20,10 @@ import * as classNames from 'classnames'; import * as React from 'react'; import InstanceMessage from '../../../../components/common/InstanceMessage'; -import HelpTooltip from '../../../../sonar-ui-common/components/controls/HelpTooltip'; -import Tooltip from '../../../../sonar-ui-common/components/controls/Tooltip'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../../components/controls/HelpTooltip'; +import Tooltip from '../../../../components/controls/Tooltip'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { isPermissionDefinitionGroup } from '../../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.tsx index 71d4fcae909..11ff4b763e5 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioToggle from '../../../../sonar-ui-common/components/controls/RadioToggle'; -import SearchBox from '../../../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import RadioToggle from '../../../../components/controls/RadioToggle'; +import SearchBox from '../../../../components/controls/SearchBox'; +import { translate } from '../../../../helpers/l10n'; interface Props { filter: string; diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx index 5359fec5ef1..8f767da002f 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx @@ -20,7 +20,7 @@ import { without } from 'lodash'; import * as React from 'react'; import Avatar from '../../../../components/ui/Avatar'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { isPermissionDefinitionGroup } from '../../utils'; import PermissionCell from './PermissionCell'; diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/GroupHolder-test.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/GroupHolder-test.tsx index 945e6f71b44..733fd0bc0bd 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/GroupHolder-test.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/GroupHolder-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockPermissionGroup } from '../../../../../helpers/mocks/permissions'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import GroupHolder from '../GroupHolder'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/UserHolder-test.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/UserHolder-test.tsx index 29bb671ec58..a816a48ac99 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/UserHolder-test.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/__tests__/UserHolder-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockPermissionUser } from '../../../../../helpers/mocks/permissions'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import UserHolder from '../UserHolder'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/permissions/utils.ts b/server/sonar-web/src/main/js/apps/permissions/utils.ts index 242d3691adb..1fd5ab17dd4 100644 --- a/server/sonar-web/src/main/js/apps/permissions/utils.ts +++ b/server/sonar-web/src/main/js/apps/permissions/utils.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { hasMessage, translate } from '../../helpers/l10n'; import { isSonarCloud } from '../../helpers/system'; -import { hasMessage, translate } from '../../sonar-ui-common/helpers/l10n'; export const PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE = [ 'user', diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx index 633a0b5c971..3490ddbd5fa 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx @@ -27,9 +27,9 @@ import MeasuresLink from '../../../components/common/MeasuresLink'; import ComponentReportActions from '../../../components/controls/ComponentReportActions'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; import Measure from '../../../components/measure/Measure'; +import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; +import { translate } from '../../../helpers/l10n'; import { isLoggedIn } from '../../../helpers/users'; -import handleRequiredAuthentication from '../../../sonar-ui-common/helpers/handleRequiredAuthentication'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { fetchMetrics } from '../../../store/rootActions'; import { getMetrics, Store } from '../../../store/rootReducer'; import '../styles.css'; diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/Effort.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/Effort.tsx index fae774e31ef..7a9097aac29 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/Effort.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/Effort.tsx @@ -21,9 +21,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import Measure from '../../../components/measure/Measure'; +import Rating from '../../../components/ui/Rating'; +import { translate } from '../../../helpers/l10n'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; -import Rating from '../../../sonar-ui-common/components/ui/Rating'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { component: string; diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/MainRating.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/MainRating.tsx index 256a965ccca..e691dc822ac 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/MainRating.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/MainRating.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import Rating from '../../../components/ui/Rating'; import { getMeasureTreemapUrl } from '../../../helpers/urls'; -import Rating from '../../../sonar-ui-common/components/ui/Rating'; interface Props { component: string; diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/MetricBox.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/MetricBox.tsx index 9266e9a28e2..e8942f336a9 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/MetricBox.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/MetricBox.tsx @@ -21,11 +21,11 @@ import * as React from 'react'; import { Link } from 'react-router'; import ActivityLink from '../../../components/common/ActivityLink'; import MeasuresLink from '../../../components/common/MeasuresLink'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import Measure from '../../../components/measure/Measure'; +import Level from '../../../components/ui/Level'; +import { translate } from '../../../helpers/l10n'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import Level from '../../../sonar-ui-common/components/ui/Level'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { GraphType } from '../../../types/project-activity'; import { METRICS_PER_TYPE } from '../utils'; import Effort from './Effort'; diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/RatingFreshness.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/RatingFreshness.tsx index c6fd9b6cf65..e5944766e09 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/RatingFreshness.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/RatingFreshness.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import Rating from '../../../sonar-ui-common/components/ui/Rating'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import Rating from '../../../components/ui/Rating'; +import { translate } from '../../../helpers/l10n'; interface Props { lastChange?: string; diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/UnsubscribeEmailModal.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/UnsubscribeEmailModal.tsx index df51e53bc91..49a0c8849a9 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/UnsubscribeEmailModal.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/UnsubscribeEmailModal.tsx @@ -19,15 +19,11 @@ */ import * as React from 'react'; import { unsubscribeFromEmailReport } from '../../../api/component-report'; -import { - Button, - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; interface Props { component: T.Component; diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx index 061abcba40a..ebadc03e3cc 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx @@ -21,11 +21,11 @@ import { max } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; import { colors } from '../../../app/theme'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import Measure from '../../../components/measure/Measure'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getComponentOverviewUrl } from '../../../helpers/urls'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; import { ComponentQualifier } from '../../../types/component'; import { SubComponent } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/App-test.tsx index a859c82944e..3ff3dbc56cc 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/App-test.tsx @@ -21,6 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getChildren } from '../../../../api/components'; import { getMeasures } from '../../../../api/measures'; +import handleRequiredAuthentication from '../../../../helpers/handleRequiredAuthentication'; import { mockComponent, mockCurrentUser, @@ -28,13 +29,12 @@ import { mockLoggedInUser, mockRouter } from '../../../../helpers/testMocks'; -import handleRequiredAuthentication from '../../../../sonar-ui-common/helpers/handleRequiredAuthentication'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { ComponentQualifier } from '../../../../types/component'; import { App } from '../App'; import UnsubscribeEmailModal from '../UnsubscribeEmailModal'; -jest.mock('../../../../sonar-ui-common/helpers/handleRequiredAuthentication', () => ({ +jest.mock('../../../../helpers/handleRequiredAuthentication', () => ({ default: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/UnsubscribeEmailModal-test.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/UnsubscribeEmailModal-test.tsx index 4c829c3cd3a..42c4323cb34 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/UnsubscribeEmailModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/UnsubscribeEmailModal-test.tsx @@ -21,9 +21,9 @@ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; import { unsubscribeFromEmailReport } from '../../../../api/component-report'; +import SimpleModal from '../../../../components/controls/SimpleModal'; import { mockComponent } from '../../../../helpers/testMocks'; -import SimpleModal from '../../../../sonar-ui-common/components/controls/SimpleModal'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { ComponentQualifier } from '../../../../types/component'; import UnsubscribeEmailModal from '../UnsubscribeEmailModal'; diff --git a/server/sonar-web/src/main/js/apps/portfolio/routes.ts b/server/sonar-web/src/main/js/apps/portfolio/routes.ts index f57b5528d59..3056655f8ba 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/routes.ts +++ b/server/sonar-web/src/main/js/apps/portfolio/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/actions-test.ts b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/actions-test.ts index b48e012e808..f5510d00dd3 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/actions-test.ts +++ b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/actions-test.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { DEFAULT_GRAPH } from '../../../components/activity-graph/utils'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import * as actions from '../actions'; const ANALYSES = [ diff --git a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.ts index 1c5547da888..0b2cd01534d 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { DEFAULT_GRAPH } from '../../../components/activity-graph/utils'; -import * as dates from '../../../sonar-ui-common/helpers/dates'; +import * as dates from '../../../helpers/dates'; import { GraphType } from '../../../types/project-activity'; import * as utils from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/DefinitionChangeEventInner.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/DefinitionChangeEventInner.tsx index 5eec7466ff2..32b6759c9cb 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/DefinitionChangeEventInner.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/DefinitionChangeEventInner.tsx @@ -20,13 +20,13 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { ButtonLink } from '../../../components/controls/buttons'; +import BranchIcon from '../../../components/icons/BranchIcon'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; import { isMainBranch } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; +import { limitComponentName } from '../../../helpers/path'; import { getProjectUrl } from '../../../helpers/urls'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import BranchIcon from '../../../sonar-ui-common/components/icons/BranchIcon'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { limitComponentName } from '../../../sonar-ui-common/helpers/path'; import { BranchLike } from '../../../types/branch-like'; export type DefinitionChangeEvent = T.AnalysisEvent & diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/Event.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/Event.tsx index f41fbdc028a..a90c8bd379c 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/Event.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/Event.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DeleteButton, EditButton } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { DeleteButton, EditButton } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import EventInner from './EventInner'; import ChangeEventForm from './forms/ChangeEventForm'; import RemoveEventForm from './forms/RemoveEventForm'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.tsx index 2050f7d5634..1180aa9d6c3 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { ComponentContext } from '../../../app/components/ComponentContext'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; import { DefinitionChangeEventInner, isDefinitionChangeEvent } from './DefinitionChangeEventInner'; import { isRichQualityGateEvent, RichQualityGateEventInner } from './RichQualityGateEventInner'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx index 00a46b93d1a..1fbbb071979 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx @@ -21,10 +21,10 @@ import * as classNames from 'classnames'; import { isEqual } from 'date-fns'; import { throttle } from 'lodash'; import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import { toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import DateFormatter from '../../../components/intl/DateFormatter'; +import { toShortNotSoISOString } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; import { ComponentQualifier } from '../../../types/component'; import { activityQueryChanged, getAnalysesByVersionByDay, Query } from '../utils'; import ProjectActivityAnalysis from './ProjectActivityAnalysis'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx index 1ad4d7a82c8..f6711f19bb0 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx @@ -22,14 +22,14 @@ import * as React from 'react'; import ActionsDropdown, { ActionsDropdownDivider, ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import ClickEventBoundary from '../../../sonar-ui-common/components/controls/ClickEventBoundary'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import TimeFormatter from '../../../sonar-ui-common/components/intl/TimeFormatter'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +} from '../../../components/controls/ActionsDropdown'; +import ClickEventBoundary from '../../../components/controls/ClickEventBoundary'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import TimeFormatter from '../../../components/intl/TimeFormatter'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { parseDate } from '../../../helpers/dates'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { scrollToElement } from '../../../helpers/scrolling'; import Events from './Events'; import AddEventForm from './forms/AddEventForm'; import RemoveAnalysisForm from './forms/RemoveAnalysisForm'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx index 105dfe9296f..b119bcbd6c6 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { parseDate } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; import { MeasureHistory } from '../../../types/project-activity'; import { Query } from '../utils'; import './projectActivity.css'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.tsx index 1a0ddaf497a..ce321125b04 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.tsx @@ -30,7 +30,7 @@ import { isCustomGraph } from '../../../components/activity-graph/utils'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; import { GraphType, MeasureHistory } from '../../../types/project-activity'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityDateInput.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityDateInput.tsx index 6b711cf5e2f..568a27c22a8 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityDateInput.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityDateInput.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { Button } from '../../../components/controls/buttons'; import DateRangeInput from '../../../components/controls/DateRangeInput'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Query } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFooter.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFooter.tsx index 6bcaf4e561c..0bccf88b719 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFooter.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFooter.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; +import ListFooter from '../../../components/controls/ListFooter'; interface Props { analyses: unknown[]; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.tsx index 4f57d232d25..149d4a4f174 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { translate } from '../../../helpers/l10n'; import { APPLICATION_EVENT_TYPES, EVENT_TYPES, Query } from '../utils'; import ProjectActivityDateInput from './ProjectActivityDateInput'; import ProjectActivityEventSelectOption from './ProjectActivityEventSelectOption'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/RichQualityGateEventInner.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/RichQualityGateEventInner.tsx index daf5c273e96..253dfc700f1 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/RichQualityGateEventInner.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/RichQualityGateEventInner.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { ResetButtonLink } from '../../../components/controls/buttons'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import Level from '../../../components/ui/Level'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; -import { ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import Level from '../../../sonar-ui-common/components/ui/Level'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; export type RichQualityGateEvent = T.AnalysisEvent & Required>; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/DefinitionChangeEventInner-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/DefinitionChangeEventInner-test.tsx index 81c74f4c6bf..859c72cf3d6 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/DefinitionChangeEventInner-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/DefinitionChangeEventInner-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockBranch } from '../../../../helpers/mocks/branch-like'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { DefinitionChangeEvent, DefinitionChangeEventInner } from '../DefinitionChangeEventInner'; it('should render', () => { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/Event-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/Event-test.tsx index 63874c580ae..8f39bbe505d 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/Event-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/Event-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { DeleteButton, EditButton } from '../../../../components/controls/buttons'; import { mockAnalysisEvent } from '../../../../helpers/testMocks'; -import { DeleteButton, EditButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { Event, EventProps } from '../Event'; import ChangeEventForm from '../forms/ChangeEventForm'; import RemoveEventForm from '../forms/RemoveEventForm'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.tsx index 0153190aae9..097909c9223 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.tsx @@ -20,8 +20,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { DEFAULT_GRAPH } from '../../../../components/activity-graph/utils'; +import { parseDate } from '../../../../helpers/dates'; import { mockParsedAnalysis } from '../../../../helpers/testMocks'; -import { parseDate } from '../../../../sonar-ui-common/helpers/dates'; import { ComponentQualifier } from '../../../../types/component'; import ProjectActivityAnalysesList from '../ProjectActivityAnalysesList'; @@ -31,8 +31,8 @@ jest.mock('date-fns/start_of_day', () => (date: Date) => { return startDay; }); -jest.mock('../../../../sonar-ui-common/helpers/dates', () => { - const actual = jest.requireActual('../../../../sonar-ui-common/helpers/dates'); +jest.mock('../../../../helpers/dates', () => { + const actual = jest.requireActual('../../../../helpers/dates'); return { ...actual, toShortNotSoISOString: (date: string) => 'ISO.' + date }; }); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysis-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysis-test.tsx index cce2034ddfb..7ff059886ff 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysis-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysis-test.tsx @@ -21,22 +21,22 @@ import { mount, shallow } from 'enzyme'; import * as React from 'react'; import { IntlProvider } from 'react-intl'; +import TimeFormatter from '../../../../components/intl/TimeFormatter'; +import { scrollToElement } from '../../../../helpers/scrolling'; import { mockAnalysisEvent, mockParsedAnalysis } from '../../../../helpers/testMocks'; -import TimeFormatter from '../../../../sonar-ui-common/components/intl/TimeFormatter'; -import { scrollToElement } from '../../../../sonar-ui-common/helpers/scrolling'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import AddEventForm from '../forms/AddEventForm'; import RemoveAnalysisForm from '../forms/RemoveAnalysisForm'; import { ProjectActivityAnalysis, ProjectActivityAnalysisProps } from '../ProjectActivityAnalysis'; -jest.mock('../../../../sonar-ui-common/helpers/dates', () => ({ +jest.mock('../../../../helpers/dates', () => ({ parseDate: () => ({ valueOf: () => 1546333200000, toISOString: () => '2019-01-01T09:00:00.000Z' }) })); -jest.mock('../../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../../helpers/scrolling', () => ({ scrollToElement: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.tsx index 459c868e341..538f1fc687c 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { DEFAULT_GRAPH } from '../../../../components/activity-graph/utils'; -import { parseDate } from '../../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../../helpers/dates'; import ProjectActivityApp from '../ProjectActivityApp'; const ANALYSES = [ diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityDateInput-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityDateInput-test.tsx index 57533ad372a..1996fd11937 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityDateInput-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityDateInput-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../../helpers/dates'; import ProjectActivityDateInput from '../ProjectActivityDateInput'; it('should render correctly the date inputs', () => { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.tsx index f061b28fcbb..3406ffb0f1a 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { DEFAULT_GRAPH } from '../../../../components/activity-graph/utils'; -import { parseDate } from '../../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../../helpers/dates'; import ProjectActivityGraphs from '../ProjectActivityGraphs'; const ANALYSES = [ diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityPageHeader-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityPageHeader-test.tsx index 228cc9b3449..fec1d672c04 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityPageHeader-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityPageHeader-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../../helpers/dates'; import ProjectActivityPageHeader from '../ProjectActivityPageHeader'; it('should render correctly the list of series', () => { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/RichQualityGateEventInner-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/RichQualityGateEventInner-test.tsx index 9fead0cdb74..3f24e1cf49e 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/RichQualityGateEventInner-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/RichQualityGateEventInner-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { RichQualityGateEvent, RichQualityGateEventInner } from '../RichQualityGateEventInner'; const event: RichQualityGateEvent = { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.tsx index dd5cd7a52cc..715b9c53e48 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ConfirmModal from '../../../../sonar-ui-common/components/controls/ConfirmModal'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import ConfirmModal from '../../../../components/controls/ConfirmModal'; +import { translate } from '../../../../helpers/l10n'; interface Props { addEvent: (analysis: string, name: string, category?: string) => Promise; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.tsx index 5825d1b9133..e21cb74372d 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ConfirmModal from '../../../../sonar-ui-common/components/controls/ConfirmModal'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import ConfirmModal from '../../../../components/controls/ConfirmModal'; +import { translate } from '../../../../helpers/l10n'; interface Props { changeEvent: (event: string, name: string) => Promise; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.tsx index c923b2f5903..ddb2a25ba8b 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ConfirmModal from '../../../../sonar-ui-common/components/controls/ConfirmModal'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import ConfirmModal from '../../../../components/controls/ConfirmModal'; +import { translate } from '../../../../helpers/l10n'; interface Props { analysis: T.ParsedAnalysis; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.tsx index 9f1d83fd887..3934f697e27 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ConfirmModal from '../../../../sonar-ui-common/components/controls/ConfirmModal'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import ConfirmModal from '../../../../components/controls/ConfirmModal'; +import { translate } from '../../../../helpers/l10n'; export interface RemoveEventFormProps { analysisKey: string; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/__tests__/RemoveEventForm-test.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/__tests__/RemoveEventForm-test.tsx index bc4c89918cd..8fe812288d4 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/__tests__/RemoveEventForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/__tests__/RemoveEventForm-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import ConfirmModal from '../../../../../components/controls/ConfirmModal'; import { mockAnalysisEvent } from '../../../../../helpers/testMocks'; -import ConfirmModal from '../../../../../sonar-ui-common/components/controls/ConfirmModal'; import RemoveEventForm, { RemoveEventFormProps } from '../RemoveEventForm'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/routes.ts b/server/sonar-web/src/main/js/apps/projectActivity/routes.ts index a2945a661f6..fc201e1f620 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/routes.ts +++ b/server/sonar-web/src/main/js/apps/projectActivity/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts index 7757447ff32..d642d7484b6 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts +++ b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts @@ -20,7 +20,7 @@ import * as startOfDay from 'date-fns/start_of_day'; import { isEqual } from 'lodash'; import { DEFAULT_GRAPH } from '../../components/activity-graph/utils'; -import { parseDate } from '../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../helpers/dates'; import { cleanQuery, parseAsArray, @@ -29,7 +29,7 @@ import { serializeDate, serializeString, serializeStringArray -} from '../../sonar-ui-common/helpers/query'; +} from '../../helpers/query'; import { GraphType } from '../../types/project-activity'; export interface Query { diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/App.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/App.tsx index 6c11045130e..a840de4a57e 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/App.tsx @@ -22,10 +22,10 @@ import { debounce } from 'lodash'; import * as React from 'react'; import { getNewCodePeriod, resetNewCodePeriod, setNewCodePeriod } from '../../../api/newCodePeriod'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { isBranch, sortBranches } from '../../../helpers/branch-like'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Branch, BranchLike } from '../../../types/branch-like'; import '../styles.css'; import { getSettingValue } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx index 64fcec257b5..1327a8f3402 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface AppHeaderProps { canAdmin: boolean; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingAnalysis.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingAnalysis.tsx index dacca51fe9e..0dd4a639f45 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingAnalysis.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingAnalysis.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioCard from '../../../sonar-ui-common/components/controls/RadioCard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import RadioCard from '../../../components/controls/RadioCard'; +import { translate } from '../../../helpers/l10n'; export interface Props { disabled?: boolean; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingDays.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingDays.tsx index 38de4bead2e..a0f88c0fc16 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingDays.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingDays.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioCard from '../../../sonar-ui-common/components/controls/RadioCard'; -import ValidationInput from '../../../sonar-ui-common/components/controls/ValidationInput'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import RadioCard from '../../../components/controls/RadioCard'; +import ValidationInput from '../../../components/controls/ValidationInput'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; export interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingPreviousVersion.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingPreviousVersion.tsx index 7848ab80e2e..9a24385d5ee 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingPreviousVersion.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingPreviousVersion.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioCard from '../../../sonar-ui-common/components/controls/RadioCard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import RadioCard from '../../../components/controls/RadioCard'; +import { translate } from '../../../helpers/l10n'; export interface Props { disabled?: boolean; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx index abc8d6a50a4..9e932cd4996 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx @@ -18,13 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioCard from '../../../sonar-ui-common/components/controls/RadioCard'; -import SearchSelect from '../../../sonar-ui-common/components/controls/SearchSelect'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import AlertErrorIcon from '../../../sonar-ui-common/components/icons/AlertErrorIcon'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import RadioCard from '../../../components/controls/RadioCard'; +import SearchSelect from '../../../components/controls/SearchSelect'; +import Tooltip from '../../../components/controls/Tooltip'; +import AlertErrorIcon from '../../../components/icons/AlertErrorIcon'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; export interface BaselineSettingReferenceBranchProps { branchList: BranchOption[]; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisList.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisList.tsx index ba9eb88eebb..dcf12cd846b 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisList.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisList.tsx @@ -21,8 +21,8 @@ import { subDays } from 'date-fns'; import { throttle } from 'lodash'; import * as React from 'react'; import { getProjectActivity } from '../../../api/projectActivity'; -import { parseDate, toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { parseDate, toShortNotSoISOString } from '../../../helpers/dates'; +import { scrollToElement } from '../../../helpers/scrolling'; import BranchAnalysisListRenderer from './BranchAnalysisListRenderer'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx index d2262269977..c22fa3fa8ed 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx @@ -19,14 +19,14 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import TimeFormatter from '../../../sonar-ui-common/components/intl/TimeFormatter'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { parseDate, toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Radio from '../../../components/controls/Radio'; +import Select from '../../../components/controls/Select'; +import Tooltip from '../../../components/controls/Tooltip'; +import DateFormatter from '../../../components/intl/DateFormatter'; +import TimeFormatter from '../../../components/intl/TimeFormatter'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { parseDate, toShortNotSoISOString } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; import Events from '../../projectActivity/components/Events'; import { getAnalysesByVersionByDay } from '../../projectActivity/utils'; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchBaselineSettingModal.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchBaselineSettingModal.tsx index 5e4f4d08dad..2fb28321fe1 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchBaselineSettingModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchBaselineSettingModal.tsx @@ -19,14 +19,11 @@ */ import * as React from 'react'; import { setNewCodePeriod } from '../../../api/newCodePeriod'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { toNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { toNotSoISOString } from '../../../helpers/dates'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Branch, BranchWithNewCodePeriod } from '../../../types/branch-like'; import { getSettingValue, validateSetting } from '../utils'; import BaselineSettingAnalysis from './BaselineSettingAnalysis'; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchList.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchList.tsx index 613134ec5c0..f91052b6517 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchList.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchList.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { listBranchesNewCodePeriod, resetNewCodePeriod } from '../../../api/newCodePeriod'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { isBranch, sortBranches } from '../../../helpers/branch-like'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Branch, BranchLike, BranchWithNewCodePeriod } from '../../../types/branch-like'; import BranchBaselineSettingModal from './BranchBaselineSettingModal'; import BranchListRow from './BranchListRow'; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchListRow.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchListRow.tsx index 22ce6e8b579..0b45d2f1c48 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchListRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchListRow.tsx @@ -18,14 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import ActionsDropdown, { ActionsDropdownItem } from '../../../components/controls/ActionsDropdown'; +import Tooltip from '../../../components/controls/Tooltip'; import BranchLikeIcon from '../../../components/icons/BranchLikeIcon'; -import ActionsDropdown, { - ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import WarningIcon from '../../../sonar-ui-common/components/icons/WarningIcon'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import WarningIcon from '../../../components/icons/WarningIcon'; +import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { BranchWithNewCodePeriod } from '../../../types/branch-like'; export interface BranchListRowProps { diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx index a9ab6045382..6d9e74d3a6f 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx @@ -19,14 +19,11 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Radio from '../../../components/controls/Radio'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Branch } from '../../../types/branch-like'; import { validateSetting } from '../utils'; import BaselineSettingAnalysis from './BaselineSettingAnalysis'; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/App-test.tsx index 710fa4222bc..ec099bba891 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/App-test.tsx @@ -26,7 +26,7 @@ import { } from '../../../../api/newCodePeriod'; import { mockBranch, mockMainBranch, mockPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockComponent, mockEvent } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import App from '../App'; jest.mock('../../../../api/newCodePeriod', () => ({ diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx index b6708b46522..8b917458dbe 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import RadioCard from '../../../../sonar-ui-common/components/controls/RadioCard'; -import SearchSelect from '../../../../sonar-ui-common/components/controls/SearchSelect'; +import RadioCard from '../../../../components/controls/RadioCard'; +import SearchSelect from '../../../../components/controls/SearchSelect'; import BaselineSettingReferenceBranch, { BaselineSettingReferenceBranchProps, BranchOption diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisList-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisList-test.tsx index b20677d9d3b..3b9941a5ca4 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisList-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisList-test.tsx @@ -21,9 +21,9 @@ import { subDays } from 'date-fns'; import { shallow } from 'enzyme'; import * as React from 'react'; import { getProjectActivity } from '../../../../api/projectActivity'; +import { toShortNotSoISOString } from '../../../../helpers/dates'; import { mockAnalysis, mockAnalysisEvent } from '../../../../helpers/testMocks'; -import { toShortNotSoISOString } from '../../../../sonar-ui-common/helpers/dates'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import BranchAnalysisList from '../BranchAnalysisList'; jest.mock('date-fns/start_of_day', () => @@ -32,7 +32,7 @@ jest.mock('date-fns/start_of_day', () => })) ); -jest.mock('../../../../sonar-ui-common/helpers/dates', () => ({ +jest.mock('../../../../helpers/dates', () => ({ parseDate: jest.fn().mockReturnValue('2017-03-02'), toShortNotSoISOString: jest.fn().mockReturnValue('2017-03-02') })); diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisListRenderer-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisListRenderer-test.tsx index defba93f077..9250748d74a 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisListRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchAnalysisListRenderer-test.tsx @@ -30,8 +30,8 @@ jest.mock('date-fns/start_of_day', () => (date: Date) => { return startDay; }); -jest.mock('../../../../sonar-ui-common/helpers/dates', () => { - const actual = jest.requireActual('../../../../sonar-ui-common/helpers/dates'); +jest.mock('../../../../helpers/dates', () => { + const actual = jest.requireActual('../../../../helpers/dates'); return { ...actual, toShortNotSoISOString: (date: string) => `ISO.${date}` }; }); diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchBaselineSettingModal-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchBaselineSettingModal-test.tsx index 4a6c8e9b4cb..ed73ae3f3d0 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchBaselineSettingModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchBaselineSettingModal-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { setNewCodePeriod } from '../../../../api/newCodePeriod'; import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; -import { mockEvent, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils'; import BranchBaselineSettingModal from '../BranchBaselineSettingModal'; jest.mock('../../../../api/newCodePeriod', () => ({ diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchList-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchList-test.tsx index b4b26018353..5895a95cfc5 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchList-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchList-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { listBranchesNewCodePeriod, resetNewCodePeriod } from '../../../../api/newCodePeriod'; import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import BranchBaselineSettingModal from '../BranchBaselineSettingModal'; import BranchList from '../BranchList'; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchListRow-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchListRow-test.tsx index 266860211b9..bb90b57e3eb 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchListRow-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BranchListRow-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { ActionsDropdownItem } from '../../../../components/controls/ActionsDropdown'; import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; -import { ActionsDropdownItem } from '../../../../sonar-ui-common/components/controls/ActionsDropdown'; import BranchListRow, { BranchListRowProps } from '../BranchListRow'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/routes.ts b/server/sonar-web/src/main/js/apps/projectBaseline/routes.ts index d9f2449a14f..028c08f3c05 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/routes.ts +++ b/server/sonar-web/src/main/js/apps/projectBaseline/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx index 4ae3217093f..072a6c557ee 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import BranchLikeTabs from './BranchLikeTabs'; import LifetimeInformation from './LifetimeInformation'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx index 6c0a4061d7c..ba2402fc380 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx @@ -19,18 +19,16 @@ */ import * as React from 'react'; import BranchStatus from '../../../components/common/BranchStatus'; +import ActionsDropdown, { ActionsDropdownItem } from '../../../components/controls/ActionsDropdown'; import BranchLikeIcon from '../../../components/icons/BranchLikeIcon'; +import DateFromNow from '../../../components/intl/DateFromNow'; import { getBranchLikeDisplayName, isBranch, isMainBranch, isPullRequest } from '../../../helpers/branch-like'; -import ActionsDropdown, { - ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import BranchPurgeSetting from './BranchPurgeSetting'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx index b8e12914ab4..746a7edec53 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import { getBranchLikeKey } from '../../../helpers/branch-like'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import BranchLikeRow from './BranchLikeRow'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx index ef7b87e756f..d4707949acb 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx @@ -18,6 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import BoxedTabs from '../../../components/controls/BoxedTabs'; +import BranchIcon from '../../../components/icons/BranchIcon'; +import PullRequestIcon from '../../../components/icons/PullRequestIcon'; import { isBranch, isMainBranch, @@ -25,10 +28,7 @@ import { sortBranches, sortPullRequests } from '../../../helpers/branch-like'; -import BoxedTabs from '../../../sonar-ui-common/components/controls/BoxedTabs'; -import BranchIcon from '../../../sonar-ui-common/components/icons/BranchIcon'; -import PullRequestIcon from '../../../sonar-ui-common/components/icons/PullRequestIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import BranchLikeTable from './BranchLikeTable'; import DeleteBranchModal from './DeleteBranchModal'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx index a08f4595aec..ea204c09cd5 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { excludeBranchFromPurge } from '../../../api/branches'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import Toggle from '../../../components/controls/Toggle'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { isMainBranch } from '../../../helpers/branch-like'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import Toggle from '../../../sonar-ui-common/components/controls/Toggle'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Branch } from '../../../types/branch-like'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx index a04783cfa96..79180d0edce 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx @@ -19,13 +19,10 @@ */ import * as React from 'react'; import { deleteBranch, deletePullRequest } from '../../../api/branches'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branch-like'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx index 01b353f870b..012417bcc50 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; export interface LifetimeInformationRendererProps { branchAndPullRequestLifeTimeInDays?: string; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx index b25f1ac0b86..5b0403f627f 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx @@ -19,14 +19,11 @@ */ import * as React from 'react'; import { renameBranch } from '../../../api/branches'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; import { MainBranch } from '../../../types/branch-like'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx index a46a7b75579..f74dbaf81dd 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx @@ -19,13 +19,13 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import BoxedTabs from '../../../../components/controls/BoxedTabs'; import { mockMainBranch, mockPullRequest, mockSetOfBranchAndPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/testMocks'; -import BoxedTabs from '../../../../sonar-ui-common/components/controls/BoxedTabs'; import { BranchLikeTable } from '../BranchLikeTable'; import BranchLikeTabs, { Tabs } from '../BranchLikeTabs'; import DeleteBranchModal from '../DeleteBranchModal'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx index 1f6f8c473ac..19ff713f9eb 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx @@ -20,9 +20,9 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { excludeBranchFromPurge } from '../../../../api/branches'; +import Toggle from '../../../../components/controls/Toggle'; import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/testMocks'; -import Toggle from '../../../../sonar-ui-common/components/controls/Toggle'; import BranchPurgeSetting from '../BranchPurgeSetting'; jest.mock('../../../../api/branches', () => ({ diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx index bda6fcc725a..18845abf99a 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx @@ -22,12 +22,7 @@ import * as React from 'react'; import { deleteBranch, deletePullRequest } from '../../../../api/branches'; import { mockBranch, mockPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/testMocks'; -import { - click, - doAsync, - submit, - waitAndUpdate -} from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, doAsync, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import { BranchLike } from '../../../../types/branch-like'; import DeleteBranchModal from '../DeleteBranchModal'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/LifetimeInformation-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/LifetimeInformation-test.tsx index 59be149f47b..0f8cfbbd2c6 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/LifetimeInformation-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/LifetimeInformation-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getValues } from '../../../../api/settings'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { SettingsKey } from '../../../../types/settings'; import { LifetimeInformation } from '../LifetimeInformation'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx index cca1eee7530..ef7ff7fc0fe 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx @@ -22,13 +22,7 @@ import * as React from 'react'; import { renameBranch } from '../../../../api/branches'; import { mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/testMocks'; -import { - change, - click, - doAsync, - submit, - waitAndUpdate -} from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, click, doAsync, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import RenameBranchModal from '../RenameBranchModal'; jest.mock('../../../../api/branches', () => ({ renameBranch: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/projectBranches/routes.ts b/server/sonar-web/src/main/js/apps/projectBranches/routes.ts index f57b5528d59..3056655f8ba 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/routes.ts +++ b/server/sonar-web/src/main/js/apps/projectBranches/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/projectDeletion/App.tsx b/server/sonar-web/src/main/js/apps/projectDeletion/App.tsx index dd4c6a02932..9fd50d11b03 100644 --- a/server/sonar-web/src/main/js/apps/projectDeletion/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectDeletion/App.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import Form from './Form'; import Header from './Header'; diff --git a/server/sonar-web/src/main/js/apps/projectDeletion/Form.tsx b/server/sonar-web/src/main/js/apps/projectDeletion/Form.tsx index 1ae2bb00a8c..8c97d9d87e3 100644 --- a/server/sonar-web/src/main/js/apps/projectDeletion/Form.tsx +++ b/server/sonar-web/src/main/js/apps/projectDeletion/Form.tsx @@ -21,10 +21,10 @@ import * as React from 'react'; import { deleteApplication } from '../../api/application'; import { deletePortfolio, deleteProject } from '../../api/components'; import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage'; +import { Button } from '../../components/controls/buttons'; +import ConfirmButton from '../../components/controls/ConfirmButton'; import { Router, withRouter } from '../../components/hoc/withRouter'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../sonar-ui-common/components/controls/ConfirmButton'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { isApplication, isPortfolioLike } from '../../types/component'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectDeletion/Header.tsx b/server/sonar-web/src/main/js/apps/projectDeletion/Header.tsx index 7fdfb20cabe..a20e57b22ff 100644 --- a/server/sonar-web/src/main/js/apps/projectDeletion/Header.tsx +++ b/server/sonar-web/src/main/js/apps/projectDeletion/Header.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; interface Props { component: Pick; diff --git a/server/sonar-web/src/main/js/apps/projectKey/Key.tsx b/server/sonar-web/src/main/js/apps/projectKey/Key.tsx index 6458a99d296..df70da33abb 100644 --- a/server/sonar-web/src/main/js/apps/projectKey/Key.tsx +++ b/server/sonar-web/src/main/js/apps/projectKey/Key.tsx @@ -22,7 +22,7 @@ import { Helmet } from 'react-helmet-async'; import { withRouter, WithRouterProps } from 'react-router'; import { changeKey } from '../../api/components'; import RecentHistory from '../../app/components/RecentHistory'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import UpdateForm from './UpdateForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectKey/UpdateForm.tsx b/server/sonar-web/src/main/js/apps/projectKey/UpdateForm.tsx index 63eaf48076f..1cb39eb737b 100644 --- a/server/sonar-web/src/main/js/apps/projectKey/UpdateForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectKey/UpdateForm.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import ProjectKeyInput from '../../components/common/ProjectKeyInput'; +import { Button, SubmitButton } from '../../components/controls/buttons'; +import ConfirmButton from '../../components/controls/ConfirmButton'; +import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { validateProjectKey } from '../../helpers/projects'; -import { Button, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../sonar-ui-common/components/controls/ConfirmButton'; -import MandatoryFieldsExplanation from '../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; import { ProjectKeyValidationResult } from '../../types/component'; export interface UpdateFormProps { diff --git a/server/sonar-web/src/main/js/apps/projectKey/__tests__/UpdateForm-test.tsx b/server/sonar-web/src/main/js/apps/projectKey/__tests__/UpdateForm-test.tsx index fce8a5e10e6..1f441e68139 100644 --- a/server/sonar-web/src/main/js/apps/projectKey/__tests__/UpdateForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectKey/__tests__/UpdateForm-test.tsx @@ -20,9 +20,9 @@ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; import ProjectKeyInput from '../../../components/common/ProjectKeyInput'; +import { Button, SubmitButton } from '../../../components/controls/buttons'; import { mockComponent, mockEvent } from '../../../helpers/testMocks'; -import { Button, SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import UpdateForm, { UpdateFormProps } from '../UpdateForm'; it('should render', () => { diff --git a/server/sonar-web/src/main/js/apps/projectLinks/App.tsx b/server/sonar-web/src/main/js/apps/projectLinks/App.tsx index 0548f6e082b..82cc8f6c8a1 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/App.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { createLink, deleteLink, getProjectLinks } from '../../api/projectLinks'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; import Header from './Header'; import Table from './Table'; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/CreationModal.tsx b/server/sonar-web/src/main/js/apps/projectLinks/CreationModal.tsx index 1d6cd1b81ac..968fe784411 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/CreationModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/CreationModal.tsx @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ResetButtonLink, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons'; +import SimpleModal from '../../components/controls/SimpleModal'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/Header.tsx b/server/sonar-web/src/main/js/apps/projectLinks/Header.tsx index d91ff946350..f9d691c6147 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/Header.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/Header.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import { translate } from '../../helpers/l10n'; import CreationModal from './CreationModal'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx b/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx index 32d57ddc6c0..955a2dffd26 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import isValidUri from '../../app/utils/isValidUri'; +import { Button } from '../../components/controls/buttons'; +import ConfirmButton from '../../components/controls/ConfirmButton'; +import ProjectLinkIcon from '../../components/icons/ProjectLinkIcon'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { getLinkName, isProvided } from '../../helpers/projectLinks'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../sonar-ui-common/components/controls/ConfirmButton'; -import ProjectLinkIcon from '../../sonar-ui-common/components/icons/ProjectLinkIcon'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; interface Props { link: T.ProjectLink; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/Table.tsx b/server/sonar-web/src/main/js/apps/projectLinks/Table.tsx index 4f8bccf0dbc..7d33bb5997c 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/Table.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/Table.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { translate } from '../../helpers/l10n'; import { orderLinks } from '../../helpers/projectLinks'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import LinkRow from './LinkRow'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx index 1224f82d98e..f84fd1ce5be 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { createLink, deleteLink, getProjectLinks } from '../../../api/projectLinks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import App from '../App'; // import { getProjectLinks, createLink, deleteLink } from '../../api/projectLinks'; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx index 8b2e2f7b837..4f85862c2df 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change, submit } from '../../../sonar-ui-common/helpers/testUtils'; +import { change, submit } from '../../../helpers/testUtils'; import CreationModal from '../CreationModal'; it('should create link', () => { diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx index 4ff3a8785c3..bdeb6e0b1a8 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import Header from '../Header'; it('should render', () => { diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx index 51e52ab61b8..08468d1fb8e 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx @@ -28,7 +28,7 @@ import { } from '../../api/quality-gates'; import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage'; import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import { USE_SYSTEM_DEFAULT } from './constants'; import ProjectQualityGateAppRenderer from './ProjectQualityGateAppRenderer'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx index 88325f4dbb8..044d4423e80 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx @@ -24,13 +24,13 @@ import { Link } from 'react-router'; import A11ySkipTarget from '../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../app/components/embed-docs-modal/Suggestions'; import DisableableSelectOption from '../../components/common/DisableableSelectOption'; -import { SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import HelpTooltip from '../../sonar-ui-common/components/controls/HelpTooltip'; -import Radio from '../../sonar-ui-common/components/controls/Radio'; -import Select from '../../sonar-ui-common/components/controls/Select'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { isDiffMetric } from '../../sonar-ui-common/helpers/measures'; +import { SubmitButton } from '../../components/controls/buttons'; +import HelpTooltip from '../../components/controls/HelpTooltip'; +import Radio from '../../components/controls/Radio'; +import Select from '../../components/controls/Select'; +import { Alert } from '../../components/ui/Alert'; +import { translate } from '../../helpers/l10n'; +import { isDiffMetric } from '../../helpers/measures'; import BuiltInQualityGateBadge from '../quality-gates/components/BuiltInQualityGateBadge'; import { USE_SYSTEM_DEFAULT } from './constants'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateApp-test.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateApp-test.tsx index cf1b581b214..184545784f7 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateApp-test.tsx @@ -29,7 +29,7 @@ import { import handleRequiredAuthorization from '../../../app/utils/handleRequiredAuthorization'; import { mockQualityGate } from '../../../helpers/mocks/quality-gates'; import { mockComponent } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { USE_SYSTEM_DEFAULT } from '../constants'; import ProjectQualityGateApp from '../ProjectQualityGateApp'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateAppRenderer-test.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateAppRenderer-test.tsx index e2c2938f294..61e9dd74f1d 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateAppRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/ProjectQualityGateAppRenderer-test.tsx @@ -19,11 +19,11 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import Radio from '../../../components/controls/Radio'; +import Select from '../../../components/controls/Select'; import { mockQualityGate } from '../../../helpers/mocks/quality-gates'; import { mockCondition } from '../../../helpers/testMocks'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { submit } from '../../../sonar-ui-common/helpers/testUtils'; +import { submit } from '../../../helpers/testUtils'; import { MetricKey } from '../../../types/metrics'; import { USE_SYSTEM_DEFAULT } from '../constants'; import ProjectQualityGateAppRenderer, { diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/routes.ts b/server/sonar-web/src/main/js/apps/projectQualityGate/routes.ts index 395a4f4dd01..01fb88c5b50 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/routes.ts +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesApp.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesApp.tsx index c8158903dcb..81b7af22f5d 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesApp.tsx @@ -28,8 +28,8 @@ import { } from '../../api/quality-profiles'; import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage'; import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization'; -import { translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; -import { isDefined } from '../../sonar-ui-common/helpers/types'; +import { translateWithParameters } from '../../helpers/l10n'; +import { isDefined } from '../../helpers/types'; import ProjectQualityProfilesAppRenderer from './ProjectQualityProfilesAppRenderer'; import { ProjectProfile } from './types'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx index 8a7635275fe..024ca06fab3 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx @@ -24,12 +24,12 @@ import { Link } from 'react-router'; import { Profile } from '../../api/quality-profiles'; import A11ySkipTarget from '../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../app/components/embed-docs-modal/Suggestions'; +import { Button } from '../../components/controls/buttons'; +import HelpTooltip from '../../components/controls/HelpTooltip'; +import EditIcon from '../../components/icons/EditIcon'; +import PlusCircleIcon from '../../components/icons/PlusCircleIcon'; +import { translate } from '../../helpers/l10n'; import { getRulesUrl } from '../../helpers/urls'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import HelpTooltip from '../../sonar-ui-common/components/controls/HelpTooltip'; -import EditIcon from '../../sonar-ui-common/components/icons/EditIcon'; -import PlusCircleIcon from '../../sonar-ui-common/components/icons/PlusCircleIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import BuiltInQualityProfileBadge from '../quality-profiles/components/BuiltInQualityProfileBadge'; import AddLanguageModal from './components/AddLanguageModal'; import SetQualityProfileModal from './components/SetQualityProfileModal'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProjectQualityProfilesApp-test.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProjectQualityProfilesApp-test.tsx index 547bead93eb..f61d1cb964d 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProjectQualityProfilesApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProjectQualityProfilesApp-test.tsx @@ -28,7 +28,7 @@ import { } from '../../../api/quality-profiles'; import handleRequiredAuthorization from '../../../app/utils/handleRequiredAuthorization'; import { mockComponent } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import ProjectQualityProfilesApp from '../ProjectQualityProfilesApp'; jest.mock('../../../api/quality-profiles', () => { diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/AddLanguageModal.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/AddLanguageModal.tsx index 82a90de0c71..1630c4de320 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/AddLanguageModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/AddLanguageModal.tsx @@ -23,11 +23,11 @@ import { connect } from 'react-redux'; import { Link } from 'react-router'; import { Profile } from '../../../api/quality-profiles'; import DisableableSelectOption from '../../../components/common/DisableableSelectOption'; +import { ButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Select from '../../../components/controls/Select'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import { translate } from '../../../helpers/l10n'; import { getQualityProfileUrl } from '../../../helpers/urls'; -import { ButtonLink, SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Store } from '../../../store/rootReducer'; export interface AddLanguageModalProps { diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/SetQualityProfileModal.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/SetQualityProfileModal.tsx index cb9be26ae92..063502c7278 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/SetQualityProfileModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/SetQualityProfileModal.tsx @@ -21,13 +21,13 @@ import * as React from 'react'; import { Link } from 'react-router'; import { Profile } from '../../../api/quality-profiles'; import DisableableSelectOption from '../../../components/common/DisableableSelectOption'; +import { ButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Radio from '../../../components/controls/Radio'; +import Select from '../../../components/controls/Select'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import { Alert } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getQualityProfileUrl } from '../../../helpers/urls'; -import { ButtonLink, SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import BuiltInQualityProfileBadge from '../../quality-profiles/components/BuiltInQualityProfileBadge'; import { USE_SYSTEM_DEFAULT } from '../constants'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/AddLanguageModal-test.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/AddLanguageModal-test.tsx index d97beb3023c..4c091a9aeea 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/AddLanguageModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/AddLanguageModal-test.tsx @@ -19,9 +19,9 @@ */ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; +import Select from '../../../../components/controls/Select'; +import SimpleModal from '../../../../components/controls/SimpleModal'; import { mockQualityProfile } from '../../../../helpers/testMocks'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; -import SimpleModal from '../../../../sonar-ui-common/components/controls/SimpleModal'; import { AddLanguageModal, AddLanguageModalProps } from '../AddLanguageModal'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/SetQualityProfileModal-test.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/SetQualityProfileModal-test.tsx index 2c9ad1797cb..309426a0391 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/SetQualityProfileModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/SetQualityProfileModal-test.tsx @@ -19,10 +19,10 @@ */ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; +import Radio from '../../../../components/controls/Radio'; +import Select from '../../../../components/controls/Select'; +import SimpleModal from '../../../../components/controls/SimpleModal'; import { mockComponent, mockQualityProfile } from '../../../../helpers/testMocks'; -import Radio from '../../../../sonar-ui-common/components/controls/Radio'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; -import SimpleModal from '../../../../sonar-ui-common/components/controls/SimpleModal'; import SetQualityProfileModal, { SetQualityProfileModalProps } from '../SetQualityProfileModal'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/routes.ts b/server/sonar-web/src/main/js/apps/projectQualityProfiles/routes.ts index b04a9d34320..7ef64209da5 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/routes.ts +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx index f520c820609..4034a6fd592 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx @@ -23,15 +23,15 @@ import { Helmet } from 'react-helmet-async'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; +import ListFooter from '../../../components/controls/ListFooter'; import { Location, Router, withRouter } from '../../../components/hoc/withRouter'; import '../../../components/search-navigator.css'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; +import { translate } from '../../../helpers/l10n'; +import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages'; +import { get, save } from '../../../helpers/storage'; import { isLoggedIn } from '../../../helpers/users'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import handleRequiredAuthentication from '../../../sonar-ui-common/helpers/handleRequiredAuthentication'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { addSideBarClass, removeSideBarClass } from '../../../sonar-ui-common/helpers/pages'; -import { get, save } from '../../../sonar-ui-common/helpers/storage'; import { ComponentQualifier } from '../../../types/component'; import { hasFilterParams, hasVisualizationParams, parseUrlQuery, Query } from '../query'; import '../styles.css'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx index 016fcb5f7b5..5fe4dd2d0a9 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { connect } from 'react-redux'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; import { getAppState, getCurrentUser, Store } from '../../../store/rootReducer'; import { ComponentQualifier } from '../../../types/component'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx b/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx index 6370abe992c..b652a99505b 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx @@ -20,13 +20,13 @@ import * as React from 'react'; import { getComponentNavigation } from '../../../api/nav'; import CreateApplicationForm from '../../../app/components/extensions/CreateApplicationForm'; +import { Button } from '../../../components/controls/buttons'; import { withAppState } from '../../../components/hoc/withAppState'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; import { Router, withRouter } from '../../../components/hoc/withRouter'; +import { translate } from '../../../helpers/l10n'; import { getComponentAdminUrl, getComponentOverviewUrl } from '../../../helpers/urls'; import { hasGlobalPermission } from '../../../helpers/users'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { ComponentQualifier } from '../../../types/component'; import { Permissions } from '../../../types/permissions'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/ClearAll.tsx b/server/sonar-web/src/main/js/apps/projects/components/ClearAll.tsx index 3ab932bb29a..ec08ad69245 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ClearAll.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ClearAll.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; interface Props { onClearAll: () => void; diff --git a/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx b/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx index f511a91a6c8..68329e25c0a 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import { searchProjects } from '../../../api/components'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; import { Location, Router, withRouter } from '../../../components/hoc/withRouter'; +import { get } from '../../../helpers/storage'; import { hasGlobalPermission, isLoggedIn } from '../../../helpers/users'; -import { get } from '../../../sonar-ui-common/helpers/storage'; import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE } from '../utils'; import AllProjectsContainer from './AllProjectsContainer'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/EmptyFavoriteSearch.tsx b/server/sonar-web/src/main/js/apps/projects/components/EmptyFavoriteSearch.tsx index c86b03c66a2..4ff272ce959 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/EmptyFavoriteSearch.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/EmptyFavoriteSearch.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import '../../../components/common/EmptySearch.css'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Query } from '../query'; export default function EmptyFavoriteSearch({ query }: { query: Query }) { diff --git a/server/sonar-web/src/main/js/apps/projects/components/EmptyInstance.tsx b/server/sonar-web/src/main/js/apps/projects/components/EmptyInstance.tsx index 3397720a780..c1fc2b8209e 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/EmptyInstance.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/EmptyInstance.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { WithRouterProps } from 'react-router'; +import { Button } from '../../../components/controls/buttons'; import { withRouter } from '../../../components/hoc/withRouter'; +import { translate } from '../../../helpers/l10n'; import { hasGlobalPermission, isLoggedIn } from '../../../helpers/users'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Permissions } from '../../../types/permissions'; export interface EmptyInstanceProps { diff --git a/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.tsx b/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.tsx index 3e3c57bc6d4..7a017538197 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { IndexLink, Link } from 'react-router'; +import { translate } from '../../../helpers/l10n'; +import { save } from '../../../helpers/storage'; import { isLoggedIn } from '../../../helpers/users'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { save } from '../../../sonar-ui-common/helpers/storage'; import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projects/components/NoFavoriteProjects.tsx b/server/sonar-web/src/main/js/apps/projects/components/NoFavoriteProjects.tsx index 3daaee1d38c..6f44acbdbc2 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/NoFavoriteProjects.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/NoFavoriteProjects.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function NoFavoriteProjects() { return ( diff --git a/server/sonar-web/src/main/js/apps/projects/components/PageHeader.tsx b/server/sonar-web/src/main/js/apps/projects/components/PageHeader.tsx index 0809336d957..b2980207975 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/PageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/PageHeader.tsx @@ -20,9 +20,9 @@ import * as classNames from 'classnames'; import * as React from 'react'; import HomePageSelect from '../../../components/controls/HomePageSelect'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; import { isLoggedIn } from '../../../helpers/users'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import SearchFilterContainer from '../filters/SearchFilterContainer'; import { Project } from '../types'; import ApplicationCreation from './ApplicationCreation'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.tsx b/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.tsx index 9bdb1e57928..13872969632 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.tsx @@ -19,7 +19,7 @@ */ import { flatMap } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import CoverageFilter from '../filters/CoverageFilter'; import DuplicationsFilter from '../filters/DuplicationsFilter'; import LanguagesFilterContainer from '../filters/LanguagesFilterContainer'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.tsx b/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.tsx index 441efc3962d..c7168badf4a 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { translate } from '../../../helpers/l10n'; import { VIEWS, VISUALIZATIONS } from '../utils'; import PerspectiveSelectOption, { Option } from './PerspectiveSelectOption'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelectOption.tsx b/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelectOption.tsx index 5cf080bbdff..a9115bc1d14 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelectOption.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelectOption.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BubblesIcon from '../../../sonar-ui-common/components/icons/BubblesIcon'; -import ListIcon from '../../../sonar-ui-common/components/icons/ListIcon'; +import BubblesIcon from '../../../components/icons/BubblesIcon'; +import ListIcon from '../../../components/icons/ListIcon'; export interface Option { label: string; diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx index 264167ce4f1..d43ce028420 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx @@ -20,14 +20,14 @@ import * as React from 'react'; import { Link } from 'react-router'; import { getAlmSettings } from '../../../api/alm-settings'; +import { Button } from '../../../components/controls/buttons'; +import Dropdown from '../../../components/controls/Dropdown'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import EllipsisIcon from '../../../components/icons/EllipsisIcon'; import { IMPORT_COMPATIBLE_ALMS, IMPORT_COMPATIBLE_ALM_COUNT } from '../../../helpers/constants'; +import { translate } from '../../../helpers/l10n'; import { hasGlobalPermission } from '../../../helpers/users'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import EllipsisIcon from '../../../sonar-ui-common/components/icons/EllipsisIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; import { Permissions } from '../../../types/permissions'; import ProjectCreationMenuItem from './ProjectCreationMenuItem'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenuItem.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenuItem.tsx index 5decdbb78b5..c34b94152d2 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenuItem.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenuItem.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import ChevronsIcon from '../../../sonar-ui-common/components/icons/ChevronsIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import ChevronsIcon from '../../../components/icons/ChevronsIcon'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { AlmKeys } from '../../../types/alm-settings'; export interface ProjectCreationMenuItemProps { diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx index 2f26cf63cf7..8e265138f43 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx @@ -22,7 +22,7 @@ import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; import { List, ListRowProps } from 'react-virtualized/dist/commonjs/List'; import { WindowScroller } from 'react-virtualized/dist/commonjs/WindowScroller'; import EmptySearch from '../../../components/common/EmptySearch'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Query } from '../query'; import { Project } from '../types'; import EmptyFavoriteSearch from './EmptyFavoriteSearch'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectsSortingSelect.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectsSortingSelect.tsx index 59f1a6a0712..cdf13fbbfac 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectsSortingSelect.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectsSortingSelect.tsx @@ -20,12 +20,12 @@ import { sortBy } from 'lodash'; import * as React from 'react'; import { colors } from '../../../app/theme'; -import { ButtonIcon } from '../../../sonar-ui-common/components/controls/buttons'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import SortAscIcon from '../../../sonar-ui-common/components/icons/SortAscIcon'; -import SortDescIcon from '../../../sonar-ui-common/components/icons/SortDescIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonIcon } from '../../../components/controls/buttons'; +import Select from '../../../components/controls/Select'; +import Tooltip from '../../../components/controls/Tooltip'; +import SortAscIcon from '../../../components/icons/SortAscIcon'; +import SortDescIcon from '../../../components/icons/SortDescIcon'; +import { translate } from '../../../helpers/l10n'; import { parseSorting, SORTING_LEAK_METRICS, SORTING_METRICS } from '../utils'; import ProjectsSortingSelectOption, { Option } from './ProjectsSortingSelectOption'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx index 81bef7f6a77..e149a05897a 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { get, save } from '../../../../sonar-ui-common/helpers/storage'; +import { get, save } from '../../../../helpers/storage'; import { ComponentQualifier } from '../../../../types/component'; import { AllProjects, @@ -55,7 +55,7 @@ jest.mock('../../utils', () => { return utils; }); -jest.mock('../../../../sonar-ui-common/helpers/storage', () => ({ +jest.mock('../../../../helpers/storage', () => ({ get: jest.fn(() => null), save: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ApplicationCreation-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ApplicationCreation-test.tsx index 127b03b12d8..5e33911867b 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ApplicationCreation-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ApplicationCreation-test.tsx @@ -21,8 +21,8 @@ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; import { getComponentNavigation } from '../../../../api/nav'; import CreateApplicationForm from '../../../../app/components/extensions/CreateApplicationForm'; +import { Button } from '../../../../components/controls/buttons'; import { mockAppState, mockLoggedInUser, mockRouter } from '../../../../helpers/testMocks'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; import { ComponentQualifier } from '../../../../types/component'; import { ApplicationCreation, ApplicationCreationProps } from '../ApplicationCreation'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ClearAll-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ClearAll-test.tsx index 5fbf88db635..6d5fe5170b6 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ClearAll-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ClearAll-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import ClearAll from '../ClearAll'; it('renders', () => { diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/DefaultPageSelector-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/DefaultPageSelector-test.tsx index 9ac62fb5336..e0ac85e5c84 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/DefaultPageSelector-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/DefaultPageSelector-test.tsx @@ -20,15 +20,15 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { searchProjects } from '../../../../api/components'; +import { get } from '../../../../helpers/storage'; import { mockCurrentUser, mockLocation, mockLoggedInUser, mockRouter } from '../../../../helpers/testMocks'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { hasGlobalPermission } from '../../../../helpers/users'; -import { get } from '../../../../sonar-ui-common/helpers/storage'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; import { DefaultPageSelector } from '../DefaultPageSelector'; jest.mock('../AllProjectsContainer', () => ({ @@ -38,7 +38,7 @@ jest.mock('../AllProjectsContainer', () => ({ } })); -jest.mock('../../../../sonar-ui-common/helpers/storage', () => ({ +jest.mock('../../../../helpers/storage', () => ({ get: jest.fn().mockReturnValue(undefined) })); diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/FavoriteFilter-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/FavoriteFilter-test.tsx index 61be1c433b5..2e4a2b0aabe 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/FavoriteFilter-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/FavoriteFilter-test.tsx @@ -19,11 +19,11 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { save } from '../../../../sonar-ui-common/helpers/storage'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { save } from '../../../../helpers/storage'; +import { click } from '../../../../helpers/testUtils'; import FavoriteFilter from '../FavoriteFilter'; -jest.mock('../../../../sonar-ui-common/helpers/storage', () => ({ +jest.mock('../../../../helpers/storage', () => ({ save: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCreationMenu-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCreationMenu-test.tsx index d53dee50767..5571a631e55 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCreationMenu-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCreationMenu-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getAlmSettings } from '../../../../api/alm-settings'; import { mockLoggedInUser } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import { ProjectCreationMenu } from '../ProjectCreationMenu'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsSortingSelect-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsSortingSelect-test.tsx index 4253c43401b..5ec93155c70 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsSortingSelect-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsSortingSelect-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import ProjectsSortingSelect from '../ProjectsSortingSelect'; it('should render correctly for overall view', () => { diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx index 7ab96073b33..7cde29df645 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx @@ -23,16 +23,16 @@ import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import PrivacyBadgeContainer from '../../../../components/common/PrivacyBadgeContainer'; import Favorite from '../../../../components/controls/Favorite'; +import Tooltip from '../../../../components/controls/Tooltip'; +import QualifierIcon from '../../../../components/icons/QualifierIcon'; +import DateFromNow from '../../../../components/intl/DateFromNow'; +import DateTimeFormatter from '../../../../components/intl/DateTimeFormatter'; import Measure from '../../../../components/measure/Measure'; import TagsList from '../../../../components/tags/TagsList'; +import SizeRating from '../../../../components/ui/SizeRating'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { getProjectUrl } from '../../../../helpers/urls'; import { isLoggedIn } from '../../../../helpers/users'; -import Tooltip from '../../../../sonar-ui-common/components/controls/Tooltip'; -import QualifierIcon from '../../../../sonar-ui-common/components/icons/QualifierIcon'; -import DateFromNow from '../../../../sonar-ui-common/components/intl/DateFromNow'; -import DateTimeFormatter from '../../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import SizeRating from '../../../../sonar-ui-common/components/ui/SizeRating'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; import { ComponentQualifier } from '../../../../types/component'; import { MetricKey } from '../../../../types/metrics'; import { Project } from '../../types'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardLanguages.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardLanguages.tsx index 23316b03e90..567ca229559 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardLanguages.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardLanguages.tsx @@ -19,7 +19,7 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasure.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasure.tsx index bd1d1f42a4f..d103da690ac 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasure.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasure.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import IssueTypeIcon from '../../../../sonar-ui-common/components/icons/IssueTypeIcon'; +import IssueTypeIcon from '../../../../components/icons/IssueTypeIcon'; export interface ProjectCardMeasureProps { iconKey?: string; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx index 57347d495a9..b9d1c682865 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx @@ -20,13 +20,13 @@ import * as classNames from 'classnames'; import * as difference from 'date-fns/difference_in_milliseconds'; import * as React from 'react'; +import DateTimeFormatter from '../../../../components/intl/DateTimeFormatter'; import Measure from '../../../../components/measure/Measure'; import CoverageRating from '../../../../components/ui/CoverageRating'; -import DateTimeFormatter from '../../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import DuplicationsRating from '../../../../sonar-ui-common/components/ui/DuplicationsRating'; -import Rating from '../../../../sonar-ui-common/components/ui/Rating'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; -import { isDefined } from '../../../../sonar-ui-common/helpers/types'; +import DuplicationsRating from '../../../../components/ui/DuplicationsRating'; +import Rating from '../../../../components/ui/Rating'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; +import { isDefined } from '../../../../helpers/types'; import { ComponentQualifier } from '../../../../types/component'; import { MetricKey } from '../../../../types/metrics'; import { formatDuration } from '../../utils'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardQualityGate.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardQualityGate.tsx index e0c16d01a6a..3a0b96b6fd8 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardQualityGate.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardQualityGate.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import HelpTooltip from '../../../../sonar-ui-common/components/controls/HelpTooltip'; -import Level from '../../../../sonar-ui-common/components/ui/Level'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../../sonar-ui-common/helpers/measures'; +import HelpTooltip from '../../../../components/controls/HelpTooltip'; +import Level from '../../../../components/ui/Level'; +import { translate } from '../../../../helpers/l10n'; +import { formatMeasure } from '../../../../helpers/measures'; interface Props { status?: string; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx index b656d3716f2..4e1463002db 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx @@ -19,11 +19,8 @@ */ import * as React from 'react'; import CoverageRating from '../../../components/ui/CoverageRating'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { - getCoverageRatingAverageValue, - getCoverageRatingLabel -} from '../../../sonar-ui-common/helpers/ratings'; +import { translate } from '../../../helpers/l10n'; +import { getCoverageRatingAverageValue, getCoverageRatingLabel } from '../../../helpers/ratings'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx index a06946a3c98..8ad097a9826 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import DuplicationsRating from '../../../sonar-ui-common/components/ui/DuplicationsRating'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DuplicationsRating from '../../../components/ui/DuplicationsRating'; +import { translate } from '../../../helpers/l10n'; import { getDuplicationsRatingAverageValue, getDuplicationsRatingLabel -} from '../../../sonar-ui-common/helpers/ratings'; +} from '../../../helpers/ratings'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx index 6c8f79e38a1..150a78d6cb8 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { Facet } from '../types'; export type Option = string | number; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx index b437b47f244..ade2ba79d85 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Rating from '../../../sonar-ui-common/components/ui/Rating'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Rating from '../../../components/ui/Rating'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx index 6e3c8a53469..e3786e0f5b1 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx @@ -19,7 +19,7 @@ */ import { difference, sortBy } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getLanguageByKey } from '../../../store/languages'; import { Facet } from '../types'; import Filter from './Filter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx index a6bb27b3042..73a3c437eca 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import CodeSmellIcon from '../../../sonar-ui-common/components/icons/CodeSmellIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import CodeSmellIcon from '../../../components/icons/CodeSmellIcon'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import IssuesFilter from './IssuesFilter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx index 86e5b4f1f81..73b9dceb8dc 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getSizeRatingLabel } from '../../../sonar-ui-common/helpers/ratings'; +import { translate } from '../../../helpers/l10n'; +import { getSizeRatingLabel } from '../../../helpers/ratings'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx index 66325a135b7..c151cb3c6fc 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import CodeSmellIcon from '../../../sonar-ui-common/components/icons/CodeSmellIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import CodeSmellIcon from '../../../components/icons/CodeSmellIcon'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import IssuesFilter from './IssuesFilter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx index 3bf152eeae5..423e5fd205b 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BugIcon from '../../../sonar-ui-common/components/icons/BugIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import BugIcon from '../../../components/icons/BugIcon'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import IssuesFilter from './IssuesFilter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx index 092d0a4a54a..64614768687 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import VulnerabilityIcon from '../../../sonar-ui-common/components/icons/VulnerabilityIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import IssuesFilter from './IssuesFilter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx index a59fde35725..84812b36415 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { translate } from '../../../helpers/l10n'; import { ComponentQualifier } from '../../../types/component'; import { Facet } from '../types'; import Filter from './Filter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx index 347c88539a9..fd857bf2f80 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import Level from '../../../sonar-ui-common/components/ui/Level'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import Level from '../../../components/ui/Level'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx index 952a6ef84d5..2f4f683241e 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BugIcon from '../../../sonar-ui-common/components/icons/BugIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import BugIcon from '../../../components/icons/BugIcon'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import IssuesFilter from './IssuesFilter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SearchFilterContainer.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SearchFilterContainer.tsx index b4f2563967f..36bdaab7f53 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SearchFilterContainer.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SearchFilterContainer.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import SearchBox from '../../../components/controls/SearchBox'; +import { translate } from '../../../helpers/l10n'; interface Props { query: { search?: string }; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx index 5e184e6a4f4..ee10558c61d 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { translate } from '../../../helpers/l10n'; interface Props { isFavorite?: boolean; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.tsx index e787a18af65..77bed6716a7 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { option?: { name: string }; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx index be34bbbf52c..a553d205870 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import VulnerabilityIcon from '../../../sonar-ui-common/components/icons/VulnerabilityIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import IssuesFilter from './IssuesFilter'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx index ec8ea03df5e..816b7428e33 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import SecurityHotspotIcon from '../../../sonar-ui-common/components/icons/SecurityHotspotIcon'; -import Rating from '../../../sonar-ui-common/components/ui/Rating'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import SecurityHotspotIcon from '../../../components/icons/SecurityHotspotIcon'; +import Rating from '../../../components/ui/Rating'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx index 8265900fa18..9df9a168890 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx @@ -18,12 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import SizeRating from '../../../sonar-ui-common/components/ui/SizeRating'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { - getSizeRatingAverageValue, - getSizeRatingLabel -} from '../../../sonar-ui-common/helpers/ratings'; +import SizeRating from '../../../components/ui/SizeRating'; +import { translate } from '../../../helpers/l10n'; +import { getSizeRatingAverageValue, getSizeRatingLabel } from '../../../helpers/ratings'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx index 3e78ddcd323..c7175a3cc3b 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx @@ -20,7 +20,7 @@ import { debounce, difference, size, sortBy } from 'lodash'; import * as React from 'react'; import { searchProjectTags } from '../../../api/components'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Facet } from '../types'; import Filter from './Filter'; import FilterHeader from './FilterHeader'; diff --git a/server/sonar-web/src/main/js/apps/projects/routes.ts b/server/sonar-web/src/main/js/apps/projects/routes.ts index cc026f8dd9b..c398749aed4 100644 --- a/server/sonar-web/src/main/js/apps/projects/routes.ts +++ b/server/sonar-web/src/main/js/apps/projects/routes.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { RedirectFunction, RouterState } from 'react-router'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; -import { save } from '../../sonar-ui-common/helpers/storage'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; +import { save } from '../../helpers/storage'; import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER } from './utils'; const routes = [ diff --git a/server/sonar-web/src/main/js/apps/projects/utils.ts b/server/sonar-web/src/main/js/apps/projects/utils.ts index f729cf3a72e..d9c0446d643 100644 --- a/server/sonar-web/src/main/js/apps/projects/utils.ts +++ b/server/sonar-web/src/main/js/apps/projects/utils.ts @@ -20,9 +20,9 @@ import { invert } from 'lodash'; import { Facet, searchProjects } from '../../api/components'; import { getMeasuresForProjects } from '../../api/measures'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { isDiffMetric } from '../../helpers/measures'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; -import { RequestData } from '../../sonar-ui-common/helpers/request'; +import { RequestData } from '../../helpers/request'; import { MetricKey } from '../../types/metrics'; import { convertToFilter, Query } from './query'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Coverage.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Coverage.tsx index ee807a7ffcd..3223754c5f9 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/Coverage.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Coverage.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Project } from '../types'; import SimpleBubbleChart from './SimpleBubbleChart'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Duplications.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Duplications.tsx index a353b4810c4..523b6293267 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/Duplications.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Duplications.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Project } from '../types'; import SimpleBubbleChart from './SimpleBubbleChart'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Maintainability.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Maintainability.tsx index d963b5359ba..1bd88d95b0a 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/Maintainability.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Maintainability.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Project } from '../types'; import SimpleBubbleChart from './SimpleBubbleChart'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Reliability.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Reliability.tsx index e62c648276a..61a8a070537 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/Reliability.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Reliability.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Project } from '../types'; import SimpleBubbleChart from './SimpleBubbleChart'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Risk.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Risk.tsx index 013026433b3..bd671ce8718 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/Risk.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Risk.tsx @@ -18,15 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import BubbleChart from '../../../components/charts/BubbleChart'; import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { RATING_COLORS } from '../../../helpers/constants'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; +import { isDefined } from '../../../helpers/types'; import { getProjectUrl } from '../../../helpers/urls'; -import BubbleChart from '../../../sonar-ui-common/components/charts/BubbleChart'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; import { ComponentQualifier } from '../../../types/component'; import { Project } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Security.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Security.tsx index d2df2ff39b9..4298e5e1c6a 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/Security.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Security.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { Project } from '../types'; import SimpleBubbleChart from './SimpleBubbleChart'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/SimpleBubbleChart.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/SimpleBubbleChart.tsx index 9d387853d9c..5a0a94ee888 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/SimpleBubbleChart.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/SimpleBubbleChart.tsx @@ -18,15 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import BubbleChart from '../../../components/charts/BubbleChart'; import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; import { RATING_COLORS } from '../../../helpers/constants'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; +import { isDefined } from '../../../helpers/types'; import { getProjectUrl } from '../../../helpers/urls'; -import BubbleChart from '../../../sonar-ui-common/components/charts/BubbleChart'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; -import { isDefined } from '../../../sonar-ui-common/helpers/types'; import { ComponentQualifier } from '../../../types/component'; import { Project } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx index 3dc25731990..db77fa42331 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Project } from '../types'; import { localizeSorting } from '../utils'; import Coverage from './Coverage'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx index c624bd1db93..c3c7d9ce91f 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx @@ -25,10 +25,10 @@ import { getComponents, Project } from '../../api/components'; import { changeProjectDefaultVisibility } from '../../api/permissions'; import { getValues } from '../../api/settings'; import Suggestions from '../../app/components/embed-docs-modal/Suggestions'; +import ListFooter from '../../components/controls/ListFooter'; +import { toShortNotSoISOString } from '../../helpers/dates'; +import { translate } from '../../helpers/l10n'; import { hasGlobalPermission } from '../../helpers/users'; -import ListFooter from '../../sonar-ui-common/components/controls/ListFooter'; -import { toShortNotSoISOString } from '../../sonar-ui-common/helpers/dates'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import { getAppState, getCurrentUser, Store } from '../../store/rootReducer'; import { Permissions } from '../../types/permissions'; import { SettingsKey } from '../../types/settings'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx index 027ee59e33a..d6d90784353 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx @@ -19,14 +19,14 @@ */ import * as React from 'react'; import { bulkApplyTemplate, getPermissionTemplates } from '../../api/permissions'; -import { ResetButtonLink, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../sonar-ui-common/components/controls/Modal'; -import Select from '../../sonar-ui-common/components/controls/Select'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { toNotSoISOString } from '../../sonar-ui-common/helpers/dates'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons'; +import Modal from '../../components/controls/Modal'; +import Select from '../../components/controls/Select'; +import { Alert } from '../../components/ui/Alert'; +import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation'; +import { toNotSoISOString } from '../../helpers/dates'; +import { translate, translateWithParameters } from '../../helpers/l10n'; export interface Props { analyzedBefore: Date | undefined; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ChangeDefaultVisibilityForm.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ChangeDefaultVisibilityForm.tsx index 4c38ce4f1d0..06fe0785b93 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ChangeDefaultVisibilityForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ChangeDefaultVisibilityForm.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button, ResetButtonLink } from '../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../sonar-ui-common/components/controls/Modal'; -import Radio from '../../sonar-ui-common/components/controls/Radio'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button, ResetButtonLink } from '../../components/controls/buttons'; +import Modal from '../../components/controls/Modal'; +import Radio from '../../components/controls/Radio'; +import { Alert } from '../../components/ui/Alert'; +import { translate } from '../../helpers/l10n'; export interface Props { defaultVisibility: T.Visibility; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx index 15c93000141..eeb7e424efe 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx @@ -22,13 +22,13 @@ import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { createProject } from '../../api/components'; import VisibilitySelector from '../../components/common/VisibilitySelector'; +import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons'; +import Modal from '../../components/controls/Modal'; +import { Alert } from '../../components/ui/Alert'; +import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../helpers/l10n'; import { getProjectUrl } from '../../helpers/urls'; -import { ResetButtonLink, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../sonar-ui-common/components/controls/Modal'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; interface Props { defaultProjectVisibility?: T.Visibility; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx index 66e3d015a7d..9fa913a0c47 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { bulkDeleteProjects } from '../../api/components'; -import { ResetButtonLink, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../sonar-ui-common/components/controls/Modal'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import { toNotSoISOString } from '../../sonar-ui-common/helpers/dates'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons'; +import Modal from '../../components/controls/Modal'; +import { Alert } from '../../components/ui/Alert'; +import { toNotSoISOString } from '../../helpers/dates'; +import { translate, translateWithParameters } from '../../helpers/l10n'; export interface Props { analyzedBefore: Date | undefined; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Header.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Header.tsx index ba9e78aee19..186366ffc0f 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/Header.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/Header.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button, EditButton } from '../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button, EditButton } from '../../components/controls/buttons'; +import { translate } from '../../helpers/l10n'; import ChangeDefaultVisibilityForm from './ChangeDefaultVisibilityForm'; export interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx index 767495017dc..6bcb30683f8 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx @@ -21,11 +21,11 @@ import * as React from 'react'; import { Link } from 'react-router'; import { Project } from '../../api/components'; import PrivacyBadgeContainer from '../../components/common/PrivacyBadgeContainer'; +import Checkbox from '../../components/controls/Checkbox'; +import Tooltip from '../../components/controls/Tooltip'; +import QualifierIcon from '../../components/icons/QualifierIcon'; +import DateFormatter from '../../components/intl/DateFormatter'; import { getComponentOverviewUrl } from '../../helpers/urls'; -import Checkbox from '../../sonar-ui-common/components/controls/Checkbox'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import QualifierIcon from '../../sonar-ui-common/components/icons/QualifierIcon'; -import DateFormatter from '../../sonar-ui-common/components/intl/DateFormatter'; import './ProjectRow.css'; import ProjectRowActions from './ProjectRowActions'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx index 69f808ff22e..8110759fa59 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx @@ -20,12 +20,10 @@ import * as React from 'react'; import { Project } from '../../api/components'; import { getComponentNavigation } from '../../api/nav'; +import ActionsDropdown, { ActionsDropdownItem } from '../../components/controls/ActionsDropdown'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; import { getComponentPermissionsUrl } from '../../helpers/urls'; -import ActionsDropdown, { - ActionsDropdownItem -} from '../../sonar-ui-common/components/controls/ActionsDropdown'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import ApplyTemplate from '../permissions/project/components/ApplyTemplate'; import RestoreAccessModal from './RestoreAccessModal'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Projects.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Projects.tsx index 3a40b6806b4..60a2ed2f579 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/Projects.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/Projects.tsx @@ -20,7 +20,7 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Project } from '../../api/components'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import ProjectRow from './ProjectRow'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx index 562a38942ad..c651f31e4c5 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx @@ -21,9 +21,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Project } from '../../api/components'; import { grantPermissionToUser } from '../../api/permissions'; -import { ResetButtonLink, SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons'; +import Modal from '../../components/controls/Modal'; +import { translate } from '../../helpers/l10n'; interface Props { currentUser: Pick; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx index b0625038a14..fbf0c4558f2 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx @@ -20,14 +20,14 @@ import { sortBy } from 'lodash'; import * as React from 'react'; import { Project } from '../../api/components'; +import { Button } from '../../components/controls/buttons'; +import Checkbox from '../../components/controls/Checkbox'; import DateInput from '../../components/controls/DateInput'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import Checkbox from '../../sonar-ui-common/components/controls/Checkbox'; -import HelpTooltip from '../../sonar-ui-common/components/controls/HelpTooltip'; -import SearchBox from '../../sonar-ui-common/components/controls/SearchBox'; -import Select from '../../sonar-ui-common/components/controls/Select'; -import QualifierIcon from '../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../components/controls/HelpTooltip'; +import SearchBox from '../../components/controls/SearchBox'; +import Select from '../../components/controls/Select'; +import QualifierIcon from '../../components/icons/QualifierIcon'; +import { translate } from '../../helpers/l10n'; import BulkApplyTemplateModal from './BulkApplyTemplateModal'; import DeleteModal from './DeleteModal'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx index 5d66104f58c..be92a02befa 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx @@ -23,7 +23,7 @@ import { getComponents } from '../../../api/components'; import { changeProjectDefaultVisibility } from '../../../api/permissions'; import { getValues } from '../../../api/settings'; import { mockAppState, mockLoggedInUser } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { App, Props } from '../App'; import Search from '../Search'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx index 647aab9334c..81f90d0c9bd 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; -import { click, waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { parseDate } from '../../../helpers/dates'; +import { click, waitAndUpdate } from '../../../helpers/testUtils'; import BulkApplyTemplateModal, { Props } from '../BulkApplyTemplateModal'; jest.mock('../../../api/permissions', () => ({ diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ChangeDefaultVisibilityForm-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ChangeDefaultVisibilityForm-test.tsx index 0b9a405c4ce..b8d381ebb39 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ChangeDefaultVisibilityForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ChangeDefaultVisibilityForm-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import Radio from '../../../components/controls/Radio'; +import { click } from '../../../helpers/testUtils'; import ChangeDefaultVisibilityForm from '../ChangeDefaultVisibilityForm'; it('closes', () => { diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx index ab62bb13fb4..4e3c40dee58 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx @@ -26,7 +26,7 @@ jest.mock('../../../api/components', () => ({ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change, submit, waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { change, submit, waitAndUpdate } from '../../../helpers/testUtils'; import CreateProjectForm from '../CreateProjectForm'; const createProject = require('../../../api/components').createProject as jest.Mock; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx index 0f7d0062043..46b525fbb05 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/DeleteModal-test.tsx @@ -24,8 +24,8 @@ jest.mock('../../../api/components', () => ({ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { parseDate } from '../../../helpers/dates'; +import { click } from '../../../helpers/testUtils'; import DeleteModal, { Props } from '../DeleteModal'; const bulkDeleteProjects = require('../../../api/components').bulkDeleteProjects as jest.Mock; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Header-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Header-test.tsx index e50560a61cf..c67e81e0cf6 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Header-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Header-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import Header, { Props } from '../Header'; jest.mock('../../../helpers/system', () => ({ isSonarCloud: jest.fn().mockReturnValue(false) })); diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx index 09163cf0930..3356b769755 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getComponentNavigation } from '../../../api/nav'; import { mockLoggedInUser } from '../../../helpers/testMocks'; -import { click, waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../helpers/testUtils'; import ProjectRowActions, { Props } from '../ProjectRowActions'; jest.mock('../../../api/nav', () => ({ diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Search-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Search-test.tsx index c215f55bb1c..a2e3ce57d66 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Search-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Search-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import Search, { Props } from '../Search'; it('renders', () => { diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/routes.ts b/server/sonar-web/src/main/js/apps/projectsManagement/routes.ts index a823184781c..3af374600fb 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/routes.ts +++ b/server/sonar-web/src/main/js/apps/projectsManagement/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx index 0e36cbc3817..e2bd83f3f84 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx @@ -24,15 +24,15 @@ import { fetchQualityGates } from '../../../api/quality-gates'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; import '../../../components/search-navigator.css'; -import { getQualityGateUrl } from '../../../helpers/urls'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { addSideBarClass, addWhitePageClass, removeSideBarClass, removeWhitePageClass -} from '../../../sonar-ui-common/helpers/pages'; +} from '../../../helpers/pages'; +import { getQualityGateUrl } from '../../../helpers/urls'; import '../styles.css'; import Details from './Details'; import List from './List'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx index 9e444f895e7..948c81a73f6 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx index f4f4ccb2bdd..313ff3af985 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx @@ -20,14 +20,10 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { deleteCondition } from '../../../api/quality-gates'; -import { DeleteButton, EditButton } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmModal from '../../../sonar-ui-common/components/controls/ConfirmModal'; -import { - getLocalizedMetricName, - translate, - translateWithParameters -} from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { DeleteButton, EditButton } from '../../../components/controls/buttons'; +import ConfirmModal from '../../../components/controls/ConfirmModal'; +import { getLocalizedMetricName, translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getLocalizedMetricNameNoDiffMetric } from '../utils'; import ConditionModal from './ConditionModal'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx index 394c1361d33..c28d5966448 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { createCondition, updateCondition } from '../../../api/quality-gates'; -import ConfirmModal from '../../../sonar-ui-common/components/controls/ConfirmModal'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { getLocalizedMetricName, translate } from '../../../sonar-ui-common/helpers/l10n'; -import { isDiffMetric } from '../../../sonar-ui-common/helpers/measures'; +import ConfirmModal from '../../../components/controls/ConfirmModal'; +import Radio from '../../../components/controls/Radio'; +import { Alert } from '../../../components/ui/Alert'; +import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; +import { isDiffMetric } from '../../../helpers/measures'; import { getPossibleOperators } from '../utils'; import ConditionOperator from './ConditionOperator'; import MetricSelect from './MetricSelect'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx index a0738cb978f..b1c2b68ae39 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { translate } from '../../../helpers/l10n'; import { getPossibleOperators } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx index b57955f08a3..6d5d1fd5fd9 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx @@ -20,12 +20,12 @@ import { differenceWith, map, sortBy, uniqBy } from 'lodash'; import * as React from 'react'; import DocumentationTooltip from '../../../components/common/DocumentationTooltip'; +import { Button } from '../../../components/controls/buttons'; +import ModalButton from '../../../components/controls/ModalButton'; import { withAppState } from '../../../components/hoc/withAppState'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ModalButton from '../../../sonar-ui-common/components/controls/ModalButton'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { getLocalizedMetricName, translate } from '../../../sonar-ui-common/helpers/l10n'; -import { isDiffMetric } from '../../../sonar-ui-common/helpers/measures'; +import { Alert } from '../../../components/ui/Alert'; +import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; +import { isDiffMetric } from '../../../helpers/measures'; import { MetricKey } from '../../../types/metrics'; import Condition from './Condition'; import ConditionModal from './ConditionModal'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx index 428d744ebe8..fbace702f0e 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx @@ -19,12 +19,12 @@ */ import * as React from 'react'; import { copyQualityGate } from '../../../api/quality-gates'; +import ConfirmModal from '../../../components/controls/ConfirmModal'; import { Router, withRouter } from '../../../components/hoc/withRouter'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; import { getQualityGateUrl } from '../../../helpers/urls'; -import ConfirmModal from '../../../sonar-ui-common/components/controls/ConfirmModal'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx index 7895710de5f..0a2588245bf 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx @@ -19,12 +19,12 @@ */ import * as React from 'react'; import { createQualityGate } from '../../../api/quality-gates'; +import ConfirmModal from '../../../components/controls/ConfirmModal'; import { Router, withRouter } from '../../../components/hoc/withRouter'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; import { getQualityGateUrl } from '../../../helpers/urls'; -import ConfirmModal from '../../../sonar-ui-common/components/controls/ConfirmModal'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx index 42aaa9a917a..db52e78926a 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { deleteQualityGate } from '../../../api/quality-gates'; +import { Button } from '../../../components/controls/buttons'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; import { Router, withRouter } from '../../../components/hoc/withRouter'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getQualityGatesUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; interface Props { onDelete: () => Promise; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx index 7c2a628693c..9b7f5c7cd33 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx @@ -22,8 +22,8 @@ import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { fetchQualityGate } from '../../../api/quality-gates'; import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { fetchMetrics } from '../../../store/rootActions'; import { getMetrics, Store } from '../../../store/rootReducer'; import { addCondition, checkIfDefault, deleteCondition, replaceCondition } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx index 4c92f487df6..c37b90a2ff0 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import Conditions from './Conditions'; import Projects from './Projects'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx index 5a73c571973..5bd11877f2a 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { setQualityGateAsDefault } from '../../../api/quality-gates'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ModalButton from '../../../sonar-ui-common/components/controls/ModalButton'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import ModalButton from '../../../components/controls/ModalButton'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; import BuiltInQualityGateBadge from './BuiltInQualityGateBadge'; import CopyQualityGateForm from './CopyQualityGateForm'; import DeleteQualityGateForm from './DeleteQualityGateForm'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx index f3352364859..873cb4e4870 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import { translate } from '../../../helpers/l10n'; import { getQualityGateUrl } from '../../../helpers/urls'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import BuiltInQualityGateBadge from './BuiltInQualityGateBadge'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx index d8ab82b47a5..f430ae44008 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import DocumentationTooltip from '../../../components/common/DocumentationTooltip'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ModalButton from '../../../sonar-ui-common/components/controls/ModalButton'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import ModalButton from '../../../components/controls/ModalButton'; +import { translate } from '../../../helpers/l10n'; import CreateQualityGateForm from './CreateQualityGateForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx index eaedaf45569..8875ebe4261 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx @@ -19,8 +19,8 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { getLocalizedMetricDomain, translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { getLocalizedMetricDomain, translate } from '../../../helpers/l10n'; import { getLocalizedMetricNameNoDiffMetric } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx index 0d99068bd47..ef0b28780ac 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx @@ -27,8 +27,8 @@ import { import SelectList, { SelectListFilter, SelectListSearchParams -} from '../../../sonar-ui-common/components/controls/SelectList'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/SelectList'; +import { translate } from '../../../helpers/l10n'; interface Props { canEdit?: boolean; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx index 23f830ac0a7..8113666ba3e 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { renameQualityGate } from '../../../api/quality-gates'; -import ConfirmModal from '../../../sonar-ui-common/components/controls/ConfirmModal'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import ConfirmModal from '../../../components/controls/ConfirmModal'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx index 9061af66f26..4de825249d7 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; +import Select from '../../../components/controls/Select'; interface Props { name: string; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App.tsx index fe81f19f993..1fe843ea541 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/App.tsx @@ -22,17 +22,17 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import ScreenPositionHelper from '../../../../components/common/ScreenPositionHelper'; import { mockQualityGate } from '../../../../helpers/mocks/quality-gates'; -import { mockRouter } from '../../../../helpers/testMocks'; import { addSideBarClass, addWhitePageClass, removeSideBarClass, removeWhitePageClass -} from '../../../../sonar-ui-common/helpers/pages'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +} from '../../../../helpers/pages'; +import { mockRouter } from '../../../../helpers/testMocks'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import App from '../App'; -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addSideBarClass: jest.fn(), addWhitePageClass: jest.fn(), removeSideBarClass: jest.fn(), diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/CreateQualityGateForm-test.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/CreateQualityGateForm-test.tsx index 8f60de3a03b..24ada5f49e5 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/CreateQualityGateForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/CreateQualityGateForm-test.tsx @@ -21,10 +21,10 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { createQualityGate } from '../../../../api/quality-gates'; +import ConfirmModal from '../../../../components/controls/ConfirmModal'; import { mockRouter } from '../../../../helpers/testMocks'; +import { change, waitAndUpdate } from '../../../../helpers/testUtils'; import { getQualityGateUrl } from '../../../../helpers/urls'; -import ConfirmModal from '../../../../sonar-ui-common/components/controls/ConfirmModal'; -import { change, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; import { CreateQualityGateForm } from '../CreateQualityGateForm'; jest.mock('../../../../api/quality-gates', () => ({ diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Details-test.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Details-test.tsx index ed7be58bbb5..15b0284972f 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Details-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Details-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { fetchQualityGate } from '../../../../api/quality-gates'; import { mockQualityGate } from '../../../../helpers/mocks/quality-gates'; import { mockCondition } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { addCondition, deleteCondition, replaceCondition } from '../../utils'; import { Details } from '../Details'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/DetailsHeader-test.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/DetailsHeader-test.tsx index 7612885c892..401c4bbdc0c 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/DetailsHeader-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/DetailsHeader-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { setQualityGateAsDefault } from '../../../../api/quality-gates'; import { mockQualityGate } from '../../../../helpers/mocks/quality-gates'; import { mockCondition } from '../../../../helpers/testMocks'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import DetailsHeader from '../DetailsHeader'; jest.mock('../../../../api/quality-gates', () => ({ diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Projects-test.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Projects-test.tsx index bbe7406cc8d..bbee13ab20c 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Projects-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/Projects-test.tsx @@ -24,12 +24,10 @@ import { dissociateGateWithProject, searchProjects } from '../../../../api/quality-gates'; +import SelectList, { SelectListFilter } from '../../../../components/controls/SelectList'; import { mockQualityGate } from '../../../../helpers/mocks/quality-gates'; import { mockCondition } from '../../../../helpers/testMocks'; -import SelectList, { - SelectListFilter -} from '../../../../sonar-ui-common/components/controls/SelectList'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import Projects from '../Projects'; jest.mock('../../../../api/quality-gates', () => ({ diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/ThresholdInput-test.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/ThresholdInput-test.tsx index a02d0cf5135..ade8d250f5e 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/ThresholdInput-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/ThresholdInput-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change } from '../../../../helpers/testUtils'; import ThresholdInput from '../ThresholdInput'; describe('on strings', () => { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/routes.ts b/server/sonar-web/src/main/js/apps/quality-gates/routes.ts index 352daf06175..56e5aae7fa5 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/routes.ts +++ b/server/sonar-web/src/main/js/apps/quality-gates/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const App = lazyLoadComponent(() => import('./components/App')); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/utils.ts b/server/sonar-web/src/main/js/apps/quality-gates/utils.ts index 813e1382b91..146f820c9d3 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/utils.ts +++ b/server/sonar-web/src/main/js/apps/quality-gates/utils.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import getStore from '../../app/utils/getStore'; +import { getLocalizedMetricName } from '../../helpers/l10n'; import { isDiffMetric } from '../../helpers/measures'; -import { getLocalizedMetricName } from '../../sonar-ui-common/helpers/l10n'; import { getMetricByKey } from '../../store/rootReducer'; export function checkIfDefault(qualityGate: T.QualityGate, list: T.QualityGate[]): boolean { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx index 113a61d92b0..4805da105c8 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx @@ -21,10 +21,10 @@ import * as isSameMinute from 'date-fns/is_same_minute'; import { sortBy } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; +import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; +import { parseDate } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { ProfileChangelogEvent } from '../types'; import ChangesList from './ChangesList'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx index 588014b1900..8960d47eba3 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import { WithRouterProps } from 'react-router'; import { getProfileChangelog } from '../../../api/quality-profiles'; import { withRouter } from '../../../components/hoc/withRouter'; -import { parseDate, toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { parseDate, toShortNotSoISOString } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; import { Profile, ProfileChangelogEvent } from '../types'; import { getProfileChangelogPath } from '../utils'; import Changelog from './Changelog'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogEmpty.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogEmpty.tsx index 4fe78fa6197..d76129405b5 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogEmpty.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogEmpty.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function ChangelogEmpty() { return
{translate('no_results')}
; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogSearch.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogSearch.tsx index c478fbf2949..1d1ccddb75d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogSearch.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogSearch.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { Button } from '../../../components/controls/buttons'; import DateRangeInput from '../../../components/controls/DateRangeInput'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { dateRange: { from?: Date; to?: Date } | undefined; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx index 3b66dcbb47d..3f0aa4ab901 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translateWithParameters } from '../../../helpers/l10n'; interface Props { name: string; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx index 2587989d965..af605f8a20d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import SeverityHelper from '../../../components/shared/SeverityHelper'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { severity: string; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogContainer-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogContainer-test.tsx index 76b7a1f8b11..e6809256872 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogContainer-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogContainer-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getProfileChangelog } from '../../../../api/quality-profiles'; import { mockLocation, mockQualityProfile, mockRouter } from '../../../../helpers/testMocks'; -import { mockEvent, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils'; import { ChangelogContainer } from '../ChangelogContainer'; beforeEach(() => jest.clearAllMocks()); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogSearch-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogSearch-test.tsx index 5a935c82d3b..bcde91892ec 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogSearch-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogSearch-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../../sonar-ui-common/helpers/dates'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { parseDate } from '../../../../helpers/dates'; +import { click } from '../../../../helpers/testUtils'; import ChangelogSearch from '../ChangelogSearch'; it('should render', () => { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonEmpty.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonEmpty.tsx index 76dc039719d..eb19ec4eaf3 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonEmpty.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonEmpty.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function ComparisonEmpty() { return
{translate('quality_profile.empty_comparison')}
; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx index 143be6943ea..3d3c3ca64cf 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Select from '../../../components/controls/Select'; +import { translate } from '../../../helpers/l10n'; import { Profile } from '../types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx index 643e3cc4ac7..c74b3c05461 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx @@ -20,10 +20,10 @@ import * as React from 'react'; import { Profile } from '../../../api/quality-profiles'; import { getRuleDetails } from '../../../api/rules'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { lazyLoadComponent } from '../../../sonar-ui-common/components/lazyLoadComponent'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; const ActivationFormModal = lazyLoadComponent( () => import('../../coding-rules/components/ActivationFormModal'), diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx index 606d04efc69..1b30f681105 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import { Link } from 'react-router'; import { CompareResponse, Profile } from '../../../api/quality-profiles'; +import ChevronLeftIcon from '../../../components/icons/ChevronLeftIcon'; +import ChevronRightIcon from '../../../components/icons/ChevronRightIcon'; +import SeverityIcon from '../../../components/icons/SeverityIcon'; +import { translateWithParameters } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import ChevronLeftIcon from '../../../sonar-ui-common/components/icons/ChevronLeftIcon'; -import ChevronRightIcon from '../../../sonar-ui-common/components/icons/ChevronRightIcon'; -import SeverityIcon from '../../../sonar-ui-common/components/icons/SeverityIcon'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import ComparisonEmpty from './ComparisonEmpty'; import ComparisonResultActivation from './ComparisonResultActivation'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResultActivation-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResultActivation-test.tsx index ef092ef8ab7..d31a5785429 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResultActivation-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonResultActivation-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { Profile } from '../../../../api/quality-profiles'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import ComparisonResultActivation from '../ComparisonResultActivation'; jest.mock('../../../../api/rules', () => ({ diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx index 857f2f6be72..883481de687 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { Actions, getExporters, searchQualityProfiles } from '../../../api/quality-profiles'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import '../styles.css'; import { Exporter, Profile } from '../types'; import { sortProfiles } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx index 01d15945b28..0654a37825a 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx index d8b699e8f60..aa5a1f29aa3 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx @@ -18,13 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { Alert } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Profile } from '../types'; export interface DeleteProfileFormProps { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx index 055b2f7d123..852fc5e1f9d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx @@ -27,15 +27,15 @@ import { renameProfile, setDefaultProfile } from '../../../api/quality-profiles'; -import { Router, withRouter } from '../../../components/hoc/withRouter'; -import { getBaseUrl } from '../../../helpers/system'; -import { getRulesUrl } from '../../../helpers/urls'; import ActionsDropdown, { ActionsDropdownDivider, ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/ActionsDropdown'; +import Tooltip from '../../../components/controls/Tooltip'; +import { Router, withRouter } from '../../../components/hoc/withRouter'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/system'; +import { getRulesUrl } from '../../../helpers/urls'; import { Profile, ProfileActionModals } from '../types'; import { getProfileComparePath, getProfilePath, PROFILE_PATH } from '../utils'; import DeleteProfileForm from './DeleteProfileForm'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileModalForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileModalForm.tsx index 6929c5a590f..ca4293b817a 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileModalForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileModalForm.tsx @@ -18,14 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Profile } from '../types'; export interface ProfileModalFormProps { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx index 524d8a99b30..4e1806e9ade 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileNotFound.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { IndexLink } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { PROFILE_PATH } from '../utils'; export default function ProfileNotFound() { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileActions-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileActions-test.tsx index 67414faf3b1..f2bd85f6a2c 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileActions-test.tsx @@ -28,7 +28,7 @@ import { setDefaultProfile } from '../../../../api/quality-profiles'; import { mockQualityProfile, mockRouter } from '../../../../helpers/testMocks'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import { ProfileActionModals } from '../../types'; import { PROFILE_PATH } from '../../utils'; import DeleteProfileForm from '../DeleteProfileForm'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileModalForm-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileModalForm-test.tsx index b2bf600e13c..23b668820f4 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileModalForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileModalForm-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockEvent, mockQualityProfile } from '../../../../helpers/testMocks'; -import { change } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change } from '../../../../helpers/testUtils'; import ProfileModalForm, { ProfileModalFormProps } from '../ProfileModalForm'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx index e7567b1cab9..60ce4e975e7 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx @@ -20,15 +20,12 @@ import { sortBy } from 'lodash'; import * as React from 'react'; import { changeProfileParent } from '../../../api/quality-profiles'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import Select from '../../../components/controls/Select'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; import { Profile } from '../types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx index 23c048c91e8..f7bca990903 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx @@ -25,12 +25,12 @@ import { getProfileProjects, ProfileProject } from '../../../api/quality-profiles'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; +import Modal from '../../../components/controls/Modal'; import SelectList, { SelectListFilter, SelectListSearchParams -} from '../../../sonar-ui-common/components/controls/SelectList'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/SelectList'; +import { translate } from '../../../helpers/l10n'; import { Profile } from '../types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx index 5634d4cd0d7..bf62758153f 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { Exporter, Profile } from '../types'; import ProfileExporters from './ProfileExporters'; import ProfileInheritance from './ProfileInheritance'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileExporters.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileExporters.tsx index 64ad085420a..f1f1836eb69 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileExporters.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileExporters.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { getQualityProfileExporterUrl } from '../../../api/quality-profiles'; +import { translate } from '../../../helpers/l10n'; import { getBaseUrl } from '../../../helpers/system'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Exporter, Profile } from '../types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx index 1c040ae76d4..74f6deba021 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { IndexLink, Link } from 'react-router'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import { translate } from '../../../helpers/l10n'; import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge'; import ProfileActions from '../components/ProfileActions'; import ProfileLink from '../components/ProfileLink'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx index f8300362c6e..ad15bdf407e 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { getProfileInheritance } from '../../../api/quality-profiles'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import { Profile } from '../types'; import ChangeParentForm from './ChangeParentForm'; import ProfileInheritanceBox from './ProfileInheritanceBox'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx index db2a854428b..341904871ae 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge'; import ProfileLink from '../components/ProfileLink'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx index 2b4fc8fdb27..b3f42f3adfc 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx @@ -24,8 +24,8 @@ import { searchUsers, SearchUsersGroupsParameters } from '../../../api/quality-profiles'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import { Profile } from '../types'; import ProfilePermissionsForm from './ProfilePermissionsForm'; import ProfilePermissionsGroup from './ProfilePermissionsGroup'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx index 8e027b9d42a..216aadd8f06 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx @@ -25,12 +25,9 @@ import { searchUsers, SearchUsersGroupsParameters } from '../../../api/quality-profiles'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { translate } from '../../../helpers/l10n'; import { Group } from './ProfilePermissions'; import ProfilePermissionsFormSelect from './ProfilePermissionsFormSelect'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx index ae90e02f2c1..cdacf1c9431 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx @@ -19,10 +19,10 @@ */ import { debounce, identity } from 'lodash'; import * as React from 'react'; +import Select from '../../../components/controls/Select'; +import GroupIcon from '../../../components/icons/GroupIcon'; import Avatar from '../../../components/ui/Avatar'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import GroupIcon from '../../../sonar-ui-common/components/icons/GroupIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Group } from './ProfilePermissions'; type Option = T.UserSelected | Group; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx index 4d767a4f78c..f4757e3e533 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx @@ -20,16 +20,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { removeGroup } from '../../../api/quality-profiles'; -import { - Button, - DeleteButton, - ResetButtonLink -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal, { - ChildrenProps -} from '../../../sonar-ui-common/components/controls/SimpleModal'; -import GroupIcon from '../../../sonar-ui-common/components/icons/GroupIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, DeleteButton, ResetButtonLink } from '../../../components/controls/buttons'; +import SimpleModal, { ChildrenProps } from '../../../components/controls/SimpleModal'; +import GroupIcon from '../../../components/icons/GroupIcon'; +import { translate } from '../../../helpers/l10n'; import { Group } from './ProfilePermissions'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx index 7df85415ab7..2021ced88dd 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx @@ -20,16 +20,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { removeUser } from '../../../api/quality-profiles'; +import { DeleteButton, ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal, { ChildrenProps } from '../../../components/controls/SimpleModal'; import Avatar from '../../../components/ui/Avatar'; -import { - DeleteButton, - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal, { - ChildrenProps -} from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { onDelete: (user: T.UserSelected) => void; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx index da2f88e1bf5..00994dcf255 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx @@ -20,12 +20,12 @@ import * as React from 'react'; import { Link } from 'react-router'; import { getProfileProjects } from '../../../api/quality-profiles'; +import { Button } from '../../../components/controls/buttons'; +import ListFooter from '../../../components/controls/ListFooter'; +import Tooltip from '../../../components/controls/Tooltip'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { translate } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Profile } from '../types'; import ChangeProjectsForm from './ChangeProjectsForm'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx index 4c34a906c39..c1be69c17e7 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx @@ -22,10 +22,10 @@ import * as React from 'react'; import { Link } from 'react-router'; import { getQualityProfile } from '../../../api/quality-profiles'; import { searchRules, takeFacet } from '../../../api/rules'; +import { Button } from '../../../components/controls/buttons'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Profile } from '../types'; import ProfileRulesDeprecatedWarning from './ProfileRulesDeprecatedWarning'; import ProfileRulesRowOfType from './ProfileRulesRowOfType'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx index ca7d7c2d674..8c43c6175fb 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { translate } from '../../../helpers/l10n'; import { getDeprecatedActiveRulesUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { activeDeprecatedRules: number; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowOfType.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowOfType.tsx index 6f4647eccf8..293b9bcecad 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowOfType.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowOfType.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getRulesUrl } from '../../../helpers/urls'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; interface Props { count: number | null; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowTotal.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowTotal.tsx index 058342fb563..df2b2f7fb4b 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowTotal.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRowTotal.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import { translate } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getRulesUrl } from '../../../helpers/urls'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; interface Props { count: number | null; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx index f64f265ec1b..b3447638e15 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { translate } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; interface Props { language: string; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeParentForm-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeParentForm-test.tsx index 5f082599f45..ec344372f43 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeParentForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeParentForm-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockQualityProfile } from '../../../../helpers/testMocks'; -import { mockEvent, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils'; import ChangeParentForm from '../ChangeParentForm'; beforeEach(() => jest.clearAllMocks()); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeProjectsForm-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeProjectsForm-test.tsx index 479ef91f3c7..b8fb0a70084 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeProjectsForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ChangeProjectsForm-test.tsx @@ -24,10 +24,8 @@ import { dissociateProject, getProfileProjects } from '../../../../api/quality-profiles'; -import SelectList, { - SelectListFilter -} from '../../../../sonar-ui-common/components/controls/SelectList'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import SelectList, { SelectListFilter } from '../../../../components/controls/SelectList'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import ChangeProjectsForm from '../ChangeProjectsForm'; const profile: any = { key: 'profFile_key' }; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileInheritance-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileInheritance-test.tsx index 003bd0a94cd..f3857c86603 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileInheritance-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileInheritance-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockQualityProfile, mockQualityProfileInheritance } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import ProfileInheritance from '../ProfileInheritance'; beforeEach(() => jest.clearAllMocks()); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissions-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissions-test.tsx index 9ca5c5169a7..09062304cfb 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissions-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissions-test.tsx @@ -20,7 +20,7 @@ import { mount, shallow } from 'enzyme'; import * as React from 'react'; import { searchGroups, searchUsers } from '../../../../api/quality-profiles'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import ProfilePermissions from '../ProfilePermissions'; jest.mock('../../../../api/quality-profiles', () => ({ diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsForm-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsForm-test.tsx index e92e57f36b5..42d21ab29a2 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsForm-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { addGroup, addUser, searchGroups, searchUsers } from '../../../../api/quality-profiles'; import { mockGroup, mockUser } from '../../../../helpers/testMocks'; -import { submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { submit, waitAndUpdate } from '../../../../helpers/testUtils'; import ProfilePermissionsForm from '../ProfilePermissionsForm'; import ProfilePermissionsFormSelect from '../ProfilePermissionsFormSelect'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsGroup-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsGroup-test.tsx index 7e04f85cff9..afa65a31bb1 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsGroup-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsGroup-test.tsx @@ -24,7 +24,7 @@ jest.mock('../../../../api/quality-profiles', () => ({ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import ProfilePermissionsGroup from '../ProfilePermissionsGroup'; const removeGroup = require('../../../../api/quality-profiles').removeGroup as jest.Mock; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsUser-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsUser-test.tsx index 60356c89550..7ba649fe3c3 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsUser-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsUser-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { removeUser } from '../../../../api/quality-profiles'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import ProfilePermissionsUser from '../ProfilePermissionsUser'; jest.mock('../../../../api/quality-profiles', () => ({ diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileProjects-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileProjects-test.tsx index 774f7137a84..689a9d82c06 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileProjects-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileProjects-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockQualityProfile } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import ChangeProjectsForm from '../ChangeProjectsForm'; import ProfileProjects from '../ProfileProjects'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileRules-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileRules-test.tsx index 6893b3e2934..8357260a882 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileRules-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileRules-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import * as apiQP from '../../../../api/quality-profiles'; import * as apiRules from '../../../../api/rules'; import { mockQualityProfile } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import ProfileRules from '../ProfileRules'; const PROFILE = mockQualityProfile({ diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx index f14dedc7194..4119a215923 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx @@ -24,17 +24,14 @@ import { createQualityProfile, getImporters } from '../../../api/quality-profiles'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import Select from '../../../components/controls/Select'; import { Location } from '../../../components/hoc/withRouter'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { parseAsOptionalString } from '../../../sonar-ui-common/helpers/query'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; +import { parseAsOptionalString } from '../../../helpers/query'; import { Profile } from '../types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionDeprecated.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionDeprecated.tsx index 6e1aaed6a78..82379493c02 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionDeprecated.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionDeprecated.tsx @@ -20,8 +20,8 @@ import { sortBy } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getDeprecatedActiveRulesUrl } from '../../../helpers/urls'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import ProfileLink from '../components/ProfileLink'; import { Profile } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx index acc5a25353e..e22e81e2460 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx @@ -21,10 +21,10 @@ import { sortBy } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; import { searchRules } from '../../../api/rules'; +import { toShortNotSoISOString } from '../../../helpers/dates'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getRulesUrl } from '../../../helpers/urls'; -import { toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; const RULES_LIMIT = 10; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionStagnant.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionStagnant.tsx index c0134055e85..205e024441d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionStagnant.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionStagnant.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import DateFormatter from '../../../components/intl/DateFormatter'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import ProfileLink from '../components/ProfileLink'; import { Profile } from '../types'; import { isStagnant } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.tsx index 7cc7c92c70b..618fa3b9f54 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.tsx @@ -20,10 +20,10 @@ import * as React from 'react'; import { Link } from 'react-router'; import { Actions } from '../../../api/quality-profiles'; +import { Button } from '../../../components/controls/buttons'; import { Location, Router, withRouter } from '../../../components/hoc/withRouter'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { Profile } from '../types'; import { getProfilePath } from '../utils'; import CreateProfileForm from './CreateProfileForm'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx index f97318cd496..c1256df0850 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx @@ -20,9 +20,9 @@ import { Location } from 'history'; import { groupBy, pick, sortBy } from 'lodash'; import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import { Alert } from '../../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Profile } from '../types'; import ProfilesListHeader from './ProfilesListHeader'; import ProfilesListRow from './ProfilesListRow'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListHeader.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListHeader.tsx index 121985ee261..148113653aa 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListHeader.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import Select from '../../../components/controls/Select'; import { Router, withRouter } from '../../../components/hoc/withRouter'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getProfilesForLanguagePath, PROFILE_PATH } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx index 33540dc7155..467d4a324ea 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import Tooltip from '../../../components/controls/Tooltip'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import { translate } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge'; import ProfileActions from '../components/ProfileActions'; import ProfileLink from '../components/ProfileLink'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx index aa7bbdf254e..ac0991da915 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx @@ -19,15 +19,12 @@ */ import * as React from 'react'; import { restoreQualityProfile } from '../../../api/quality-profiles'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { Alert } from '../../../components/ui/Alert'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/CreateProfileForm-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/CreateProfileForm-test.tsx index f6019e79a32..1c5253c724f 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/CreateProfileForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/CreateProfileForm-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { changeProfileParent, createQualityProfile } from '../../../../api/quality-profiles'; import { mockLocation, mockQualityProfile } from '../../../../helpers/testMocks'; -import { mockEvent, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils'; import CreateProfileForm from '../CreateProfileForm'; beforeEach(() => jest.clearAllMocks()); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/PageHeader-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/PageHeader-test.tsx index 38f058bb4dd..de6cac215f0 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/PageHeader-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/PageHeader-test.tsx @@ -25,7 +25,7 @@ import { mockQualityProfile, mockRouter } from '../../../../helpers/testMocks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { PageHeader } from '../PageHeader'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/routes.ts b/server/sonar-web/src/main/js/apps/quality-profiles/routes.ts index 4e4a92076ba..6d6690c3fe4 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/routes.ts +++ b/server/sonar-web/src/main/js/apps/quality-profiles/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/utils.ts b/server/sonar-web/src/main/js/apps/quality-profiles/utils.ts index febe5f6fcc9..cc8ddea8634 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/utils.ts +++ b/server/sonar-web/src/main/js/apps/quality-profiles/utils.ts @@ -20,7 +20,7 @@ import * as differenceInYears from 'date-fns/difference_in_years'; import { sortBy } from 'lodash'; import { Profile as BaseProfile } from '../../api/quality-profiles'; -import { isValidDate, parseDate } from '../../sonar-ui-common/helpers/dates'; +import { isValidDate, parseDate } from '../../helpers/dates'; import { Profile } from './types'; export function sortProfiles(profiles: BaseProfile[]): Profile[] { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx index 7306e8ed2ed..178e7d6fd79 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx @@ -22,10 +22,10 @@ import { Helmet } from 'react-helmet-async'; import A11ySkipTarget from '../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../app/components/embed-docs-modal/Suggestions'; import ScreenPositionHelper from '../../components/common/ScreenPositionHelper'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; import { isBranch } from '../../helpers/branch-like'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { scrollToElement } from '../../sonar-ui-common/helpers/scrolling'; +import { translate } from '../../helpers/l10n'; +import { scrollToElement } from '../../helpers/scrolling'; import { BranchLike } from '../../types/branch-like'; import { SecurityStandard, Standards } from '../../types/security'; import { HotspotFilters, HotspotStatusFilter, RawHotspot } from '../../types/security-hotspots'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-test.tsx index fa5c0781c05..c712a77dac2 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-test.tsx @@ -31,7 +31,7 @@ import { mockLoggedInUser, mockRouter } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { SecurityStandard } from '../../../types/security'; import { HotspotResolution, diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsAppRenderer-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsAppRenderer-test.tsx index 1816ab12c25..a716fc2a28f 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsAppRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsAppRenderer-test.tsx @@ -21,8 +21,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; import { mockRawHotspot, mockStandards } from '../../../helpers/mocks/security-hotspots'; +import { scrollToElement } from '../../../helpers/scrolling'; import { mockComponent } from '../../../helpers/testMocks'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; import { SecurityStandard } from '../../../types/security'; import { HotspotStatusFilter } from '../../../types/security-hotspots'; import FilterBar from '../components/FilterBar'; @@ -30,7 +30,7 @@ import SecurityHotspotsAppRenderer, { SecurityHotspotsAppRendererProps } from '../SecurityHotspotsAppRenderer'; -jest.mock('../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../helpers/scrolling', () => ({ scrollToElement: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/EmptyHotspotsPage.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/EmptyHotspotsPage.tsx index d4bcab1274c..ab115bb0128 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/EmptyHotspotsPage.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/EmptyHotspotsPage.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; export interface EmptyHotspotsPageProps { filtered: boolean; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx index 8410c6c3b0b..30efa3ebf28 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx @@ -18,15 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import RadioToggle from '../../../components/controls/RadioToggle'; +import Select from '../../../components/controls/Select'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; import Measure from '../../../components/measure/Measure'; import CoverageRating from '../../../components/ui/CoverageRating'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { isLoggedIn } from '../../../helpers/users'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import RadioToggle from '../../../sonar-ui-common/components/controls/RadioToggle'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { ComponentQualifier } from '../../../types/component'; import { HotspotFilters, HotspotStatusFilter } from '../../../types/security-hotspots'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCategory.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCategory.tsx index 60f808c0eea..2d08d7d9a04 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCategory.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCategory.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import ChevronDownIcon from '../../../sonar-ui-common/components/icons/ChevronDownIcon'; -import ChevronUpIcon from '../../../sonar-ui-common/components/icons/ChevronUpIcon'; +import ChevronDownIcon from '../../../components/icons/ChevronDownIcon'; +import ChevronUpIcon from '../../../components/icons/ChevronUpIcon'; import { RawHotspot } from '../../../types/security-hotspots'; import HotspotListItem from './HotspotListItem'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCommentPopup.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCommentPopup.tsx index fabe06e89b7..f4d9090dce9 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCommentPopup.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotCommentPopup.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import FormattingTips from '../../../components/common/FormattingTips'; -import { Button, ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, ResetButtonLink } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; export interface HotspotCommentPopupProps { markdownComment: string; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotList.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotList.tsx index 506c8ca5169..f4631ea1018 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotList.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotList.tsx @@ -20,10 +20,10 @@ import * as classNames from 'classnames'; import { groupBy } from 'lodash'; import * as React from 'react'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import SecurityHotspotIcon from '../../../sonar-ui-common/components/icons/SecurityHotspotIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { addSideBarClass, removeSideBarClass } from '../../../sonar-ui-common/helpers/pages'; +import ListFooter from '../../../components/controls/ListFooter'; +import SecurityHotspotIcon from '../../../components/icons/SecurityHotspotIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages'; import { HotspotStatusFilter, RawHotspot, RiskExposure } from '../../../types/security-hotspots'; import { groupByCategory, RISK_EXPOSURE_LEVELS } from '../utils'; import HotspotCategory from './HotspotCategory'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotListItem.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotListItem.tsx index 26ecd5738a2..1ca23f4a7f2 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotListItem.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotListItem.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { RawHotspot } from '../../../types/security-hotspots'; import { getStatusOptionFromStatusAndResolution } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotOpenInIdeButton.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotOpenInIdeButton.tsx index 782640cd6a3..75d0fdd8e79 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotOpenInIdeButton.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotOpenInIdeButton.tsx @@ -20,12 +20,12 @@ import * as React from 'react'; import addGlobalErrorMessage from '../../../app/utils/addGlobalErrorMessage'; import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage'; +import { Button } from '../../../components/controls/buttons'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import Toggler from '../../../components/controls/Toggler'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { openHotspot, probeSonarLintServers } from '../../../helpers/sonarlint'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Ide } from '../../../types/sonarlint'; import { HotspotOpenInIdeOverlay } from './HotspotOpenInIdeOverlay'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx index 0490f09f3ec..fd320921e0f 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx @@ -19,19 +19,15 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import { Button, DeleteButton, EditButton } from '../../../components/controls/buttons'; +import Dropdown, { DropdownOverlay } from '../../../components/controls/Dropdown'; +import Toggler from '../../../components/controls/Toggler'; +import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; import IssueChangelogDiff from '../../../components/issue/components/IssueChangelogDiff'; import Avatar from '../../../components/ui/Avatar'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { sanitizeString } from '../../../helpers/sanitize'; -import { - Button, - DeleteButton, - EditButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Dropdown, { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import { Hotspot, ReviewHistoryType } from '../../../types/security-hotspots'; import { getHotspotReviewHistory } from '../utils'; import HotspotCommentPopup from './HotspotCommentPopup'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx index baadf35f33b..42d9a2fbc92 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx @@ -25,9 +25,9 @@ import { editSecurityHotspotComment } from '../../../api/security-hotspots'; import FormattingTips from '../../../components/common/FormattingTips'; +import { Button, ResetButtonLink } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import { isLoggedIn } from '../../../helpers/users'; -import { Button, ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Hotspot } from '../../../types/security-hotspots'; import HotspotReviewHistory from './HotspotReviewHistory'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx index 3722efddca1..67398f7d7d4 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx @@ -18,13 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import SecurityHotspotIcon from '../../../sonar-ui-common/components/icons/SecurityHotspotIcon'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { addSideBarClass, removeSideBarClass } from '../../../sonar-ui-common/helpers/pages'; -import { fileFromPath } from '../../../sonar-ui-common/helpers/path'; +import ListFooter from '../../../components/controls/ListFooter'; +import Tooltip from '../../../components/controls/Tooltip'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import SecurityHotspotIcon from '../../../components/icons/SecurityHotspotIcon'; +import { translateWithParameters } from '../../../helpers/l10n'; +import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages'; +import { fileFromPath } from '../../../helpers/path'; import { ComponentQualifier } from '../../../types/component'; import { SecurityStandard, Standards } from '../../../types/security'; import { RawHotspot } from '../../../types/security-hotspots'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainerRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainerRenderer.tsx index 775d850f2b9..975abfb7dbf 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainerRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainerRenderer.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { SourceViewerContext } from '../../../components/SourceViewer/SourceViewerContext'; import SourceViewerHeaderSlim from '../../../components/SourceViewer/SourceViewerHeaderSlim'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { Hotspot } from '../../../types/security-hotspots'; import SnippetViewer from '../../issues/crossComponentSourceViewer/SnippetViewer'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewer.tsx index 5073832a407..a5063559257 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewer.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { getSecurityHotspotDetails } from '../../../api/security-hotspots'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { scrollToElement } from '../../../helpers/scrolling'; import { BranchLike } from '../../../types/branch-like'; import { Hotspot } from '../../../types/security-hotspots'; import HotspotViewerRenderer from './HotspotViewerRenderer'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx index 646a5d214c4..3f9f57d225d 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx @@ -20,16 +20,19 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link } from 'react-router'; +import { Button } from '../../../components/controls/buttons'; +import { ClipboardButton } from '../../../components/controls/clipboard'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; +import LinkIcon from '../../../components/icons/LinkIcon'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { fillBranchLike, getBranchLikeQuery } from '../../../helpers/branch-like'; -import { getComponentSecurityHotspotsUrl, getRuleUrl } from '../../../helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { + getComponentSecurityHotspotsUrl, + getPathUrlAsString, + getRuleUrl +} from '../../../helpers/urls'; import { isLoggedIn } from '../../../helpers/users'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import LinkIcon from '../../../sonar-ui-common/components/icons/LinkIcon'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getPathUrlAsString } from '../../../sonar-ui-common/helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { Hotspot } from '../../../types/security-hotspots'; import Assignee from './assignee/Assignee'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerTabs.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerTabs.tsx index e7dae95f184..bddd55b52a2 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerTabs.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerTabs.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import BoxedTabs from '../../../components/controls/BoxedTabs'; +import Tab from '../../../components/controls/Tabs'; +import { translate } from '../../../helpers/l10n'; import { sanitizeString } from '../../../helpers/sanitize'; -import BoxedTabs from '../../../sonar-ui-common/components/controls/BoxedTabs'; -import Tab from '../../../sonar-ui-common/components/controls/Tabs'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { Hotspot } from '../../../types/security-hotspots'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/FilterBar-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/FilterBar-test.tsx index 56cd321cde9..875dacc04ba 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/FilterBar-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/FilterBar-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import RadioToggle from '../../../../components/controls/RadioToggle'; +import Select from '../../../../components/controls/Select'; import { mockComponent, mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks'; -import RadioToggle from '../../../../sonar-ui-common/components/controls/RadioToggle'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; import { ComponentQualifier } from '../../../../types/component'; import { HotspotStatusFilter } from '../../../../types/security-hotspots'; import { AssigneeFilterOption, FilterBar, FilterBarProps } from '../FilterBar'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotCommentPopup-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotCommentPopup-test.tsx index 2efb0d0c276..dc211741686 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotCommentPopup-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotCommentPopup-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { Button, ResetButtonLink } from '../../../../sonar-ui-common/components/controls/buttons'; +import { Button, ResetButtonLink } from '../../../../components/controls/buttons'; import HotspotCommentPopup, { HotspotCommentPopupProps } from '../HotspotCommentPopup'; it('should render correclty', () => { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotList-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotList-test.tsx index 476c2378b6a..474452648c8 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotList-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotList-test.tsx @@ -20,12 +20,12 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockRawHotspot } from '../../../../helpers/mocks/security-hotspots'; -import { addSideBarClass, removeSideBarClass } from '../../../../sonar-ui-common/helpers/pages'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { addSideBarClass, removeSideBarClass } from '../../../../helpers/pages'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { HotspotStatusFilter, RiskExposure } from '../../../../types/security-hotspots'; import HotspotList from '../HotspotList'; -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addSideBarClass: jest.fn(), removeSideBarClass: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotOpenInIdeButton-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotOpenInIdeButton-test.tsx index ae15ee009a4..6fcc9f3d0bd 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotOpenInIdeButton-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotOpenInIdeButton-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { Button } from '../../../../components/controls/buttons'; import * as sonarlint from '../../../../helpers/sonarlint'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; import HotspotOpenInIdeButton from '../HotspotOpenInIdeButton'; jest.mock('../../../../helpers/sonarlint'); diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotReviewHistoryAndComments-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotReviewHistoryAndComments-test.tsx index 5bc5a600124..27f02fac853 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotReviewHistoryAndComments-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotReviewHistoryAndComments-test.tsx @@ -26,8 +26,8 @@ import { } from '../../../../api/security-hotspots'; import { mockHotspot } from '../../../../helpers/mocks/security-hotspots'; import { mockCurrentUser } from '../../../../helpers/testMocks'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { isLoggedIn } from '../../../../helpers/users'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; import HotspotReviewHistory from '../HotspotReviewHistory'; import HotspotReviewHistoryAndComments from '../HotspotReviewHistoryAndComments'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx index 4244bdf9442..a980b47346a 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx @@ -20,12 +20,12 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockRawHotspot } from '../../../../helpers/mocks/security-hotspots'; -import { addSideBarClass, removeSideBarClass } from '../../../../sonar-ui-common/helpers/pages'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { addSideBarClass, removeSideBarClass } from '../../../../helpers/pages'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { SecurityStandard } from '../../../../types/security'; import HotspotSimpleList, { HotspotSimpleListProps } from '../HotspotSimpleList'; -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addSideBarClass: jest.fn(), removeSideBarClass: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSnippetContainer-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSnippetContainer-test.tsx index 645436ef0f2..b2eb7cae32b 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSnippetContainer-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSnippetContainer-test.tsx @@ -24,7 +24,7 @@ import { getSources } from '../../../../api/components'; import { mockBranch } from '../../../../helpers/mocks/branch-like'; import { mockHotspot, mockHotspotComponent } from '../../../../helpers/mocks/security-hotspots'; import { mockComponent, mockSourceLine } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { ComponentQualifier } from '../../../../types/component'; import HotspotSnippetContainer from '../HotspotSnippetContainer'; import HotspotSnippetContainerRenderer from '../HotspotSnippetContainerRenderer'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewer-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewer-test.tsx index a7289309a07..f129626f4ee 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewer-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewer-test.tsx @@ -21,9 +21,9 @@ import { shallow } from 'enzyme'; import { clone } from 'lodash'; import * as React from 'react'; import { getSecurityHotspotDetails } from '../../../../api/security-hotspots'; +import { scrollToElement } from '../../../../helpers/scrolling'; import { mockComponent } from '../../../../helpers/testMocks'; -import { scrollToElement } from '../../../../sonar-ui-common/helpers/scrolling'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import HotspotViewer from '../HotspotViewer'; import HotspotViewerRenderer from '../HotspotViewerRenderer'; @@ -33,7 +33,7 @@ jest.mock('../../../../api/security-hotspots', () => ({ getSecurityHotspotDetails: jest.fn().mockResolvedValue({ id: `I am a detailled hotspot` }) })); -jest.mock('../../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../../helpers/scrolling', () => ({ scrollToElement: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewerTabs-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewerTabs-test.tsx index 1fc6854b804..e12d0f2741c 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewerTabs-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotViewerTabs-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import BoxedTabs from '../../../../components/controls/BoxedTabs'; import { mockHotspot, mockHotspotRule } from '../../../../helpers/mocks/security-hotspots'; import { mockUser } from '../../../../helpers/testMocks'; -import BoxedTabs from '../../../../sonar-ui-common/components/controls/BoxedTabs'; import HotspotViewerTabs, { TabKeys } from '../HotspotViewerTabs'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/Assignee.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/Assignee.tsx index ba12ef0c8e2..dbc6c822822 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/Assignee.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/Assignee.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import { assignSecurityHotspot } from '../../../../api/security-hotspots'; import addGlobalSuccessMessage from '../../../../app/utils/addGlobalSuccessMessage'; import { withCurrentUser } from '../../../../components/hoc/withCurrentUser'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { isLoggedIn } from '../../../../helpers/users'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; import { Hotspot, HotspotStatus } from '../../../../types/security-hotspots'; import AssigneeRenderer from './AssigneeRenderer'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeRenderer.tsx index 33c0ac53018..78235489ac5 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeRenderer.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { EditButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import EscKeydownHandler from '../../../../sonar-ui-common/components/controls/EscKeydownHandler'; -import OutsideClickHandler from '../../../../sonar-ui-common/components/controls/OutsideClickHandler'; -import DeferredSpinner from '../../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import { EditButton } from '../../../../components/controls/buttons'; +import EscKeydownHandler from '../../../../components/controls/EscKeydownHandler'; +import OutsideClickHandler from '../../../../components/controls/OutsideClickHandler'; +import DeferredSpinner from '../../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import AssigneeSelection from './AssigneeSelection'; export interface AssigneeRendererProps { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelection.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelection.tsx index a4c7a4cb0c3..5a2d364fcb6 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelection.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelection.tsx @@ -20,9 +20,9 @@ import { debounce } from 'lodash'; import * as React from 'react'; import { searchUsers } from '../../../../api/users'; +import { KeyCodes } from '../../../../helpers/keycodes'; +import { translate } from '../../../../helpers/l10n'; import { isUserActive } from '../../../../helpers/users'; -import { KeyCodes } from '../../../../sonar-ui-common/helpers/keycodes'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; import AssigneeSelectionRenderer from './AssigneeSelectionRenderer'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelectionRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelectionRenderer.tsx index afe33d95a99..51f06bf170a 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelectionRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelectionRenderer.tsx @@ -19,12 +19,12 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import { DropdownOverlay } from '../../../../components/controls/Dropdown'; +import SearchBox from '../../../../components/controls/SearchBox'; import Avatar from '../../../../components/ui/Avatar'; -import { DropdownOverlay } from '../../../../sonar-ui-common/components/controls/Dropdown'; -import SearchBox from '../../../../sonar-ui-common/components/controls/SearchBox'; -import DeferredSpinner from '../../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { PopupPlacement } from '../../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../../../components/ui/DeferredSpinner'; +import { PopupPlacement } from '../../../../components/ui/popups'; +import { translate } from '../../../../helpers/l10n'; import './AssigneeSelection.css'; export interface HotspotAssigneeSelectRendererProps { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/Assignee-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/Assignee-test.tsx index 94be36bda05..1228c2457c3 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/Assignee-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/Assignee-test.tsx @@ -23,7 +23,7 @@ import { assignSecurityHotspot } from '../../../../../api/security-hotspots'; import addGlobalSuccessMessage from '../../../../../app/utils/addGlobalSuccessMessage'; import { mockHotspot } from '../../../../../helpers/mocks/security-hotspots'; import { mockCurrentUser, mockUser } from '../../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { HotspotStatus } from '../../../../../types/security-hotspots'; import { Assignee } from '../Assignee'; import AssigneeRenderer from '../AssigneeRenderer'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeRenderer-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeRenderer-test.tsx index 41cb5036403..7d5e5140cc6 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeRenderer-test.tsx @@ -19,10 +19,10 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { EditButton } from '../../../../../components/controls/buttons'; +import OutsideClickHandler from '../../../../../components/controls/OutsideClickHandler'; import { mockLoggedInUser, mockUser } from '../../../../../helpers/testMocks'; -import { EditButton } from '../../../../../sonar-ui-common/components/controls/buttons'; -import OutsideClickHandler from '../../../../../sonar-ui-common/components/controls/OutsideClickHandler'; -import { click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../helpers/testUtils'; import AssigneeRenderer, { AssigneeRendererProps } from '../AssigneeRenderer'; import AssigneeSelection from '../AssigneeSelection'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeSelection-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeSelection-test.tsx index 69e882dc30a..7820149048a 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeSelection-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeSelection-test.tsx @@ -20,9 +20,9 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { searchUsers } from '../../../../../api/users'; +import { KeyCodes } from '../../../../../helpers/keycodes'; import { mockLoggedInUser, mockUser } from '../../../../../helpers/testMocks'; -import { KeyCodes } from '../../../../../sonar-ui-common/helpers/keycodes'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import AssigneeSelection from '../AssigneeSelection'; jest.mock('../../../../../api/users', () => ({ diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/Status.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/Status.tsx index e8e75a5b63e..b8538b9743b 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/Status.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/Status.tsx @@ -19,15 +19,15 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import { Button } from '../../../../components/controls/buttons'; +import { DropdownOverlay } from '../../../../components/controls/Dropdown'; +import Toggler from '../../../../components/controls/Toggler'; +import Tooltip from '../../../../components/controls/Tooltip'; import { withCurrentUser } from '../../../../components/hoc/withCurrentUser'; +import DropdownIcon from '../../../../components/icons/DropdownIcon'; +import { PopupPlacement } from '../../../../components/ui/popups'; +import { translate } from '../../../../helpers/l10n'; import { isLoggedIn } from '../../../../helpers/users'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import { DropdownOverlay } from '../../../../sonar-ui-common/components/controls/Dropdown'; -import Toggler from '../../../../sonar-ui-common/components/controls/Toggler'; -import Tooltip from '../../../../sonar-ui-common/components/controls/Tooltip'; -import DropdownIcon from '../../../../sonar-ui-common/components/icons/DropdownIcon'; -import { PopupPlacement } from '../../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; import { Hotspot } from '../../../../types/security-hotspots'; import { getStatusOptionFromStatusAndResolution } from '../../utils'; import StatusDescription from './StatusDescription'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusDescription.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusDescription.tsx index cb2b3853689..41efb24b023 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusDescription.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusDescription.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { HotspotStatusOption } from '../../../../types/security-hotspots'; export interface StatusDescriptionProps { diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelection.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelection.tsx index c09078c2644..8cc96c275ec 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelection.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelection.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { setSecurityHotspotStatus } from '../../../../api/security-hotspots'; import addGlobalSuccessMessage from '../../../../app/utils/addGlobalSuccessMessage'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { Hotspot, HotspotStatusOption } from '../../../../types/security-hotspots'; import { getStatusAndResolutionFromStatusOption, diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelectionRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelectionRenderer.tsx index 42a1254a477..343b03fed0a 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelectionRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusSelectionRenderer.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import FormattingTips from '../../../../components/common/FormattingTips'; -import { SubmitButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import Radio from '../../../../sonar-ui-common/components/controls/Radio'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { SubmitButton } from '../../../../components/controls/buttons'; +import Radio from '../../../../components/controls/Radio'; +import { translate } from '../../../../helpers/l10n'; import { HotspotStatusOption } from '../../../../types/security-hotspots'; import StatusDescription from './StatusDescription'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/Status-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/Status-test.tsx index fe8d5d1577d..ca9c3730456 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/Status-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/Status-test.tsx @@ -19,11 +19,11 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { DropdownOverlay } from '../../../../../components/controls/Dropdown'; +import Toggler from '../../../../../components/controls/Toggler'; import { mockHotspot } from '../../../../../helpers/mocks/security-hotspots'; import { mockCurrentUser } from '../../../../../helpers/testMocks'; -import { DropdownOverlay } from '../../../../../sonar-ui-common/components/controls/Dropdown'; -import Toggler from '../../../../../sonar-ui-common/components/controls/Toggler'; -import { click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../helpers/testUtils'; import { HotspotStatusOption } from '../../../../../types/security-hotspots'; import { Status, StatusProps } from '../Status'; import StatusSelection from '../StatusSelection'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelection-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelection-test.tsx index 42563dd9e2a..7d45379108a 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelection-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelection-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { setSecurityHotspotStatus } from '../../../../../api/security-hotspots'; import { mockHotspot } from '../../../../../helpers/mocks/security-hotspots'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { HotspotStatus, HotspotStatusOption } from '../../../../../types/security-hotspots'; import StatusSelection from '../StatusSelection'; import StatusSelectionRenderer from '../StatusSelectionRenderer'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelectionRenderer-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelectionRenderer-test.tsx index 872c45c041b..0a24e00016f 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelectionRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/__tests__/StatusSelectionRenderer-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { SubmitButton } from '../../../../../sonar-ui-common/components/controls/buttons'; -import Radio from '../../../../../sonar-ui-common/components/controls/Radio'; -import { change, click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { SubmitButton } from '../../../../../components/controls/buttons'; +import Radio from '../../../../../components/controls/Radio'; +import { change, click } from '../../../../../helpers/testUtils'; import { HotspotStatusOption } from '../../../../../types/security-hotspots'; import StatusSelectionRenderer, { StatusSelectionRendererProps } from '../StatusSelectionRenderer'; diff --git a/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx b/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx index 6dba8f5395b..2658732ff13 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { connect } from 'react-redux'; import GlobalMessagesContainer from '../../../app/components/GlobalMessagesContainer'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { Store } from '../../../store/rootReducer'; import './Login.css'; import LoginForm from './LoginForm'; diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginContainer.tsx b/server/sonar-web/src/main/js/apps/sessions/components/LoginContainer.tsx index f4d2928692b..f30ee82f972 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/LoginContainer.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginContainer.tsx @@ -21,7 +21,7 @@ import { Location } from 'history'; import * as React from 'react'; import { connect } from 'react-redux'; import { getIdentityProviders } from '../../../api/users'; -import { getReturnUrl } from '../../../sonar-ui-common/helpers/urls'; +import { getReturnUrl } from '../../../helpers/urls'; import { doLogin } from '../../../store/rootActions'; import Login from './Login'; diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx b/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx index 2e46f9a411b..4268892d492 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { SubmitButton } from '../../../components/controls/buttons'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import './LoginForm.css'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx b/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx index c05e0fd400a..8b240308f7e 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import { connect } from 'react-redux'; import GlobalMessagesContainer from '../../../app/components/GlobalMessagesContainer'; import RecentHistory from '../../../app/components/RecentHistory'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { doLogout } from '../../../store/rootActions'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx b/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx index 0a2924d15e0..85d3ce9cf53 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx @@ -19,10 +19,10 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import IdentityProviderLink from '../../../sonar-ui-common/components/controls/IdentityProviderLink'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import IdentityProviderLink from '../../../components/controls/IdentityProviderLink'; +import { translateWithParameters } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import './OAuthProviders.css'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.tsx b/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.tsx index dcd1abbc14e..c6c7b573e87 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { getCookie } from '../../../sonar-ui-common/helpers/cookies'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { getCookie } from '../../../helpers/cookies'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; export default function Unauthorized() { const message = decodeURIComponent(getCookie('AUTHENTICATION-ERROR') || ''); diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginContainer-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginContainer-test.tsx index 7e6d57e388a..cb177cbca9f 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginContainer-test.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginContainer-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getIdentityProviders } from '../../../../api/users'; import { mockLocation } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { LoginContainer } from '../LoginContainer'; jest.mock('../../../../api/users', () => { diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx index 4e4612b2fbe..e38ae55e8ca 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx @@ -19,12 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { - change, - click, - submit, - waitAndUpdate -} from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, click, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import LoginForm from '../LoginForm'; it('logs in with simple credentials', () => { diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-test.tsx index 55f8d3461a1..8b5afc8d2c5 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-test.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { Logout } from '../Logout'; const originalLocation = window.location; diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-test.tsx index 51b9a810610..dda00d2ff57 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-test.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import Unauthorized from '../Unauthorized'; -jest.mock('../../../../sonar-ui-common/helpers/cookies', () => ({ +jest.mock('../../../../helpers/cookies', () => ({ getCookie: jest.fn().mockReturnValue('Foo') })); diff --git a/server/sonar-web/src/main/js/apps/sessions/routes.ts b/server/sonar-web/src/main/js/apps/sessions/routes.ts index 87793f47aff..3c490c803c3 100644 --- a/server/sonar-web/src/main/js/apps/sessions/routes.ts +++ b/server/sonar-web/src/main/js/apps/sessions/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/settings/components/AdditionalCategories.tsx b/server/sonar-web/src/main/js/apps/settings/components/AdditionalCategories.tsx index 651362b551d..aa946fabeae 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/AdditionalCategories.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/AdditionalCategories.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { ALM_INTEGRATION, ANALYSIS_SCOPE_CATEGORY, diff --git a/server/sonar-web/src/main/js/apps/settings/components/AnalysisScope.tsx b/server/sonar-web/src/main/js/apps/settings/components/AnalysisScope.tsx index ebf60c38e3d..5dda7658457 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/AnalysisScope.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/AnalysisScope.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { AdditionalCategoryComponentProps } from './AdditionalCategories'; import CategoryDefinitionsList from './CategoryDefinitionsList'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx index 087e10a3ea8..685699d15a6 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx @@ -24,13 +24,13 @@ import { connect } from 'react-redux'; import { WithRouterProps } from 'react-router'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { addSideBarClass, addWhitePageClass, removeSideBarClass, removeWhitePageClass -} from '../../../sonar-ui-common/helpers/pages'; +} from '../../../helpers/pages'; import { getSettingsAppDefaultCategory, Store } from '../../../store/rootReducer'; import { fetchSettings } from '../store/actions'; import '../styles.css'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx b/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx index 1d28db83706..7f9994de439 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx @@ -20,10 +20,10 @@ import classNames from 'classnames'; import * as React from 'react'; import { connect } from 'react-redux'; +import AlertErrorIcon from '../../../components/icons/AlertErrorIcon'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { sanitizeStringRestricted } from '../../../helpers/sanitize'; -import AlertErrorIcon from '../../../sonar-ui-common/components/icons/AlertErrorIcon'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; import { getSettingsAppChangedValue, getSettingsAppValidationMessage, diff --git a/server/sonar-web/src/main/js/apps/settings/components/DefinitionActions.tsx b/server/sonar-web/src/main/js/apps/settings/components/DefinitionActions.tsx index ce1f79d27e3..6ccf74d70a2 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/DefinitionActions.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/DefinitionActions.tsx @@ -18,13 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - Button, - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { translate } from '../../../helpers/l10n'; import { Setting } from '../../../types/settings'; import { getDefaultValue, getSettingValue, isEmptyValue } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/EmailForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/EmailForm.tsx index d3a51ee9f38..544a42df889 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/EmailForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/EmailForm.tsx @@ -19,14 +19,14 @@ */ import * as React from 'react'; import { sendTestEmail } from '../../../api/settings'; +import { SubmitButton } from '../../../components/controls/buttons'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { parseError } from '../../../sonar-ui-common/helpers/request'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { parseError } from '../../../helpers/request'; interface Props { currentUser: T.LoggedInUser; diff --git a/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx b/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx index 432461ca743..7a27154b398 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/Languages.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; +import Select from '../../../components/controls/Select'; import { Location, Router, withRouter } from '../../../components/hoc/withRouter'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getSettingsAppAllCategories, Store } from '../../../store/rootReducer'; import { getCategoryName } from '../utils'; import { AdditionalCategoryComponentProps } from './AdditionalCategories'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx b/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx index be4033936b5..ac5b327ae95 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx @@ -21,13 +21,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { getNewCodePeriod, setNewCodePeriod } from '../../../api/newCodePeriod'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import BaselineSettingDays from '../../projectBaseline/components/BaselineSettingDays'; import BaselineSettingPreviousVersion from '../../projectBaseline/components/BaselineSettingPreviousVersion'; import { validateDays } from '../../projectBaseline/utils'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/PageHeader.tsx b/server/sonar-web/src/main/js/apps/settings/components/PageHeader.tsx index e0d9061df4f..bca4bc82355 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/PageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/PageHeader.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import InstanceMessage from '../../../components/common/InstanceMessage'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface PageHeaderProps { component?: T.Component; diff --git a/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.tsx b/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.tsx index df2e2eba045..272c0e1d75e 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.tsx @@ -21,7 +21,7 @@ import { groupBy, isEqual, sortBy } from 'lodash'; import * as React from 'react'; import { Location, withRouter } from '../../../components/hoc/withRouter'; import { sanitizeStringRestricted } from '../../../helpers/sanitize'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { scrollToElement } from '../../../helpers/scrolling'; import { SettingWithCategory } from '../../../types/settings'; import { getSubCategoryDescription, getSubCategoryName } from '../utils'; import DefinitionsList from './DefinitionsList'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/__tests__/AppContainer-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/__tests__/AppContainer-test.tsx index dcb1ab3ca39..03a755a6277 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/__tests__/AppContainer-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/__tests__/AppContainer-test.tsx @@ -20,14 +20,14 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import ScreenPositionHelper from '../../../../components/common/ScreenPositionHelper'; -import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; import { addSideBarClass, addWhitePageClass, removeSideBarClass, removeWhitePageClass -} from '../../../../sonar-ui-common/helpers/pages'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +} from '../../../../helpers/pages'; +import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { ALM_INTEGRATION, ANALYSIS_SCOPE_CATEGORY, @@ -37,7 +37,7 @@ import { } from '../AdditionalCategoryKeys'; import { App } from '../AppContainer'; -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addSideBarClass: jest.fn(), addWhitePageClass: jest.fn(), removeSideBarClass: jest.fn(), diff --git a/server/sonar-web/src/main/js/apps/settings/components/__tests__/Definition-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/__tests__/Definition-test.tsx index eaee4ef5677..56841809b8b 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/__tests__/Definition-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/__tests__/Definition-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockSetting } from '../../../../helpers/mocks/settings'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { Definition } from '../Definition'; const setting = mockSetting(); diff --git a/server/sonar-web/src/main/js/apps/settings/components/__tests__/EmailForm-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/__tests__/EmailForm-test.tsx index c67ab25a908..e5887c1fb83 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/__tests__/EmailForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/__tests__/EmailForm-test.tsx @@ -22,10 +22,10 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { sendTestEmail } from '../../../../api/settings'; import { mockLoggedInUser } from '../../../../helpers/testMocks'; -import { change, submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import { EmailForm } from '../EmailForm'; -jest.mock('../../../../sonar-ui-common/helpers/request', () => ({ +jest.mock('../../../../helpers/request', () => ({ parseError: jest.fn().mockResolvedValue('Error message') })); diff --git a/server/sonar-web/src/main/js/apps/settings/components/__tests__/Languages-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/__tests__/Languages-test.tsx index f50ef2ce95f..10da93d2941 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/__tests__/Languages-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/__tests__/Languages-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import Select from '../../../../components/controls/Select'; import { mockComponent, mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; import CategoryDefinitionsList from '../CategoryDefinitionsList'; import { Languages, LanguagesProps } from '../Languages'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/__tests__/NewCodePeriod-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/__tests__/NewCodePeriod-test.tsx index 35a12846b8a..8db20195146 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/__tests__/NewCodePeriod-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/__tests__/NewCodePeriod-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getNewCodePeriod, setNewCodePeriod } from '../../../../api/newCodePeriod'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import NewCodePeriod from '../NewCodePeriod'; jest.mock('../../../../api/newCodePeriod', () => ({ diff --git a/server/sonar-web/src/main/js/apps/settings/components/__tests__/SubCategoryDefinitionsList-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/__tests__/SubCategoryDefinitionsList-test.tsx index 4185f5fedd4..9fa3fdaa3f4 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/__tests__/SubCategoryDefinitionsList-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/__tests__/SubCategoryDefinitionsList-test.tsx @@ -20,15 +20,15 @@ import { mount, shallow } from 'enzyme'; import * as React from 'react'; import { mockSettingWithCategory } from '../../../../helpers/mocks/settings'; +import { scrollToElement } from '../../../../helpers/scrolling'; import { mockLocation } from '../../../../helpers/testMocks'; -import { scrollToElement } from '../../../../sonar-ui-common/helpers/scrolling'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { SubCategoryDefinitionsList, SubCategoryDefinitionsListProps } from '../SubCategoryDefinitionsList'; -jest.mock('../../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../../helpers/scrolling', () => ({ scrollToElement: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx index 74e2282f121..1c56446acfe 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx @@ -20,17 +20,17 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Button } from '../../../../components/controls/buttons'; +import HelpTooltip from '../../../../components/controls/HelpTooltip'; +import Tooltip from '../../../../components/controls/Tooltip'; +import AlertErrorIcon from '../../../../components/icons/AlertErrorIcon'; +import AlertSuccessIcon from '../../../../components/icons/AlertSuccessIcon'; +import DeleteIcon from '../../../../components/icons/DeleteIcon'; +import EditIcon from '../../../../components/icons/EditIcon'; +import { Alert } from '../../../../components/ui/Alert'; import { ALM_DOCUMENTATION_PATHS, IMPORT_COMPATIBLE_ALMS } from '../../../../helpers/constants'; import { getEdition, getEditionUrl } from '../../../../helpers/editions'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import HelpTooltip from '../../../../sonar-ui-common/components/controls/HelpTooltip'; -import Tooltip from '../../../../sonar-ui-common/components/controls/Tooltip'; -import AlertErrorIcon from '../../../../sonar-ui-common/components/icons/AlertErrorIcon'; -import AlertSuccessIcon from '../../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import DeleteIcon from '../../../../sonar-ui-common/components/icons/DeleteIcon'; -import EditIcon from '../../../../sonar-ui-common/components/icons/EditIcon'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmBindingDefinitionBase, AlmKeys, diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormField.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormField.tsx index 0edf9c46bac..edee930408a 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormField.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormField.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../../sonar-ui-common/components/controls/buttons'; -import HelpTooltip from '../../../../sonar-ui-common/components/controls/HelpTooltip'; -import MandatoryFieldMarker from '../../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../../components/controls/buttons'; +import HelpTooltip from '../../../../components/controls/HelpTooltip'; +import MandatoryFieldMarker from '../../../../components/ui/MandatoryFieldMarker'; +import { translate } from '../../../../helpers/l10n'; import { AlmBindingDefinitionBase } from '../../../../types/alm-settings'; export interface AlmBindingDefinitionFormFieldProps { diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx index f8664a28637..005c426940a 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx @@ -18,14 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../../sonar-ui-common/components/controls/Modal'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../../components/controls/buttons'; +import Modal from '../../../../components/controls/Modal'; +import { Alert } from '../../../../components/ui/Alert'; +import DeferredSpinner from '../../../../components/ui/DeferredSpinner'; +import { translate } from '../../../../helpers/l10n'; import { AlmBindingDefinition, AlmKeys, diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmIntegrationRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmIntegrationRenderer.tsx index 3444cb9fd83..094c1214e8b 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmIntegrationRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmIntegrationRenderer.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BoxedTabs from '../../../../sonar-ui-common/components/controls/BoxedTabs'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../../sonar-ui-common/helpers/urls'; +import BoxedTabs from '../../../../components/controls/BoxedTabs'; +import { translate } from '../../../../helpers/l10n'; +import { getBaseUrl } from '../../../../helpers/urls'; import { AlmKeys, AlmSettingsBindingDefinitions, diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx index 1661200ae7a..8712e292617 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import DeferredSpinner from '../../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../../components/controls/buttons'; +import DeferredSpinner from '../../../../components/ui/DeferredSpinner'; +import { translate } from '../../../../helpers/l10n'; import { AlmBindingDefinition, AlmBindingDefinitionBase, diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AzureForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AzureForm.tsx index fdb38dfcd39..0b14dbda1e5 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AzureForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AzureForm.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../../components/ui/Alert'; import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmKeys, AzureBindingDefinition } from '../../../../types/alm-settings'; import { AlmBindingDefinitionFormField } from './AlmBindingDefinitionFormField'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketCloudForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketCloudForm.tsx index 5d766957f36..168d5111543 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketCloudForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketCloudForm.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { BitbucketCloudBindingDefinition } from '../../../../types/alm-settings'; import { AlmBindingDefinitionFormField } from './AlmBindingDefinitionFormField'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketForm.tsx index 749ce2e1081..a8d489a1e3d 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketForm.tsx @@ -20,10 +20,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import RadioToggle from '../../../../components/controls/RadioToggle'; +import { Alert } from '../../../../components/ui/Alert'; import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants'; -import RadioToggle from '../../../../sonar-ui-common/components/controls/RadioToggle'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmKeys, BitbucketCloudBindingDefinition, diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketServerForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketServerForm.tsx index 67f7fa430f3..5823139f42c 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketServerForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketServerForm.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { BitbucketServerBindingDefinition } from '../../../../types/alm-settings'; import { AlmBindingDefinitionFormField } from './AlmBindingDefinitionFormField'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx index 936f2efbcc8..fc23742666c 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import Tooltip from '../../../../components/controls/Tooltip'; import { withAppState } from '../../../../components/hoc/withAppState'; import { getEdition, getEditionUrl } from '../../../../helpers/editions'; -import Tooltip from '../../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmKeys } from '../../../../types/alm-settings'; import { EditionKey } from '../../../../types/editions'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/DeleteModal.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/DeleteModal.tsx index 05c3cb63f38..6926da558b4 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/DeleteModal.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/DeleteModal.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import ConfirmModal from '../../../../sonar-ui-common/components/controls/ConfirmModal'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import ConfirmModal from '../../../../components/controls/ConfirmModal'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; export interface DeleteModalProps { id: string; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GithubForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GithubForm.tsx index b00cb30273b..37e7b2a01cb 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GithubForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GithubForm.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../../components/ui/Alert'; import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmKeys, GithubBindingDefinition } from '../../../../types/alm-settings'; import { AlmBindingDefinitionFormField } from './AlmBindingDefinitionFormField'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GitlabForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GitlabForm.tsx index ec89c8b8752..67d6ba83ea5 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GitlabForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/GitlabForm.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../../components/ui/Alert'; import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmKeys, GitlabBindingDefinition } from '../../../../types/alm-settings'; import { AlmBindingDefinitionFormField } from './AlmBindingDefinitionFormField'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx index c78b1d3cfe9..4ad2a7bd49b 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx @@ -40,7 +40,7 @@ import { mockGithubBindingDefinition, mockGitlabBindingDefinition } from '../../../../../helpers/mocks/alm-settings'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { AlmBindingDefinition, AlmKeys } from '../../../../../types/alm-settings'; import AlmBindingDefinitionForm from '../AlmBindingDefinitionForm'; import AlmBindingDefinitionFormRenderer from '../AlmBindingDefinitionFormRenderer'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormField-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormField-test.tsx index 4261bd1dffd..180abec4816 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormField-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormField-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { ButtonLink } from '../../../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { ButtonLink } from '../../../../../components/controls/buttons'; +import { click } from '../../../../../helpers/testUtils'; import { AlmBindingDefinitionBase } from '../../../../../types/alm-settings'; import { AlmBindingDefinitionFormField, diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx index 02643d899fd..32fa8e265f0 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx @@ -19,10 +19,10 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { ResetButtonLink } from '../../../../../components/controls/buttons'; import { mockGithubBindingDefinition } from '../../../../../helpers/mocks/alm-settings'; import { mockEvent } from '../../../../../helpers/testMocks'; -import { ResetButtonLink } from '../../../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../helpers/testUtils'; import { AlmKeys } from '../../../../../types/alm-settings'; import AlmBindingDefinitionFormRenderer, { AlmBindingDefinitionFormProps diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx index b9f4b241050..9f34b761623 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx @@ -26,7 +26,7 @@ import { validateAlmSettings } from '../../../../../api/alm-settings'; import { mockLocation } from '../../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { AlmKeys, AlmSettingsBindingStatusType } from '../../../../../types/alm-settings'; import { AlmIntegration } from '../AlmIntegration'; import AlmIntegrationRenderer from '../AlmIntegrationRenderer'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmTab-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmTab-test.tsx index a7af4d5ca22..abe098a1d02 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmTab-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmTab-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockAzureBindingDefinition } from '../../../../../helpers/mocks/alm-settings'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { AlmKeys } from '../../../../../types/alm-settings'; import AlmTab from '../AlmTab'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/BitbucketForm-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/BitbucketForm-test.tsx index 88a12490b64..c6fd445ddce 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/BitbucketForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/BitbucketForm-test.tsx @@ -19,11 +19,11 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import RadioToggle from '../../../../../components/controls/RadioToggle'; import { mockBitbucketCloudBindingDefinition, mockBitbucketServerBindingDefinition } from '../../../../../helpers/mocks/alm-settings'; -import RadioToggle from '../../../../../sonar-ui-common/components/controls/RadioToggle'; import { AlmKeys } from '../../../../../types/alm-settings'; import BitbucketForm, { BitbucketFormProps } from '../BitbucketForm'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.tsx index 74921a67aba..4af9cd65018 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Toggle from '../../../../sonar-ui-common/components/controls/Toggle'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import Toggle from '../../../../components/controls/Toggle'; +import { translate } from '../../../../helpers/l10n'; import { DefaultSpecializedInputProps } from '../../utils'; interface Props extends DefaultSpecializedInputProps { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForJSON.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForJSON.tsx index 0edf6bb3ab1..626afaef73e 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForJSON.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForJSON.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../../components/controls/buttons'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import { DefaultSpecializedInputProps } from '../../utils'; const JSON_SPACE_SIZE = 4; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForPassword.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForPassword.tsx index aae8152eb8b..c63b3106ea4 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForPassword.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForPassword.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { colors } from '../../../../app/theme'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import LockIcon from '../../../../sonar-ui-common/components/icons/LockIcon'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../../components/controls/buttons'; +import LockIcon from '../../../../components/icons/LockIcon'; +import { translate } from '../../../../helpers/l10n'; import { DefaultSpecializedInputProps } from '../../utils'; interface State { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.tsx index 12421ba9618..f994fb8011a 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; +import Select from '../../../../components/controls/Select'; import { SettingCategoryDefinition } from '../../../../types/settings'; import { DefaultSpecializedInputProps } from '../../utils'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.tsx index 8dfa106672d..e6bb87e44ae 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DeleteButton } from '../../../../sonar-ui-common/components/controls/buttons'; +import { DeleteButton } from '../../../../components/controls/buttons'; import { DefaultInputProps, getEmptyValue } from '../../utils'; import PrimitiveInput from './PrimitiveInput'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.tsx index c85f583f4fd..7db52e8b289 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DeleteButton } from '../../../../sonar-ui-common/components/controls/buttons'; +import { DeleteButton } from '../../../../components/controls/buttons'; import { DefaultInputProps, getEmptyValue, getUniqueName, isCategoryDefinition } from '../../utils'; import PrimitiveInput from './PrimitiveInput'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForJSON-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForJSON-test.tsx index 42090287fe1..2884097b537 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForJSON-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForJSON-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { change } from '../../../../../helpers/testUtils'; import { DefaultSpecializedInputProps } from '../../../utils'; import InputForJSON from '../InputForJSON'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForPassword-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForPassword-test.tsx index e8ddd53ecd2..bb1716d9879 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForPassword-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForPassword-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change, click, submit } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { change, click, submit } from '../../../../../helpers/testUtils'; import { DefaultSpecializedInputProps } from '../../../utils'; import InputForPassword from '../InputForPassword'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForText-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForText-test.tsx index aa8e6e094d0..4b9a42653fb 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForText-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/InputForText-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { change } from '../../../../../helpers/testUtils'; import { DefaultSpecializedInputProps } from '../../../utils'; import InputForText from '../InputForText'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/MultiValueInput-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/MultiValueInput-test.tsx index 5fc3cc4c1ef..7f5dd70dc64 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/MultiValueInput-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/MultiValueInput-test.tsx @@ -19,7 +19,7 @@ */ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../helpers/testUtils'; import { SettingCategoryDefinition } from '../../../../../types/settings'; import { DefaultInputProps } from '../../../utils'; import MultiValueInput from '../MultiValueInput'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/SimpleInput-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/SimpleInput-test.tsx index 7f55d57aa47..2f6125c6732 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/SimpleInput-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/__tests__/SimpleInput-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { change } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { change } from '../../../../../helpers/testUtils'; import SimpleInput from '../SimpleInput'; it('should render input', () => { diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/AlmSpecificForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/AlmSpecificForm.tsx index b17b0555153..db66a5ebe05 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/AlmSpecificForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/AlmSpecificForm.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../../components/ui/Alert'; +import MandatoryFieldMarker from '../../../../components/ui/MandatoryFieldMarker'; import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants'; +import { translate } from '../../../../helpers/l10n'; import { convertGithubApiUrlToLink, stripTrailingSlash } from '../../../../helpers/urls'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; import { AlmKeys, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBinding.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBinding.tsx index 65ccfa6d87d..6a3271221c1 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBinding.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBinding.tsx @@ -32,8 +32,8 @@ import { } from '../../../../api/alm-settings'; import throwGlobalError from '../../../../app/utils/throwGlobalError'; import { withCurrentUser } from '../../../../components/hoc/withCurrentUser'; +import { HttpStatus } from '../../../../helpers/request'; import { hasGlobalPermission } from '../../../../helpers/users'; -import { HttpStatus } from '../../../../sonar-ui-common/helpers/request'; import { getAppState, Store } from '../../../../store/rootReducer'; import { AlmKeys, diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx index 95444b37b7d..7f1b0058160 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx @@ -20,15 +20,15 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Button, SubmitButton } from '../../../../components/controls/buttons'; +import Select from '../../../../components/controls/Select'; +import AlertSuccessIcon from '../../../../components/icons/AlertSuccessIcon'; +import { Alert } from '../../../../components/ui/Alert'; +import DeferredSpinner from '../../../../components/ui/DeferredSpinner'; +import MandatoryFieldMarker from '../../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../../helpers/l10n'; import { getGlobalSettingsUrl } from '../../../../helpers/urls'; -import { Button, SubmitButton } from '../../../../sonar-ui-common/components/controls/buttons'; -import Select from '../../../../sonar-ui-common/components/controls/Select'; -import AlertSuccessIcon from '../../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../../sonar-ui-common/components/ui/DeferredSpinner'; -import MandatoryFieldMarker from '../../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; import { AlmSettingsInstance, ProjectAlmBindingConfigurationErrors, diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBinding-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBinding-test.tsx index a262274f7e3..db848429969 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBinding-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBinding-test.tsx @@ -36,7 +36,7 @@ import { mockProjectAlmBindingResponse } from '../../../../../helpers/mocks/alm-settings'; import { mockComponent, mockCurrentUser } from '../../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { AlmKeys, AlmSettingsInstance } from '../../../../../types/alm-settings'; import { PRDecorationBinding } from '../PRDecorationBinding'; import PRDecorationBindingRenderer from '../PRDecorationBindingRenderer'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBindingRenderer-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBindingRenderer-test.tsx index c8cb2ca7d4c..adbe0156488 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBindingRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/PRDecorationBindingRenderer-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import Select from '../../../../../sonar-ui-common/components/controls/Select'; -import { waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import Select from '../../../../../components/controls/Select'; +import { waitAndUpdate } from '../../../../../helpers/testUtils'; import { AlmKeys, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.tsx b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.tsx index 247cb3f1ac3..6ea37067ce7 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.tsx +++ b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { checkSecretKey, generateSecretKey } from '../../../api/settings'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import EncryptionForm from './EncryptionForm'; import GenerateSecretKeyForm from './GenerateSecretKeyForm'; diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.tsx b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.tsx index 014152a685a..655b3bc2390 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.tsx @@ -21,10 +21,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { encryptValue } from '../../../api/settings'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { SubmitButton } from '../../../components/controls/buttons'; +import { ClipboardButton } from '../../../components/controls/clipboard'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; interface Props { generateSecretKey: () => Promise; diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.tsx b/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.tsx index 1bf80f49722..e024d187aa2 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.tsx @@ -20,10 +20,10 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { SubmitButton } from '../../../components/controls/buttons'; +import { ClipboardButton } from '../../../components/controls/clipboard'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; interface Props { generateSecretKey: () => Promise; diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/__tests__/EncryptionApp-test.tsx b/server/sonar-web/src/main/js/apps/settings/encryption/__tests__/EncryptionApp-test.tsx index 7ba6081f616..242b304e84c 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/__tests__/EncryptionApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/encryption/__tests__/EncryptionApp-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { checkSecretKey, generateSecretKey } from '../../../../api/settings'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import EncryptionApp from '../EncryptionApp'; jest.mock('../../../../api/settings', () => ({ diff --git a/server/sonar-web/src/main/js/apps/settings/routes.ts b/server/sonar-web/src/main/js/apps/settings/routes.ts index ad62cde0340..53d18a0ed1a 100644 --- a/server/sonar-web/src/main/js/apps/settings/routes.ts +++ b/server/sonar-web/src/main/js/apps/settings/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/settings/store/actions.ts b/server/sonar-web/src/main/js/apps/settings/store/actions.ts index 87f45788979..6bc80bb37e6 100644 --- a/server/sonar-web/src/main/js/apps/settings/store/actions.ts +++ b/server/sonar-web/src/main/js/apps/settings/store/actions.ts @@ -24,8 +24,8 @@ import { resetSettingValue, setSettingValue } from '../../../api/settings'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { parseError } from '../../../sonar-ui-common/helpers/request'; +import { translate } from '../../../helpers/l10n'; +import { parseError } from '../../../helpers/request'; import { closeAllGlobalMessages } from '../../../store/globalMessages'; import { getSettingsAppChangedValue, diff --git a/server/sonar-web/src/main/js/apps/settings/utils.ts b/server/sonar-web/src/main/js/apps/settings/utils.ts index ab37d79e892..fe956af3e50 100644 --- a/server/sonar-web/src/main/js/apps/settings/utils.ts +++ b/server/sonar-web/src/main/js/apps/settings/utils.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { hasMessage, translate } from '../../sonar-ui-common/helpers/l10n'; +import { hasMessage, translate } from '../../helpers/l10n'; import { Setting, SettingCategoryDefinition, SettingDefinition } from '../../types/settings'; export const DEFAULT_CATEGORY = 'general'; diff --git a/server/sonar-web/src/main/js/apps/system/components/App.tsx b/server/sonar-web/src/main/js/apps/system/components/App.tsx index 7de833ce33d..6df2047788c 100644 --- a/server/sonar-web/src/main/js/apps/system/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/App.tsx @@ -22,7 +22,7 @@ import { Helmet } from 'react-helmet-async'; import { withRouter, WithRouterProps } from 'react-router'; import { getSystemInfo } from '../../../api/system'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import '../styles.css'; import { getClusterVersion, diff --git a/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx b/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx index ef5d423ffd8..a79936d6b3d 100644 --- a/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/ChangeLogLevelForm.tsx @@ -19,13 +19,10 @@ */ import * as React from 'react'; import { setLogLevel } from '../../../api/system'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { LOGS_LEVELS } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/system/components/ClusterSysInfos.tsx b/server/sonar-web/src/main/js/apps/system/components/ClusterSysInfos.tsx index 858d434b304..28b52667d18 100644 --- a/server/sonar-web/src/main/js/apps/system/components/ClusterSysInfos.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/ClusterSysInfos.tsx @@ -19,7 +19,7 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getAppNodes, getClusterMainCardSection, diff --git a/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx index 72ca8e89938..5f3e0887fe9 100644 --- a/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import AdminContext from '../../../app/components/AdminContext'; import RestartButton from '../../../components/common/RestartButton'; -import { Button, EditButton } from '../../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { Button, EditButton } from '../../../components/controls/buttons'; +import Dropdown from '../../../components/controls/Dropdown'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { getFileNameSuffix } from '../utils'; import ChangeLogLevelForm from './ChangeLogLevelForm'; diff --git a/server/sonar-web/src/main/js/apps/system/components/PageHeader.tsx b/server/sonar-web/src/main/js/apps/system/components/PageHeader.tsx index 61a883e6491..0aab72a96ad 100644 --- a/server/sonar-web/src/main/js/apps/system/components/PageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/PageHeader.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClipboardButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { toShortNotSoISOString } from '../../../sonar-ui-common/helpers/dates'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ClipboardButton } from '../../../components/controls/clipboard'; +import { toShortNotSoISOString } from '../../../helpers/dates'; +import { translate } from '../../../helpers/l10n'; import PageActions from './PageActions'; export interface Props { diff --git a/server/sonar-web/src/main/js/apps/system/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/system/components/__tests__/App-test.tsx index 57f68f7204a..dbeec9dabbd 100644 --- a/server/sonar-web/src/main/js/apps/system/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/__tests__/App-test.tsx @@ -26,7 +26,7 @@ import { mockRouter, mockStandaloneSysInfo } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { App } from '../App'; jest.mock('../../../../api/system', () => ({ diff --git a/server/sonar-web/src/main/js/apps/system/components/__tests__/PageActions-test.tsx b/server/sonar-web/src/main/js/apps/system/components/__tests__/PageActions-test.tsx index 35d745f404c..02aacf5d4ba 100644 --- a/server/sonar-web/src/main/js/apps/system/components/__tests__/PageActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/__tests__/PageActions-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import PageActions from '../PageActions'; jest.mock('../../utils', () => ({ diff --git a/server/sonar-web/src/main/js/apps/system/components/__tests__/PageHeader-test.tsx b/server/sonar-web/src/main/js/apps/system/components/__tests__/PageHeader-test.tsx index 7d143597513..32c07327d72 100644 --- a/server/sonar-web/src/main/js/apps/system/components/__tests__/PageHeader-test.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/__tests__/PageHeader-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import PageHeader, { Props } from '../PageHeader'; -jest.mock('../../../../sonar-ui-common/helpers/dates', () => ({ +jest.mock('../../../../helpers/dates', () => ({ toShortNotSoISOString: () => '2019-01-01' })); diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCard.tsx b/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCard.tsx index c03ad6e1270..5c403aadf4f 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCard.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCard.tsx @@ -19,9 +19,9 @@ */ import { map } from 'lodash'; import * as React from 'react'; -import BoxedGroupAccordion from '../../../../sonar-ui-common/components/controls/BoxedGroupAccordion'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import BoxedGroupAccordion from '../../../../components/controls/BoxedGroupAccordion'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import { getLogsLevel, groupSections, LOGS_LEVELS } from '../../utils'; import HealthItem from './HealthItem'; import Section from './Section'; diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCauseItem.tsx b/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCauseItem.tsx index f764c9fc0c8..49cd480e91d 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCauseItem.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/HealthCauseItem.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; +import { Alert } from '../../../../components/ui/Alert'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/HealthItem.tsx b/server/sonar-web/src/main/js/apps/system/components/info-items/HealthItem.tsx index 4571978f6e4..f445caf6d0a 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/HealthItem.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/HealthItem.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import * as React from 'react'; import StatusIndicator from '../../../../components/common/StatusIndicator'; -import Tooltip from '../../../../sonar-ui-common/components/controls/Tooltip'; -import { translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../../components/controls/Tooltip'; +import { translateWithParameters } from '../../../../helpers/l10n'; import HealthCauseItem from './HealthCauseItem'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/SysInfoItem.tsx b/server/sonar-web/src/main/js/apps/system/components/info-items/SysInfoItem.tsx index 8a6ab950f38..4cd91ec7c53 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/SysInfoItem.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/SysInfoItem.tsx @@ -19,7 +19,7 @@ */ import { map } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { HEALTH_FIELD, STATE_FIELD } from '../../utils'; import HealthItem from './HealthItem'; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx index e32b51f73d2..b4a25a71963 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { ResetButtonLink } from '../../../../components/controls/buttons'; +import Modal from '../../../../components/controls/Modal'; import { withAppState } from '../../../../components/hoc/withAppState'; -import { ResetButtonLink } from '../../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { EditionKey } from '../../../../types/editions'; import { SystemUpgrade } from '../../../../types/system'; import SystemUpgradeItem from './SystemUpgradeItem'; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx index 4442791ab58..b059fe41805 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../../sonar-ui-common/components/controls/buttons'; -import DropdownIcon from '../../../../sonar-ui-common/components/icons/DropdownIcon'; -import DateFormatter from '../../../../sonar-ui-common/components/intl/DateFormatter'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../../components/controls/buttons'; +import DropdownIcon from '../../../../components/icons/DropdownIcon'; +import DateFormatter from '../../../../components/intl/DateFormatter'; +import { translate } from '../../../../helpers/l10n'; import { SystemUpgrade } from '../../../../types/system'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx index 06487ebb3fd..d5c605cbc4b 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx @@ -19,13 +19,13 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import DateFormatter from '../../../../components/intl/DateFormatter'; import { getEdition, getEditionDownloadFilename, getEditionDownloadUrl } from '../../../../helpers/editions'; -import DateFormatter from '../../../../sonar-ui-common/components/intl/DateFormatter'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { EditionKey } from '../../../../types/editions'; import { SystemUpgrade } from '../../../../types/system'; import SystemUpgradeIntermediate from './SystemUpgradeIntermediate'; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx index f332bc0a98f..5655488d6d8 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { getSystemUpgrades } from '../../../../api/system'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../../components/controls/buttons'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import { SystemUpgrade } from '../../../../types/system'; import { groupUpgrades, sortUpgrades } from '../../utils'; import SystemUpgradeForm from './SystemUpgradeForm'; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeIntermediate-test.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeIntermediate-test.tsx index 1d16b436a19..c2d05b1853f 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeIntermediate-test.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeIntermediate-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../../helpers/testUtils'; import SystemUpgradeIntermediate from '../SystemUpgradeIntermediate'; const UPGRADES = [ diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeNotif-test.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeNotif-test.tsx index 181e892cbca..7ad1e031157 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeNotif-test.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeNotif-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getSystemUpgrades } from '../../../../../api/system'; -import { click, waitAndUpdate } from '../../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../../helpers/testUtils'; import SystemUpgradeNotif from '../SystemUpgradeNotif'; jest.mock('../../../../../api/system', () => ({ diff --git a/server/sonar-web/src/main/js/apps/system/routes.ts b/server/sonar-web/src/main/js/apps/system/routes.ts index f57b5528d59..3056655f8ba 100644 --- a/server/sonar-web/src/main/js/apps/system/routes.ts +++ b/server/sonar-web/src/main/js/apps/system/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/system/utils.ts b/server/sonar-web/src/main/js/apps/system/utils.ts index 7727bfeb690..4a4c7f28242 100644 --- a/server/sonar-web/src/main/js/apps/system/utils.ts +++ b/server/sonar-web/src/main/js/apps/system/utils.ts @@ -18,13 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { each, groupBy, memoize, omit, omitBy, pickBy, sortBy } from 'lodash'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; -import { - cleanQuery, - parseAsArray, - parseAsString, - serializeStringArray -} from '../../sonar-ui-common/helpers/query'; +import { formatMeasure } from '../../helpers/measures'; +import { cleanQuery, parseAsArray, parseAsString, serializeStringArray } from '../../helpers/query'; import { SystemUpgrade } from '../../types/system'; export interface Query { diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/TutorialsApp.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/TutorialsApp.tsx index 91793919adb..15e0ed88dae 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/components/TutorialsApp.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/components/TutorialsApp.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; import TutorialSelection from '../../../components/tutorials/TutorialSelection'; +import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; import { isLoggedIn } from '../../../helpers/users'; -import handleRequiredAuthentication from '../../../sonar-ui-common/helpers/handleRequiredAuthentication'; import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; export interface TutorialsAppProps { diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/TutorialsApp-test.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/TutorialsApp-test.tsx index 1cb372e0c1c..db9050fde0f 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/TutorialsApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/TutorialsApp-test.tsx @@ -19,12 +19,12 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import handleRequiredAuthentication from '../../../../helpers/handleRequiredAuthentication'; import { mockProjectAzureBindingResponse } from '../../../../helpers/mocks/alm-settings'; import { mockComponent, mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks'; -import handleRequiredAuthentication from '../../../../sonar-ui-common/helpers/handleRequiredAuthentication'; import { TutorialsApp, TutorialsAppProps } from '../TutorialsApp'; -jest.mock('../../../../sonar-ui-common/helpers/handleRequiredAuthentication', () => ({ +jest.mock('../../../../helpers/handleRequiredAuthentication', () => ({ default: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/tutorials/routes.ts b/server/sonar-web/src/main/js/apps/tutorials/routes.ts index 4cb72f2c83d..98f75c84934 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/routes.ts +++ b/server/sonar-web/src/main/js/apps/tutorials/routes.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/users/Header.tsx b/server/sonar-web/src/main/js/apps/users/Header.tsx index e6ffc857c95..b7baff64b0b 100644 --- a/server/sonar-web/src/main/js/apps/users/Header.tsx +++ b/server/sonar-web/src/main/js/apps/users/Header.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; import UserForm from './components/UserForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/users/Search.tsx b/server/sonar-web/src/main/js/apps/users/Search.tsx index b374db588b7..64416e7eee5 100644 --- a/server/sonar-web/src/main/js/apps/users/Search.tsx +++ b/server/sonar-web/src/main/js/apps/users/Search.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import SearchBox from '../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import SearchBox from '../../components/controls/SearchBox'; +import { translate } from '../../helpers/l10n'; import { Query } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx index e65a54b2026..83b6c6d1f31 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx @@ -21,10 +21,10 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { getIdentityProviders, searchUsers } from '../../api/users'; import Suggestions from '../../app/components/embed-docs-modal/Suggestions'; +import ListFooter from '../../components/controls/ListFooter'; import { withCurrentUser } from '../../components/hoc/withCurrentUser'; import { Location, Router, withRouter } from '../../components/hoc/withRouter'; -import ListFooter from '../../sonar-ui-common/components/controls/ListFooter'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import Header from './Header'; import Search from './Search'; import UsersList from './UsersList'; diff --git a/server/sonar-web/src/main/js/apps/users/UsersList.tsx b/server/sonar-web/src/main/js/apps/users/UsersList.tsx index ff8667fb031..a12eb00d3ea 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersList.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersList.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import UserListItem from './components/UserListItem'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/users/__tests__/Header-test.tsx b/server/sonar-web/src/main/js/apps/users/__tests__/Header-test.tsx index 3e974b597a3..7d37ecf370a 100644 --- a/server/sonar-web/src/main/js/apps/users/__tests__/Header-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/__tests__/Header-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import Header from '../Header'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-test.tsx b/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-test.tsx index 995f39a29bd..66bbca41153 100644 --- a/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { Location } from '../../../components/hoc/withRouter'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { UsersApp } from '../UsersApp'; jest.mock('../../../api/users', () => ({ diff --git a/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx b/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx index db786c14565..ff9cac6acd6 100644 --- a/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx @@ -19,12 +19,9 @@ */ import * as React from 'react'; import { deactivateUser } from '../../../api/users'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; export interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx b/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx index b08e6e2f428..a61d96e1ae0 100644 --- a/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx @@ -21,12 +21,12 @@ import { find, without } from 'lodash'; import * as React from 'react'; import { getUserGroups, UserGroup } from '../../../api/users'; import { addUserToGroup, removeUserFromGroup } from '../../../api/user_groups'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; +import Modal from '../../../components/controls/Modal'; import SelectList, { SelectListFilter, SelectListSearchParams -} from '../../../sonar-ui-common/components/controls/SelectList'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/SelectList'; +import { translate } from '../../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx b/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx index 5dc1e6baf93..6dd4d5adbcd 100644 --- a/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx @@ -21,16 +21,13 @@ import * as React from 'react'; import { changePassword } from '../../../api/users'; import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage'; import throwGlobalError from '../../../app/utils/throwGlobalError'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { parseError } from '../../../sonar-ui-common/helpers/request'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { Alert } from '../../../components/ui/Alert'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; +import { parseError } from '../../../helpers/request'; interface Props { isCurrentUser: boolean; diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx index a1e31da9165..4f4ce1b6dfb 100644 --- a/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { generateToken, getTokens } from '../../../api/user-tokens'; -import { SubmitButton } from '../../../sonar-ui-common/components/controls/buttons'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { SubmitButton } from '../../../components/controls/buttons'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; import TokensFormItem, { TokenDeleteConfirmation } from './TokensFormItem'; import TokensFormNewToken from './TokensFormNewToken'; diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx index 075aa88ffee..4c8fc26c29f 100644 --- a/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx @@ -20,14 +20,14 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { revokeToken } from '../../../api/user-tokens'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../../sonar-ui-common/components/controls/ConfirmButton'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { limitComponentName } from '../../../sonar-ui-common/helpers/path'; +import { Button } from '../../../components/controls/buttons'; +import ConfirmButton from '../../../components/controls/ConfirmButton'; +import Tooltip from '../../../components/controls/Tooltip'; +import DateFormatter from '../../../components/intl/DateFormatter'; +import DateFromNow from '../../../components/intl/DateFromNow'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { limitComponentName } from '../../../helpers/path'; export type TokenDeleteConfirmation = 'inline' | 'modal'; diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx index cde0666a09d..bb9e48a4feb 100644 --- a/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { translate } from '../../../helpers/l10n'; import TokensForm from './TokensForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensFormNewToken.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensFormNewToken.tsx index 09d8ce01824..78f8dc276c5 100644 --- a/server/sonar-web/src/main/js/apps/users/components/TokensFormNewToken.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/TokensFormNewToken.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClipboardButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ClipboardButton } from '../../../components/controls/clipboard'; +import { Alert } from '../../../components/ui/Alert'; +import { translateWithParameters } from '../../../helpers/l10n'; interface Props { token: { name: string; token: string }; diff --git a/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx b/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx index 1a196e3a561..e58df4f9e09 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { isUserActive } from '../../../helpers/users'; import ActionsDropdown, { ActionsDropdownDivider, ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/ActionsDropdown'; +import { translate } from '../../../helpers/l10n'; +import { isUserActive } from '../../../helpers/users'; import DeactivateForm from './DeactivateForm'; import PasswordForm from './PasswordForm'; import UserForm from './UserForm'; diff --git a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx index a3a1e7a36f3..55193531878 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx @@ -21,17 +21,13 @@ import { uniq } from 'lodash'; import * as React from 'react'; import { createUser, updateUser } from '../../../api/users'; import throwGlobalError from '../../../app/utils/throwGlobalError'; -import { - Button, - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { parseError } from '../../../sonar-ui-common/helpers/request'; +import { Button, ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import { Alert } from '../../../components/ui/Alert'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { parseError } from '../../../helpers/request'; import UserScmAccountInput from './UserScmAccountInput'; export interface Props { diff --git a/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx b/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx index 8aab5c250f5..e525bdeb7fa 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonIcon } from '../../../sonar-ui-common/components/controls/buttons'; -import BulletListIcon from '../../../sonar-ui-common/components/icons/BulletListIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonIcon } from '../../../components/controls/buttons'; +import BulletListIcon from '../../../components/icons/BulletListIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import GroupsForm from './GroupsForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx b/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx index 0d32ce150fd..dd728bf3f9c 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { ButtonIcon } from '../../../components/controls/buttons'; +import BulletListIcon from '../../../components/icons/BulletListIcon'; +import DateFromNow from '../../../components/intl/DateFromNow'; import Avatar from '../../../components/ui/Avatar'; -import { ButtonIcon } from '../../../sonar-ui-common/components/controls/buttons'; -import BulletListIcon from '../../../sonar-ui-common/components/icons/BulletListIcon'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import TokensFormModal from './TokensFormModal'; import UserActions from './UserActions'; import UserGroups from './UserGroups'; diff --git a/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx b/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx index e34a18f37e5..14ba55b04b2 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { colors } from '../../../app/theme'; -import { getTextColor } from '../../../sonar-ui-common/helpers/colors'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { getTextColor } from '../../../helpers/colors'; +import { getBaseUrl } from '../../../helpers/urls'; export interface Props { identityProvider?: T.IdentityProvider; diff --git a/server/sonar-web/src/main/js/apps/users/components/UserScmAccountInput.tsx b/server/sonar-web/src/main/js/apps/users/components/UserScmAccountInput.tsx index 7d4dff74860..eda700ca8e1 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserScmAccountInput.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserScmAccountInput.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DeleteButton } from '../../../sonar-ui-common/components/controls/buttons'; +import { DeleteButton } from '../../../components/controls/buttons'; export interface Props { idx: number; diff --git a/server/sonar-web/src/main/js/apps/users/components/UserScmAccounts.tsx b/server/sonar-web/src/main/js/apps/users/components/UserScmAccounts.tsx index 16a5a956a47..c68d0234c00 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserScmAccounts.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserScmAccounts.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translateWithParameters } from '../../../helpers/l10n'; interface Props { scmAccounts: string[]; diff --git a/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx b/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx index 6a1abba5d25..9676bf12248 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx @@ -19,9 +19,9 @@ */ import { debounce } from 'lodash'; import * as React from 'react'; +import Select from '../../../components/controls/Select'; import Avatar from '../../../components/ui/Avatar'; -import Select from '../../../sonar-ui-common/components/controls/Select'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Option { login: string; diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/GroupsForm-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/GroupsForm-test.tsx index c145a9d395d..ad6baaf8636 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/GroupsForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/GroupsForm-test.tsx @@ -21,11 +21,9 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getUserGroups } from '../../../../api/users'; import { addUserToGroup, removeUserFromGroup } from '../../../../api/user_groups'; +import SelectList, { SelectListFilter } from '../../../../components/controls/SelectList'; import { mockUser } from '../../../../helpers/testMocks'; -import SelectList, { - SelectListFilter -} from '../../../../sonar-ui-common/components/controls/SelectList'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import GroupsForm from '../GroupsForm'; const user = mockUser(); diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensForm-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensForm-test.tsx index d31169e00dc..f611f9b4706 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensForm-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { generateToken, getTokens } from '../../../../api/user-tokens'; -import { change, submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import TokensForm from '../TokensForm'; jest.mock('../../../../api/user-tokens', () => ({ diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensFormItem-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensFormItem-test.tsx index 8a28525f059..310642b9948 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensFormItem-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/TokensFormItem-test.tsx @@ -20,12 +20,12 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { revokeToken } from '../../../../api/user-tokens'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import TokensFormItem from '../TokensFormItem'; -jest.mock('../../../../sonar-ui-common/components/intl/DateFormatter'); -jest.mock('../../../../sonar-ui-common/components/intl/DateFromNow'); -jest.mock('../../../../sonar-ui-common/components/intl/DateTimeFormatter'); +jest.mock('../../../../components/intl/DateFormatter'); +jest.mock('../../../../components/intl/DateFromNow'); +jest.mock('../../../../components/intl/DateTimeFormatter'); jest.mock('../../../../api/user-tokens', () => ({ revokeToken: jest.fn().mockResolvedValue(undefined) diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserActions-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserActions-test.tsx index cf86b50d6d8..500e7f8d7c4 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserActions-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import UserActions from '../UserActions'; const user = { diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserForm-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserForm-test.tsx index 99b0d2b5e5a..8a2b99f6558 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserForm-test.tsx @@ -20,9 +20,9 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { createUser, updateUser } from '../../../../api/users'; +import { Alert } from '../../../../components/ui/Alert'; import { mockUser } from '../../../../helpers/testMocks'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { submit, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { submit, waitAndUpdate } from '../../../../helpers/testUtils'; import UserForm from '../UserForm'; jest.mock('../../../../api/users', () => ({ diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserGroups-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserGroups-test.tsx index c5f995d4555..7cacc03b285 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserGroups-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserGroups-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import UserGroups from '../UserGroups'; const user = { diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx index c5f5af71c78..742b4ff7a01 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx @@ -19,11 +19,11 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import UserListItem from '../UserListItem'; -jest.mock('../../../../sonar-ui-common/components/intl/DateFromNow'); -jest.mock('../../../../sonar-ui-common/components/intl/DateTimeFormatter'); +jest.mock('../../../../components/intl/DateFromNow'); +jest.mock('../../../../components/intl/DateTimeFormatter'); const user: T.User = { active: true, diff --git a/server/sonar-web/src/main/js/apps/users/routes.ts b/server/sonar-web/src/main/js/apps/users/routes.ts index 71f305b65fb..03bc4ef51ea 100644 --- a/server/sonar-web/src/main/js/apps/users/routes.ts +++ b/server/sonar-web/src/main/js/apps/users/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/users/utils.ts b/server/sonar-web/src/main/js/apps/users/utils.ts index 870809f002b..e5b1d89655b 100644 --- a/server/sonar-web/src/main/js/apps/users/utils.ts +++ b/server/sonar-web/src/main/js/apps/users/utils.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { memoize } from 'lodash'; -import { cleanQuery, parseAsString, serializeString } from '../../sonar-ui-common/helpers/query'; +import { cleanQuery, parseAsString, serializeString } from '../../helpers/query'; export interface Query { search: string; diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx b/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx index 96565880849..5bcc98ade25 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link } from 'react-router'; -import LinkIcon from '../../../sonar-ui-common/components/icons/LinkIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import LinkIcon from '../../../components/icons/LinkIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getActionKey, serializeQuery } from '../utils'; import ActionChangelog from './ActionChangelog'; import DeprecatedBadge from './DeprecatedBadge'; diff --git a/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx b/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx index cfe9f1d302a..4c59dec8ad8 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { parseVersion } from '../utils'; export default function DeprecatedBadge({ since }: { since?: string }) { diff --git a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx index 87a62da168a..6bd861e0df4 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate } from '../../../helpers/l10n'; export default function InternalBadge() { return ( diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx b/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx index a71d897572c..41746a001d7 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import DeprecatedBadge from './DeprecatedBadge'; import InternalBadge from './InternalBadge'; diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx b/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx index 730b178656b..b57ff2ca194 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import HelpTooltip from '../../../sonar-ui-common/components/controls/HelpTooltip'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import Checkbox from '../../../components/controls/Checkbox'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; +import SearchBox from '../../../components/controls/SearchBox'; +import { translate } from '../../../helpers/l10n'; import { Query } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx index 3d1fb81400c..fda24c8f547 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx @@ -25,9 +25,9 @@ import { fetchWebApi } from '../../../api/web-api'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { addSideBarClass, removeSideBarClass } from '../../../sonar-ui-common/helpers/pages'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; +import { translate } from '../../../helpers/l10n'; +import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages'; +import { scrollToElement } from '../../../helpers/scrolling'; import '../styles/web-api.css'; import { getActionKey, diff --git a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/WebApiApp-test.tsx b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/WebApiApp-test.tsx index 92cd3153b23..02c22c885a1 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/WebApiApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/WebApiApp-test.tsx @@ -20,9 +20,9 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { fetchWebApi } from '../../../../api/web-api'; +import { addSideBarClass, removeSideBarClass } from '../../../../helpers/pages'; import { mockLocation, mockRouter } from '../../../../helpers/testMocks'; -import { addSideBarClass, removeSideBarClass } from '../../../../sonar-ui-common/helpers/pages'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { WebApiApp } from '../WebApiApp'; jest.mock('../../../../components/common/ScreenPositionHelper'); @@ -39,7 +39,7 @@ jest.mock('../../../../api/web-api', () => ({ ]) })); -jest.mock('../../../../sonar-ui-common/helpers/pages', () => ({ +jest.mock('../../../../helpers/pages', () => ({ addSideBarClass: jest.fn(), removeSideBarClass: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/web-api/routes.ts b/server/sonar-web/src/main/js/apps/web-api/routes.ts index de4eedbd65a..64101820c36 100644 --- a/server/sonar-web/src/main/js/apps/web-api/routes.ts +++ b/server/sonar-web/src/main/js/apps/web-api/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/apps/web-api/utils.ts b/server/sonar-web/src/main/js/apps/web-api/utils.ts index cbd54a2a37c..86329e02465 100644 --- a/server/sonar-web/src/main/js/apps/web-api/utils.ts +++ b/server/sonar-web/src/main/js/apps/web-api/utils.ts @@ -23,7 +23,7 @@ import { parseAsOptionalBoolean, parseAsString, serializeString -} from '../../sonar-ui-common/helpers/query'; +} from '../../helpers/query'; export interface Query { search: string; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx index 164e6afb170..4ba44aab5d4 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { createWebhook, deleteWebhook, searchWebhooks, updateWebhook } from '../../../api/webhooks'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import PageActions from './PageActions'; import PageHeader from './PageHeader'; import WebhooksList from './WebhooksList'; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/CreateWebhookForm.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/CreateWebhookForm.tsx index 89679a7515d..cfeb285deed 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/CreateWebhookForm.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/CreateWebhookForm.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { isWebUri } from 'valid-url'; -import InputValidationField from '../../../sonar-ui-common/components/controls/InputValidationField'; -import ValidationModal from '../../../sonar-ui-common/components/controls/ValidationModal'; -import MandatoryFieldMarker from '../../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import InputValidationField from '../../../components/controls/InputValidationField'; +import ValidationModal from '../../../components/controls/ValidationModal'; +import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/DeleteWebhookForm.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/DeleteWebhookForm.tsx index 10f6d69985e..b543fbc1242 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/DeleteWebhookForm.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/DeleteWebhookForm.tsx @@ -18,13 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - ResetButtonLink, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveriesForm.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveriesForm.tsx index fb5ac01d617..ffd7c4d39d6 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveriesForm.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveriesForm.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { searchDeliveries } from '../../../api/webhooks'; -import { ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import ListFooter from '../../../sonar-ui-common/components/controls/ListFooter'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink } from '../../../components/controls/buttons'; +import ListFooter from '../../../components/controls/ListFooter'; +import Modal from '../../../components/controls/Modal'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import DeliveryAccordion from './DeliveryAccordion'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryAccordion.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryAccordion.tsx index b4fab1f2dda..42c74882ba9 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryAccordion.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryAccordion.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { getDelivery } from '../../../api/webhooks'; -import BoxedGroupAccordion from '../../../sonar-ui-common/components/controls/BoxedGroupAccordion'; -import AlertErrorIcon from '../../../sonar-ui-common/components/icons/AlertErrorIcon'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; +import BoxedGroupAccordion from '../../../components/controls/BoxedGroupAccordion'; +import AlertErrorIcon from '../../../components/icons/AlertErrorIcon'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; import DeliveryItem from './DeliveryItem'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx index 5dd449cc09e..bfa6d026a17 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import CodeSnippet from '../../../components/common/CodeSnippet'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/LatestDeliveryForm.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/LatestDeliveryForm.tsx index b12491e5675..012b9466a50 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/LatestDeliveryForm.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/LatestDeliveryForm.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { getDelivery } from '../../../api/webhooks'; -import { ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ResetButtonLink } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import DeliveryItem from './DeliveryItem'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx index dfe3683c5c7..45fabd72b1c 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import CreateWebhookForm from './CreateWebhookForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/PageHeader.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/PageHeader.tsx index 206bba574b8..34f593d8573 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/PageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/PageHeader.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; interface Props { children?: React.ReactNode; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/WebhookActions.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/WebhookActions.tsx index 78a4c71408a..5b09c83230e 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/WebhookActions.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/WebhookActions.tsx @@ -21,8 +21,8 @@ import * as React from 'react'; import ActionsDropdown, { ActionsDropdownDivider, ActionsDropdownItem -} from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +} from '../../../components/controls/ActionsDropdown'; +import { translate } from '../../../helpers/l10n'; import CreateWebhookForm from './CreateWebhookForm'; import DeleteWebhookForm from './DeleteWebhookForm'; import DeliveriesForm from './DeliveriesForm'; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItem.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItem.tsx index 20012c7ab37..22f864d2809 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItem.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItem.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import WebhookActions from './WebhookActions'; import WebhookItemLatestDelivery from './WebhookItemLatestDelivery'; diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItemLatestDelivery.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItemLatestDelivery.tsx index 21c70df97ab..e8e671c10e3 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItemLatestDelivery.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/WebhookItemLatestDelivery.tsx @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonIcon } from '../../../sonar-ui-common/components/controls/buttons'; -import AlertErrorIcon from '../../../sonar-ui-common/components/icons/AlertErrorIcon'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import BulletListIcon from '../../../sonar-ui-common/components/icons/BulletListIcon'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonIcon } from '../../../components/controls/buttons'; +import AlertErrorIcon from '../../../components/icons/AlertErrorIcon'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import BulletListIcon from '../../../components/icons/BulletListIcon'; +import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; +import { translate } from '../../../helpers/l10n'; import LatestDeliveryForm from './LatestDeliveryForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/WebhooksList.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/WebhooksList.tsx index 9c22e4d4d8a..40f8815a9a9 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/WebhooksList.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/WebhooksList.tsx @@ -19,7 +19,7 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import WebhookItem from './WebhookItem'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/PageActions-test.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/PageActions-test.tsx index 152768c5682..f1d41fc6640 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/PageActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/PageActions-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import PageActions from '../PageActions'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookActions-test.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookActions-test.tsx index ed0f960e078..db11414cb13 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookActions-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import WebhookActions from '../WebhookActions'; const webhook = { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookItemLatestDelivery-test.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookItemLatestDelivery-test.tsx index 6684c49377e..f7f5b2639b2 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookItemLatestDelivery-test.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/WebhookItemLatestDelivery-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import WebhookItemLatestDelivery from '../WebhookItemLatestDelivery'; const latestDelivery = { diff --git a/server/sonar-web/src/main/js/apps/webhooks/routes.ts b/server/sonar-web/src/main/js/apps/webhooks/routes.ts index f57b5528d59..3056655f8ba 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/routes.ts +++ b/server/sonar-web/src/main/js/apps/webhooks/routes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../../components/lazyLoadComponent'; const routes = [ { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx index f08f456c69d..fc7368f0708 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../lazyLoadComponent'; const SourceViewer = lazyLoadComponent( () => import(/* webpackPrefetch: true */ './SourceViewerBase'), diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx index 51a2089cfa0..949673bb7b1 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx @@ -25,9 +25,9 @@ import { getDuplications, getSources } from '../../api/components'; +import { Alert } from '../../components/ui/Alert'; import { getBranchLikeQuery, isSameBranchLike } from '../../helpers/branch-like'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import { BranchLike } from '../../types/branch-like'; import { WorkspaceContext } from '../workspace/context'; import DuplicationPopup from './components/DuplicationPopup'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx index c95af38d52e..d108b1442f9 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import { translate } from '../../helpers/l10n'; import { BranchLike } from '../../types/branch-like'; import { MetricKey } from '../../types/metrics'; import Line from './components/Line'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx index 089f44cf40c..cbe62d3d085 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx @@ -20,21 +20,26 @@ import { stringify } from 'querystring'; import * as React from 'react'; import { Link } from 'react-router'; +import { ButtonIcon } from '../../components/controls/buttons'; +import { ClipboardIconButton } from '../../components/controls/clipboard'; +import Dropdown from '../../components/controls/Dropdown'; +import ListIcon from '../../components/icons/ListIcon'; +import QualifierIcon from '../../components/icons/QualifierIcon'; +import { PopupPlacement } from '../../components/ui/popups'; import { getBranchLikeQuery } from '../../helpers/branch-like'; import { ISSUE_TYPES } from '../../helpers/constants'; import { ISSUETYPE_METRIC_KEYS_MAP } from '../../helpers/issues'; -import { getBranchLikeUrl, getCodeUrl, getComponentIssuesUrl } from '../../helpers/urls'; -import { ButtonIcon } from '../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../sonar-ui-common/components/controls/clipboard'; -import Dropdown from '../../sonar-ui-common/components/controls/Dropdown'; -import ListIcon from '../../sonar-ui-common/components/icons/ListIcon'; -import QualifierIcon from '../../sonar-ui-common/components/icons/QualifierIcon'; -import { PopupPlacement } from '../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; -import { collapsedDirFromPath, fileFromPath } from '../../sonar-ui-common/helpers/path'; -import { omitNil } from '../../sonar-ui-common/helpers/request'; -import { getBaseUrl, getPathUrlAsString } from '../../sonar-ui-common/helpers/urls'; +import { translate } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; +import { collapsedDirFromPath, fileFromPath } from '../../helpers/path'; +import { omitNil } from '../../helpers/request'; +import { + getBaseUrl, + getBranchLikeUrl, + getCodeUrl, + getComponentIssuesUrl, + getPathUrlAsString +} from '../../helpers/urls'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { WorkspaceContextShape } from '../workspace/context'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx index 6a160338172..917cc49f1a7 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx @@ -20,16 +20,15 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link } from 'react-router'; +import { ButtonIcon } from '../../components/controls/buttons'; +import { ClipboardIconButton } from '../../components/controls/clipboard'; +import ExpandSnippetIcon from '../../components/icons/ExpandSnippetIcon'; +import QualifierIcon from '../../components/icons/QualifierIcon'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; import { getBranchLikeQuery } from '../../helpers/branch-like'; -import { getBranchLikeUrl, getComponentIssuesUrl } from '../../helpers/urls'; -import { ButtonIcon } from '../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../sonar-ui-common/components/controls/clipboard'; -import ExpandSnippetIcon from '../../sonar-ui-common/components/icons/ExpandSnippetIcon'; -import QualifierIcon from '../../sonar-ui-common/components/icons/QualifierIcon'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { collapsedDirFromPath, fileFromPath } from '../../sonar-ui-common/helpers/path'; -import { getPathUrlAsString } from '../../sonar-ui-common/helpers/urls'; +import { translate } from '../../helpers/l10n'; +import { collapsedDirFromPath, fileFromPath } from '../../helpers/path'; +import { getBranchLikeUrl, getComponentIssuesUrl, getPathUrlAsString } from '../../helpers/urls'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import './SourceViewerHeaderSlim.css'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerBase-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerBase-test.tsx index 7f9ac1d28a1..3fd9556de43 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerBase-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerBase-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { getComponentData, getComponentForSourceViewer, getSources } from '../../../api/components'; import { mockMainBranch } from '../../../helpers/mocks/branch-like'; import { mockIssue, mockSourceLine, mockSourceViewerFile } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import defaultLoadIssues from '../helpers/loadIssues'; import SourceViewerBase from '../SourceViewerBase'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx index 5f64b732f39..3071fbe2ed6 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx @@ -20,12 +20,12 @@ import { groupBy, sortBy } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import { Alert } from '../../../components/ui/Alert'; import { isPullRequest } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; +import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path'; import { getProjectUrl } from '../../../helpers/urls'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { collapsedDirFromPath, fileFromPath } from '../../../sonar-ui-common/helpers/path'; import { BranchLike } from '../../../types/branch-like'; import { WorkspaceContextShape } from '../../workspace/context'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineCoverage.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineCoverage.tsx index 5ca08ba5d0a..0d36d7830ff 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineCoverage.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineCoverage.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; export interface LineCoverageProps { line: T.SourceLine; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx index 74d9e33f258..abaeff59dc9 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx @@ -19,11 +19,11 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import Toggler from '../../../components/controls/Toggler'; +import Tooltip from '../../../components/controls/Tooltip'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate } from '../../../helpers/l10n'; export interface LineDuplicationBlockProps { blocksLoaded: boolean; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesIndicator.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesIndicator.tsx index 2397856404c..63424aa667b 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesIndicator.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesIndicator.tsx @@ -20,10 +20,10 @@ import * as classNames from 'classnames'; import { uniq } from 'lodash'; import * as React from 'react'; +import Tooltip from '../../../components/controls/Tooltip'; +import IssueIcon from '../../../components/icons/IssueIcon'; import { sortByType } from '../../../helpers/issues'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import IssueIcon from '../../../sonar-ui-common/components/icons/IssueIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; export interface LineIssuesIndicatorProps { issues: T.Issue[]; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineNumber.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineNumber.tsx index 8015ab5d8cc..31be34e3965 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineNumber.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineNumber.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import { translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import Toggler from '../../../components/controls/Toggler'; +import { translateWithParameters } from '../../../helpers/l10n'; import LineOptionsPopup from './LineOptionsPopup'; export interface LineNumberProps { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineOptionsPopup.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineOptionsPopup.tsx index 57a43002b9c..7bd16b97b50 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineOptionsPopup.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineOptionsPopup.tsx @@ -18,12 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { getCodeUrl } from '../../../helpers/urls'; -import { ActionsDropdownItem } from '../../../sonar-ui-common/components/controls/ActionsDropdown'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getPathUrlAsString } from '../../../sonar-ui-common/helpers/urls'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate } from '../../../helpers/l10n'; +import { getCodeUrl, getPathUrlAsString } from '../../../helpers/urls'; +import { ActionsDropdownItem } from '../../controls/ActionsDropdown'; import { SourceViewerContext } from '../SourceViewerContext'; export interface LineOptionsPopupProps { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineSCM.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineSCM.tsx index e50618cad7f..f4b892213a1 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineSCM.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineSCM.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Dropdown from '../../../sonar-ui-common/components/controls/Dropdown'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import Dropdown from '../../../components/controls/Dropdown'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import SCMPopup from './SCMPopup'; export interface LineSCMProps { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx index f403e9ab6d6..dbcce374910 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx @@ -23,18 +23,21 @@ import { Link } from 'react-router'; import { getFacets } from '../../../api/issues'; import { getMeasures } from '../../../api/measures'; import { getAllMetrics } from '../../../api/metrics'; +import { ResetButtonLink } from '../../../components/controls/buttons'; +import Modal from '../../../components/controls/Modal'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import TagsIcon from '../../../components/icons/TagsIcon'; +import DuplicationsRating from '../../../components/ui/DuplicationsRating'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; import { ISSUE_TYPES, SEVERITIES } from '../../../helpers/constants'; -import { enhanceMeasuresWithMetrics, getDisplayMetrics } from '../../../helpers/measures'; +import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; +import { + enhanceMeasuresWithMetrics, + formatMeasure, + getDisplayMetrics +} from '../../../helpers/measures'; import { getBranchLikeUrl } from '../../../helpers/urls'; -import { ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../../sonar-ui-common/components/controls/Modal'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import TagsIcon from '../../../sonar-ui-common/components/icons/TagsIcon'; -import DuplicationsRating from '../../../sonar-ui-common/components/ui/DuplicationsRating'; -import { getLocalizedMetricName, translate } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import Measure from '../../measure/Measure'; import SeverityHelper from '../../shared/SeverityHelper'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx index 394b748d5e8..5931b6e9ccf 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { getLocalizedMetricName } from '../../../sonar-ui-common/helpers/l10n'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import { getLocalizedMetricName } from '../../../helpers/l10n'; import { isMetricKey, MetricKey } from '../../../types/metrics'; import Measure from '../../measure/Measure'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/SCMPopup.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/SCMPopup.tsx index cd324ab1263..08b523df621 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/SCMPopup.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/SCMPopup.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import DateFormatter from '../../../sonar-ui-common/components/intl/DateFormatter'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; +import DateFormatter from '../../intl/DateFormatter'; export interface SCMPopupProps { line: T.SourceLine; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineDuplicationBlock-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineDuplicationBlock-test.tsx index a0d47ae847e..ce05bd64754 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineDuplicationBlock-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineDuplicationBlock-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import Toggler from '../../../../sonar-ui-common/components/controls/Toggler'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import Toggler from '../../../../components/controls/Toggler'; +import { click } from '../../../../helpers/testUtils'; import { LineDuplicationBlock, LineDuplicationBlockProps } from '../LineDuplicationBlock'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesIndicator-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesIndicator-test.tsx index abba13b5906..66fad92f8fe 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesIndicator-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesIndicator-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockIssue } from '../../../../helpers/testMocks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import { LineIssuesIndicator, LineIssuesIndicatorProps } from '../LineIssuesIndicator'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx index 1af17b98b44..e000aea59e2 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockBranch } from '../../../../helpers/mocks/branch-like'; -import { click, waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click, waitAndUpdate } from '../../../../helpers/testUtils'; import { MetricKey } from '../../../../types/metrics'; import MeasuresOverlay from '../MeasuresOverlay'; diff --git a/server/sonar-web/src/main/js/components/__tests__/__snapshots__/lazyLoadComponent-test.tsx.snap b/server/sonar-web/src/main/js/components/__tests__/__snapshots__/lazyLoadComponent-test.tsx.snap new file mode 100644 index 00000000000..9edbac96c7c --- /dev/null +++ b/server/sonar-web/src/main/js/components/__tests__/__snapshots__/lazyLoadComponent-test.tsx.snap @@ -0,0 +1,36 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should correctly set given display name 1`] = ` +
+ +
+`; + +exports[`should lazy load and display the component 1`] = ` + + + + + +`; + +exports[`should lazy load and display the component 2`] = ` + + + + + + + + + +`; diff --git a/server/sonar-web/src/main/js/components/__tests__/lazyLoadComponent-test.tsx b/server/sonar-web/src/main/js/components/__tests__/lazyLoadComponent-test.tsx new file mode 100644 index 00000000000..788482d1e90 --- /dev/null +++ b/server/sonar-web/src/main/js/components/__tests__/lazyLoadComponent-test.tsx @@ -0,0 +1,57 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount, shallow } from 'enzyme'; +import * as React from 'react'; +import { waitAndUpdate } from '../../helpers/testUtils'; +import { lazyLoadComponent } from '../lazyLoadComponent'; + +const factory = jest.fn().mockImplementation(() => import('../../components/controls/Checkbox')); + +beforeEach(() => { + factory.mockClear(); +}); + +it('should lazy load and display the component', async () => { + const LazyComponent = lazyLoadComponent(factory); + const wrapper = mount(); + expect(wrapper).toMatchSnapshot(); + expect(factory).toBeCalledTimes(1); + await waitAndUpdate(wrapper); + await waitAndUpdate(wrapper); + expect(wrapper).toMatchSnapshot(); + expect(factory).toBeCalledTimes(1); +}); + +it('should correctly handle import errors', () => { + const LazyComponent = lazyLoadComponent(factory); + const wrapper = mount(); + wrapper.find('Suspense').simulateError({ request: 'test' }); + expect(wrapper.find('Alert').exists()).toBe(true); +}); + +it('should correctly set given display name', () => { + const LazyComponent = lazyLoadComponent(factory, 'CustomDisplayName'); + const wrapper = shallow( +
+ +
+ ); + expect(wrapper).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx index a0295be6d31..6f50f63de03 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx @@ -19,11 +19,11 @@ */ import { find, sortBy } from 'lodash'; import * as React from 'react'; +import { Button } from '../../components/controls/buttons'; +import Dropdown from '../../components/controls/Dropdown'; +import DropdownIcon from '../../components/icons/DropdownIcon'; +import { getLocalizedMetricName, translate } from '../../helpers/l10n'; import { isDiffMetric } from '../../helpers/measures'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../sonar-ui-common/components/controls/Dropdown'; -import DropdownIcon from '../../sonar-ui-common/components/icons/DropdownIcon'; -import { getLocalizedMetricName, translate } from '../../sonar-ui-common/helpers/l10n'; import AddGraphMetricPopup from './AddGraphMetricPopup'; interface Props { diff --git a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetricPopup.tsx b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetricPopup.tsx index 45098fa56a9..c39f8e40803 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetricPopup.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetricPopup.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../components/ui/Alert'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import MultiSelect from '../common/MultiSelect'; export interface AddGraphMetricPopupProps { diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx index 8e872d882ae..af55a9814a6 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx @@ -19,9 +19,8 @@ */ import * as React from 'react'; import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; -import { getShortType } from '../../helpers/measures'; -import AdvancedTimeline from '../../sonar-ui-common/components/charts/AdvancedTimeline'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import AdvancedTimeline from '../../components/charts/AdvancedTimeline'; +import { formatMeasure, getShortType } from '../../helpers/measures'; import { MeasureHistory, Serie } from '../../types/project-activity'; import GraphsLegendCustom from './GraphsLegendCustom'; import GraphsLegendStatic from './GraphsLegendStatic'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx index 74879dc3999..fdc9cf287bf 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx @@ -19,8 +19,8 @@ */ import classNames from 'classnames'; import * as React from 'react'; -import Select from '../../sonar-ui-common/components/controls/Select'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import Select from '../../components/controls/Select'; +import { translate } from '../../helpers/l10n'; import { GraphType } from '../../types/project-activity'; import AddGraphMetric from './AddGraphMetric'; import './styles.css'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsHistory.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsHistory.tsx index b82f6f2406b..8da9f418f94 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsHistory.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsHistory.tsx @@ -19,9 +19,9 @@ */ import { isEqual } from 'lodash'; import * as React from 'react'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../sonar-ui-common/helpers/urls'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; +import { getBaseUrl } from '../../helpers/urls'; import { GraphType, MeasureHistory, Serie } from '../../types/project-activity'; import GraphHistory from './GraphHistory'; import './styles.css'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx index 78cbb66d597..d4019a5c4d5 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../components/controls/Tooltip'; +import { translate } from '../../helpers/l10n'; import { Serie } from '../../types/project-activity'; import GraphsLegendItem from './GraphsLegendItem'; import { hasDataValues } from './utils'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx index 3303a22455f..90a3c46c77f 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx @@ -19,9 +19,9 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { ClearButton } from '../../sonar-ui-common/components/controls/buttons'; -import AlertWarnIcon from '../../sonar-ui-common/components/icons/AlertWarnIcon'; -import ChartLegendIcon from '../../sonar-ui-common/components/icons/ChartLegendIcon'; +import { ClearButton } from '../../components/controls/buttons'; +import AlertWarnIcon from '../../components/icons/AlertWarnIcon'; +import ChartLegendIcon from '../../components/icons/ChartLegendIcon'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendNewCode.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendNewCode.tsx index 65bda38c508..63d82afa4b5 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendNewCode.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendNewCode.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../components/controls/Tooltip'; +import { translate } from '../../helpers/l10n'; export default function GraphsLegendNewCode() { return ( diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltips.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltips.tsx index 6f0f22c36cf..5fefe862278 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltips.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltips.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import DateTimeFormatter from '../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { Popup, PopupPlacement } from '../../sonar-ui-common/components/ui/popups'; -import { isDefined } from '../../sonar-ui-common/helpers/types'; +import { Popup, PopupPlacement } from '../../components/ui/popups'; +import { isDefined } from '../../helpers/types'; import { MeasureHistory, Serie } from '../../types/project-activity'; +import DateTimeFormatter from '../intl/DateTimeFormatter'; import GraphsTooltipsContent from './GraphsTooltipsContent'; import GraphsTooltipsContentCoverage from './GraphsTooltipsContentCoverage'; import GraphsTooltipsContentDuplication from './GraphsTooltipsContentDuplication'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContent.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContent.tsx index 3c30e28cf87..ae980d762b7 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContent.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContent.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ChartLegendIcon from '../../sonar-ui-common/components/icons/ChartLegendIcon'; +import ChartLegendIcon from '../../components/icons/ChartLegendIcon'; interface Props { name: string; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx index 482a4503dd8..0af91c5ae7c 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import { translate } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; import { MeasureHistory } from '../../types/project-activity'; export interface GraphsTooltipsContentCoverageProps { diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx index 95839b501d7..afc5f21773a 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import { translate } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; import { MeasureHistory } from '../../types/project-activity'; export interface GraphsTooltipsContentDuplicationProps { diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentIssues.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentIssues.tsx index 5346165eea9..14bb68e56b9 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentIssues.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentIssues.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ChartLegendIcon from '../../sonar-ui-common/components/icons/ChartLegendIcon'; -import Rating from '../../sonar-ui-common/components/ui/Rating'; +import ChartLegendIcon from '../../components/icons/ChartLegendIcon'; +import Rating from '../../components/ui/Rating'; import { MeasureHistory } from '../../types/project-activity'; export interface GraphsTooltipsContentIssuesProps { diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsZoom.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsZoom.tsx index b2aee06f7fd..8f171dabacf 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsZoom.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsZoom.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; -import ZoomTimeLine from '../../sonar-ui-common/components/charts/ZoomTimeLine'; +import ZoomTimeLine from '../../components/charts/ZoomTimeLine'; import { Serie } from '../../types/project-activity'; import { hasHistoryData } from './utils'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphHistory-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphHistory-test.tsx index aa6fcc54dd8..a693605fe7b 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphHistory-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphHistory-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import GraphHistory from '../GraphHistory'; import { DEFAULT_GRAPH } from '../utils'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsHistory-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsHistory-test.tsx index b18469949a3..1f84b51d6f3 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsHistory-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsHistory-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import GraphsHistory from '../GraphsHistory'; import { DEFAULT_GRAPH } from '../utils'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendCustom-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendCustom-test.tsx index 5829be3deac..1e6e70dd096 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendCustom-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendCustom-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import GraphsLegendCustom, { GraphsLegendCustomProps } from '../GraphsLegendCustom'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendItem-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendItem-test.tsx index dcac4a82363..fe2425d5e6a 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendItem-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsLegendItem-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { ClearButton } from '../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { ClearButton } from '../../../components/controls/buttons'; +import { click } from '../../../helpers/testUtils'; import GraphsLegendItem from '../GraphsLegendItem'; it('should render correctly a legend', () => { diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltips-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltips-test.tsx index 6bb92900cf5..1358dd2e40f 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltips-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltips-test.tsx @@ -20,8 +20,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; +import { parseDate } from '../../../helpers/dates'; import { mockEvent } from '../../../helpers/testMocks'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; import GraphsTooltips from '../GraphsTooltips'; import { DEFAULT_GRAPH } from '../utils'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentCoverage-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentCoverage-test.tsx index 9f89feeeddd..03bd44c725d 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentCoverage-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentCoverage-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import GraphsTooltipsContentCoverage, { GraphsTooltipsContentCoverageProps } from '../GraphsTooltipsContentCoverage'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentDuplication-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentDuplication-test.tsx index cf994c06583..d8109f78c61 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentDuplication-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentDuplication-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import GraphsTooltipsContentDuplication, { GraphsTooltipsContentDuplicationProps } from '../GraphsTooltipsContentDuplication'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentIssues-test.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentIssues-test.tsx index 635e8fee88a..84c2d59d38c 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentIssues-test.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/GraphsTooltipsContentIssues-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import GraphsTooltipsContentIssues, { GraphsTooltipsContentIssuesProps } from '../GraphsTooltipsContentIssues'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts b/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts index 6e26f2f9e5e..2b1eeca21b6 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as dates from '../../../sonar-ui-common/helpers/dates'; +import * as dates from '../../../helpers/dates'; import { MetricKey } from '../../../types/metrics'; import { GraphType, Serie } from '../../../types/project-activity'; import * as utils from '../utils'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/utils.ts b/server/sonar-web/src/main/js/components/activity-graph/utils.ts index c4b13e1887c..c0d44ce9c41 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/utils.ts +++ b/server/sonar-web/src/main/js/components/activity-graph/utils.ts @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { chunk, flatMap, groupBy, sortBy } from 'lodash'; +import { getLocalizedMetricName, translate } from '../../helpers/l10n'; import { localizeMetric } from '../../helpers/measures'; -import { getLocalizedMetricName, translate } from '../../sonar-ui-common/helpers/l10n'; -import { get, save } from '../../sonar-ui-common/helpers/storage'; +import { get, save } from '../../helpers/storage'; import { MetricKey } from '../../types/metrics'; import { GraphType, MeasureHistory, Serie } from '../../types/project-activity'; diff --git a/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.css b/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.css new file mode 100644 index 00000000000..d71ef2dee96 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.css @@ -0,0 +1,82 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.line-tooltip { + fill: none; + stroke: var(--secondFontColor); + stroke-width: 1px; + shape-rendering: crispEdges; +} + +.chart-mouse-events-overlay { + fill: none; + stroke: none; + pointer-events: all; +} + +.chart-zoomed .line-chart-area { + clip-path: url(#chart-clip); +} + +.chart-zoomed .line-chart-path { + clip-path: url(#chart-clip); +} + +.chart-zoomed .leak-chart-rect { + clip-path: url(#chart-clip); +} + +.line-chart-dot { + fill: var(--blue); +} + +.line-chart-dot.line-chart-dot-1 { + fill: var(--darkBlue); +} + +.line-chart-dot.line-chart-dot-2 { + fill: #24c6e0; +} + +.line-chart-event { + fill: #fff; + stroke: var(--blue); + stroke-width: 2px; +} + +.line-chart-event.VERSION { + stroke: var(--blue); +} + +.line-chart-event.QUALITY_GATE { + stroke: var(--green); +} + +.line-chart-event.QUALITY_PROFILE { + stroke: var(--orange); +} + +.line-chart-event.OTHER { + stroke: var(--purple); +} + +.new-code-legend { + fill: var(--secondFontColor); + font-size: var(--smallFontSize); +} diff --git a/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.tsx b/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.tsx new file mode 100644 index 00000000000..6263de1a6a6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.tsx @@ -0,0 +1,629 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { bisector, extent, max } from 'd3-array'; +import { scaleLinear, scalePoint, scaleTime, ScaleTime } from 'd3-scale'; +import { area, curveBasis, line as d3Line } from 'd3-shape'; +import { flatten, isEqual, sortBy, throttle, uniq } from 'lodash'; +import * as React from 'react'; +import { isDefined } from '../../helpers/types'; +import { Theme, ThemeConsumer } from '../theme'; +import './AdvancedTimeline.css'; +import './LineChart.css'; + +export interface Props { + basisCurve?: boolean; + endDate?: Date; + disableZoom?: boolean; + displayNewCodeLegend?: boolean; + formatYTick?: (tick: number | string) => string; + hideGrid?: boolean; + hideXAxis?: boolean; + height: number; + width: number; + leakPeriodDate?: Date; + // used to avoid same y ticks labels + maxYTicksCount: number; + metricType: string; + padding: number[]; + selectedDate?: Date; + series: T.Chart.Serie[]; + showAreas?: boolean; + startDate?: Date; + updateSelectedDate?: (selectedDate?: Date) => void; + updateTooltip?: (selectedDate?: Date, tooltipXPos?: number, tooltipIdx?: number) => void; + updateZoom?: (start?: Date, endDate?: Date) => void; + zoomSpeed: number; +} + +type XScale = ScaleTime; +// TODO it should be `ScaleLinear | ScalePoint | ScalePoint`, but it's super hard to make it work :'( +type YScale = any; + +const LEGEND_LINE_HEIGHT = 16; + +interface State { + leakLegendTextWidth?: number; + maxXRange: number[]; + mouseOver?: boolean; + selectedDate?: Date; + selectedDateXPos?: number; + selectedDateIdx?: number; + yScale: YScale; + xScale: XScale; +} + +export default class AdvancedTimeline extends React.PureComponent { + static defaultProps = { + eventSize: 8, + maxYTicksCount: 4, + padding: [26, 10, 50, 60], + zoomSpeed: 1 + }; + + constructor(props: Props) { + super(props); + const scales = this.getScales(props); + const selectedDatePos = this.getSelectedDatePos(scales.xScale, props.selectedDate); + this.state = { ...scales, ...selectedDatePos }; + this.updateTooltipPos = throttle(this.updateTooltipPos, 40); + this.handleZoomUpdate = throttle(this.handleZoomUpdate, 40); + } + + componentDidUpdate(prevProps: Props) { + let scales; + let selectedDatePos; + if ( + this.props.metricType !== prevProps.metricType || + this.props.startDate !== prevProps.startDate || + this.props.endDate !== prevProps.endDate || + this.props.width !== prevProps.width || + this.props.padding !== prevProps.padding || + this.props.height !== prevProps.height || + this.props.series !== prevProps.series + ) { + scales = this.getScales(this.props); + if (this.state.selectedDate != null) { + selectedDatePos = this.getSelectedDatePos(scales.xScale, this.state.selectedDate); + } + } + + if (!isEqual(this.props.selectedDate, prevProps.selectedDate)) { + const xScale = scales ? scales.xScale : this.state.xScale; + selectedDatePos = this.getSelectedDatePos(xScale, this.props.selectedDate); + } + + if (scales || selectedDatePos) { + if (scales) { + this.setState({ ...scales }); + } + if (selectedDatePos) { + this.setState({ ...selectedDatePos }); + } + + if (selectedDatePos && this.props.updateTooltip) { + this.props.updateTooltip( + selectedDatePos.selectedDate, + selectedDatePos.selectedDateXPos, + selectedDatePos.selectedDateIdx + ); + } + } + } + + getRatingScale = (availableHeight: number) => { + return scalePoint() + .domain([5, 4, 3, 2, 1]) + .range([availableHeight, 0]); + }; + + getLevelScale = (availableHeight: number) => { + return scalePoint() + .domain(['ERROR', 'WARN', 'OK']) + .range([availableHeight, 0]); + }; + + getYScale = (props: Props, availableHeight: number, flatData: T.Chart.Point[]): YScale => { + if (props.metricType === 'RATING') { + return this.getRatingScale(availableHeight); + } else if (props.metricType === 'LEVEL') { + return this.getLevelScale(availableHeight); + } + return scaleLinear() + .range([availableHeight, 0]) + .domain([0, max(flatData, d => Number(d.y || 0)) || 1]) + .nice(); + }; + + getXScale = ( + { startDate, endDate }: Props, + availableWidth: number, + flatData: T.Chart.Point[] + ) => { + const dateRange = extent(flatData, d => d.x) as [Date, Date]; + const start = startDate && startDate > dateRange[0] ? startDate : dateRange[0]; + const end = endDate && endDate < dateRange[1] ? endDate : dateRange[1]; + const xScale: ScaleTime = scaleTime() + .domain(sortBy([start, end])) + .range([0, availableWidth]) + .clamp(false); + return { + xScale, + maxXRange: dateRange.map(xScale) + }; + }; + + getScales = (props: Props) => { + const availableWidth = props.width - props.padding[1] - props.padding[3]; + const availableHeight = props.height - props.padding[0] - props.padding[2]; + const flatData = flatten(props.series.map(serie => serie.data)); + return { + ...this.getXScale(props, availableWidth, flatData), + yScale: this.getYScale(props, availableHeight, flatData) + }; + }; + + getSelectedDatePos = (xScale: XScale, selectedDate?: Date) => { + const firstSerie = this.props.series[0]; + if (selectedDate && firstSerie) { + const idx = firstSerie.data.findIndex(p => p.x.valueOf() === selectedDate.valueOf()); + const xRange = sortBy(xScale.range()); + const xPos = xScale(selectedDate); + if (idx >= 0 && xPos >= xRange[0] && xPos <= xRange[1]) { + return { + selectedDate, + selectedDateXPos: xScale(selectedDate), + selectedDateIdx: idx + }; + } + } + return { selectedDate: undefined, selectedDateXPos: undefined, selectedDateIdx: undefined }; + }; + + getEventMarker = (size: number) => { + const half = size / 2; + return `M${half} 0 L${size} ${half} L ${half} ${size} L0 ${half} L${half} 0 L${size} ${half}`; + }; + + handleWheel = (event: React.WheelEvent) => { + event.preventDefault(); + const { maxXRange, xScale } = this.state; + const parentBbox = event.currentTarget.getBoundingClientRect(); + const mouseXPos = (event.pageX - parentBbox.left) / parentBbox.width; + const xRange = xScale.range(); + + const speed = event.deltaMode + ? (25 / event.deltaMode) * this.props.zoomSpeed + : this.props.zoomSpeed; + const leftPos = xRange[0] - Math.round(speed * event.deltaY * mouseXPos); + const rightPos = xRange[1] + Math.round(speed * event.deltaY * (1 - mouseXPos)); + const startDate = leftPos > maxXRange[0] ? xScale.invert(leftPos) : undefined; + const endDate = rightPos < maxXRange[1] ? xScale.invert(rightPos) : undefined; + this.handleZoomUpdate(startDate, endDate); + }; + + handleZoomUpdate = (startDate?: Date, endDate?: Date) => { + if (this.props.updateZoom) { + this.props.updateZoom(startDate, endDate); + } + }; + + handleMouseMove = (event: React.MouseEvent) => { + const parentBbox = event.currentTarget.getBoundingClientRect(); + this.updateTooltipPos(event.pageX - parentBbox.left); + }; + + handleMouseEnter = () => { + this.setState({ mouseOver: true }); + }; + + handleMouseOut = () => { + const { updateTooltip } = this.props; + if (updateTooltip) { + this.setState({ + mouseOver: false, + selectedDate: undefined, + selectedDateXPos: undefined, + selectedDateIdx: undefined + }); + updateTooltip(undefined, undefined, undefined); + } + }; + + handleClick = () => { + const { updateSelectedDate } = this.props; + if (updateSelectedDate) { + updateSelectedDate(this.state.selectedDate || undefined); + } + }; + + setLeakLegendTextWidth = (node: SVGTextElement | null) => { + if (node) { + this.setState({ leakLegendTextWidth: node.getBoundingClientRect().width }); + } + }; + + updateTooltipPos = (xPos: number) => { + this.setState(state => { + const firstSerie = this.props.series[0]; + if (state.mouseOver && firstSerie) { + const { updateTooltip } = this.props; + const date = state.xScale.invert(xPos); + const bisectX = bisector(d => d.x).right; + let idx = bisectX(firstSerie.data, date); + if (idx >= 0) { + const previousPoint = firstSerie.data[idx - 1]; + const nextPoint = firstSerie.data[idx]; + if ( + !nextPoint || + (previousPoint && + date.valueOf() - previousPoint.x.valueOf() <= nextPoint.x.valueOf() - date.valueOf()) + ) { + idx--; + } + const selectedDate = firstSerie.data[idx].x; + const xPos = state.xScale(selectedDate); + if (updateTooltip) { + updateTooltip(selectedDate, xPos, idx); + } + return { selectedDate, selectedDateXPos: xPos, selectedDateIdx: idx }; + } + } + return null; + }); + }; + + renderHorizontalGrid = () => { + const { formatYTick } = this.props; + const { xScale, yScale } = this.state; + const hasTicks = typeof yScale.ticks === 'function'; + let ticks: Array = hasTicks + ? yScale.ticks(this.props.maxYTicksCount) + : yScale.domain(); + + if (!ticks.length) { + ticks.push(yScale.domain()[1]); + } + + // if there are duplicated ticks, that means 4 ticks are too much for this data + // so let's just use the domain values (min and max) + if (formatYTick) { + const formattedTicks = ticks.map(tick => formatYTick(tick)); + if (ticks.length > uniq(formattedTicks).length) { + ticks = yScale.domain(); + } + } + + return ( + + {ticks.map(tick => ( + + {formatYTick != null && ( + + {formatYTick(tick)} + + )} + + + ))} + + ); + }; + + renderXAxisTicks = () => { + const { xScale, yScale } = this.state; + const format = xScale.tickFormat(7); + const ticks = xScale.ticks(7); + const y = yScale.range()[0]; + return ( + + {ticks.slice(0, -1).map((tick, index) => { + const nextTick = index + 1 < ticks.length ? ticks[index + 1] : xScale.domain()[1]; + const x = (xScale(tick) + xScale(nextTick)) / 2; + return ( + + {format(tick)} + + ); + })} + + ); + }; + + renderNewCodeLegend = (params: { leakStart: number; leakWidth: number; theme: Theme }) => { + const { leakStart, leakWidth, theme } = params; + const { leakLegendTextWidth, xScale, yScale } = this.state; + const yRange = yScale.range(); + const xRange = xScale.range(); + + const legendMinWidth = (leakLegendTextWidth || 0) + theme.rawSizes.grid; + const legendPadding = theme.rawSizes.grid / 2; + + let legendBackgroundPosition; + let legendBackgroundWidth; + let legendMargin; + let legendPosition; + let legendTextAnchor; + + if (leakWidth >= legendMinWidth) { + legendBackgroundWidth = leakWidth; + legendBackgroundPosition = leakStart; + legendMargin = 0; + legendPosition = legendBackgroundPosition + legendPadding; + legendTextAnchor = 'start'; + } else { + legendBackgroundWidth = legendMinWidth; + legendBackgroundPosition = xRange[xRange.length - 1] - legendBackgroundWidth; + legendMargin = theme.rawSizes.grid / 2; + legendPosition = xRange[xRange.length - 1] - legendPadding; + legendTextAnchor = 'end'; + } + + return ( + <> + + + new code + + + ); + }; + + renderLeak = () => { + const { displayNewCodeLegend, leakPeriodDate } = this.props; + if (!leakPeriodDate) { + return null; + } + const { xScale, yScale } = this.state; + const yRange = yScale.range(); + const xRange = xScale.range(); + + // truncate leak to start of chart to prevent weird visual artifacts when too far left + // (occurs when leak starts a long time before first analysis) + const leakStart = Math.max(xScale(leakPeriodDate), xRange[0]); + + const leakWidth = xRange[xRange.length - 1] - leakStart; + if (leakWidth < 1) { + return null; + } + + return ( + + {theme => ( + <> + {displayNewCodeLegend && this.renderNewCodeLegend({ leakStart, leakWidth, theme })} + + + )} + + ); + }; + + renderLines = () => { + const lineGenerator = d3Line() + .defined(d => Boolean(d.y || d.y === 0)) + .x(d => this.state.xScale(d.x)) + .y(d => this.state.yScale(d.y)); + if (this.props.basisCurve) { + lineGenerator.curve(curveBasis); + } + return ( + + {this.props.series.map((serie, idx) => ( + + ))} + + ); + }; + + renderDots = () => { + return ( + + {this.props.series + .map((serie, serieIdx) => + serie.data + .map((point, idx) => { + const pointNotDefined = !point.y && point.y !== 0; + const hasPointBefore = + serie.data[idx - 1] && (serie.data[idx - 1].y || serie.data[idx - 1].y === 0); + const hasPointAfter = + serie.data[idx + 1] && (serie.data[idx + 1].y || serie.data[idx + 1].y === 0); + if (pointNotDefined || hasPointBefore || hasPointAfter) { + return undefined; + } + return ( + + ); + }) + .filter(isDefined) + ) + .filter(dots => dots.length > 0)} + + ); + }; + + renderAreas = () => { + const areaGenerator = area() + .defined(d => Boolean(d.y || d.y === 0)) + .x(d => this.state.xScale(d.x)) + .y1(d => this.state.yScale(d.y)) + .y0(this.state.yScale(0)); + if (this.props.basisCurve) { + areaGenerator.curve(curveBasis); + } + return ( + + {this.props.series.map((serie, idx) => ( + + ))} + + ); + }; + + renderSelectedDate = () => { + const { selectedDateIdx, selectedDateXPos, yScale } = this.state; + const firstSerie = this.props.series[0]; + if (selectedDateIdx == null || selectedDateXPos == null || !firstSerie) { + return null; + } + + return ( + + + {this.props.series.map((serie, idx) => { + const point = serie.data[selectedDateIdx]; + if (!point || (!point.y && point.y !== 0)) { + return null; + } + return ( + + ); + })} + + ); + }; + + renderClipPath = () => { + return ( + + + + + + ); + }; + + renderMouseEventsOverlay = (zoomEnabled: boolean) => { + const mouseEvents: Partial> = {}; + if (zoomEnabled) { + mouseEvents.onWheel = this.handleWheel; + } + if (this.props.updateTooltip) { + mouseEvents.onMouseEnter = this.handleMouseEnter; + mouseEvents.onMouseMove = this.handleMouseMove; + mouseEvents.onMouseOut = this.handleMouseOut; + } + if (this.props.updateSelectedDate) { + mouseEvents.onClick = this.handleClick; + } + return ( + + ); + }; + + render() { + if (!this.props.width || !this.props.height) { + return
; + } + const zoomEnabled = !this.props.disableZoom && this.props.updateZoom != null; + const isZoomed = Boolean(this.props.startDate || this.props.endDate); + return ( + + {zoomEnabled && this.renderClipPath()} + + {this.props.leakPeriodDate != null && this.renderLeak()} + {!this.props.hideGrid && this.renderHorizontalGrid()} + {!this.props.hideXAxis && this.renderXAxisTicks()} + {this.props.showAreas && this.renderAreas()} + {this.renderLines()} + {this.renderDots()} + {this.renderSelectedDate()} + {this.renderMouseEventsOverlay(zoomEnabled)} + + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/charts/BarChart.css b/server/sonar-web/src/main/js/components/charts/BarChart.css new file mode 100644 index 00000000000..849885a4cda --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/BarChart.css @@ -0,0 +1,28 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.bar-chart-bar { + fill: var(--blue); +} + +.bar-chart-tick { + fill: var(--secondFontColor); + font-size: var(--smallFontSize); + text-anchor: middle; +} diff --git a/server/sonar-web/src/main/js/components/charts/BarChart.tsx b/server/sonar-web/src/main/js/components/charts/BarChart.tsx new file mode 100644 index 00000000000..210dc3acf0a --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/BarChart.tsx @@ -0,0 +1,176 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { max } from 'd3-array'; +import { scaleBand, ScaleBand, scaleLinear, ScaleLinear } from 'd3-scale'; +import * as React from 'react'; +import Tooltip from '../controls/Tooltip'; +import './BarChart.css'; + +interface DataPoint { + tooltip?: React.ReactNode; + x: number; + y: number; +} + +interface Props { + barsWidth: number; + data: Array; + height: number; + onBarClick?: (point: DataPoint & T) => void; + padding?: [number, number, number, number]; + width: number; + xTicks?: string[]; + xValues?: string[]; +} + +export default class BarChart extends React.PureComponent> { + handleClick = (point: DataPoint & T) => { + if (this.props.onBarClick) { + this.props.onBarClick(point); + } + }; + + renderXTicks = (xScale: ScaleBand, yScale: ScaleLinear) => { + const { data, xTicks = [] } = this.props; + + if (!xTicks.length) { + return null; + } + + const ticks = xTicks.map((tick, index) => { + const point = data[index]; + const x = Math.round((xScale(point.x) as number) + xScale.bandwidth() / 2); + const y = yScale.range()[0]; + const d = data[index]; + const text = ( + this.handleClick(point)} + style={{ cursor: this.props.onBarClick ? 'pointer' : 'default' }} + x={x} + y={y}> + {tick} + + ); + return ( + // eslint-disable-next-line react/no-array-index-key + + {text} + + ); + }); + return {ticks}; + }; + + renderXValues = (xScale: ScaleBand, yScale: ScaleLinear) => { + const { data, xValues = [] } = this.props; + + if (!xValues.length) { + return null; + } + + const ticks = xValues.map((value, index) => { + const point = data[index]; + const x = Math.round((xScale(point.x) as number) + xScale.bandwidth() / 2); + const y = yScale(point.y); + const text = ( + this.handleClick(point)} + style={{ cursor: this.props.onBarClick ? 'pointer' : 'default' }} + x={x} + y={y}> + {value} + + ); + return ( + // eslint-disable-next-line react/no-array-index-key + + {text} + + ); + }); + return {ticks}; + }; + + renderBars = (xScale: ScaleBand, yScale: ScaleLinear) => { + const bars = this.props.data.map((point, index) => { + const x = Math.round(xScale(point.x) as number); + const maxY = yScale.range()[0]; + const y = Math.round(yScale(point.y)) - /* minimum bar height */ 1; + const height = maxY - y; + const rect = ( + this.handleClick(point)} + style={{ cursor: this.props.onBarClick ? 'pointer' : 'default' }} + width={this.props.barsWidth} + x={x} + y={y} + /> + ); + return ( + // eslint-disable-next-line react/no-array-index-key + + {rect} + + ); + }); + return {bars}; + }; + + render() { + const { barsWidth, data, width, height, padding = [10, 10, 10, 10] } = this.props; + + const availableWidth = width - padding[1] - padding[3]; + const availableHeight = height - padding[0] - padding[2]; + + const innerPadding = (availableWidth - barsWidth * data.length) / (data.length - 1); + const relativeInnerPadding = innerPadding / (innerPadding + barsWidth); + + const maxY = max(data, d => d.y) as number; + const xScale = scaleBand() + .domain(data.map(d => d.x)) + .range([0, availableWidth]) + .paddingInner(relativeInnerPadding); + const yScale = scaleLinear() + .domain([0, maxY]) + .range([availableHeight, 0]); + + return ( + + + {this.renderXTicks(xScale, yScale)} + {this.renderXValues(xScale, yScale)} + {this.renderBars(xScale, yScale)} + + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/charts/BubbleChart.css b/server/sonar-web/src/main/js/components/charts/BubbleChart.css new file mode 100644 index 00000000000..c5faa9af5a1 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/BubbleChart.css @@ -0,0 +1,56 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.bubble-chart text { + user-select: none; +} + +.bubble-chart-bubble { + fill: var(--blue); + fill-opacity: 0.2; + stroke: var(--blue); + cursor: pointer; + transition: fill-opacity 0.2s ease; +} + +.bubble-chart-bubble:hover { + fill-opacity: 0.8; +} + +.bubble-chart-grid { + shape-rendering: crispedges; + stroke: #eee; +} + +.bubble-chart-tick { + fill: var(--secondFontColor); + font-size: var(--smallFontSize); + text-anchor: middle; +} + +.bubble-chart-tick-y { + text-anchor: end; +} + +.bubble-chart-zoom { + position: absolute; + right: 20px; + top: 20px; + z-index: var(--aboveNormalZIndex); +} diff --git a/server/sonar-web/src/main/js/components/charts/BubbleChart.tsx b/server/sonar-web/src/main/js/components/charts/BubbleChart.tsx new file mode 100644 index 00000000000..75d3172ea80 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/BubbleChart.tsx @@ -0,0 +1,390 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { max, min } from 'd3-array'; +import { scaleLinear, ScaleLinear } from 'd3-scale'; +import { event, select } from 'd3-selection'; +import { zoom, ZoomBehavior, zoomIdentity } from 'd3-zoom'; +import { sortBy, uniq } from 'lodash'; +import * as React from 'react'; +import { Link } from 'react-router'; +import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; +import { translate } from '../../helpers/l10n'; +import { Location } from '../../helpers/urls'; +import Tooltip from '../controls/Tooltip'; +import './BubbleChart.css'; + +const TICKS_COUNT = 5; + +interface BubbleItem { + color?: string; + key?: string; + link?: string | Location; + data?: T; + size: number; + tooltip?: React.ReactNode; + x: number; + y: number; +} + +interface Props { + displayXGrid?: boolean; + displayXTicks?: boolean; + displayYGrid?: boolean; + displayYTicks?: boolean; + formatXTick: (tick: number) => string; + formatYTick: (tick: number) => string; + height: number; + items: BubbleItem[]; + onBubbleClick?: (ref?: T) => void; + padding: [number, number, number, number]; + sizeDomain?: [number, number]; + sizeRange?: [number, number]; + xDomain?: [number, number]; + yDomain?: [number, number]; +} + +interface State { + transform: { x: number; y: number; k: number }; +} + +type Scale = ScaleLinear; + +export default class BubbleChart extends React.PureComponent, State> { + private node?: Element; + private zoom?: ZoomBehavior; + + static defaultProps = { + displayXGrid: true, + displayXTicks: true, + displayYGrid: true, + displayYTicks: true, + formatXTick: (d: number) => String(d), + formatYTick: (d: number) => String(d), + padding: [10, 10, 10, 10], + sizeRange: [5, 45] + }; + + constructor(props: Props) { + super(props); + this.state = { transform: { x: 0, y: 0, k: 1 } }; + } + + componentDidUpdate() { + if (this.zoom && this.node) { + const rect = this.node.getBoundingClientRect(); + this.zoom.translateExtent([ + [0, 0], + [rect.width, rect.height] + ]); + } + } + + boundNode = (node: SVGSVGElement) => { + this.node = node; + this.zoom = zoom() + .scaleExtent([1, 10]) + .on('zoom', this.zoomed); + // TODO: Check why as any cast is necessary now. + select(this.node).call(this.zoom as any); + }; + + zoomed = () => { + const { padding } = this.props; + const { x, y, k } = event.transform as { x: number; y: number; k: number }; + this.setState({ + transform: { + x: x + padding[3] * (k - 1), + y: y + padding[0] * (k - 1), + k + } + }); + }; + + resetZoom = (event: React.MouseEvent) => { + event.stopPropagation(); + event.preventDefault(); + if (this.zoom && this.node) { + // TODO: Check why as any cast is necessary now. + select(this.node).call(this.zoom.transform as any, zoomIdentity); + } + }; + + getXRange(xScale: Scale, sizeScale: Scale, availableWidth: number) { + const minX = min(this.props.items, d => xScale(d.x) - sizeScale(d.size)) || 0; + const maxX = max(this.props.items, d => xScale(d.x) + sizeScale(d.size)) || 0; + const dMinX = minX < 0 ? xScale.range()[0] - minX : xScale.range()[0]; + const dMaxX = maxX > xScale.range()[1] ? maxX - xScale.range()[1] : 0; + return [dMinX, availableWidth - dMaxX]; + } + + getYRange(yScale: Scale, sizeScale: Scale, availableHeight: number) { + const minY = min(this.props.items, d => yScale(d.y) - sizeScale(d.size)) || 0; + const maxY = max(this.props.items, d => yScale(d.y) + sizeScale(d.size)) || 0; + const dMinY = minY < 0 ? yScale.range()[1] - minY : yScale.range()[1]; + const dMaxY = maxY > yScale.range()[0] ? maxY - yScale.range()[0] : 0; + return [availableHeight - dMaxY, dMinY]; + } + + getTicks(scale: Scale, format: (d: number) => string) { + const zoom = Math.ceil(this.state.transform.k); + const ticks = scale.ticks(TICKS_COUNT * zoom).map(tick => format(tick)); + const uniqueTicksCount = uniq(ticks).length; + const ticksCount = + uniqueTicksCount < TICKS_COUNT * zoom ? uniqueTicksCount - 1 : TICKS_COUNT * zoom; + return scale.ticks(ticksCount); + } + + getZoomLevelLabel = () => Math.floor(this.state.transform.k * 100) + '%'; + + renderXGrid = (ticks: number[], xScale: Scale, yScale: Scale) => { + if (!this.props.displayXGrid) { + return null; + } + + const { transform } = this.state; + const lines = ticks.map((tick, index) => { + const x = xScale(tick); + const y1 = yScale.range()[0]; + const y2 = yScale.range()[1]; + return ( + 1 ? 0 : y2} + /> + ); + }); + + return {lines}; + }; + + renderYGrid = (ticks: number[], xScale: Scale, yScale: Scale) => { + if (!this.props.displayYGrid) { + return null; + } + + const { transform } = this.state; + const lines = ticks.map((tick, index) => { + const y = yScale(tick); + const x1 = xScale.range()[0]; + const x2 = xScale.range()[1]; + return ( + 1 ? 0 : x1} + x2={x2 * transform.k} + y1={y * transform.k + transform.y} + y2={y * transform.k + transform.y} + /> + ); + }); + + return {lines}; + }; + + renderXTicks = (xTicks: number[], xScale: Scale, yScale: Scale) => { + if (!this.props.displayXTicks) { + return null; + } + + const { transform } = this.state; + const ticks = xTicks.map((tick, index) => { + const x = xScale(tick) * transform.k + transform.x; + const y = yScale.range()[0]; + const innerText = this.props.formatXTick(tick); + // as we modified the `x` using `transform`, check that it is inside the range again + return x > 0 && x < xScale.range()[1] ? ( + // eslint-disable-next-line react/no-array-index-key + + {innerText} + + ) : null; + }); + + return {ticks}; + }; + + renderYTicks = (yTicks: number[], xScale: Scale, yScale: Scale) => { + if (!this.props.displayYTicks) { + return null; + } + + const { transform } = this.state; + const ticks = yTicks.map((tick, index) => { + const x = xScale.range()[0]; + const y = yScale(tick) * transform.k + transform.y; + const innerText = this.props.formatYTick(tick); + // as we modified the `y` using `transform`, check that it is inside the range again + return y > 0 && y < yScale.range()[0] ? ( + + {innerText} + + ) : null; + }); + + return {ticks}; + }; + + renderChart = (width: number) => { + const { transform } = this.state; + const availableWidth = width - this.props.padding[1] - this.props.padding[3]; + const availableHeight = this.props.height - this.props.padding[0] - this.props.padding[2]; + + const xScale = scaleLinear() + .domain(this.props.xDomain || [0, max(this.props.items, d => d.x) || 0]) + .range([0, availableWidth]) + .nice(); + const yScale = scaleLinear() + .domain(this.props.yDomain || [0, max(this.props.items, d => d.y) || 0]) + .range([availableHeight, 0]) + .nice(); + const sizeScale = scaleLinear() + .domain(this.props.sizeDomain || [0, max(this.props.items, d => d.size) || 0]) + .range(this.props.sizeRange || []); + + const xScaleOriginal = xScale.copy(); + const yScaleOriginal = yScale.copy(); + + xScale.range(this.getXRange(xScale, sizeScale, availableWidth)); + yScale.range(this.getYRange(yScale, sizeScale, availableHeight)); + + const bubbles = sortBy(this.props.items, b => -b.size).map((item, index) => { + return ( + + ); + }); + + const xTicks = this.getTicks(xScale, this.props.formatXTick); + const yTicks = this.getTicks(yScale, this.props.formatYTick); + + return ( + + + + + + + + + {this.renderXGrid(xTicks, xScale, yScale)} + {this.renderYGrid(yTicks, xScale, yScale)} + + {bubbles} + + + {this.renderXTicks(xTicks, xScale, yScaleOriginal)} + {this.renderYTicks(yTicks, xScaleOriginal, yScale)} + + + ); + }; + + render() { + return ( +
+
+ + + {this.getZoomLevelLabel()} + + +
+ {size => this.renderChart(size.width)} +
+ ); + } +} + +interface BubbleProps { + color?: string; + link?: string | Location; + onClick?: (ref?: T) => void; + data?: T; + r: number; + scale: number; + tooltip?: string | React.ReactNode; + x: number; + y: number; +} + +function Bubble(props: BubbleProps) { + const handleClick = (event: React.MouseEvent) => { + if (props.onClick) { + event.stopPropagation(); + event.preventDefault(); + props.onClick(props.data); + } + }; + + let circle = ( + + ); + + if (props.link && !props.onClick) { + circle = {circle}; + } + + return ( + + {circle} + + ); +} diff --git a/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx b/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx index 67605e1db0e..8dc53e8e0dd 100644 --- a/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx +++ b/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx @@ -20,7 +20,7 @@ import * as classNames from 'classnames'; import { ScaleLinear, ScaleOrdinal } from 'd3-scale'; import * as React from 'react'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import { formatMeasure } from '../../helpers/measures'; import './ColorBoxLegend.css'; interface Props { diff --git a/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.css b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.css new file mode 100644 index 00000000000..a6c96275921 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.css @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.gradient-legend-text, +.gradient-legend-na { + text-anchor: middle; + fill: var(--secondFontColor); + font-size: 10px; +} + +.gradient-legend-text:first-of-type { + text-anchor: start; +} + +.gradient-legend-text:last-of-type { + text-anchor: end; +} diff --git a/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.tsx b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.tsx new file mode 100644 index 00000000000..9cfc0f92203 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.tsx @@ -0,0 +1,133 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { ScaleLinear, ScaleOrdinal } from 'd3-scale'; +import * as React from 'react'; +import { ThemeConsumer } from '../theme'; +import './ColorGradientLegend.css'; + +interface Props { + className?: string; + colorScale: + | ScaleOrdinal // used for LEVEL type + | ScaleLinear; // used for RATING or PERCENT type + height: number; + padding?: [number, number, number, number]; + showColorNA?: boolean; + width: number; +} + +const NA_SPACING = 4; +const NA_GRADIENT_LINE_INCREMENTS = [0, 8, 16, 24]; + +export default function ColorGradientLegend({ + className, + colorScale, + padding = [12, 24, 0, 0], + height, + showColorNA = false, + width +}: Props) { + const colorRange: Array = colorScale.range(); + const colorDomain: Array = colorScale.domain(); + const lastColorIdx = colorRange.length - 1; + const lastDomainIdx = colorDomain.length - 1; + const widthNoPadding = width - padding[1]; + const rectHeight = height - padding[0]; + return ( + + {({ colors }) => ( + + + + {colorRange.map((color, idx) => ( + // eslint-disable-next-line react/no-array-index-key + + ))} + + + + {NA_GRADIENT_LINE_INCREMENTS.map(i => ( + + + + + ))} + + + + + {colorDomain.map((d, idx) => ( + + {d} + + ))} + + {showColorNA && ( + + + + N/A + + + )} + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/charts/ColorRatingsLegend.tsx b/server/sonar-web/src/main/js/components/charts/ColorRatingsLegend.tsx index cce95472cc0..b51b8b3e9b0 100644 --- a/server/sonar-web/src/main/js/components/charts/ColorRatingsLegend.tsx +++ b/server/sonar-web/src/main/js/components/charts/ColorRatingsLegend.tsx @@ -19,11 +19,11 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import { ButtonLink } from '../../components/controls/buttons'; +import Tooltip from '../../components/controls/Tooltip'; import { RATING_COLORS } from '../../helpers/constants'; -import { ButtonLink } from '../../sonar-ui-common/components/controls/buttons'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import { translate } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; import './ColorBoxLegend.css'; export interface ColorRatingsLegendProps { diff --git a/server/sonar-web/src/main/js/components/charts/DonutChart.tsx b/server/sonar-web/src/main/js/components/charts/DonutChart.tsx new file mode 100644 index 00000000000..223e0c26cf8 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/DonutChart.tsx @@ -0,0 +1,89 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { arc as d3Arc, pie as d3Pie, PieArcDatum } from 'd3-shape'; +import * as React from 'react'; + +interface DataPoint { + fill: string; + value: number; +} + +export interface DonutChartProps { + data: DataPoint[]; + height: number; + padAngle?: number; + padding?: [number, number, number, number]; + thickness: number; + width: number; +} + +export default function DonutChart(props: DonutChartProps) { + const { height, padding = [0, 0, 0, 0], width } = props; + + const availableWidth = width - padding[1] - padding[3]; + const availableHeight = height - padding[0] - padding[2]; + + const size = Math.min(availableWidth, availableHeight); + const radius = Math.floor(size / 2); + + const pie = d3Pie() + .sort(null) + .value(d => d.value); + + if (props.padAngle !== undefined) { + pie.padAngle(props.padAngle); + } + + const sectors = pie(props.data).map((d, i) => { + return ( + + ); + }); + + return ( + + + {sectors} + + + ); +} + +interface SectorProps { + data: PieArcDatum; + fill: string; + radius: number; + thickness: number; +} + +function Sector(props: SectorProps) { + const arc = d3Arc>() + .outerRadius(props.radius) + .innerRadius(props.radius - props.thickness); + const d = arc(props.data) as string; + return ; +} diff --git a/server/sonar-web/src/main/js/components/charts/Histogram.css b/server/sonar-web/src/main/js/components/charts/Histogram.css new file mode 100644 index 00000000000..8ca78c53e4b --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/Histogram.css @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.histogram-tick { + text-anchor: end; +} + +.histogram-tick-start { + text-anchor: start; +} + +.histogram-value { + text-anchor: start; +} diff --git a/server/sonar-web/src/main/js/components/charts/Histogram.tsx b/server/sonar-web/src/main/js/components/charts/Histogram.tsx new file mode 100644 index 00000000000..a4ae509a2ef --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/Histogram.tsx @@ -0,0 +1,139 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { max } from 'd3-array'; +import { scaleBand, ScaleBand, scaleLinear, ScaleLinear } from 'd3-scale'; +import * as React from 'react'; +import Tooltip from '../controls/Tooltip'; +import './BarChart.css'; +import './Histogram.css'; + +interface Props { + alignTicks?: boolean; + bars: number[]; + height: number; + padding?: [number, number, number, number]; + yTicks?: string[]; + yTooltips?: string[]; + yValues?: string[]; + width: number; +} + +const BAR_HEIGHT = 10; +const DEFAULT_PADDING = [10, 10, 10, 10]; + +type XScale = ScaleLinear; +type YScale = ScaleBand; + +export default class Histogram extends React.PureComponent { + renderBar(d: number, index: number, xScale: XScale, yScale: YScale) { + const { alignTicks, padding = DEFAULT_PADDING } = this.props; + + const width = Math.round(xScale(d)) + /* minimum bar width */ 1; + const x = xScale.range()[0] + (alignTicks ? padding[3] : 0); + const y = Math.round(yScale(index)! + yScale.bandwidth() / 2); + + return ; + } + + renderValue(d: number, index: number, xScale: XScale, yScale: YScale) { + const { alignTicks, padding = DEFAULT_PADDING, yValues } = this.props; + + const value = yValues && yValues[index]; + + if (!value) { + return null; + } + + const x = xScale(d) + (alignTicks ? padding[3] : 0); + const y = Math.round(yScale(index)! + yScale.bandwidth() / 2 + BAR_HEIGHT / 2); + + return ( + + + {value} + + + ); + } + + renderTick(index: number, xScale: XScale, yScale: YScale) { + const { alignTicks, yTicks } = this.props; + + const tick = yTicks && yTicks[index]; + + if (!tick) { + return null; + } + + const x = xScale.range()[0]; + const y = Math.round(yScale(index)! + yScale.bandwidth() / 2 + BAR_HEIGHT / 2); + const historyTickClass = alignTicks ? 'histogram-tick-start' : 'histogram-tick'; + + return ( + + {tick} + + ); + } + + renderBars(xScale: XScale, yScale: YScale) { + return ( + + {this.props.bars.map((d, index) => { + return ( + // eslint-disable-next-line react/no-array-index-key + + {this.renderBar(d, index, xScale, yScale)} + {this.renderValue(d, index, xScale, yScale)} + {this.renderTick(index, xScale, yScale)} + + ); + })} + + ); + } + + render() { + const { bars, width, height, padding = DEFAULT_PADDING } = this.props; + + const availableWidth = width - padding[1] - padding[3]; + const xScale: XScale = scaleLinear() + .domain([0, max(bars)!]) + .range([0, availableWidth]); + + const availableHeight = height - padding[0] - padding[2]; + const yScale: YScale = scaleBand() + .domain(bars.map((_, index) => index)) + .rangeRound([0, availableHeight]); + + return ( + + + {this.renderBars(xScale, yScale)} + + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx b/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx index f603b34a89e..c8dba29b8be 100644 --- a/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx +++ b/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx @@ -19,9 +19,9 @@ */ import { sortBy } from 'lodash'; import * as React from 'react'; -import Histogram from '../../sonar-ui-common/components/charts/Histogram'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import Histogram from '../../components/charts/Histogram'; +import { translate } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; interface Props { alignTicks?: boolean; diff --git a/server/sonar-web/src/main/js/components/charts/LineChart.css b/server/sonar-web/src/main/js/components/charts/LineChart.css new file mode 100644 index 00000000000..37d7f95698c --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/LineChart.css @@ -0,0 +1,69 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.line-chart-path { + fill: none; + stroke: var(--blue); + stroke-width: 2px; +} + +.line-chart-path.line-chart-path-1 { + stroke: var(--darkBlue); +} + +.line-chart-path.line-chart-path-2 { + stroke: #24c6e0; +} + +.line-chart-area { + fill: rgba(75, 159, 213, 0.3); + stroke-width: 0; +} + +.line-chart-area.line-chart-area-1 { + fill: rgba(35, 106, 151, 0.3); +} + +.line-chart-area.line-chart-area-2 { + fill: rgba(36, 198, 224, 0.3); +} + +.line-chart-point { + fill: #fff; + stroke: var(--blue); + stroke-width: 2px; +} + +.line-chart-tick { + fill: var(--secondFontColor); + font-size: var(--smallFontSize); +} + +.line-chart-tick-x { + text-anchor: end; +} + +.line-chart-tick-x-right { + text-anchor: start; +} + +.line-chart-grid { + shape-rendering: crispedges; + stroke: #eee; +} diff --git a/server/sonar-web/src/main/js/components/charts/LineChart.tsx b/server/sonar-web/src/main/js/components/charts/LineChart.tsx new file mode 100644 index 00000000000..9cf7f76623b --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/LineChart.tsx @@ -0,0 +1,199 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { extent, max } from 'd3-array'; +import { scaleLinear, ScaleLinear } from 'd3-scale'; +import { area as d3Area, curveBasis, line as d3Line } from 'd3-shape'; +import * as React from 'react'; +import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; +import './LineChart.css'; + +interface DataPoint { + x: number; + y?: number; +} + +interface Props { + backdropConstraints?: [number, number]; + data: DataPoint[]; + displayBackdrop?: boolean; + displayPoints?: boolean; + displayVerticalGrid?: boolean; + domain?: [number, number]; + height: number; + padding?: [number, number, number, number]; + width?: number; + xTicks?: {}[]; + xValues?: {}[]; +} + +export default class LineChart extends React.PureComponent { + renderBackdrop(xScale: ScaleLinear, yScale: ScaleLinear) { + const { displayBackdrop = true } = this.props; + + if (!displayBackdrop) { + return null; + } + + const area = d3Area() + .x(d => xScale(d.x)) + .y0(yScale.range()[0]) + .y1(d => yScale(d.y || 0)) + .defined(d => d.y != null) + .curve(curveBasis); + + let { data } = this.props; + if (this.props.backdropConstraints) { + const c = this.props.backdropConstraints; + data = data.filter(d => c[0] <= d.x && d.x <= c[1]); + } + + return ; + } + + renderPoints(xScale: ScaleLinear, yScale: ScaleLinear) { + const { displayPoints = true } = this.props; + + if (!displayPoints) { + return null; + } + + const points = this.props.data + .filter(point => point.y != null) + .map((point, index) => { + const x = xScale(point.x); + const y = yScale(point.y || 0); + // eslint-disable-next-line react/no-array-index-key + return ; + }); + return {points}; + } + + renderVerticalGrid(xScale: ScaleLinear, yScale: ScaleLinear) { + const { displayVerticalGrid = true } = this.props; + + if (!displayVerticalGrid) { + return null; + } + + const lines = this.props.data.map((point, index) => { + const x = xScale(point.x); + const y1 = yScale.range()[0]; + const y2 = yScale(point.y || 0); + // eslint-disable-next-line react/no-array-index-key + return ; + }); + return {lines}; + } + + renderXTicks(xScale: ScaleLinear, yScale: ScaleLinear) { + const { xTicks = [] } = this.props; + + if (!xTicks.length) { + return null; + } + + const ticks = xTicks.map((tick, index) => { + const point = this.props.data[index]; + const x = xScale(point.x); + const y = yScale.range()[0]; + return ( + // eslint-disable-next-line react/no-array-index-key + + {tick} + + ); + }); + return {ticks}; + } + + renderXValues(xScale: ScaleLinear, yScale: ScaleLinear) { + const { xValues = [] } = this.props; + + if (!xValues.length) { + return null; + } + + const ticks = xValues.map((value, index) => { + const point = this.props.data[index]; + const x = xScale(point.x); + const y = yScale(point.y || 0); + return ( + // eslint-disable-next-line react/no-array-index-key + + {value} + + ); + }); + return {ticks}; + } + + renderLine(xScale: ScaleLinear, yScale: ScaleLinear) { + const p = d3Line() + .x(d => xScale(d.x)) + .y(d => yScale(d.y || 0)) + .defined(d => d.y != null) + .curve(curveBasis); + return ; + } + + renderChart = (width: number) => { + const { height, padding = [10, 10, 10, 10] } = this.props; + + if (!width || !height) { + return
; + } + + const availableWidth = width - padding[1] - padding[3]; + const availableHeight = height - padding[0] - padding[2]; + + const xScale = scaleLinear() + .domain(extent(this.props.data, d => d.x) as [number, number]) + .range([0, availableWidth]); + const yScale = scaleLinear().range([availableHeight, 0]); + + if (this.props.domain) { + yScale.domain(this.props.domain); + } else { + const maxY = max(this.props.data, d => d.y) as number; + yScale.domain([0, maxY]); + } + + return ( + + + {this.renderVerticalGrid(xScale, yScale)} + {this.renderBackdrop(xScale, yScale)} + {this.renderLine(xScale, yScale)} + {this.renderPoints(xScale, yScale)} + {this.renderXTicks(xScale, yScale)} + {this.renderXValues(xScale, yScale)} + + + ); + }; + + render() { + return this.props.width !== undefined ? ( + this.renderChart(this.props.width) + ) : ( + {size => this.renderChart(size.width)} + ); + } +} diff --git a/server/sonar-web/src/main/js/components/charts/TreeMap.css b/server/sonar-web/src/main/js/components/charts/TreeMap.css new file mode 100644 index 00000000000..fe9e1d24b18 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/TreeMap.css @@ -0,0 +1,95 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.sonar-d3 .treemap-container { + position: relative; +} + +.sonar-d3 .treemap-cell { + position: absolute; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + box-sizing: border-box; + text-align: center; + overflow: hidden; +} + +.sonar-d3 .treemap-cell:focus { + outline: none; +} + +.sonar-d3 .treemap-inner { + display: inline-flex; + vertical-align: middle; + align-items: center; + justify-content: center; + flex-wrap: wrap; + padding: var(--gridSize); + box-sizing: border-box; + line-height: 1.2; + background: rgba(0, 0, 0, 0.6); + border-radius: 2px; +} + +.sonar-d3 .treemap-inner .treemap-icon { + flex-shrink: 0; +} + +.sonar-d3 .treemap-inner .treemap-icon svg { + margin-top: 2px; +} + +.sonar-d3 .treemap-inner .treemap-icon svg path { + fill: var(--barBackgroundColor) !important; +} + +.sonar-d3 .treemap-inner .treemap-text { + flex-shrink: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: center; + color: var(--barBackgroundColor); +} + +.sonar-d3 .treemap-inner .treemap-text-suffix { + color: var(--barBorderColor); + font-size: var(--smallFontSize); +} + +.sonar-d3 .treemap-link { + position: absolute; + z-index: var(--normalZIndex); + top: 5px; + right: 5px; + line-height: 14px; + font-size: var(--smallFontSize); + border-bottom: none; +} + +.sonar-d3 .treemap-link:hover { + color: #d1eafb; +} + +.sonar-d3 .treemap-link i, +.sonar-d3 .treemap-link i:before { + vertical-align: top; + font-size: inherit; + line-height: inherit; +} diff --git a/server/sonar-web/src/main/js/components/charts/TreeMap.tsx b/server/sonar-web/src/main/js/components/charts/TreeMap.tsx new file mode 100644 index 00000000000..3a6e25112a7 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/TreeMap.tsx @@ -0,0 +1,116 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { hierarchy as d3Hierarchy, treemap as d3Treemap } from 'd3-hierarchy'; +import * as React from 'react'; +import { formatMeasure, localizeMetric } from '../../helpers/measures'; +import { Location } from '../../helpers/urls'; +import './TreeMap.css'; +import TreeMapRect from './TreeMapRect'; + +export interface TreeMapItem { + color?: string; + gradient?: string; + icon?: React.ReactNode; + key: string; + label: string; + link?: string | Location; + measureValue?: string; + metric?: { key: string; type: string }; + size: number; + tooltip?: React.ReactNode; +} + +interface HierarchicalTreemapItem extends TreeMapItem { + children?: TreeMapItem[]; +} + +interface Props { + height: number; + items: TreeMapItem[]; + onRectangleClick?: (item: string) => void; + width: number; +} + +export default class TreeMap extends React.PureComponent { + mostCommitPrefix = (labels: string[]) => { + const sortedLabels = labels.slice(0).sort(); + const firstLabel = sortedLabels[0]; + const firstLabelLength = firstLabel.length; + const lastLabel = sortedLabels[sortedLabels.length - 1]; + let i = 0; + while (i < firstLabelLength && firstLabel.charAt(i) === lastLabel.charAt(i)) { + i++; + } + const prefix = firstLabel.substr(0, i); + const prefixTokens = prefix.split(/[\s\\/]/); + const lastPrefixPart = prefixTokens[prefixTokens.length - 1]; + return prefix.substr(0, prefix.length - lastPrefixPart.length); + }; + + render() { + const { items, height, width } = this.props; + const hierarchy = d3Hierarchy({ children: items } as HierarchicalTreemapItem) + .sum(d => d.size) + .sort((a, b) => (b.value || 0) - (a.value || 0)); + + const treemap = d3Treemap() + .round(true) + .size([width, height]); + + const nodes = treemap(hierarchy).leaves(); + const prefix = this.mostCommitPrefix(items.map(item => item.label)); + const halfWidth = width / 2; + return ( +
+
+ {nodes.map(node => ( + + {formatMeasure(node.data.measureValue, node.data.metric.type)} + + {localizeMetric(node.data.metric.key)} + + + ) + } + tooltip={node.data.tooltip} + width={node.x1 - node.x0} + x={node.x0} + y={node.y0} + /> + ))} +
+
+ ); + } +} diff --git a/server/sonar-web/src/main/js/components/charts/TreeMapRect.tsx b/server/sonar-web/src/main/js/components/charts/TreeMapRect.tsx new file mode 100644 index 00000000000..9a2f86e7af9 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/TreeMapRect.tsx @@ -0,0 +1,145 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { scaleLinear } from 'd3-scale'; +import * as React from 'react'; +import { Link } from 'react-router'; +import { Location } from '../../helpers/urls'; +import Tooltip, { Placement } from '../controls/Tooltip'; +import LinkIcon from '../icons/LinkIcon'; + +const SIZE_SCALE = scaleLinear() + .domain([3, 15]) + .range([11, 18]) + .clamp(true); + +interface Props { + fill?: string; + gradient?: string; + height: number; + icon?: React.ReactNode; + itemKey: string; + label: string; + link?: string | Location; + onClick?: (item: string) => void; + placement?: Placement; + prefix: string; + tooltip?: React.ReactNode; + value?: React.ReactNode; + width: number; + x: number; + y: number; +} + +const TEXT_VISIBLE_AT_WIDTH = 80; +const TEXT_VISIBLE_AT_HEIGHT = 50; +const ICON_VISIBLE_AT_WIDTH = 60; +const ICON_VISIBLE_AT_HEIGHT = 30; +export default class TreeMapRect extends React.PureComponent { + handleLinkClick = (event: React.MouseEvent) => { + event.stopPropagation(); + }; + + handleRectClick = () => { + if (this.props.onClick) { + this.props.onClick(this.props.itemKey); + } + }; + + renderLink = () => { + const { link, height, width } = this.props; + const hasMinSize = width >= 24 && height >= 24 && (width >= 48 || height >= 50); + if (!hasMinSize || link == null) { + return null; + } + return ( + + + + ); + }; + + renderCell = () => { + const cellStyles = { + left: this.props.x, + top: this.props.y, + width: this.props.width, + height: this.props.height, + backgroundColor: this.props.fill, + backgroundImage: this.props.gradient, + backgroundSize: '12px 12px', + fontSize: SIZE_SCALE(this.props.width / this.props.label.length), + lineHeight: `${this.props.height}px`, + cursor: this.props.onClick != null ? 'pointer' : 'default' + }; + const isTextVisible = + this.props.width >= TEXT_VISIBLE_AT_WIDTH && this.props.height >= TEXT_VISIBLE_AT_HEIGHT; + const isIconVisible = + this.props.width >= ICON_VISIBLE_AT_WIDTH && this.props.height >= ICON_VISIBLE_AT_HEIGHT; + + return ( +
+ {isTextVisible && ( +
+ {this.props.prefix || this.props.value ? ( +
+
+ {isIconVisible && ( + + {this.props.icon} + + )} + + {this.props.prefix && ( + <> + {this.props.prefix} +
+ + )} + + {this.props.label.substr(this.props.prefix.length)} +
+ +
{this.props.value}
+
+ ) : ( +
{this.props.label}
+ )} +
+ )} + {this.renderLink()} +
+ ); + }; + + render() { + const { placement, tooltip } = this.props; + return ( + + {this.renderCell()} + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/charts/ZoomTimeLine.css b/server/sonar-web/src/main/js/components/charts/ZoomTimeLine.css new file mode 100644 index 00000000000..21997431077 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/ZoomTimeLine.css @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.chart-zoom-tick { + fill: var(--secondFontColor); + font-size: 10px; + text-anchor: middle; + user-select: none; +} + +.chart-zoom .zoom-overlay { + fill: none; + stroke: none; + cursor: crosshair; + pointer-events: all; +} + +.chart-zoom .zoom-selection { + fill: var(--secondFontColor); + fill-opacity: 0.2; + stroke: var(--secondFontColor); + shape-rendering: crispEdges; + cursor: move; +} + +.chart-zoom .zoom-selection-handle { + cursor: ew-resize; + fill-opacity: 0; + stroke: none; +} diff --git a/server/sonar-web/src/main/js/components/charts/ZoomTimeLine.tsx b/server/sonar-web/src/main/js/components/charts/ZoomTimeLine.tsx new file mode 100644 index 00000000000..8b37a6a2587 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/ZoomTimeLine.tsx @@ -0,0 +1,401 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { extent, max } from 'd3-array'; +import { scaleLinear, scalePoint, scaleTime, ScaleTime } from 'd3-scale'; +import { area, curveBasis, line as d3Line } from 'd3-shape'; +import { flatten, sortBy, throttle } from 'lodash'; +import * as React from 'react'; +import Draggable, { DraggableBounds, DraggableCore, DraggableData } from 'react-draggable'; +import { ThemeConsumer } from '../theme'; +import './LineChart.css'; +import './ZoomTimeLine.css'; + +export interface Props { + basisCurve?: boolean; + endDate?: Date; + height: number; + leakPeriodDate?: Date; + metricType: string; + padding: number[]; + series: T.Chart.Serie[]; + showAreas?: boolean; + showXTicks: boolean; + startDate?: Date; + updateZoom: (start?: Date, endDate?: Date) => void; + width: number; +} + +interface State { + overlayLeftPos?: number; + newZoomStart?: number; +} + +type XScale = ScaleTime; +// TODO it should be `ScaleLinear | ScalePoint | ScalePoint`, but it's super hard to make it work :'( +type YScale = any; + +export default class ZoomTimeLine extends React.PureComponent { + static defaultProps = { + padding: [0, 0, 18, 0], + showXTicks: true + }; + + constructor(props: Props) { + super(props); + this.state = {}; + this.handleZoomUpdate = throttle(this.handleZoomUpdate, 40); + } + + getRatingScale = (availableHeight: number) => { + return scalePoint() + .domain([5, 4, 3, 2, 1]) + .range([availableHeight, 0]); + }; + + getLevelScale = (availableHeight: number) => { + return scalePoint() + .domain(['ERROR', 'WARN', 'OK']) + .range([availableHeight, 0]); + }; + + getYScale = (availableHeight: number, flatData: T.Chart.Point[]): YScale => { + if (this.props.metricType === 'RATING') { + return this.getRatingScale(availableHeight); + } else if (this.props.metricType === 'LEVEL') { + return this.getLevelScale(availableHeight); + } + return scaleLinear() + .range([availableHeight, 0]) + .domain([0, max(flatData, d => Number(d.y || 0)) as number]) + .nice(); + }; + + getXScale = (availableWidth: number, flatData: T.Chart.Point[]): XScale => { + return scaleTime() + .domain(extent(flatData, d => d.x) as [Date, Date]) + .range([0, availableWidth]) + .clamp(true); + }; + + getScales = () => { + const availableWidth = this.props.width - this.props.padding[1] - this.props.padding[3]; + const availableHeight = this.props.height - this.props.padding[0] - this.props.padding[2]; + const flatData = flatten(this.props.series.map(serie => serie.data)); + return { + xScale: this.getXScale(availableWidth, flatData), + yScale: this.getYScale(availableHeight, flatData) + }; + }; + + getEventMarker = (size: number) => { + const half = size / 2; + return `M${half} 0 L${size} ${half} L ${half} ${size} L0 ${half} L${half} 0 L${size} ${half}`; + }; + + handleDoubleClick = (xScale: XScale, xDim: number[]) => () => { + this.handleZoomUpdate(xScale, xDim); + }; + + handleSelectionDrag = (xScale: XScale, width: number, xDim: number[], checkDelta?: boolean) => ( + _: MouseEvent, + data: DraggableData + ) => { + if (!checkDelta || data.deltaX) { + const x = Math.max(xDim[0], Math.min(data.x, xDim[1] - width)); + this.handleZoomUpdate(xScale, [x, width + x]); + } + }; + + handleSelectionHandleDrag = ( + xScale: XScale, + fixedX: number, + xDim: number[], + handleDirection: string, + checkDelta?: boolean + ) => (_: MouseEvent, data: DraggableData) => { + if (!checkDelta || data.deltaX) { + const x = Math.max(xDim[0], Math.min(data.x, xDim[1])); + this.handleZoomUpdate(xScale, handleDirection === 'right' ? [fixedX, x] : [x, fixedX]); + } + }; + + handleNewZoomDragStart = (xDim: number[]) => (_: MouseEvent, data: DraggableData) => { + const overlayLeftPos = data.node.getBoundingClientRect().left; + this.setState({ + overlayLeftPos, + newZoomStart: Math.round(Math.max(xDim[0], Math.min(data.x - overlayLeftPos, xDim[1]))) + }); + }; + + handleNewZoomDrag = (xScale: XScale, xDim: number[]) => (_: MouseEvent, data: DraggableData) => { + const { newZoomStart, overlayLeftPos } = this.state; + if (newZoomStart != null && overlayLeftPos != null && data.deltaX) { + this.handleZoomUpdate( + xScale, + sortBy([newZoomStart, Math.max(xDim[0], Math.min(data.x - overlayLeftPos, xDim[1]))]) + ); + } + }; + + handleNewZoomDragEnd = (xScale: XScale, xDim: number[]) => ( + _: MouseEvent, + data: DraggableData + ) => { + const { newZoomStart, overlayLeftPos } = this.state; + if (newZoomStart !== undefined && overlayLeftPos !== undefined) { + const x = Math.round(Math.max(xDim[0], Math.min(data.x - overlayLeftPos, xDim[1]))); + this.handleZoomUpdate(xScale, newZoomStart === x ? xDim : sortBy([newZoomStart, x])); + this.setState({ newZoomStart: undefined, overlayLeftPos: undefined }); + } + }; + + handleZoomUpdate = (xScale: XScale, xArray: number[]) => { + const xRange = xScale.range(); + const startDate = + xArray[0] > xRange[0] && xArray[0] < xRange[xRange.length - 1] + ? xScale.invert(xArray[0]) + : undefined; + const endDate = + xArray[1] > xRange[0] && xArray[1] < xRange[xRange.length - 1] + ? xScale.invert(xArray[1]) + : undefined; + this.props.updateZoom(startDate, endDate); + }; + + renderBaseLine = (xScale: XScale, yScale: YScale) => { + return ( + + ); + }; + + renderTicks = (xScale: XScale, yScale: YScale) => { + const format = xScale.tickFormat(7); + const ticks = xScale.ticks(7); + const y = yScale.range()[0]; + return ( + + {ticks.slice(0, -1).map((tick, index) => { + const nextTick = index + 1 < ticks.length ? ticks[index + 1] : xScale.domain()[1]; + const x = (xScale(tick) + xScale(nextTick)) / 2; + return ( + // eslint-disable-next-line react/no-array-index-key + + {format(tick)} + + ); + })} + + ); + }; + + renderLeak = (xScale: XScale, yScale: YScale) => { + const { leakPeriodDate } = this.props; + if (!leakPeriodDate) { + return null; + } + const yRange = yScale.range(); + return ( + + {theme => ( + + )} + + ); + }; + + renderLines = (xScale: XScale, yScale: YScale) => { + const lineGenerator = d3Line() + .defined(d => Boolean(d.y || d.y === 0)) + .x(d => xScale(d.x)) + .y(d => yScale(d.y)); + if (this.props.basisCurve) { + lineGenerator.curve(curveBasis); + } + return ( + + {this.props.series.map((serie, idx) => ( + + ))} + + ); + }; + + renderAreas = (xScale: XScale, yScale: YScale) => { + const areaGenerator = area() + .defined(d => Boolean(d.y || d.y === 0)) + .x(d => xScale(d.x)) + .y1(d => yScale(d.y)) + .y0(yScale(0)); + if (this.props.basisCurve) { + areaGenerator.curve(curveBasis); + } + return ( + + {this.props.series.map((serie, idx) => ( + + ))} + + ); + }; + + renderZoomHandle = (options: { + xScale: XScale; + xPos: number; + fixedPos: number; + yDim: number[]; + xDim: number[]; + direction: string; + }) => ( + + + + ); + + renderZoom = (xScale: XScale, yScale: YScale) => { + const xRange = xScale.range(); + const yRange = yScale.range(); + const xDim = [xRange[0], xRange[xRange.length - 1]]; + const yDim = [yRange[0], yRange[yRange.length - 1]]; + const startX = Math.round(this.props.startDate ? xScale(this.props.startDate) : xDim[0]); + const endX = Math.round(this.props.endDate ? xScale(this.props.endDate) : xDim[1]); + const xArray = sortBy([startX, endX]); + const zoomBoxWidth = xArray[1] - xArray[0]; + const showZoomArea = + this.state.newZoomStart == null || + this.state.newZoomStart === startX || + this.state.newZoomStart === endX; + + return ( + + + + + {showZoomArea && ( + + + + )} + {showZoomArea && + this.renderZoomHandle({ + xScale, + xPos: startX, + fixedPos: endX, + xDim, + yDim, + direction: 'left' + })} + {showZoomArea && + this.renderZoomHandle({ + xScale, + xPos: endX, + fixedPos: startX, + xDim, + yDim, + direction: 'right' + })} + + ); + }; + + render() { + if (!this.props.width || !this.props.height) { + return
; + } + + const { xScale, yScale } = this.getScales(); + + return ( + + + {this.renderLeak(xScale, yScale)} + {this.renderBaseLine(xScale, yScale)} + {this.props.showXTicks && this.renderTicks(xScale, yScale)} + {this.props.showAreas && this.renderAreas(xScale, yScale)} + {this.renderLines(xScale, yScale)} + {this.renderZoom(xScale, yScale)} + + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/AdvancedTimeline-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/AdvancedTimeline-test.tsx new file mode 100644 index 00000000000..77f2aafcceb --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/AdvancedTimeline-test.tsx @@ -0,0 +1,300 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { ThemeConsumer } from '../../theme'; +import AdvancedTimeline from '../AdvancedTimeline'; + +const newCodeLegendClass = '.new-code-legend'; + +// Replace scaleTime with scaleUtc to avoid timezone-dependent snapshots +jest.mock('d3-scale', () => { + const { scaleUtc, ...others } = jest.requireActual('d3-scale'); + + return { + ...others, + scaleTime: scaleUtc + }; +}); + +jest.mock('lodash', () => { + const lodash = jest.requireActual('lodash'); + return { ...lodash, throttle: (f: any) => f }; +}); + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + expect(shallowRender({ disableZoom: false, updateZoom: () => {} })).toMatchSnapshot( + 'Zoom enabled' + ); + expect(shallowRender({ formatYTick: t => `Nicer tick ${t}` })).toMatchSnapshot('format y tick'); + expect(shallowRender({ width: undefined })).toMatchSnapshot('no width'); + expect(shallowRender({ height: undefined })).toMatchSnapshot('no height'); + expect(shallowRender({ showAreas: undefined })).toMatchSnapshot('no areas'); +}); + +it('should render leak correctly', () => { + const wrapper = shallowRender({ leakPeriodDate: new Date('2019-10-02') }); + + const leakNode = wrapper + .find(ThemeConsumer) + .dive() + .find('.leak-chart-rect'); + expect(leakNode.exists()).toBe(true); + expect(leakNode.getElement().props.width).toBe(15); +}); + +it('should render leak legend correctly', () => { + const wrapper = shallowRender({ + displayNewCodeLegend: true, + leakPeriodDate: new Date('2019-10-02') + }); + + const leakNode = wrapper.find(ThemeConsumer).dive(); + expect(leakNode.find(newCodeLegendClass).exists()).toBe(true); + expect(leakNode.find(newCodeLegendClass).props().textAnchor).toBe('start'); + expect(leakNode).toMatchSnapshot(); +}); + +it('should render leak legend correctly for small leak', () => { + const wrapper = shallowRender({ + displayNewCodeLegend: true, + leakPeriodDate: new Date('2020-02-06'), + series: [ + mockData(1, '2020-02-01'), + mockData(2, '2020-02-02'), + mockData(3, '2020-02-03'), + mockData(4, '2020-02-04'), + mockData(5, '2020-02-05'), + mockData(6, '2020-02-06'), + mockData(7, '2020-02-07') + ] + }); + + const leakNode = wrapper.find(ThemeConsumer).dive(); + expect(leakNode.find(newCodeLegendClass).exists()).toBe(true); + expect(leakNode.find(newCodeLegendClass).props().textAnchor).toBe('end'); +}); + +it('should set leakLegendTextWidth correctly', () => { + const wrapper = shallowRender(); + + wrapper.instance().setLeakLegendTextWidth({ + getBoundingClientRect: () => ({ width: 12 } as DOMRect) + } as SVGTextElement); + + expect(wrapper.state().leakLegendTextWidth).toBe(12); + + wrapper.instance().setLeakLegendTextWidth(null); + + expect(wrapper.state().leakLegendTextWidth).toBe(12); +}); + +it('should render old leak correctly', () => { + const wrapper = shallowRender({ leakPeriodDate: new Date('2014-10-02') }); + + const leakNode = wrapper + .find(ThemeConsumer) + .dive() + .find('.leak-chart-rect'); + expect(leakNode.exists()).toBe(true); + expect(leakNode.getElement().props.width).toBe(30); +}); + +it('should find date to display based on mouse location', () => { + const wrapper = shallowRender(); + + wrapper.instance().updateTooltipPos(0); + expect(wrapper.state().selectedDateIdx).toBeUndefined(); + + wrapper.instance().handleMouseEnter(); + wrapper.instance().updateTooltipPos(10); + expect(wrapper.state().selectedDateIdx).toBe(1); +}); + +it('should update timeline when width changes', () => { + const updateTooltip = jest.fn(); + const wrapper = shallowRender({ selectedDate: new Date('2019-10-02'), updateTooltip }); + const { xScale, selectedDateXPos } = wrapper.state(); + + wrapper.setProps({ width: 200 }); + expect(wrapper.state().xScale).not.toBe(xScale); + expect(wrapper.state().xScale).toEqual(expect.any(Function)); + expect(wrapper.state().selectedDateXPos).not.toBe(selectedDateXPos); + expect(wrapper.state().selectedDateXPos).toEqual(expect.any(Number)); + expect(updateTooltip).toBeCalled(); +}); + +it('should update tootlips when selected date changes', () => { + const updateTooltip = jest.fn(); + + const wrapper = shallowRender({ selectedDate: new Date('2019-10-01'), updateTooltip }); + const { xScale, selectedDateXPos } = wrapper.state(); + const selectedDate = new Date('2019-10-02'); + + wrapper.setProps({ selectedDate }); + expect(wrapper.state().xScale).toBe(xScale); + expect(wrapper.state().selectedDate).toBe(selectedDate); + expect(wrapper.state().selectedDateXPos).not.toBe(selectedDateXPos); + expect(wrapper.state().selectedDateXPos).toEqual(expect.any(Number)); + expect(updateTooltip).toBeCalled(); +}); + +it('should handle scroll correcly', () => { + let updateZoom = jest.fn(); + let preventDefault = jest.fn(); + let wrapper = shallowRender({ updateZoom }); + wrapper.instance().handleWheel(({ + preventDefault, + deltaX: 1, + deltaY: -2, + deltaZ: 0, + pageX: 100, + pageY: 1, + currentTarget: ({ + getBoundingClientRect: () => ({ + bottom: 0, + height: 100, + width: 50, + left: 0, + right: 0, + top: 10, + x: 12, + y: 23, + toJSON: () => '' + }) + } as any) as SVGElement + } as any) as React.WheelEvent); + expect(preventDefault).toBeCalled(); + expect(updateZoom).toBeCalledWith(new Date('2019-10-01T06:24:00.000Z'), undefined); + + updateZoom = jest.fn(); + preventDefault = jest.fn(); + wrapper = shallowRender({ updateZoom }); + wrapper.instance().handleWheel(({ + preventDefault, + deltaX: 1, + deltaY: 2, + deltaZ: 0, + pageX: 100, + pageY: 1, + deltaMode: 25, + currentTarget: ({ + getBoundingClientRect: () => ({ + bottom: 0, + height: 100, + width: 50, + left: 0, + right: 0, + top: 10, + x: 12, + y: 23, + toJSON: () => '' + }) + } as any) as SVGElement + } as any) as React.WheelEvent); + expect(preventDefault).toBeCalled(); + expect(updateZoom).toBeCalledWith(undefined, new Date('2019-10-02T20:48:00.000Z')); +}); + +it('should handle mouse out correcly', () => { + const updateTooltip = jest.fn(); + const wrapper = shallowRender({ updateTooltip: undefined }); + wrapper.setState({ + mouseOver: true, + selectedDate: new Date(), + selectedDateXPos: 1, + selectedDateIdx: 1 + }); + wrapper.instance().handleMouseOut(); + expect(wrapper.state().mouseOver).toBe(true); + + wrapper.setProps({ updateTooltip }); + wrapper.instance().handleMouseOut(); + expect(wrapper.state().mouseOver).toBe(false); + expect(wrapper.state().selectedDate).toBeUndefined(); + expect(wrapper.state().selectedDateXPos).toBeUndefined(); + expect(wrapper.state().selectedDateIdx).toBeUndefined(); + wrapper.instance().handleMouseOut(); +}); + +it('should handle click correcly', () => { + const updateSelectedDate = jest.fn(); + const wrapper = shallowRender({ updateSelectedDate }); + wrapper.setState({ selectedDate: new Date() }); + + wrapper.instance().handleClick(); + expect(updateSelectedDate).toBeCalledWith(wrapper.state().selectedDate); + + wrapper.setProps({ updateSelectedDate: undefined }); + updateSelectedDate.mockClear(); + wrapper.instance().handleClick(); + expect(updateSelectedDate).not.toBeCalled(); +}); + +function shallowRender(props?: Partial) { + return shallow( + + ); +} + +function mockData(i: number, date: string): T.Chart.Serie { + return { + name: `t${i}`, + type: 'type', + translatedName: '', + data: [{ x: new Date(date), y: i }] + }; +} diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/BarChart-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/BarChart-test.tsx new file mode 100644 index 00000000000..794bb3ace38 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/BarChart-test.tsx @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import BarChart from '../BarChart'; + +it('should display bars', () => { + const data = [ + { x: 1, y: 10 }, + { x: 2, y: 30 }, + { x: 3, y: 20 } + ]; + const chart = shallow(); + expect(chart.find('.bar-chart-bar').length).toBe(3); +}); + +it('should display ticks', () => { + const data = [ + { x: 1, y: 10 }, + { x: 2, y: 30 }, + { x: 3, y: 20 } + ]; + const ticks = ['A', 'B', 'C']; + const chart = shallow( + + ); + expect(chart.find('.bar-chart-tick').length).toBe(3); +}); + +it('should display values', () => { + const data = [ + { x: 1, y: 10 }, + { x: 2, y: 30 }, + { x: 3, y: 20 } + ]; + const values = ['A', 'B', 'C']; + const chart = shallow( + + ); + expect(chart.find('.bar-chart-tick').length).toBe(3); +}); + +it('should display bars, ticks and values', () => { + const data = [ + { x: 1, y: 10 }, + { x: 2, y: 30 }, + { x: 3, y: 20 } + ]; + const ticks = ['A', 'B', 'C']; + const values = ['A', 'B', 'C']; + const chart = shallow( + + ); + expect(chart.find('.bar-chart-bar').length).toBe(3); + expect(chart.find('.bar-chart-tick').length).toBe(6); +}); diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/BubbleChart-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/BubbleChart-test.tsx new file mode 100644 index 00000000000..3be36c3677d --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/BubbleChart-test.tsx @@ -0,0 +1,59 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount } from 'enzyme'; +import * as React from 'react'; +import { AutoSizerProps } from 'react-virtualized'; +import BubbleChart from '../BubbleChart'; + +jest.mock('react-virtualized/dist/commonjs/AutoSizer', () => ({ + AutoSizer: ({ children }: AutoSizerProps) => children({ width: 100, height: NaN }) +})); + +it('should display bubbles', () => { + const items = [ + { x: 1, y: 10, size: 7 }, + { x: 2, y: 30, size: 5 } + ]; + const chart = mount(); + chart.find('Bubble').forEach(bubble => expect(bubble).toMatchSnapshot()); + + chart.setProps({ height: 120 }); +}); + +it('should render bubble links', () => { + const items = [ + { x: 1, y: 10, size: 7, link: 'foo' }, + { x: 2, y: 30, size: 5, link: 'bar' } + ]; + const chart = mount(); + chart.find('Bubble').forEach(bubble => expect(bubble).toMatchSnapshot()); +}); + +it('should render bubbles with click handlers', () => { + const onClick = jest.fn(); + const items = [ + { x: 1, y: 10, size: 7, data: 'foo' }, + { x: 2, y: 30, size: 5, data: 'bar' } + ]; + const chart = mount( + + ); + chart.find('Bubble').forEach(bubble => expect(bubble).toMatchSnapshot()); +}); diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/ColorGradientLegend-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/ColorGradientLegend-test.tsx new file mode 100644 index 00000000000..b9d0bb216a0 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/ColorGradientLegend-test.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { scaleLinear } from 'd3-scale'; +import { shallow } from 'enzyme'; +import * as React from 'react'; +import testTheme from '../../../../../../config/jest/testTheme'; +import ColorGradientLegend from '../ColorGradientLegend'; + +const { colors } = testTheme; +const COLORS = [colors.green, colors.lightGreen, colors.yellow, colors.orange, colors.red]; + +it('should render properly', () => { + const colorScale = scaleLinear() + .domain([0, 25, 50, 75, 100]) + .range(COLORS); + const wrapper = shallow( + + ); + expect(wrapper.dive()).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/ColorRatingsLegend-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/ColorRatingsLegend-test.tsx index 7638e1288e8..3775b169fa8 100644 --- a/server/sonar-web/src/main/js/components/charts/__tests__/ColorRatingsLegend-test.tsx +++ b/server/sonar-web/src/main/js/components/charts/__tests__/ColorRatingsLegend-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; +import { ButtonLink } from '../../../components/controls/buttons'; import ColorRatingsLegend, { ColorRatingsLegendProps } from '../ColorRatingsLegend'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/DonutChart-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/DonutChart-test.tsx new file mode 100644 index 00000000000..5a21985e96f --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/DonutChart-test.tsx @@ -0,0 +1,52 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import DonutChart, { DonutChartProps } from '../DonutChart'; + +it('should render correctly', () => { + const wrapper = shallowRender(); + expect(wrapper).toMatchSnapshot(); + expect( + wrapper + .find('Sector') + .first() + .dive() + ).toMatchSnapshot(); +}); + +it('should render correctly with padding and pad angle too', () => { + expect(shallowRender({ padAngle: 0.1, padding: [2, 2, 2, 2] })).toMatchSnapshot(); +}); + +function shallowRender(props: Partial = {}) { + return shallow( + + ); +} diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/Histogram-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/Histogram-test.tsx new file mode 100644 index 00000000000..15f4754aae0 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/Histogram-test.tsx @@ -0,0 +1,68 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import Histogram from '../Histogram'; + +it('renders', () => { + expect(shallow()).toMatchSnapshot(); +}); + +it('renders with yValues', () => { + expect( + shallow( + + ) + ).toMatchSnapshot(); +}); + +it('renders with yValues and yTicks', () => { + expect( + shallow( + + ) + ).toMatchSnapshot(); +}); + +it('renders with yValues, yTicks and yTooltips', () => { + expect( + shallow( + + ) + ).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/LineChart-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/LineChart-test.tsx new file mode 100644 index 00000000000..9e42fe3395b --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/LineChart-test.tsx @@ -0,0 +1,54 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import LineChart from '../LineChart'; + +it('should display line', () => { + const data = [ + { x: 1, y: 10 }, + { x: 2, y: 30 }, + { x: 3, y: 20 } + ]; + const chart = shallow(); + expect(chart.find('.line-chart-path').length).toBe(1); +}); + +it('should display ticks', () => { + const data = [ + { x: 1, y: 10 }, + { x: 2, y: 30 }, + { x: 3, y: 20 } + ]; + const ticks = ['A', 'B', 'C']; + const chart = shallow(); + expect(chart.find('.line-chart-tick').length).toBe(3); +}); + +it('should display values', () => { + const data = [ + { x: 1, y: 10 }, + { x: 2, y: 30 }, + { x: 3, y: 20 } + ]; + const values = ['A', 'B', 'C']; + const chart = shallow(); + expect(chart.find('.line-chart-tick').length).toBe(3); +}); diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/TreeMap-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/TreeMap-test.tsx new file mode 100644 index 00000000000..d4879956f2b --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/TreeMap-test.tsx @@ -0,0 +1,53 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount } from 'enzyme'; +import * as React from 'react'; +import TreeMap from '../TreeMap'; +import TreeMapRect from '../TreeMapRect'; + +it('should render correctly', () => { + const items = [ + { key: '1', size: 10, color: '#777', label: 'SonarQube :: Server' }, + { key: '2', size: 30, color: '#777', label: 'SonarQube :: Web' }, + { + key: '3', + size: 20, + gradient: '#777', + label: 'SonarQube :: Search', + metric: { key: 'coverage', type: 'PERCENT' } + } + ]; + const onRectClick = jest.fn(); + const chart = mount( + + ); + const rects = chart.find(TreeMapRect); + expect(rects).toHaveLength(3); + + const event: React.MouseEvent = { + stopPropagation: jest.fn() + } as any; + + (rects.first().instance() as TreeMapRect).handleLinkClick(event); + expect(event.stopPropagation).toHaveBeenCalled(); + + (rects.first().instance() as TreeMapRect).handleRectClick(); + expect(onRectClick).toHaveBeenCalledWith('2'); +}); diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/ZoomTimeLine-test.tsx b/server/sonar-web/src/main/js/components/charts/__tests__/ZoomTimeLine-test.tsx new file mode 100644 index 00000000000..415accfd48d --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/ZoomTimeLine-test.tsx @@ -0,0 +1,123 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { scaleTime } from 'd3-scale'; +import { shallow } from 'enzyme'; +import * as React from 'react'; +import testTheme from '../../../../../../config/jest/testTheme'; +import ZoomTimeLine from '../ZoomTimeLine'; + +const series = [ + { + data: [ + { + x: new Date('2020-01-01'), + y: 'beginning' + }, + { + x: new Date('2020-02-01'), + y: 'end' + } + ], + name: 'foo', + translatedName: 'foo-translated', + type: 'bar' + } +]; + +it('should render correctly', () => { + expect(shallowRender({ width: undefined })).toMatchSnapshot('no width'); + expect(shallowRender({ height: undefined })).toMatchSnapshot('no height'); +}); + +it('should draw a graph with lines', () => { + const wrapper = shallowRender(); + expect(wrapper.find('.line-chart-grid').exists()).toBe(true); + expect(wrapper.find('.line-chart-path').exists()).toBe(true); + expect(wrapper.find('.chart-zoom-tick').exists()).toBe(true); + expect(wrapper.find('.line-chart-area').exists()).toBe(false); +}); + +it('should be zoomable', () => { + expect( + shallowRender() + .find('.chart-zoom') + .exists() + ).toBe(true); +}); + +it('should render a leak period', () => { + expect( + shallowRender({ leakPeriodDate: new Date('2020-01-01') }) + .find('ContextConsumer') + .dive() + .find(`rect[fill="${testTheme.colors.leakPrimaryColor}"]`) + .exists() + ).toBe(true); +}); + +it('should render areas under the graph lines', () => { + expect( + shallowRender({ showAreas: true }) + .find('.line-chart-area') + .exists() + ).toBe(true); +}); + +it('should handle zoom update correctly', () => { + const updateZoom = jest.fn(); + const startDate = new Date('1970-01-01T00:00:00.001Z'); + const endDate = new Date('2000-01-01T00:00:00.001Z'); + let wrapper = shallowRender({ updateZoom, startDate, endDate }); + wrapper.instance().handleZoomUpdate( + scaleTime() + .domain([startDate, endDate]) + .range([0, 150]), + [3, 50] + ); + expect(updateZoom).toBeCalledWith( + new Date('1970-08-08T03:21:36.001Z'), + new Date('1980-01-01T08:00:00.001Z') + ); + + updateZoom.mockClear(); + + // We throttle the handleZoomUpdate so re-render to avoid issue + wrapper = shallowRender({ updateZoom, startDate, endDate }); + wrapper.instance().handleZoomUpdate( + scaleTime() + .domain([startDate, endDate]) + .range([0, 150]), + [-1, 151] + ); + expect(updateZoom).toBeCalledWith(undefined, undefined); +}); + +function shallowRender(props: Partial = {}) { + return shallow( + + ); +} diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/AdvancedTimeline-test.tsx.snap b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/AdvancedTimeline-test.tsx.snap new file mode 100644 index 00000000000..f4569f0f9fa --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/AdvancedTimeline-test.tsx.snap @@ -0,0 +1,1409 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + October + + + 06 AM + + + 12 PM + + + 06 PM + + + Wed 02 + + + 06 AM + + + 12 PM + + + 06 PM + + + + + + + + + + + + +`; + +exports[`should render correctly: Zoom enabled 1`] = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + October + + + 06 AM + + + 12 PM + + + 06 PM + + + Wed 02 + + + 06 AM + + + 12 PM + + + 06 PM + + + + + + + + + + + + +`; + +exports[`should render correctly: format y tick 1`] = ` + + + + + + Nicer tick 0 + + + + + + Nicer tick 0.2 + + + + + + Nicer tick 0.4 + + + + + + Nicer tick 0.6 + + + + + + Nicer tick 0.8 + + + + + + Nicer tick 1 + + + + + + Nicer tick 1.2 + + + + + + Nicer tick 1.4 + + + + + + Nicer tick 1.6 + + + + + + Nicer tick 1.8 + + + + + + Nicer tick 2 + + + + + + Nicer tick 2.2 + + + + + + Nicer tick 2.4 + + + + + + Nicer tick 2.6 + + + + + + Nicer tick 2.8 + + + + + + Nicer tick 3 + + + + + + + October + + + 06 AM + + + 12 PM + + + 06 PM + + + Wed 02 + + + 06 AM + + + 12 PM + + + 06 PM + + + + + + + + + + + + +`; + +exports[`should render correctly: no areas 1`] = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + October + + + 06 AM + + + 12 PM + + + 06 PM + + + Wed 02 + + + 06 AM + + + 12 PM + + + 06 PM + + + + + + + + + + + + +`; + +exports[`should render correctly: no height 1`] = `
`; + +exports[`should render correctly: no width 1`] = `
`; + +exports[`should render leak legend correctly 1`] = ` + + + + new code + + + +`; diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/BubbleChart-test.tsx.snap b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/BubbleChart-test.tsx.snap new file mode 100644 index 00000000000..b0f69f95417 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/BubbleChart-test.tsx.snap @@ -0,0 +1,187 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should display bubbles 1`] = ` + + + + + + + +`; + +exports[`should display bubbles 2`] = ` + + + + + + + +`; + +exports[`should render bubble links 1`] = ` + + + + + + + + + + + +`; + +exports[`should render bubble links 2`] = ` + + + + + + + + + + + +`; + +exports[`should render bubbles with click handlers 1`] = ` + + + + + + + +`; + +exports[`should render bubbles with click handlers 2`] = ` + + + + + + + +`; diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ColorGradientLegend-test.tsx.snap b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ColorGradientLegend-test.tsx.snap new file mode 100644 index 00000000000..0bbe8ee462d --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ColorGradientLegend-test.tsx.snap @@ -0,0 +1,220 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render properly 1`] = ` + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 25 + + + 50 + + + 75 + + + 100 + + + + + + N/A + + + +`; diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/DonutChart-test.tsx.snap b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/DonutChart-test.tsx.snap new file mode 100644 index 00000000000..f4da702a0d2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/DonutChart-test.tsx.snap @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + + + + + + + + +`; + +exports[`should render correctly 2`] = ` + +`; + +exports[`should render correctly with padding and pad angle too 1`] = ` + + + + + + + + +`; diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/Histogram-test.tsx.snap b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/Histogram-test.tsx.snap new file mode 100644 index 00000000000..f52a4ea6cf3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/Histogram-test.tsx.snap @@ -0,0 +1,352 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders 1`] = ` + + + + + + + + + + + + + + + +`; + +exports[`renders with yValues 1`] = ` + + + + + + + + 100.0 + + + + + + + + 75.0 + + + + + + + + 150.0 + + + + + + +`; + +exports[`renders with yValues and yTicks 1`] = ` + + + + + + + + 100.0 + + + + a + + + + + + + 75.0 + + + + b + + + + + + + 150.0 + + + + c + + + + + +`; + +exports[`renders with yValues, yTicks and yTooltips 1`] = ` + + + + + + + + 100.0 + + + + a + + + + + + + 75.0 + + + + b + + + + + + + 150.0 + + + + c + + + + + +`; diff --git a/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ZoomTimeLine-test.tsx.snap b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ZoomTimeLine-test.tsx.snap new file mode 100644 index 00000000000..adb3c28e914 --- /dev/null +++ b/server/sonar-web/src/main/js/components/charts/__tests__/__snapshots__/ZoomTimeLine-test.tsx.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: no height 1`] = `
`; + +exports[`should render correctly: no width 1`] = `
`; diff --git a/server/sonar-web/src/main/js/components/common/ActivityLink.tsx b/server/sonar-web/src/main/js/components/common/ActivityLink.tsx index 4d6afcb46ab..7ef4f0c9948 100644 --- a/server/sonar-web/src/main/js/components/common/ActivityLink.tsx +++ b/server/sonar-web/src/main/js/components/common/ActivityLink.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import HistoryIcon from '../../components/icons/HistoryIcon'; +import { translate } from '../../helpers/l10n'; import { getActivityUrl, getMeasureHistoryUrl } from '../../helpers/urls'; -import HistoryIcon from '../../sonar-ui-common/components/icons/HistoryIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import { BranchLike } from '../../types/branch-like'; import { GraphType } from '../../types/project-activity'; import { isCustomGraph } from '../activity-graph/utils'; diff --git a/server/sonar-web/src/main/js/components/common/AnalysisWarningsModal.tsx b/server/sonar-web/src/main/js/components/common/AnalysisWarningsModal.tsx index f107a35e31a..a426bcc7bf6 100644 --- a/server/sonar-web/src/main/js/components/common/AnalysisWarningsModal.tsx +++ b/server/sonar-web/src/main/js/components/common/AnalysisWarningsModal.tsx @@ -19,12 +19,12 @@ */ import * as React from 'react'; import { dismissAnalysisWarning, getTask } from '../../api/ce'; +import { ButtonLink } from '../../components/controls/buttons'; +import Modal from '../../components/controls/Modal'; +import WarningIcon from '../../components/icons/WarningIcon'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate } from '../../helpers/l10n'; import { sanitizeStringRestricted } from '../../helpers/sanitize'; -import { ButtonLink } from '../../sonar-ui-common/components/controls/buttons'; -import Modal from '../../sonar-ui-common/components/controls/Modal'; -import WarningIcon from '../../sonar-ui-common/components/icons/WarningIcon'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import { TaskWarning } from '../../types/tasks'; import { withCurrentUser } from '../hoc/withCurrentUser'; diff --git a/server/sonar-web/src/main/js/components/common/BranchStatus.tsx b/server/sonar-web/src/main/js/components/common/BranchStatus.tsx index 98bdd0eef0f..74249e8fd72 100644 --- a/server/sonar-web/src/main/js/components/common/BranchStatus.tsx +++ b/server/sonar-web/src/main/js/components/common/BranchStatus.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; -import Level from '../../sonar-ui-common/components/ui/Level'; +import Level from '../../components/ui/Level'; import { getBranchStatusByBranchLike, Store } from '../../store/rootReducer'; import { BranchLike } from '../../types/branch-like'; diff --git a/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx b/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx index e6d26f826b5..7a48b5929c2 100644 --- a/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx +++ b/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { ClipboardButton } from '../../sonar-ui-common/components/controls/clipboard'; -import { isDefined } from '../../sonar-ui-common/helpers/types'; +import { ClipboardButton } from '../../components/controls/clipboard'; +import { isDefined } from '../../helpers/types'; import './CodeSnippet.css'; export interface CodeSnippetProps { diff --git a/server/sonar-web/src/main/js/components/common/DisableableSelectOption.tsx b/server/sonar-web/src/main/js/components/common/DisableableSelectOption.tsx index ba057c4cc21..b3b82e9fd31 100644 --- a/server/sonar-web/src/main/js/components/common/DisableableSelectOption.tsx +++ b/server/sonar-web/src/main/js/components/common/DisableableSelectOption.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; +import Tooltip from '../../components/controls/Tooltip'; export interface DisableableSelectOptionProps { className?: string; diff --git a/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx b/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx index f241884c67c..62de7cb0281 100644 --- a/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx +++ b/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { Link } from 'react-router'; import { isWebUri } from 'valid-url'; -import HelpTooltip from '../../sonar-ui-common/components/controls/HelpTooltip'; -import DetachIcon from '../../sonar-ui-common/components/icons/DetachIcon'; +import HelpTooltip from '../../components/controls/HelpTooltip'; +import DetachIcon from '../../components/icons/DetachIcon'; export interface DocumentationTooltipProps { children?: React.ReactNode; diff --git a/server/sonar-web/src/main/js/components/common/EmptySearch.tsx b/server/sonar-web/src/main/js/components/common/EmptySearch.tsx index 3091ad24715..45b359a0084 100644 --- a/server/sonar-web/src/main/js/components/common/EmptySearch.tsx +++ b/server/sonar-web/src/main/js/components/common/EmptySearch.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import './EmptySearch.css'; export default function EmptySearch() { diff --git a/server/sonar-web/src/main/js/components/common/FiltersHeader.tsx b/server/sonar-web/src/main/js/components/common/FiltersHeader.tsx index 216366e6e59..5d62cfb1bc4 100644 --- a/server/sonar-web/src/main/js/components/common/FiltersHeader.tsx +++ b/server/sonar-web/src/main/js/components/common/FiltersHeader.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import { translate } from '../../helpers/l10n'; interface Props { displayReset: boolean; diff --git a/server/sonar-web/src/main/js/components/common/FormattingTips.tsx b/server/sonar-web/src/main/js/components/common/FormattingTips.tsx index 6e12fd4521f..6753e640435 100644 --- a/server/sonar-web/src/main/js/components/common/FormattingTips.tsx +++ b/server/sonar-web/src/main/js/components/common/FormattingTips.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import { translate } from '../../helpers/l10n'; import { getFormattingHelpUrl } from '../../helpers/urls'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/common/MeasuresLink.tsx b/server/sonar-web/src/main/js/components/common/MeasuresLink.tsx index 106b193920a..6b5cba0ba25 100644 --- a/server/sonar-web/src/main/js/components/common/MeasuresLink.tsx +++ b/server/sonar-web/src/main/js/components/common/MeasuresLink.tsx @@ -20,9 +20,9 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { Link } from 'react-router'; +import MeasuresIcon from '../../components/icons/MeasuresIcon'; +import { translate } from '../../helpers/l10n'; import { getComponentDrilldownUrl } from '../../helpers/urls'; -import MeasuresIcon from '../../sonar-ui-common/components/icons/MeasuresIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; import { BranchLike } from '../../types/branch-like'; import './MeasuresLink.css'; diff --git a/server/sonar-web/src/main/js/components/common/MultiSelect.tsx b/server/sonar-web/src/main/js/components/common/MultiSelect.tsx index 430aa020c64..b5f7e396bab 100644 --- a/server/sonar-web/src/main/js/components/common/MultiSelect.tsx +++ b/server/sonar-web/src/main/js/components/common/MultiSelect.tsx @@ -20,8 +20,8 @@ import * as classNames from 'classnames'; import { difference } from 'lodash'; import * as React from 'react'; -import SearchBox from '../../sonar-ui-common/components/controls/SearchBox'; -import { translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import SearchBox from '../../components/controls/SearchBox'; +import { translateWithParameters } from '../../helpers/l10n'; import MultiSelectOption from './MultiSelectOption'; interface Props { diff --git a/server/sonar-web/src/main/js/components/common/MultiSelectOption.tsx b/server/sonar-web/src/main/js/components/common/MultiSelectOption.tsx index 244c85cb2a9..03b55c64491 100644 --- a/server/sonar-web/src/main/js/components/common/MultiSelectOption.tsx +++ b/server/sonar-web/src/main/js/components/common/MultiSelectOption.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Checkbox from '../../sonar-ui-common/components/controls/Checkbox'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import Checkbox from '../../components/controls/Checkbox'; +import { translate } from '../../helpers/l10n'; export interface MultiSelectOptionProps { active?: boolean; diff --git a/server/sonar-web/src/main/js/components/common/PageCounter.tsx b/server/sonar-web/src/main/js/components/common/PageCounter.tsx index 40bc2808ddc..9eef4e4c03e 100644 --- a/server/sonar-web/src/main/js/components/common/PageCounter.tsx +++ b/server/sonar-web/src/main/js/components/common/PageCounter.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import { formatMeasure } from '../../helpers/measures'; export interface PageCounterProps { className?: string; diff --git a/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx b/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx index c8f4200691e..1b8d1113d09 100644 --- a/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx +++ b/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../components/controls/Tooltip'; +import { translate } from '../../helpers/l10n'; interface PrivacyBadgeContainerProps { className?: string; diff --git a/server/sonar-web/src/main/js/components/common/ProjectKeyInput.tsx b/server/sonar-web/src/main/js/components/common/ProjectKeyInput.tsx index 5a8ae7c92cf..0218d9d1086 100644 --- a/server/sonar-web/src/main/js/components/common/ProjectKeyInput.tsx +++ b/server/sonar-web/src/main/js/components/common/ProjectKeyInput.tsx @@ -19,9 +19,9 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import ValidationInput from '../../components/controls/ValidationInput'; import { PROJECT_KEY_MAX_LEN } from '../../helpers/constants'; -import ValidationInput from '../../sonar-ui-common/components/controls/ValidationInput'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; export interface ProjectKeyInputProps { error?: string; diff --git a/server/sonar-web/src/main/js/components/common/ResetPasswordForm.tsx b/server/sonar-web/src/main/js/components/common/ResetPasswordForm.tsx index d0de4ad77e9..d25834908cd 100644 --- a/server/sonar-web/src/main/js/components/common/ResetPasswordForm.tsx +++ b/server/sonar-web/src/main/js/components/common/ResetPasswordForm.tsx @@ -19,11 +19,11 @@ */ import * as React from 'react'; import { changePassword } from '../../api/users'; -import { SubmitButton } from '../../sonar-ui-common/components/controls/buttons'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import MandatoryFieldMarker from '../../sonar-ui-common/components/ui/MandatoryFieldMarker'; -import MandatoryFieldsExplanation from '../../sonar-ui-common/components/ui/MandatoryFieldsExplanation'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { SubmitButton } from '../../components/controls/buttons'; +import { Alert } from '../../components/ui/Alert'; +import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation'; +import { translate } from '../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/common/RestartButton.tsx b/server/sonar-web/src/main/js/components/common/RestartButton.tsx index 22215f367e3..74256cb6acf 100644 --- a/server/sonar-web/src/main/js/components/common/RestartButton.tsx +++ b/server/sonar-web/src/main/js/components/common/RestartButton.tsx @@ -20,9 +20,9 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { restart } from '../../api/system'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import ConfirmButton from '../../sonar-ui-common/components/controls/ConfirmButton'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import ConfirmButton from '../../components/controls/ConfirmButton'; +import { translate } from '../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/common/SelectListItem.tsx b/server/sonar-web/src/main/js/components/common/SelectListItem.tsx index d3f52082451..31abb2c3b2d 100644 --- a/server/sonar-web/src/main/js/components/common/SelectListItem.tsx +++ b/server/sonar-web/src/main/js/components/common/SelectListItem.tsx @@ -19,7 +19,7 @@ */ import classNames from 'classnames'; import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; +import Tooltip from '../../components/controls/Tooltip'; interface Props { active?: string; diff --git a/server/sonar-web/src/main/js/components/common/StatusIndicator.tsx b/server/sonar-web/src/main/js/components/common/StatusIndicator.tsx index f158f69abcd..34d90f14fc2 100644 --- a/server/sonar-web/src/main/js/components/common/StatusIndicator.tsx +++ b/server/sonar-web/src/main/js/components/common/StatusIndicator.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import './StatusIndicator.css'; export interface StatusIndicatorProps { diff --git a/server/sonar-web/src/main/js/components/common/VisibilitySelector.tsx b/server/sonar-web/src/main/js/components/common/VisibilitySelector.tsx index 663a3a5bf3b..2597eff618b 100644 --- a/server/sonar-web/src/main/js/components/common/VisibilitySelector.tsx +++ b/server/sonar-web/src/main/js/components/common/VisibilitySelector.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Radio from '../../sonar-ui-common/components/controls/Radio'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import Radio from '../../components/controls/Radio'; +import { translate } from '../../helpers/l10n'; interface Props { canTurnToPrivate?: boolean; diff --git a/server/sonar-web/src/main/js/components/common/__tests__/AnalysisWarningsModal-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/AnalysisWarningsModal-test.tsx index a4289821d20..cddd9a1b274 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/AnalysisWarningsModal-test.tsx +++ b/server/sonar-web/src/main/js/components/common/__tests__/AnalysisWarningsModal-test.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { dismissAnalysisWarning, getTask } from '../../../api/ce'; import { mockTaskWarning } from '../../../helpers/mocks/tasks'; import { mockCurrentUser, mockEvent } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { AnalysisWarningsModal } from '../AnalysisWarningsModal'; jest.mock('../../../api/ce', () => ({ diff --git a/server/sonar-web/src/main/js/components/common/__tests__/FormattingTips-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/FormattingTips-test.tsx index 19a384037b0..5df48de49d5 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/FormattingTips-test.tsx +++ b/server/sonar-web/src/main/js/components/common/__tests__/FormattingTips-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import FormattingTips from '../FormattingTips'; const originalOpen = window.open; diff --git a/server/sonar-web/src/main/js/components/common/__tests__/ProjectKeyInput-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/ProjectKeyInput-test.tsx index 3a4a6aaf997..6b0449cd9af 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/ProjectKeyInput-test.tsx +++ b/server/sonar-web/src/main/js/components/common/__tests__/ProjectKeyInput-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import ValidationInput from '../../../sonar-ui-common/components/controls/ValidationInput'; +import ValidationInput from '../../../components/controls/ValidationInput'; import ProjectKeyInput, { ProjectKeyInputProps } from '../ProjectKeyInput'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/components/common/__tests__/ResetPasswordForm-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/ResetPasswordForm-test.tsx index 2650c54e9c3..5e83ae6ccc1 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/ResetPasswordForm-test.tsx +++ b/server/sonar-web/src/main/js/components/common/__tests__/ResetPasswordForm-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { changePassword } from '../../../api/users'; import { mockEvent, mockLoggedInUser } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import ResetPasswordForm from '../ResetPasswordForm'; jest.mock('../../../api/users', () => ({ diff --git a/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.tsx index ce778d7f3fe..8c4449fcf9b 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.tsx +++ b/server/sonar-web/src/main/js/components/common/__tests__/SelectList-test.tsx @@ -19,7 +19,7 @@ */ import { mount, shallow } from 'enzyme'; import * as React from 'react'; -import { click, keydown } from '../../../sonar-ui-common/helpers/testUtils'; +import { click, keydown } from '../../../helpers/testUtils'; import SelectList from '../SelectList'; import SelectListItem from '../SelectListItem'; diff --git a/server/sonar-web/src/main/js/components/common/__tests__/VisibilitySelector-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/VisibilitySelector-test.tsx index 5dce0b915af..edf7e3cce4a 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/VisibilitySelector-test.tsx +++ b/server/sonar-web/src/main/js/components/common/__tests__/VisibilitySelector-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; +import Radio from '../../../components/controls/Radio'; import VisibilitySelector from '../VisibilitySelector'; it('changes visibility', () => { diff --git a/server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx b/server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx new file mode 100644 index 00000000000..0f161597a07 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ActionsDropdown.tsx @@ -0,0 +1,138 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { LocationDescriptor } from 'history'; +import * as React from 'react'; +import { Link } from 'react-router'; +import { translate } from '../../helpers/l10n'; +import DropdownIcon from '../icons/DropdownIcon'; +import SettingsIcon from '../icons/SettingsIcon'; +import { PopupPlacement } from '../ui/popups'; +import { Button } from './buttons'; +import { ClipboardBase } from './clipboard'; +import Dropdown from './Dropdown'; +import Tooltip from './Tooltip'; + +export interface ActionsDropdownProps { + className?: string; + children: React.ReactNode; + onOpen?: () => void; + overlayPlacement?: PopupPlacement; + small?: boolean; + toggleClassName?: string; +} + +export default function ActionsDropdown(props: ActionsDropdownProps) { + const { children, className, overlayPlacement, small, toggleClassName } = props; + return ( + {children}} + overlayPlacement={overlayPlacement}> + + + ); +} + +interface ItemProps { + className?: string; + children: React.ReactNode; + /** used to pass a string to copy to clipboard */ + copyValue?: string; + destructive?: boolean; + /** used to pass a name of downloaded file */ + download?: string; + id?: string; + onClick?: () => void; + to?: LocationDescriptor; +} + +export class ActionsDropdownItem extends React.PureComponent { + handleClick = (event: React.SyntheticEvent) => { + event.preventDefault(); + event.currentTarget.blur(); + if (this.props.onClick) { + this.props.onClick(); + } + }; + + render() { + const className = classNames(this.props.className, { 'text-danger': this.props.destructive }); + + if (this.props.download && typeof this.props.to === 'string') { + return ( +
  • + + {this.props.children} + +
  • + ); + } + + if (this.props.to) { + return ( +
  • + + {this.props.children} + +
  • + ); + } + + if (this.props.copyValue) { + return ( + + {({ setCopyButton, copySuccess }) => ( + +
  • + + {this.props.children} + +
  • +
    + )} +
    + ); + } + + return ( +
  • + + {this.props.children} + +
  • + ); + } +} + +export function ActionsDropdownDivider() { + return
  • ; +} diff --git a/server/sonar-web/src/main/js/components/controls/BackButton.tsx b/server/sonar-web/src/main/js/components/controls/BackButton.tsx new file mode 100644 index 00000000000..3a4010a7a86 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/BackButton.tsx @@ -0,0 +1,72 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import { ThemeConsumer } from '../theme'; +import Tooltip from './Tooltip'; + +interface Props { + className?: string; + disabled?: boolean; + onClick: () => void; + tooltip?: string; +} + +export default class BackButton extends React.PureComponent { + handleClick = (event: React.SyntheticEvent) => { + event.preventDefault(); + event.currentTarget.blur(); + if (!this.props.disabled) { + this.props.onClick(); + } + }; + + renderIcon = () => ( + + {theme => ( + + + + )} + + ); + + render() { + const { tooltip = translate('issues.return_to_list') } = this.props; + return ( + + + {this.renderIcon()} + + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/BoxedGroupAccordion.tsx b/server/sonar-web/src/main/js/components/controls/BoxedGroupAccordion.tsx new file mode 100644 index 00000000000..619b59ca330 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/BoxedGroupAccordion.tsx @@ -0,0 +1,78 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import OpenCloseIcon from '../icons/OpenCloseIcon'; + +interface Props { + children: React.ReactNode; + className?: string; + data?: string; + onClick: (data?: string) => void; + open: boolean; + renderHeader?: () => React.ReactNode; + title: React.ReactNode; +} + +interface State { + hoveringInner: boolean; +} + +export default class BoxedGroupAccordion extends React.PureComponent { + state: State = { hoveringInner: false }; + + handleClick = () => { + this.props.onClick(this.props.data); + }; + + onDetailEnter = () => { + this.setState({ hoveringInner: true }); + }; + + onDetailLeave = () => { + this.setState({ hoveringInner: false }); + }; + + render() { + const { className, open, renderHeader, title } = this.props; + return ( +
    +
    + + + {title} + + {renderHeader && renderHeader()} +
    + {open && ( +
    + {this.props.children} +
    + )} +
    + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/BoxedTabs.tsx b/server/sonar-web/src/main/js/components/controls/BoxedTabs.tsx new file mode 100644 index 00000000000..4429741e96b --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/BoxedTabs.tsx @@ -0,0 +1,92 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { styled, themeColor, ThemedProps, themeSize } from '../theme'; + +export interface BoxedTabsProps { + className?: string; + onSelect: (key: K) => void; + selected?: K; + tabs: Array<{ key: K; label: React.ReactNode }>; +} + +const TabContainer = styled.div` + display: flex; + flex-direction: row; +`; + +const baseBorder = ({ theme }: ThemedProps) => `1px solid ${theme.colors.barBorderColor}`; + +const highlightHoverMixin = ({ theme }: ThemedProps) => ` + &:hover { + background-color: ${theme.colors.barBackgroundColorHighlight}; + } +`; + +const StyledTab = styled.button<{ active: boolean }>` + position: relative; + background-color: ${props => (props.active ? 'white' : props.theme.colors.barBackgroundColor)}; + border-top: ${baseBorder}; + border-left: ${baseBorder}; + border-right: none; + border-bottom: none; + margin-bottom: -1px; + min-width: 128px; + min-height: 56px; + ${props => !props.active && 'cursor: pointer;'} + outline: 0; + padding: calc(2 * ${themeSize('gridSize')}); + + ${props => (!props.active ? highlightHoverMixin : null)} + + &:last-child { + border-right: ${baseBorder}; + } +`; + +const ActiveBorder = styled.div<{ active: boolean }>` + display: ${props => (props.active ? 'block' : 'none')}; + background-color: ${themeColor('blue')}; + height: 3px; + width: 100%; + position: absolute; + left: 0; + top: -1px; +`; + +export default function BoxedTabs(props: BoxedTabsProps) { + const { className, tabs, selected } = props; + + return ( + + {tabs.map(({ key, label }, i) => ( + selected !== key && props.onSelect(key)} + type="button"> + + {label} + + ))} + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/Checkbox.css b/server/sonar-web/src/main/js/components/controls/Checkbox.css new file mode 100644 index 00000000000..6306f855eb6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Checkbox.css @@ -0,0 +1,91 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.icon-checkbox { + display: inline-block; + line-height: 1; + vertical-align: top; + padding: 1px 2px; + box-sizing: border-box; +} + +a.icon-checkbox { + border-bottom: none; +} + +.icon-checkbox:focus { + outline: none; +} + +.icon-checkbox:before { + content: ' '; + display: inline-block; + width: 10px; + height: 10px; + border: 1px solid var(--darkBlue); + border-radius: 2px; + transition: border-color 0.2s ease, background-color 0.2s ease, background-image 0.2s ease, + box-shadow 0.4s ease; +} + +.icon-checkbox:not(.icon-checkbox-disabled):focus:before, +.link-checkbox:not(.disabled):focus:focus .icon-checkbox:before { + box-shadow: 0 0 0 3px rgba(35, 106, 151, 0.25); +} + +.icon-checkbox-checked:before { + background-color: var(--blue); + background-image: url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2014%2014%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20stroke-linejoin%3D%22round%22%20stroke-miterlimit%3D%221.414%22%3E%3Cpath%20d%3D%22M12%204.665c0%20.172-.06.318-.18.438l-5.55%205.55c-.12.12-.266.18-.438.18s-.318-.06-.438-.18L2.18%207.438C2.06%207.317%202%207.17%202%207s.06-.318.18-.44l.878-.876c.12-.12.267-.18.44-.18.17%200%20.317.06.437.18l1.897%201.903%204.233-4.24c.12-.12.266-.18.438-.18s.32.06.44.18l.876.88c.12.12.18.265.18.438z%22%20fill%3D%22%23fff%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E'); + border-color: var(--blue); +} + +.icon-checkbox-checked.icon-checkbox-single:before { + background-image: url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2014%2014%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20stroke-linejoin%3D%22round%22%20stroke-miterlimit%3D%221.414%22%3E%3Cpath%20d%3D%22M10%204.698C10%204.312%209.688%204%209.302%204H4.698C4.312%204%204%204.312%204%204.698v4.604c0%20.386.312.698.698.698h4.604c.386%200%20.698-.312.698-.698V4.698z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E'); +} + +.icon-checkbox-disabled:before { + border: 1px solid var(--disableGrayText); + cursor: not-allowed; +} + +.icon-checkbox-disabled.icon-checkbox-checked:before { + background-color: var(--disableGrayText); +} + +.icon-checkbox-invisible { + visibility: hidden; +} + +.link-checkbox { + color: inherit; + border-bottom: none; +} + +.link-checkbox.disabled, +.link-checkbox.disabled:hover, +.link-checkbox.disabled label { + color: var(--secondFontColor); + cursor: not-allowed; +} + +.link-checkbox:hover, +.link-checkbox:active, +.link-checkbox:focus { + color: inherit; +} diff --git a/server/sonar-web/src/main/js/components/controls/Checkbox.tsx b/server/sonar-web/src/main/js/components/controls/Checkbox.tsx new file mode 100644 index 00000000000..5fb87ddbf03 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Checkbox.tsx @@ -0,0 +1,101 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/* eslint-disable jsx-a11y/anchor-has-content */ +/* eslint-disable jsx-a11y/control-has-associated-label */ + +import * as classNames from 'classnames'; +import * as React from 'react'; +import DeferredSpinner from '../ui/DeferredSpinner'; +import './Checkbox.css'; + +interface Props { + checked: boolean; + disabled?: boolean; + children?: React.ReactNode; + className?: string; + id?: string; + loading?: boolean; + onCheck: (checked: boolean, id?: string) => void; + right?: boolean; + thirdState?: boolean; + title?: string; +} + +export default class Checkbox extends React.PureComponent { + static defaultProps = { + thirdState: false + }; + + handleClick = (event: React.SyntheticEvent) => { + event.preventDefault(); + event.currentTarget.blur(); + if (!this.props.disabled) { + this.props.onCheck(!this.props.checked, this.props.id); + } + }; + + render() { + const { checked, children, disabled, id, loading, right, thirdState, title } = this.props; + const className = classNames('icon-checkbox', { + 'icon-checkbox-checked': checked, + 'icon-checkbox-single': thirdState, + 'icon-checkbox-disabled': disabled + }); + + if (children) { + return ( + + {right && children} + + + + {!right && children} + + ); + } + + if (loading) { + return ; + } + + return ( + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/ClickEventBoundary.tsx b/server/sonar-web/src/main/js/components/controls/ClickEventBoundary.tsx new file mode 100644 index 00000000000..db7d0dc1c93 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ClickEventBoundary.tsx @@ -0,0 +1,35 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; + +export interface ClickEventBoundaryProps { + children: React.ReactElement; +} + +export default function ClickEventBoundary({ children }: ClickEventBoundaryProps) { + return React.cloneElement(children, { + onClick: (e: React.SyntheticEvent) => { + e.stopPropagation(); + if (typeof children.props.onClick === 'function') { + children.props.onClick(e); + } + } + }); +} diff --git a/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx b/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx index e0c4b00f660..cda9d227437 100644 --- a/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx +++ b/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx @@ -25,8 +25,8 @@ import { unsubscribeFromEmailReport } from '../../api/component-report'; import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { isLoggedIn } from '../../helpers/users'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; import { Store } from '../../store/rootReducer'; import { Branch } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; diff --git a/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx b/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx index 581ec4da87e..ed1d82e8df9 100644 --- a/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx +++ b/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx @@ -20,10 +20,10 @@ import * as React from 'react'; import { getReportUrl } from '../../api/component-report'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import Dropdown from '../../sonar-ui-common/components/controls/Dropdown'; -import DropdownIcon from '../../sonar-ui-common/components/icons/DropdownIcon'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import Dropdown from '../../components/controls/Dropdown'; +import DropdownIcon from '../../components/icons/DropdownIcon'; +import { translate, translateWithParameters } from '../../helpers/l10n'; import { Branch } from '../../types/branch-like'; export interface ComponentReportActionsRendererProps { diff --git a/server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx b/server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx new file mode 100644 index 00000000000..9ab6717f2b7 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx @@ -0,0 +1,58 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import ConfirmModal, { ConfirmModalProps } from './ConfirmModal'; +import ModalButton, { ChildrenProps, ModalProps } from './ModalButton'; + +interface Props extends ConfirmModalProps { + children: (props: ChildrenProps) => React.ReactNode; + modalBody: React.ReactNode; + modalHeader: string; + modalHeaderDescription?: React.ReactNode; +} + +interface State { + modal: boolean; +} + +export default class ConfirmButton extends React.PureComponent, State> { + renderConfirmModal = ({ onClose }: ModalProps) => { + const { + children, + modalBody, + modalHeader, + modalHeaderDescription, + ...confirmModalProps + } = this.props; + return ( + + {modalBody} + + ); + }; + + render() { + return {this.props.children}; + } +} diff --git a/server/sonar-web/src/main/js/components/controls/ConfirmModal.tsx b/server/sonar-web/src/main/js/components/controls/ConfirmModal.tsx new file mode 100644 index 00000000000..61bf510c57d --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ConfirmModal.tsx @@ -0,0 +1,107 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import DeferredSpinner from '../ui/DeferredSpinner'; +import { ResetButtonLink, SubmitButton } from './buttons'; +import ClickEventBoundary from './ClickEventBoundary'; +import { ModalProps } from './Modal'; +import SimpleModal, { ChildrenProps } from './SimpleModal'; + +export interface ConfirmModalProps extends ModalProps { + cancelButtonText?: string; + confirmButtonText: string; + confirmData?: T; + confirmDisable?: boolean; + isDestructive?: boolean; + onConfirm: (data?: T) => void | Promise; +} + +interface Props extends ConfirmModalProps { + header: string; + headerDescription?: React.ReactNode; + onClose: () => void; +} + +export default class ConfirmModal extends React.PureComponent> { + mounted = false; + + componentDidMount() { + this.mounted = true; + } + + componentWillUnmount() { + this.mounted = false; + } + + handleSubmit = () => { + const result = this.props.onConfirm(this.props.confirmData); + if (result) { + return result.then(this.props.onClose, () => {}); + } + this.props.onClose(); + return undefined; + }; + + renderModalContent = ({ onCloseClick, onFormSubmit, submitting }: ChildrenProps) => { + const { + children, + confirmButtonText, + confirmDisable, + header, + headerDescription, + isDestructive, + cancelButtonText = translate('cancel') + } = this.props; + return ( + +
    +
    +

    {header}

    + {headerDescription} +
    +
    {children}
    +
    + + + {confirmButtonText} + + + {cancelButtonText} + +
    +
    +
    + ); + }; + + render() { + const { header, onClose, noBackdrop, size } = this.props; + const modalProps = { header, onClose, noBackdrop, size }; + return ( + + {this.renderModalContent} + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/DateInput.tsx b/server/sonar-web/src/main/js/components/controls/DateInput.tsx index eb1d5422093..0c5dc5421f4 100644 --- a/server/sonar-web/src/main/js/components/controls/DateInput.tsx +++ b/server/sonar-web/src/main/js/components/controls/DateInput.tsx @@ -26,18 +26,14 @@ import { range } from 'lodash'; import * as React from 'react'; import { DayModifiers, Modifier, Modifiers } from 'react-day-picker'; import { InjectedIntlProps, injectIntl } from 'react-intl'; -import { ButtonIcon, ClearButton } from '../../sonar-ui-common/components/controls/buttons'; -import OutsideClickHandler from '../../sonar-ui-common/components/controls/OutsideClickHandler'; -import Select from '../../sonar-ui-common/components/controls/Select'; -import CalendarIcon from '../../sonar-ui-common/components/icons/CalendarIcon'; -import ChevronLeftIcon from '../../sonar-ui-common/components/icons/ChevronLeftIcon'; -import ChevronRightIcon from '../../sonar-ui-common/components/icons/ChevronRightIcon'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; -import { - getShortMonthName, - getShortWeekDayName, - getWeekDayName -} from '../../sonar-ui-common/helpers/l10n'; +import { ButtonIcon, ClearButton } from '../../components/controls/buttons'; +import OutsideClickHandler from '../../components/controls/OutsideClickHandler'; +import Select from '../../components/controls/Select'; +import CalendarIcon from '../../components/icons/CalendarIcon'; +import ChevronLeftIcon from '../../components/icons/ChevronLeftIcon'; +import ChevronRightIcon from '../../components/icons/ChevronRightIcon'; +import { getShortMonthName, getShortWeekDayName, getWeekDayName } from '../../helpers/l10n'; +import { lazyLoadComponent } from '../lazyLoadComponent'; import './DayPicker.css'; import './styles.css'; diff --git a/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx b/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx index 371ad27425a..fae75f672ce 100644 --- a/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx +++ b/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx @@ -20,7 +20,7 @@ import * as classNames from 'classnames'; import { max, min } from 'date-fns'; import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import DateInput from './DateInput'; type DateRange = { from?: Date; to?: Date }; diff --git a/server/sonar-web/src/main/js/components/controls/DocumentClickHandler.tsx b/server/sonar-web/src/main/js/components/controls/DocumentClickHandler.tsx new file mode 100644 index 00000000000..45765c95874 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/DocumentClickHandler.tsx @@ -0,0 +1,53 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; + +interface Props { + children: React.ReactNode; + onClick: () => void; +} + +export default class DocumentClickHandler extends React.Component { + componentDidMount() { + setTimeout(() => { + this.addClickHandler(); + }, 0); + } + + componentWillUnmount() { + this.removeClickHandler(); + } + + addClickHandler = () => { + document.addEventListener('click', this.handleDocumentClick); + }; + + removeClickHandler = () => { + document.removeEventListener('click', this.handleDocumentClick); + }; + + handleDocumentClick = () => { + this.props.onClick(); + }; + + render() { + return this.props.children; + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Dropdown.css b/server/sonar-web/src/main/js/components/controls/Dropdown.css new file mode 100644 index 00000000000..41b7bd79b15 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Dropdown.css @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.dropdown { + position: relative; + display: inline-block; + vertical-align: middle; +} + +.dropdown-bottom-hint { + line-height: 16px; + margin-bottom: -5px; + padding: 5px 10px; + border-top: 1px solid var(--barBorderColor); + background-color: var(--barBackgroundColor); + color: var(--secondFontColor); + font-size: 11px; +} diff --git a/server/sonar-web/src/main/js/components/controls/Dropdown.tsx b/server/sonar-web/src/main/js/components/controls/Dropdown.tsx new file mode 100644 index 00000000000..92b1444aeb7 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Dropdown.tsx @@ -0,0 +1,159 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { Popup, PopupPlacement } from '../ui/popups'; +import './Dropdown.css'; +import ScreenPositionFixer from './ScreenPositionFixer'; +import Toggler from './Toggler'; + +interface OnClickCallback { + (event?: React.SyntheticEvent): void; +} + +interface RenderProps { + closeDropdown: () => void; + onToggleClick: OnClickCallback; + open: boolean; +} + +interface Props { + children: + | ((renderProps: RenderProps) => JSX.Element) + | React.ReactElement<{ onClick: OnClickCallback }>; + className?: string; + closeOnClick?: boolean; + closeOnClickOutside?: boolean; + onOpen?: () => void; + overlay: React.ReactNode; + overlayPlacement?: PopupPlacement; + noOverlayPadding?: boolean; + tagName?: string; +} + +interface State { + open: boolean; +} + +export default class Dropdown extends React.PureComponent { + state: State = { open: false }; + + componentDidUpdate(_: Props, prevState: State) { + if (!prevState.open && this.state.open && this.props.onOpen) { + this.props.onOpen(); + } + } + + closeDropdown = () => this.setState({ open: false }); + + handleToggleClick = (event?: React.SyntheticEvent) => { + if (event) { + event.preventDefault(); + event.currentTarget.blur(); + } + this.setState(state => ({ open: !state.open })); + }; + + render() { + const a11yAttrs = { + 'aria-expanded': String(this.state.open), + 'aria-haspopup': 'true' + }; + + const child = React.isValidElement(this.props.children) + ? React.cloneElement(this.props.children, { onClick: this.handleToggleClick, ...a11yAttrs }) + : this.props.children({ + closeDropdown: this.closeDropdown, + onToggleClick: this.handleToggleClick, + open: this.state.open + }); + + const { closeOnClick = true, closeOnClickOutside = false } = this.props; + + const toggler = ( + + {this.props.overlay} + + }> + {child} + + ); + + return React.createElement( + this.props.tagName || 'div', + { className: classNames('dropdown', this.props.className) }, + toggler + ); + } +} + +interface OverlayProps { + className?: string; + children: React.ReactNode; + noPadding?: boolean; + placement?: PopupPlacement; +} + +// TODO use the same styling for + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/ListFooter.tsx b/server/sonar-web/src/main/js/components/controls/ListFooter.tsx new file mode 100644 index 00000000000..8617c126d65 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ListFooter.tsx @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate, translateWithParameters } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; +import DeferredSpinner from '../ui/DeferredSpinner'; +import { Button } from './buttons'; + +export interface ListFooterProps { + count: number; + className?: string; + loading?: boolean; + loadMore?: () => void; + needReload?: boolean; + reload?: () => void; + ready?: boolean; + total?: number; +} + +export default function ListFooter(props: ListFooterProps) { + const { className, count, loading, needReload, total, ready = true } = props; + const hasMore = total && total > count; + + let button; + if (needReload && props.reload) { + button = ( + + ); + } else if (hasMore && props.loadMore) { + button = ( + + ); + } + + return ( +
    + {translateWithParameters( + 'x_of_y_shown', + formatMeasure(count, 'INT', null), + formatMeasure(total, 'INT', null) + )} + {button} + {loading && } +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/Modal.css b/server/sonar-web/src/main/js/components/controls/Modal.css new file mode 100644 index 00000000000..04e3de15a21 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Modal.css @@ -0,0 +1,211 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.modal, +.ReactModal__Content { + position: fixed; + z-index: var(--modalZIndex); + top: 0; + left: 50%; + margin-left: -270px; + width: 540px; + background-color: #fff; + opacity: 0; + transition: all 0.2s ease; + border-radius: 3px; +} + +.modal:focus, +.ReactModal__Content:focus { + outline: none; +} + +.modal.in, +.ReactModal__Content--after-open { + top: 15%; + opacity: 1; +} + +.modal-small { + width: 450px; + margin-left: -225px; +} + +.modal-medium { + width: 830px; + margin-left: -415px; +} + +.modal-large { + width: calc(100% - 40px); + max-width: 1280px; + min-width: 1040px; + margin-left: 0; + transform: translateX(-50%); +} + +.modal-overlay, +.ReactModal__Overlay { + position: fixed; + z-index: var(--modalOverlayZIndex); + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(0, 0, 0, 0.7); + opacity: 0; + transition: all 0.2s ease; +} + +.modal-overlay.in, +.ReactModal__Overlay--after-open { + opacity: 1; +} + +.modal-no-backdrop { + background-color: transparent; +} + +.modal-open, +.ReactModal__Body--open { + overflow: hidden; + margin-right: var(--sbw); +} + +.modal-head { + padding: calc(4 * var(--gridSize)); + padding-bottom: 0; +} + +.modal-head h1, +.modal-head h2 { + margin: 0; + font-size: var(--bigFontSize); + font-weight: bold; + line-height: normal; + overflow-wrap: break-word; +} + +.modal-body { + padding: var(--pagePadding) calc(4 * var(--gridSize)); +} + +.modal-container { + max-height: 60vh; + box-sizing: border-box; + overflow-y: auto; + border-top: 1px solid var(--barBorderColor); + margin-top: var(--pagePadding); + padding-right: calc(4 * var(--gridSize)); +} + +.modal-container > :last-child { + margin-bottom: var(--pagePadding); +} + +.modal-field, +.modal-validation-field { + clear: both; + display: block; + padding: 0; + margin-bottom: calc(var(--gridSize) * 2); +} + +.modal-field label, +.modal-validation-field label { + display: block; + font-weight: bold; + padding-bottom: calc(var(--gridSize) / 2); +} + +.modal-field a.icon-checkbox, +.modal-field input, +.modal-field select, +.modal-field textarea, +.modal-field .Select { + margin-right: 5px; +} + +.modal-field a.icon-checkbox { + height: 24px; +} + +.modal-field input[type='radio'], +.modal-field input[type='checkbox'] { + margin-top: 5px; + margin-bottom: 4px; +} + +.modal-field > .icon-checkbox { + padding-top: 6px; + padding-right: 8px; +} + +.modal-field input[type='text'], +.modal-field input[type='email'], +.modal-field input[type='password'], +.modal-field textarea, +.modal-field select, +.modal-field .Select { + width: 100%; +} + +.modal-validation-field input, +.modal-validation-field textarea, +.modal-validation-field .Select { + margin-right: var(--gridSize); + margin-bottom: 2px; + width: calc(100% - 3 * var(--gridSize)); +} + +.modal-field textarea, +.modal-validation-field textarea { + max-width: 100%; + min-width: 100%; + max-height: 50vh; + min-height: var(--controlHeight); +} +.modal-validation-field input:not(.is-invalid), +.modal-validation-field .Select:not(.is-invalid) { + margin-bottom: calc(var(--tinyControlHeight) + 2px); +} + +.modal-field-description { + line-height: 1.4; + color: var(--secondFontColor); + font-size: var(--smallFontSize); + overflow: hidden; + text-overflow: ellipsis; + margin-top: 2px; +} + +.modal-foot { + padding: var(--pagePadding) calc(4 * var(--gridSize)); + border-top: 1px solid var(--barBorderColor); + background-color: var(--barBackgroundColor); + border-radius: 3px; + text-align: right; +} + +.modal-foot button, +.modal-foot .button, +.modal-foot input[type='submit'], +.modal-foot input[type='button'] { + margin-left: var(--gridSize); +} diff --git a/server/sonar-web/src/main/js/components/controls/Modal.tsx b/server/sonar-web/src/main/js/components/controls/Modal.tsx new file mode 100644 index 00000000000..d97d9e1522b --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Modal.tsx @@ -0,0 +1,76 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import * as ReactModal from 'react-modal'; +import { getReactDomContainerSelector } from '../../helpers/init'; +import './Modal.css'; + +ReactModal.setAppElement(getReactDomContainerSelector()); + +export interface ModalProps { + children: React.ReactNode; + size?: 'small' | 'medium' | 'large'; + noBackdrop?: boolean; +} + +interface Props extends ModalProps { + /* String or object className to be applied to the modal content. */ + className?: string; + + /* String or object className to be applied to the overlay. */ + overlayClassName?: string; + + /* Function that will be run after the modal has opened. */ + onAfterOpen?(): void; + + /* Function that will be run after the modal has closed. */ + onAfterClose?(): void; + + /* Function that will be run when the modal is requested to be closed, prior to actually closing. */ + onRequestClose?(event: React.MouseEvent | React.KeyboardEvent): void; + + /* Boolean indicating if the modal should be focused after render */ + shouldFocusAfterRender?: boolean; + + /* Boolean indicating if the overlay should close the modal. Defaults to true. */ + shouldCloseOnOverlayClick?: boolean; + + /* Boolean indicating if pressing the esc key should close the modal */ + shouldCloseOnEsc?: boolean; + + /* String indicating how the content container should be announced to screenreaders. */ + contentLabel: string; +} + +export default function Modal(props: Props) { + return ( + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/ModalButton.tsx b/server/sonar-web/src/main/js/components/controls/ModalButton.tsx new file mode 100644 index 00000000000..7008f3e3979 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ModalButton.tsx @@ -0,0 +1,80 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; + +export interface ChildrenProps { + onClick: () => void; + onFormSubmit: (event: React.FormEvent) => void; +} + +export interface ModalProps { + onClose: () => void; +} + +export interface Props { + children: (props: ChildrenProps) => React.ReactNode; + modal: (props: ModalProps) => React.ReactNode; +} + +interface State { + modal: boolean; +} + +export default class ModalButton extends React.PureComponent { + mounted = false; + state: State = { modal: false }; + + componentDidMount() { + this.mounted = true; + } + + componentWillUnmount() { + this.mounted = false; + } + + handleButtonClick = () => { + this.setState({ modal: true }); + }; + + handleFormSubmit = (event?: React.FormEvent) => { + if (event) { + event.preventDefault(); + } + this.setState({ modal: true }); + }; + + handleCloseModal = () => { + if (this.mounted) { + this.setState({ modal: false }); + } + }; + + render() { + return ( + <> + {this.props.children({ + onClick: this.handleButtonClick, + onFormSubmit: this.handleFormSubmit + })} + {this.state.modal && this.props.modal({ onClose: this.handleCloseModal })} + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/ModalValidationField.tsx b/server/sonar-web/src/main/js/components/controls/ModalValidationField.tsx new file mode 100644 index 00000000000..2aa649de238 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ModalValidationField.tsx @@ -0,0 +1,49 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import AlertErrorIcon from '../icons/AlertErrorIcon'; +import AlertSuccessIcon from '../icons/AlertSuccessIcon'; + +interface Props { + children: (props: { className?: string }) => React.ReactNode; + description?: string; + dirty: boolean; + error: string | undefined; + label?: React.ReactNode; + touched: boolean | undefined; +} + +export default function ModalValidationField(props: Props) { + const { description, dirty, error } = props; + + const isValid = dirty && props.touched && error === undefined; + const showError = dirty && props.touched && error !== undefined; + return ( +
    + {props.label} + {props.children({ className: classNames({ 'is-invalid': showError, 'is-valid': isValid }) })} + {showError && } + {isValid && } + {showError &&

    {error}

    } + {description &&
    {description}
    } +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/OutsideClickHandler.tsx b/server/sonar-web/src/main/js/components/controls/OutsideClickHandler.tsx new file mode 100644 index 00000000000..eaea43f89ba --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/OutsideClickHandler.tsx @@ -0,0 +1,64 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { findDOMNode } from 'react-dom'; + +interface Props { + children: React.ReactNode; + onClickOutside: () => void; +} + +export default class OutsideClickHandler extends React.Component { + mounted = false; + + componentDidMount() { + this.mounted = true; + setTimeout(() => { + this.addClickHandler(); + }, 0); + } + + componentWillUnmount() { + this.mounted = false; + this.removeClickHandler(); + } + + addClickHandler = () => { + window.addEventListener('click', this.handleWindowClick); + }; + + removeClickHandler = () => { + window.removeEventListener('click', this.handleWindowClick); + }; + + handleWindowClick = (event: MouseEvent) => { + if (this.mounted) { + // eslint-disable-next-line react/no-find-dom-node + const node = findDOMNode(this); + if (!node || !node.contains(event.target as Node)) { + this.props.onClickOutside(); + } + } + }; + + render() { + return this.props.children; + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Radio.css b/server/sonar-web/src/main/js/components/controls/Radio.css new file mode 100644 index 00000000000..6d53c4b383b --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Radio.css @@ -0,0 +1,76 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.icon-radio { + position: relative; + display: inline-block; + vertical-align: top; + width: 14px; + height: 14px; + margin: 1px; + border: 1px solid var(--gray80); + border-radius: 12px; + box-sizing: border-box; + transition: border-color 0.3s ease; + flex-shrink: 0; +} + +.icon-radio:after { + position: absolute; + top: 2px; + left: 2px; + display: block; + width: 8px; + height: 8px; + border-radius: 8px; + background-color: var(--darkBlue); + content: ''; + opacity: 0; + transition: opacity 0.3s ease; +} + +.link-radio .icon-radio.is-checked:after { + opacity: 1; +} + +.link-radio { + color: inherit; + border-bottom: none; +} + +.link-radio:not(.disabled):hover, +.link-radio:not(.disabled):active, +.link-radio:not(.disabled):focus { + color: inherit; +} + +.link-radio:not(.disabled):hover > .icon-radio { + border-color: var(--blue); +} + +.link-radio.disabled, +.link-radio.disabled:hover, +.link-radio.disabled label { + color: var(--disableGrayText); + cursor: not-allowed; +} + +.link-radio.disabled .icon-radio:after { + background-color: var(--disableGrayBg); +} diff --git a/server/sonar-web/src/main/js/components/controls/Radio.tsx b/server/sonar-web/src/main/js/components/controls/Radio.tsx new file mode 100644 index 00000000000..c664c6f2499 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Radio.tsx @@ -0,0 +1,56 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import './Radio.css'; + +interface Props { + checked: boolean; + className?: string; + disabled?: boolean; + onCheck: (value: string) => void; + value: string; +} + +export default class Radio extends React.PureComponent { + handleClick = (event: React.MouseEvent) => { + event.preventDefault(); + + if (!this.props.disabled) { + this.props.onCheck(this.props.value); + } + }; + + render() { + const { className, checked, children, disabled } = this.props; + + return ( +
    + + {children} + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/RadioCard.css b/server/sonar-web/src/main/js/components/controls/RadioCard.css new file mode 100644 index 00000000000..f51fe41c930 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/RadioCard.css @@ -0,0 +1,134 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.radio-card { + display: flex; + flex-direction: column; + width: 450px; + min-height: 210px; + background-color: #fff; + border: solid 1px var(--barBorderColor); + border-radius: 3px; + box-sizing: border-box; + margin-right: calc(2 * var(--gridSize)); + transition: all 0.2s ease; +} + +.radio-card.animated { + height: 0; + border-width: 0; + overflow: hidden; +} + +.radio-card.animated.open { + height: 210px; + border-width: 1px; +} + +.radio-card.highlight { + box-shadow: var(--defaultShadow); +} + +.radio-card:last-child { + margin-right: 0; +} + +.radio-card:focus { + outline: none; +} + +.radio-card-vertical { + width: 100%; + min-height: auto; +} + +.radio-card-actionable { + cursor: pointer; +} + +.radio-card-actionable:not(.disabled):hover { + box-shadow: var(--defaultShadow); + transform: translateY(-2px); +} + +.radio-card-actionable.selected { + border-color: var(--darkBlue); +} + +/* + * Disabled transform property because it moves the element to a new stacking context + * creating z-index conflicts with other components. + * This is a problem with a vertical list of RadioCards where a select might be above another RadioCard + */ +.radio-card-actionable.radio-card-vertical:not(.disabled):hover { + box-shadow: none; + transform: none; +} + +.radio-card-actionable.radio-card-vertical:not(.selected):not(.disabled):hover { + border-color: var(--lightBlue); +} + +.radio-card-actionable.selected .radio-card-recommended { + border: solid 1px var(--darkBlue); + border-top: none; +} + +.radio-card-actionable.disabled { + cursor: not-allowed; + background-color: var(--disableGrayBg); + border-color: var(--disableGrayBorder); +} + +.radio-card-actionable.disabled h2, +.radio-card-actionable.disabled ul { + color: var(--disableGrayText); +} + +.radio-card-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: calc(2 * var(--gridSize)) calc(2 * var(--gridSize)) 0; +} + +.radio-card-body { + flex-grow: 1; + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 0 calc(2 * var(--gridSize)) calc(2 * var(--gridSize)); +} + +.radio-card-body .alert { + margin-bottom: 0; +} + +.radio-card-recommended { + position: relative; + padding: 6px calc(var(--gridSize) * 2); + left: -1px; + bottom: -1px; + width: 450px; + color: #fff; + background-color: var(--blue); + border-radius: 0 0 3px 3px; + box-sizing: border-box; + font-size: var(--smallFontSize); +} diff --git a/server/sonar-web/src/main/js/components/controls/RadioCard.tsx b/server/sonar-web/src/main/js/components/controls/RadioCard.tsx new file mode 100644 index 00000000000..223e597e6d9 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/RadioCard.tsx @@ -0,0 +1,92 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; +import { translate } from '../../helpers/l10n'; +import RecommendedIcon from '../icons/RecommendedIcon'; +import './Radio.css'; +import './RadioCard.css'; + +export interface RadioCardProps { + className?: string; + disabled?: boolean; + onClick?: () => void; + selected?: boolean; +} + +interface Props extends RadioCardProps { + children: React.ReactNode; + recommended?: string; + title: React.ReactNode; + titleInfo?: React.ReactNode; + vertical?: boolean; +} + +export default function RadioCard(props: Props) { + const { + className, + disabled, + onClick, + recommended, + selected, + titleInfo, + vertical = false + } = props; + const isActionable = Boolean(onClick); + return ( +
    +

    + + {isActionable && ( + + )} + {props.title} + + {titleInfo} +

    +
    {props.children}
    + {recommended && ( +
    + + {translate('recommended')} }} + /> +
    + )} +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/RadioToggle.css b/server/sonar-web/src/main/js/components/controls/RadioToggle.css new file mode 100644 index 00000000000..4ca9c28df7c --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/RadioToggle.css @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.radio-toggle { + display: inline-block; + vertical-align: middle; + font-size: 0; + white-space: nowrap; +} + +.radio-toggle > li { + display: inline-block; + vertical-align: middle; + font-size: var(--smallFontSize); +} + +.radio-toggle > li:first-child > label { + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} + +.radio-toggle > li:last-child > label { + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; +} + +.radio-toggle > li + li > label { + border-left: none; +} + +.radio-toggle > li > label { + display: inline-block; + padding: 0 12px; + margin: 0; + border: 1px solid var(--darkBlue); + color: var(--darkBlue); + height: calc(var(--controlHeight) - 2px); + line-height: calc(var(--controlHeight) - 2px); + cursor: pointer; + font-weight: 600; +} + +.radio-toggle input[type='radio'] { + display: none; +} + +.radio-toggle input[type='radio']:checked + label { + background-color: var(--darkBlue); + color: #fff; +} + +.radio-toggle input[type='radio']:disabled + label { + color: var(--disableGrayText); + border-color: var(--disableGrayBorder); + background: var(--disableGrayBg); + cursor: not-allowed; +} diff --git a/server/sonar-web/src/main/js/components/controls/RadioToggle.tsx b/server/sonar-web/src/main/js/components/controls/RadioToggle.tsx new file mode 100644 index 00000000000..2ccf856ce30 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/RadioToggle.tsx @@ -0,0 +1,74 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import './RadioToggle.css'; +import Tooltip from './Tooltip'; + +type ToggleValueType = string | number | boolean; +interface Option { + disabled?: boolean; + label: string; + tooltip?: string; + value: ToggleValueType; +} + +interface Props { + className?: string; + name: string; + onCheck: (value: ToggleValueType) => void; + options: Option[]; + value?: ToggleValueType; +} + +export default class RadioToggle extends React.PureComponent { + static defaultProps = { + disabled: false, + value: null + }; + + renderOption = (option: Option) => { + const checked = option.value === this.props.value; + const htmlId = this.props.name + '__' + option.value; + return ( +
  • + this.props.onCheck(option.value)} + type="radio" + /> + + + +
  • + ); + }; + + render() { + return ( +
      + {this.props.options.map(this.renderOption)} +
    + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/ReloadButton.tsx b/server/sonar-web/src/main/js/components/controls/ReloadButton.tsx new file mode 100644 index 00000000000..1ab7a529fd5 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ReloadButton.tsx @@ -0,0 +1,63 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import { ThemeConsumer } from '../theme'; +import Tooltip from './Tooltip'; + +interface Props { + className?: string; + tooltip?: string; + onClick: () => void; +} + +export default class ReloadButton extends React.PureComponent { + handleClick = (event: React.SyntheticEvent) => { + event.preventDefault(); + event.currentTarget.blur(); + this.props.onClick(); + }; + + render() { + const { tooltip = translate('reload') } = this.props; + return ( + + + { + + {theme => ( + + + + )} + + } + + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/ScreenPositionFixer.tsx b/server/sonar-web/src/main/js/components/controls/ScreenPositionFixer.tsx new file mode 100644 index 00000000000..0065201d22e --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ScreenPositionFixer.tsx @@ -0,0 +1,117 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { throttle } from 'lodash'; +import * as React from 'react'; +import { findDOMNode } from 'react-dom'; +import { Theme, withTheme } from '../theme'; + +interface Props { + /** + * First time `children` are rendered with `undefined` fixes to measure the offset. + * Second time it renders with the computed fixes. + */ + children: (props: Fixes) => React.ReactNode; + + /** + * Use this flag to force re-positioning. + * Use cases: + * - when you need to measure `children` size first + * - when you load content asynchronously + */ + ready?: boolean; + theme: Theme; +} + +interface Fixes { + leftFix?: number; + topFix?: number; +} + +export class ScreenPositionFixer extends React.Component { + throttledPosition: () => void; + + constructor(props: Props) { + super(props); + this.state = {}; + this.throttledPosition = throttle(this.position, 50); + } + + componentDidMount() { + this.addEventListeners(); + this.position(); + } + + componentDidUpdate(prevProps: Props) { + if (!prevProps.ready && this.props.ready) { + this.position(); + } else if (prevProps.ready && !this.props.ready) { + this.reset(); + } + } + + componentWillUnmount() { + this.removeEventListeners(); + } + + addEventListeners = () => { + window.addEventListener('resize', this.throttledPosition); + }; + + removeEventListeners = () => { + window.removeEventListener('resize', this.throttledPosition); + }; + + reset = () => { + this.setState({ leftFix: undefined, topFix: undefined }); + }; + + position = () => { + const edgeMargin = 0.5 * this.props.theme.rawSizes.grid; + + // eslint-disable-next-line react/no-find-dom-node + const node = findDOMNode(this); + if (node && node instanceof Element) { + const { width, height, left, top } = node.getBoundingClientRect(); + const { clientHeight, clientWidth } = document.documentElement; + + let leftFix = 0; + if (left < edgeMargin) { + leftFix = edgeMargin - left; + } else if (left + width > clientWidth - edgeMargin) { + leftFix = clientWidth - edgeMargin - left - width; + } + + let topFix = 0; + if (top < edgeMargin) { + topFix = edgeMargin - top; + } else if (top + height > clientHeight - edgeMargin) { + topFix = clientHeight - edgeMargin - top - height; + } + + this.setState({ leftFix, topFix }); + } + }; + + render() { + return this.props.children(this.state); + } +} + +export default withTheme(ScreenPositionFixer); diff --git a/server/sonar-web/src/main/js/components/controls/SearchBox.css b/server/sonar-web/src/main/js/components/controls/SearchBox.css new file mode 100644 index 00000000000..3e91462ef5c --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SearchBox.css @@ -0,0 +1,104 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.search-box { + position: relative; + display: inline-block; + vertical-align: middle; + font-size: 0; + white-space: nowrap; +} + +.search-box, +.search-box-input { + width: 100%; + max-width: 300px; +} + +.search-box-input { + /* for magnifier icon */ + padding-left: var(--controlHeight) !important; + /* for clear button */ + padding-right: var(--controlHeight) !important; + font-size: var(--baseFontSize); +} + +.search-box-input::-webkit-search-decoration, +.search-box-input::-webkit-search-cancel-button, +.search-box-input::-webkit-search-results-button, +.search-box-input::-webkit-search-results-decoration { + -webkit-appearance: none; + display: none; +} + +.search-box-input::-ms-clear, +.search-box-input::-ms-reveal { + display: none; + width: 0; + height: 0; +} + +.search-box-note { + position: absolute; + top: 1px; + left: 40px; + right: var(--controlHeight); + line-height: var(--controlHeight); + color: var(--secondFontColor); + font-size: var(--smallFontSize); + text-align: right; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + pointer-events: none; +} + +.search-box-input:focus ~ .search-box-magnifier { + color: var(--blue); +} + +.search-box-magnifier { + position: absolute; + top: 4px; + left: 4px; + color: var(--gray60); + transition: color 0.3s ease; +} + +.search-box > .deferred-spinner { + position: absolute; + top: 4px; + left: 5px; +} + +.search-box-clear { + position: absolute; + top: 4px; + right: 4px; +} + +.search-box-input-note { + position: absolute; + top: 100%; + left: 0; + line-height: 1; + color: var(--secondFontColor); + font-size: var(--smallFontSize); + white-space: nowrap; +} diff --git a/server/sonar-web/src/main/js/components/controls/SearchBox.tsx b/server/sonar-web/src/main/js/components/controls/SearchBox.tsx new file mode 100644 index 00000000000..d03081e26bc --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SearchBox.tsx @@ -0,0 +1,176 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { Cancelable, debounce } from 'lodash'; +import * as React from 'react'; +import { translate, translateWithParameters } from '../../helpers/l10n'; +import SearchIcon from '../icons/SearchIcon'; +import DeferredSpinner from '../ui/DeferredSpinner'; +import { ClearButton } from './buttons'; +import './SearchBox.css'; + +interface Props { + autoFocus?: boolean; + className?: string; + id?: string; + innerRef?: (node: HTMLInputElement | null) => void; + loading?: boolean; + maxLength?: number; + minLength?: number; + onChange: (value: string) => void; + onClick?: React.MouseEventHandler; + onFocus?: React.FocusEventHandler; + onKeyDown?: React.KeyboardEventHandler; + placeholder: string; + value?: string; +} + +interface State { + value: string; +} + +const DEFAULT_MAX_LENGTH = 100; + +export default class SearchBox extends React.PureComponent { + debouncedOnChange: ((query: string) => void) & Cancelable; + input?: HTMLInputElement | null; + + constructor(props: Props) { + super(props); + this.state = { value: props.value || '' }; + this.debouncedOnChange = debounce(this.props.onChange, 250); + } + + componentDidUpdate(prevProps: Props) { + if ( + // input is controlled + this.props.value !== undefined && + // parent is aware of last change + // can happen when previous value was less than min length + this.state.value === prevProps.value && + this.state.value !== this.props.value + ) { + this.setState({ value: this.props.value }); + } + } + + changeValue = (value: string, debounced = true) => { + const { minLength } = this.props; + if (value.length === 0) { + // immediately notify when value is empty + this.props.onChange(''); + // and cancel scheduled callback + this.debouncedOnChange.cancel(); + } else if (!minLength || minLength <= value.length) { + if (debounced) { + this.debouncedOnChange(value); + } else { + this.props.onChange(value); + } + } + }; + + handleInputChange = (event: React.SyntheticEvent) => { + const { value } = event.currentTarget; + this.setState({ value }); + this.changeValue(value); + }; + + handleInputKeyDown = (event: React.KeyboardEvent) => { + if (event.keyCode === 27) { + // escape + event.preventDefault(); + this.handleResetClick(); + } + if (this.props.onKeyDown) { + this.props.onKeyDown(event); + } + }; + + handleResetClick = () => { + this.changeValue('', false); + if (this.props.value === undefined || this.props.value === '') { + this.setState({ value: '' }); + } + if (this.input) { + this.input.focus(); + } + }; + + ref = (node: HTMLInputElement | null) => { + this.input = node; + if (this.props.innerRef) { + this.props.innerRef(node); + } + }; + + render() { + const { loading, minLength, maxLength = DEFAULT_MAX_LENGTH } = this.props; + const { value } = this.state; + + const inputClassName = classNames('search-box-input', { + touched: value.length > 0 && (!minLength || minLength > value.length) + }); + + const tooShort = minLength !== undefined && value.length > 0 && value.length < minLength; + + return ( +
    + + + + + + + {value && ( + + )} + + {tooShort && ( + + {translateWithParameters('select2.tooShort', minLength!)} + + )} +
    + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/SearchSelect.tsx b/server/sonar-web/src/main/js/components/controls/SearchSelect.tsx new file mode 100644 index 00000000000..cf18ce100f2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SearchSelect.tsx @@ -0,0 +1,154 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { debounce } from 'lodash'; +import * as React from 'react'; +import { translate, translateWithParameters } from '../../helpers/l10n'; +import Select, { Creatable } from './Select'; + +interface Props { + autofocus?: boolean; + canCreate?: boolean; + className?: string; + clearable?: boolean; + defaultOptions?: T[]; + minimumQueryLength?: number; + multi?: boolean; + onSearch: (query: string) => Promise; + onSelect?: (option: T) => void; + onMultiSelect?: (options: T[]) => void; + promptTextCreator?: (label: string) => string; + renderOption?: (option: T) => JSX.Element; + resetOnBlur?: boolean; + value?: T | T[]; +} + +interface State { + loading: boolean; + options: T[]; + query: string; +} + +export default class SearchSelect extends React.PureComponent< + Props, + State +> { + mounted = false; + + constructor(props: Props) { + super(props); + this.state = { loading: false, options: props.defaultOptions || [], query: '' }; + this.handleSearch = debounce(this.handleSearch, 250); + } + + componentDidMount() { + this.mounted = true; + } + + componentWillUnmount() { + this.mounted = false; + } + + get autofocus() { + return this.props.autofocus !== undefined ? this.props.autofocus : true; + } + + get minimumQueryLength() { + return this.props.minimumQueryLength !== undefined ? this.props.minimumQueryLength : 2; + } + + get resetOnBlur() { + return this.props.resetOnBlur !== undefined ? this.props.resetOnBlur : true; + } + + handleSearch = (query: string) => { + // Ignore the result if the query changed + const currentQuery = query; + this.props.onSearch(currentQuery).then( + options => { + if (this.mounted) { + this.setState(state => ({ + loading: false, + options: state.query === currentQuery ? options : state.options + })); + } + }, + () => { + if (this.mounted) { + this.setState({ loading: false }); + } + } + ); + }; + + handleChange = (option: T | T[]) => { + if (Array.isArray(option)) { + if (this.props.onMultiSelect) { + this.props.onMultiSelect(option); + } + } else if (this.props.onSelect) { + this.props.onSelect(option); + } + }; + + handleInputChange = (query: string) => { + if (query.length >= this.minimumQueryLength) { + this.setState({ loading: true, query }); + this.handleSearch(query); + } else { + // `onInputChange` is called with an empty string after a user selects a value + // in this case we shouldn't reset `options`, because it also resets select value :( + const options = (query.length === 0 && this.props.defaultOptions) || []; + this.setState({ options, query }); + } + }; + + // disable internal filtering + handleFilterOption = () => true; + + render() { + const Component = this.props.canCreate ? Creatable : Select; + return ( + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Select.css b/server/sonar-web/src/main/js/components/controls/Select.css new file mode 100644 index 00000000000..8f89447cc47 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Select.css @@ -0,0 +1,477 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.Select { + position: relative; + display: inline-block; + vertical-align: middle; + font-size: var(--smallFontSize); + text-align: left; +} + +.Select, +.Select div, +.Select input, +.Select span { + box-sizing: border-box; +} + +.Select.is-disabled > .Select-control { + background-color: var(--disableGrayBg) !important; + border-color: var(--disableGrayBorder) !important; +} + +.Select.is-disabled > .Select-control:hover { + box-shadow: none !important; +} + +.Select.is-disabled .Select-arrow-zone { + cursor: not-allowed !important; + pointer-events: none !important; +} + +.Select.is-disabled .Select-placeholder, +.Select.is-disabled .Select-value { + color: var(--disableGrayText) !important; +} + +.Select-control { + position: relative; + display: table; + width: 100%; + height: var(--controlHeight); + line-height: calc(var(--controlHeight) - 2px); + border: 1px solid var(--gray80); + border-collapse: separate; + border-radius: 2px; + background-color: #fff; + color: var(--baseFontColor); + cursor: default; + outline: none; + overflow: hidden; +} + +.is-searchable.is-open > .Select-control { + cursor: text; +} + +.is-open > .Select-control { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background: #fff; +} + +.is-open > .Select-control > .Select-arrow { + border-color: transparent transparent #999; + border-width: 0 5px 5px; +} + +.is-searchable.is-focused:not(.is-open) > .Select-control { + cursor: text; +} + +.is-focused:not(.is-open) > .Select-control { + border-color: var(--blue); +} + +.Select-placeholder { + color: var(--secondFontColor); +} + +.Select-placeholder, +:not(.Select--multi) > .Select-control .Select-value { + bottom: 0; + left: 0; + line-height: 23px; + padding-left: 8px; + padding-right: 24px; + position: absolute; + right: 0; + top: 0; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.Select-value [class^='icon-'] { + padding-top: 5px; +} + +.Select-value svg, +.Select-value img { + padding-top: 3px; +} + +.Select-option svg, +.Select-option img, +.Select-option [class^='icon-'] { + padding-top: 2px; +} + +.has-value:not(.Select--multi) > .Select-control > .Select-value .Select-value-label, +.has-value.is-pseudo-focused:not(.Select--multi) + > .Select-control + > .Select-value + .Select-value-label { + color: var(--baseFontColor); +} + +.has-value:not(.Select--multi) > .Select-control > .Select-value a.Select-value-label, +.has-value.is-pseudo-focused:not(.Select--multi) + > .Select-control + > .Select-value + a.Select-value-label { + cursor: pointer; + text-decoration: none; +} + +.has-value:not(.Select--multi) > .Select-control > .Select-value a.Select-value-label:hover, +.has-value.is-pseudo-focused:not(.Select--multi) + > .Select-control + > .Select-value + a.Select-value-label:hover, +.has-value:not(.Select--multi) > .Select-control > .Select-value a.Select-value-label:focus, +.has-value.is-pseudo-focused:not(.Select--multi) + > .Select-control + > .Select-value + a.Select-value-label:focus { + color: #007eff; + outline: none; + text-decoration: underline; +} + +.Select-input { + vertical-align: top; + height: 22px; + padding-left: 8px; + padding-right: 8px; + outline: none; +} + +.Select-input > input { + background: none transparent; + border: 0 none; + cursor: default; + display: inline-block; + font-family: inherit; + font-size: var(--smallFontSize); + height: 22px; + margin: 0; + outline: none; + padding: 0; + box-shadow: none; + -webkit-appearance: none; +} + +.is-focused .Select-input > input { + cursor: text; +} + +.has-value.is-pseudo-focused .Select-input { + opacity: 0; +} + +.Select-control:not(.is-searchable) > .Select-input { + outline: none; +} + +.Select-loading-zone { + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 16px; +} + +.Select-loading { + -webkit-animation: Select-animation-spin 400ms infinite linear; + -o-animation: Select-animation-spin 400ms infinite linear; + animation: Select-animation-spin 400ms infinite linear; + width: 16px; + height: 16px; + box-sizing: border-box; + border-radius: 50%; + border: 2px solid #ccc; + border-right-color: var(--baseFontColor); + display: inline-block; + position: relative; + vertical-align: middle; +} + +.Select-clear-zone { + -webkit-animation: Select-animation-fadeIn 200ms; + -o-animation: Select-animation-fadeIn 200ms; + animation: Select-animation-fadeIn 200ms; + color: #999; + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 16px; + height: 16px; + padding-right: 4px; +} + +.Select-clear-zone:hover .Select-clear { + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxNCAxNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3BhY2U9InByZXNlcnZlIiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjE7Ij4gICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC4wMjM0Mzc1LDAsMCwwLjAyMzQzNzUsLTUuMDE1NjIsLTUuMDE1NjIpIj4gICAgICAgIDxwYXRoIGQ9Ik04MTAsMjc0TDU3Miw1MTJMODEwLDc1MEw3NTAsODEwTDUxMiw1NzJMMjc0LDgxMEwyMTQsNzUwTDQ1Miw1MTJMMjE0LDI3NEwyNzQsMjE0TDUxMiw0NTJMNzUwLDIxNEw4MTAsMjc0WiIgc3R5bGU9ImZpbGw6cmdiKDIzMSwyMCw1Nik7ZmlsbC1ydWxlOm5vbnplcm87Ii8+ICAgIDwvZz48L3N2Zz4=); +} + +.Select-clear { + display: block; + width: 9px; + height: 9px; + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxNCAxNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3BhY2U9InByZXNlcnZlIiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjE7Ij4gICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC4wMjM0Mzc1LDAsMCwwLjAyMzQzNzUsLTUuMDE1NjIsLTUuMDE1NjIpIj4gICAgICAgIDxwYXRoIGQ9Ik04MTAsMjc0TDU3Miw1MTJMODEwLDc1MEw3NTAsODEwTDUxMiw1NzJMMjc0LDgxMEwyMTQsNzUwTDQ1Miw1MTJMMjE0LDI3NEwyNzQsMjE0TDUxMiw0NTJMNzUwLDIxNEw4MTAsMjc0WiIgc3R5bGU9ImZpbGw6cmdiKDE1MywxNTMsMTUzKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4gICAgPC9nPjwvc3ZnPg==); + background-size: 9px 9px; + text-indent: -9999px; +} + +.Select--multi .Select-clear-zone { + width: 17px; +} + +.Select-arrow-zone { + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 20px; + padding-right: 5px; +} + +.Select-arrow { + border-color: #999 transparent transparent; + border-style: solid; + border-width: 4px 4px 2px; + display: inline-block; + height: 0; + width: 0; +} + +.is-open .Select-arrow, +.Select-arrow-zone:hover > .Select-arrow { + border-top-color: #666; +} + +@-webkit-keyframes Select-animation-fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +@keyframes Select-animation-fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +.Select-menu-outer { + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + background-color: #fff; + border: 1px solid #ccc; + border-top-color: var(--barBorderColor); + box-sizing: border-box; + margin-top: -1px; + max-height: 200px; + position: absolute; + top: 100%; + width: 100%; + z-index: var(--dropdownMenuZIndex); + -webkit-overflow-scrolling: touch; + box-shadow: var(--defaultShadow); +} + +.Select-menu { + max-height: 198px; + padding: 5px 0; + overflow-y: auto; +} + +.Select-option { + display: block; + line-height: 20px; + padding: 0 8px; + box-sizing: border-box; + color: var(--baseFontColor); + font-size: var(--smallFontSize); + cursor: pointer; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.Select-option:last-child { + border-bottom-right-radius: 2px; + border-bottom-left-radius: 2px; +} + +.Select-option.is-focused { + background-color: var(--barBackgroundColor); +} + +.Select-option.is-disabled { + cursor: default; + opacity: 0.4; + font-style: italic; +} + +.Select-noresults { + box-sizing: border-box; + color: var(--gray60); + cursor: default; + display: block; + padding: 8px 10px; +} + +.Select--multi .Select-value { + background-color: rgba(0, 126, 255, 0.08); + border-radius: 2px; + border: 1px solid rgba(0, 126, 255, 0.24); + color: var(--baseFontColor); + display: inline-block; + font-size: var(--smallFontSize); + line-height: 14px; + margin: 1px 4px 1px 1px; + vertical-align: top; +} + +.Select-value-label { + font-size: var(--smallFontSize); +} + +.is-searchable.is-open .Select-value-label { + opacity: 0.5; +} + +.Select-big .Select-control { + padding-top: 4px; + padding-bottom: 4px; +} + +.Select-big .Select-placeholder { + margin-top: 4px; + margin-bottom: 4px; +} + +.Select-big .Select-value-label { + display: inline-block; + margin-top: 7px; + line-height: 16px; +} + +.Select-big .Select-option { + padding: 7px 8px; + line-height: 16px; +} + +.Select-big img, +.Select-big svg { + padding-top: 0; +} + +.Select--multi .Select-value-icon, +.Select--multi .Select-value-label { + display: inline-block; + vertical-align: middle; +} + +.Select--multi .Select-value-label { + display: inline-block; + max-width: 200px; + border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + cursor: default; + padding: 2px 5px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.Select--multi a.Select-value-label { + color: #007eff; + cursor: pointer; + text-decoration: none; +} + +.Select--multi a.Select-value-label:hover { + text-decoration: underline; +} + +.Select--multi .Select-value-icon { + cursor: pointer; + border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-right: 1px solid rgba(0, 126, 255, 0.24); + padding: 1px 5px; +} + +.Select--multi .Select-value-icon:hover, +.Select--multi .Select-value-icon:focus { + background-color: rgba(0, 113, 230, 0.08); + color: #0071e6; +} + +.Select--multi .Select-value-icon:active { + background-color: rgba(0, 126, 255, 0.24); +} + +.Select--multi.is-disabled .Select-value { + background-color: #fcfcfc; + border: 1px solid #e3e3e3; + color: var(--baseFontColor); +} + +.Select--multi.is-disabled .Select-value-icon { + cursor: not-allowed; + border-right: 1px solid #e3e3e3; +} + +.Select--multi.is-disabled .Select-value-icon:hover, +.Select--multi.is-disabled .Select-value-icon:focus, +.Select--multi.is-disabled .Select-value-icon:active { + background-color: #fcfcfc; +} + +.Select-aria-only { + display: none; +} + +@keyframes Select-animation-spin { + to { + transform: rotate(1turn); + } +} + +@-webkit-keyframes Select-animation-spin { + to { + -webkit-transform: rotate(1turn); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Select.tsx b/server/sonar-web/src/main/js/components/controls/Select.tsx new file mode 100644 index 00000000000..44657a87991 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Select.tsx @@ -0,0 +1,72 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { + defaultFilterOptions as reactSelectDefaultFilterOptions, + ReactAsyncSelectProps, + ReactCreatableSelectProps, + ReactSelectProps +} from 'react-select'; +import { lazyLoadComponent } from '../lazyLoadComponent'; +import { ClearButton } from './buttons'; +import './Select.css'; + +declare module 'react-select' { + export function defaultFilterOptions(...args: any[]): any; +} + +const ReactSelectLib = import('react-select'); +const ReactSelect = lazyLoadComponent(() => ReactSelectLib); +const ReactCreatable = lazyLoadComponent(() => + ReactSelectLib.then(lib => ({ default: lib.Creatable })) +); +const ReactAsync = lazyLoadComponent(() => ReactSelectLib.then(lib => ({ default: lib.Async }))); + +function renderInput() { + return ; +} + +interface WithInnerRef { + innerRef?: (element: React.Component) => void; +} + +export default function Select({ innerRef, ...props }: WithInnerRef & ReactSelectProps) { + // TODO try to define good defaults, if any + // ReactSelect doesn't declare `clearRenderer` prop + const ReactSelectAny = ReactSelect as any; + // hide the "x" icon when select is empty + const clearable = props.clearable ? Boolean(props.value) : false; + return ( + + ); +} + +export const defaultFilterOptions = reactSelectDefaultFilterOptions; + +export function Creatable(props: ReactCreatableSelectProps) { + // ReactSelect doesn't declare `clearRenderer` prop + const ReactCreatableAny = ReactCreatable as any; + return ; +} + +// TODO figure out why `ref` prop is incompatible +export function AsyncSelect(props: ReactAsyncSelectProps & { ref?: any }) { + return ; +} diff --git a/server/sonar-web/src/main/js/components/controls/SelectList.css b/server/sonar-web/src/main/js/components/controls/SelectList.css new file mode 100644 index 00000000000..30b95c80033 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SelectList.css @@ -0,0 +1,59 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.select-list-container { + min-width: 500px; + box-sizing: border-box; +} + +.select-list-control { + margin-bottom: 10px; + box-sizing: border-box; +} + +.select-list-list-container { + border: 1px solid #bfbfbf; + box-sizing: border-box; + height: 400px; + overflow: auto; +} + +.select-list-list-checkbox { + display: flex !important; + align-items: center; +} + +.select-list-list-checkbox i { + display: inline-block; + vertical-align: middle; + margin-right: 10px; +} + +.select-list-list-disabled { + cursor: not-allowed; +} + +.select-list-list-disabled > a { + pointer-events: none; +} + +.select-list-list-item { + display: inline-block; + vertical-align: middle; +} diff --git a/server/sonar-web/src/main/js/components/controls/SelectList.tsx b/server/sonar-web/src/main/js/components/controls/SelectList.tsx new file mode 100644 index 00000000000..600dcefa22d --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SelectList.tsx @@ -0,0 +1,189 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import ListFooter from './ListFooter'; +import RadioToggle from './RadioToggle'; +import SearchBox from './SearchBox'; +import './SelectList.css'; +import SelectListListContainer from './SelectListListContainer'; + +export enum SelectListFilter { + All = 'all', + Selected = 'selected', + Unselected = 'deselected' +} + +interface Props { + allowBulkSelection?: boolean; + elements: string[]; + elementsTotalCount?: number; + disabledElements?: string[]; + labelSelected?: string; + labelUnselected?: string; + labelAll?: string; + needToReload?: boolean; + onSearch: (searchParams: SelectListSearchParams) => Promise; + onSelect: (element: string) => Promise; + onUnselect: (element: string) => Promise; + pageSize?: number; + readOnly?: boolean; + renderElement: (element: string) => React.ReactNode; + selectedElements: string[]; + withPaging?: boolean; +} + +export interface SelectListSearchParams { + filter: SelectListFilter; + page?: number; + pageSize?: number; + query: string; +} + +interface State { + lastSearchParams: SelectListSearchParams; + loading: boolean; +} + +const DEFAULT_PAGE_SIZE = 100; + +export default class SelectList extends React.PureComponent { + mounted = false; + + constructor(props: Props) { + super(props); + + this.state = { + lastSearchParams: { + filter: SelectListFilter.Selected, + page: 1, + pageSize: props.pageSize ? props.pageSize : DEFAULT_PAGE_SIZE, + query: '' + }, + loading: false + }; + } + + componentDidMount() { + this.mounted = true; + this.search({}); + } + + componentWillUnmount() { + this.mounted = false; + } + + stopLoading = () => { + if (this.mounted) { + this.setState({ loading: false }); + } + }; + + getFilter = () => + this.state.lastSearchParams.query === '' + ? this.state.lastSearchParams.filter + : SelectListFilter.All; + + search = (searchParams: Partial) => + this.setState( + prevState => ({ + loading: true, + lastSearchParams: { ...prevState.lastSearchParams, ...searchParams } + }), + () => + this.props + .onSearch({ + filter: this.getFilter(), + page: this.props.withPaging ? this.state.lastSearchParams.page : undefined, + pageSize: this.props.withPaging ? this.state.lastSearchParams.pageSize : undefined, + query: this.state.lastSearchParams.query + }) + .then(this.stopLoading) + .catch(this.stopLoading) + ); + + changeFilter = (filter: SelectListFilter) => this.search({ filter, page: 1 }); + + handleQueryChange = (query: string) => this.search({ page: 1, query }); + + onLoadMore = () => + this.search({ + page: + this.state.lastSearchParams.page != null ? this.state.lastSearchParams.page + 1 : undefined + }); + + onReload = () => this.search({ page: 1 }); + + render() { + const { + labelSelected = translate('selected'), + labelUnselected = translate('unselected'), + labelAll = translate('all') + } = this.props; + const { filter } = this.state.lastSearchParams; + + const disabled = this.state.lastSearchParams.query !== ''; + + return ( +
    +
    + + +
    + + {!!this.props.elementsTotalCount && ( + + )} +
    + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx b/server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx new file mode 100644 index 00000000000..160317b1951 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx @@ -0,0 +1,129 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import DeferredSpinner from '../ui/DeferredSpinner'; +import Checkbox from './Checkbox'; +import { SelectListFilter } from './SelectList'; +import SelectListListElement from './SelectListListElement'; + +interface Props { + allowBulkSelection?: boolean; + elements: string[]; + disabledElements: string[]; + filter: SelectListFilter; + onSelect: (element: string) => Promise; + onUnselect: (element: string) => Promise; + readOnly?: boolean; + renderElement: (element: string) => React.ReactNode; + selectedElements: string[]; +} + +interface State { + loading: boolean; +} + +export default class SelectListListContainer extends React.PureComponent { + mounted = false; + state: State = { loading: false }; + + componentDidMount() { + this.mounted = true; + } + + componentWillUnmount() { + this.mounted = false; + } + + stopLoading = () => { + if (this.mounted) { + this.setState({ loading: false }); + } + }; + + isDisabled = (element: string): boolean => { + return this.props.readOnly || this.props.disabledElements.includes(element); + }; + + isSelected = (element: string): boolean => { + return this.props.selectedElements.includes(element); + }; + + handleBulkChange = (checked: boolean) => { + this.setState({ loading: true }); + if (checked) { + Promise.all(this.props.elements.map(element => this.props.onSelect(element))) + .then(this.stopLoading) + .catch(this.stopLoading); + } else { + Promise.all(this.props.selectedElements.map(element => this.props.onUnselect(element))) + .then(this.stopLoading) + .catch(this.stopLoading); + } + }; + + renderBulkSelector() { + const { elements, readOnly, selectedElements } = this.props; + return ( + <> +
  • + 0} + disabled={this.state.loading || readOnly} + onCheck={this.handleBulkChange} + thirdState={selectedElements.length > 0 && elements.length !== selectedElements.length}> + + {translate('bulk_change')} + + + +
  • +
  • + + ); + } + + render() { + const { allowBulkSelection, elements, filter } = this.props; + + return ( +
    +
      + {allowBulkSelection && + elements.length > 0 && + filter === SelectListFilter.All && + this.renderBulkSelector()} + {elements.map(element => ( + + ))} +
    +
    + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/SelectListListElement.tsx b/server/sonar-web/src/main/js/components/controls/SelectListListElement.tsx new file mode 100644 index 00000000000..defd493f344 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SelectListListElement.tsx @@ -0,0 +1,76 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import Checkbox from './Checkbox'; + +interface Props { + active?: boolean; + disabled?: boolean; + element: string; + onSelect: (element: string) => Promise; + onUnselect: (element: string) => Promise; + renderElement: (element: string) => React.ReactNode; + selected: boolean; +} + +interface State { + loading: boolean; +} + +export default class SelectListListElement extends React.PureComponent { + mounted = false; + state: State = { loading: false }; + + componentDidMount() { + this.mounted = true; + } + + componentWillUnmount() { + this.mounted = false; + } + + stopLoading = () => { + if (this.mounted) { + this.setState({ loading: false }); + } + }; + + handleCheck = (checked: boolean) => { + this.setState({ loading: true }); + const request = checked ? this.props.onSelect : this.props.onUnselect; + request(this.props.element).then(this.stopLoading, this.stopLoading); + }; + + render() { + return ( +
  • + + {this.props.renderElement(this.props.element)} + +
  • + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx b/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx new file mode 100644 index 00000000000..4f95af38211 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx @@ -0,0 +1,101 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Modal, { ModalProps } from './Modal'; + +export interface ChildrenProps { + onCloseClick: (event?: React.SyntheticEvent) => void; + onFormSubmit: (event: React.SyntheticEvent) => void; + onSubmitClick: (event?: React.SyntheticEvent) => void; + submitting: boolean; +} + +interface Props extends ModalProps { + children: (props: ChildrenProps) => React.ReactNode; + header: string; + onClose: () => void; + onSubmit: () => void | Promise; +} + +interface State { + submitting: boolean; +} + +export default class SimpleModal extends React.Component { + mounted = false; + state: State = { submitting: false }; + + componentDidMount() { + this.mounted = true; + } + + componentWillUnmount() { + this.mounted = false; + } + + stopSubmitting = () => { + if (this.mounted) { + this.setState({ submitting: false }); + } + }; + + handleCloseClick = (event?: React.SyntheticEvent) => { + if (event) { + event.preventDefault(); + event.currentTarget.blur(); + } + this.props.onClose(); + }; + + handleFormSubmit = (event: React.SyntheticEvent) => { + event.preventDefault(); + this.submit(); + }; + + handleSubmitClick = (event?: React.SyntheticEvent) => { + if (event) { + event.preventDefault(); + event.currentTarget.blur(); + } + this.submit(); + }; + + submit = () => { + const result = this.props.onSubmit(); + if (result) { + this.setState({ submitting: true }); + result.then(this.stopSubmitting, this.stopSubmitting); + } + }; + + render() { + const { children, header, onClose, onSubmit, ...modalProps } = this.props; + return ( + + {children({ + onCloseClick: this.handleCloseClick, + onFormSubmit: this.handleFormSubmit, + onSubmitClick: this.handleSubmitClick, + submitting: this.state.submitting + })} + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Tabs.css b/server/sonar-web/src/main/js/components/controls/Tabs.css new file mode 100644 index 00000000000..334fe14f255 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Tabs.css @@ -0,0 +1,60 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.flex-tabs { + display: flex; + clear: left; + margin-bottom: calc(3 * var(--gridSize)); + border-bottom: 1px solid var(--barBorderColor); + font-size: var(--mediumFontSize); +} + +.flex-tabs > li > a { + position: relative; + display: block; + top: 1px; + height: 100%; + width: 100%; + box-sizing: border-box; + color: var(--secondFontColor); + font-weight: 600; + cursor: pointer; + padding-bottom: calc(1.5 * var(--gridSize)); + border-bottom: 3px solid transparent; + transition: color 0.2s ease; +} + +.flex-tabs > li ~ li { + margin-left: calc(4 * var(--gridSize)); +} + +.flex-tabs > li > a:hover { + color: var(--baseFontColor); +} + +.flex-tabs > li > a.selected { + color: var(--blue); + border-bottom-color: var(--blue); +} + +.flex-tabs > li > a.disabled { + color: var(--disableGrayText) !important; + cursor: not-allowed !important; + pointer-events: none !important; +} diff --git a/server/sonar-web/src/main/js/components/controls/Tabs.tsx b/server/sonar-web/src/main/js/components/controls/Tabs.tsx new file mode 100644 index 00000000000..6c25ae0c21f --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Tabs.tsx @@ -0,0 +1,77 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import './Tabs.css'; + +interface Props { + onChange: (tab: T) => void; + selected?: T; + tabs: Array<{ disabled?: boolean; key: T; node: React.ReactNode }>; +} + +export default function Tabs({ onChange, selected, tabs }: Props) { + return ( +
      + {tabs.map(tab => ( + + {tab.node} + + ))} +
    + ); +} + +interface TabProps { + children: React.ReactNode; + disabled?: boolean; + name: T; + onSelect: (tab: T) => void; + selected: boolean; +} + +export class Tab extends React.PureComponent> { + handleClick = (event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + if (!this.props.disabled) { + this.props.onSelect(this.props.name); + } + }; + + render() { + const { children, disabled, name, selected } = this.props; + return ( +
  • + + {children} + +
  • + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Toggle.css b/server/sonar-web/src/main/js/components/controls/Toggle.css new file mode 100644 index 00000000000..f9b0cfeb75b --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Toggle.css @@ -0,0 +1,82 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.button.boolean-toggle { + display: inline-block; + vertical-align: middle; + width: 48px; + height: var(--controlHeight); + padding: 1px; + border: 1px solid var(--gray80); + border-radius: var(--controlHeight); + box-sizing: border-box; + background-color: #fff; + cursor: pointer; + transition: all 0.3s ease; +} + +.button.boolean-toggle:hover { + background-color: #fff; +} + +.button.boolean-toggle:focus { + border-color: var(--blue); + background-color: #f6f6f6; +} + +.boolean-toggle-handle { + display: flex; + justify-content: center; + align-items: center; + width: 20px; + height: 20px; + border: 1px solid var(--gray80); + border-radius: 22px; + box-sizing: border-box; + background-color: #f6f6f6; + transition: transform 0.3s cubic-bezier(0.87, -0.41, 0.19, 1.44), border 0.3s ease; +} + +.boolean-toggle-handle > * { + opacity: 0; + transition: opacity 0.3s ease; +} + +.button.boolean-toggle-on { + border-color: var(--darkBlue); + background-color: var(--darkBlue); + color: var(--darkBlue); +} + +.button.boolean-toggle-on:hover { + background-color: var(--darkBlue); +} + +.button.boolean-toggle-on:focus { + background-color: var(--darkBlue); +} + +.button.boolean-toggle-on .boolean-toggle-handle { + border-color: #f6f6f6; + transform: translateX(var(--controlHeight)); +} + +.button.boolean-toggle-on .boolean-toggle-handle > * { + opacity: 1; +} diff --git a/server/sonar-web/src/main/js/components/controls/Toggle.tsx b/server/sonar-web/src/main/js/components/controls/Toggle.tsx new file mode 100644 index 00000000000..52448e8b074 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Toggle.tsx @@ -0,0 +1,60 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import CheckIcon from '../icons/CheckIcon'; +import { Button } from './buttons'; +import './Toggle.css'; + +interface Props { + disabled?: boolean; + name?: string; + onChange?: (value: boolean) => void; + value: boolean | string; +} + +export default class Toggle extends React.PureComponent { + getValue = () => { + const { value } = this.props; + return typeof value === 'string' ? value === 'true' : value; + }; + + handleClick = () => { + if (this.props.onChange) { + const value = this.getValue(); + this.props.onChange(!value); + } + }; + + render() { + const { disabled, name } = this.props; + const value = this.getValue(); + const className = classNames('boolean-toggle', { 'boolean-toggle-on': value }); + + return ( + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Toggler.tsx b/server/sonar-web/src/main/js/components/controls/Toggler.tsx new file mode 100644 index 00000000000..fe76b7a1a41 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Toggler.tsx @@ -0,0 +1,72 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import DocumentClickHandler from './DocumentClickHandler'; +import EscKeydownHandler from './EscKeydownHandler'; +import OutsideClickHandler from './OutsideClickHandler'; + +interface Props { + children?: React.ReactNode; + closeOnClick?: boolean; + closeOnClickOutside?: boolean; + closeOnEscape?: boolean; + onRequestClose: () => void; + open: boolean; + overlay: React.ReactNode; +} + +export default class Toggler extends React.Component { + renderOverlay() { + const { + closeOnClick = false, + closeOnClickOutside = true, + closeOnEscape = true, + onRequestClose, + overlay + } = this.props; + + let renderedOverlay; + if (closeOnEscape) { + renderedOverlay = {overlay}; + } else { + renderedOverlay = overlay; + } + + if (closeOnClick) { + return ( + {renderedOverlay} + ); + } else if (closeOnClickOutside) { + return ( + {renderedOverlay} + ); + } + return renderedOverlay; + } + + render() { + return ( + <> + {this.props.children} + {this.props.open && this.renderOverlay()} + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Tooltip.css b/server/sonar-web/src/main/js/components/controls/Tooltip.css new file mode 100644 index 00000000000..d49494f1f77 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Tooltip.css @@ -0,0 +1,134 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.tooltip { + position: absolute; + z-index: var(--tooltipZIndex); + display: block; + height: auto; + box-sizing: border-box; + font-size: var(--baseFontSize); + font-weight: 300; + line-height: 1.5; + animation: fadeIn 0.3s forwards; +} + +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} + +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} + +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} + +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} + +.tooltip-inner { + max-width: 300px; + text-align: left; + text-decoration: none; + border-radius: 4px; + overflow: hidden; + word-break: break-word; +} + +.tooltip-inner { + padding: 12px 17px; + color: #fff; + background-color: #475760; + letter-spacing: 0.04em; +} + +.tooltip-inner .alert { + margin-bottom: 5px; + border-radius: 4px; +} + +.tooltip-inner a { + border-bottom-color: #8da6b3; + color: #a5d0ea; +} + +.tooltip-inner hr { + background-color: #5d6d75; +} + +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border: solid transparent; +} + +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + border-width: 5px 5px 0; + transform: translateX(-5px); + border-top-color: #475760; +} + +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + transform: translateY(-5px); + border-width: 5px 5px 5px 0; + border-right-color: #475760; +} + +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + transform: translateY(-5px); + border-width: 5px 0 5px 5px; + border-left-color: #475760; +} + +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + transform: translateX(-5px); + border-width: 0 5px 5px; + border-bottom-color: #475760; +} + +/* Workaround for react issue with onMouseLeave in disabled buttons: https://github.com/facebook/react/issues/4251 */ +.tooltip button[disabled] { + pointer-events: none; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} diff --git a/server/sonar-web/src/main/js/components/controls/Tooltip.tsx b/server/sonar-web/src/main/js/components/controls/Tooltip.tsx new file mode 100644 index 00000000000..7f21fcf7c49 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/Tooltip.tsx @@ -0,0 +1,407 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { throttle } from 'lodash'; +import * as React from 'react'; +import { createPortal, findDOMNode } from 'react-dom'; +import ThemeContext from '../theme'; +import ScreenPositionFixer from './ScreenPositionFixer'; +import './Tooltip.css'; + +export type Placement = 'bottom' | 'right' | 'left' | 'top'; + +export interface TooltipProps { + classNameSpace?: string; + children: React.ReactElement<{}>; + mouseEnterDelay?: number; + mouseLeaveDelay?: number; + onShow?: () => void; + onHide?: () => void; + overlay: React.ReactNode; + placement?: Placement; + visible?: boolean; +} + +interface Measurements { + height: number; + left: number; + top: number; + width: number; +} + +interface OwnState { + flipped: boolean; + placement?: Placement; + visible: boolean; +} + +type State = OwnState & Partial; + +const FLIP_MAP: { [key in Placement]: Placement } = { + left: 'right', + right: 'left', + top: 'bottom', + bottom: 'top' +}; + +function isMeasured(state: State): state is OwnState & Measurements { + return state.height !== undefined; +} + +export default function Tooltip(props: TooltipProps) { + // overlay is a ReactNode, so it can be `undefined` or `null` + // this allows to easily render a tooltip conditionally + // more generaly we avoid rendering empty tooltips + return props.overlay != null && props.overlay !== '' ? ( + + ) : ( + props.children + ); +} + +export class TooltipInner extends React.Component { + throttledPositionTooltip: () => void; + mouseEnterTimeout?: number; + mouseLeaveTimeout?: number; + tooltipNode?: HTMLElement | null; + mounted = false; + mouseIn = false; + + static defaultProps = { + mouseEnterDelay: 0.1 + }; + + constructor(props: TooltipProps) { + super(props); + this.state = { + flipped: false, + placement: props.placement, + visible: props.visible !== undefined ? props.visible : false + }; + this.throttledPositionTooltip = throttle(this.positionTooltip, 10); + } + + componentDidMount() { + this.mounted = true; + if (this.props.visible === true) { + this.positionTooltip(); + this.addEventListeners(); + } + } + + componentDidUpdate(prevProps: TooltipProps, prevState: State) { + if (this.props.placement !== prevProps.placement) { + this.setState({ placement: this.props.placement }); + // Break. This will trigger a new componentDidUpdate() call, so the below + // positionTooltip() call will be correct. Otherwise, it might not use + // the new state.placement value. + return; + } + + if ( + // opens + (this.props.visible === true && !prevProps.visible) || + (this.props.visible === undefined && + this.state.visible === true && + prevState.visible === false) + ) { + this.positionTooltip(); + this.addEventListeners(); + } else if ( + // closes + (!this.props.visible && prevProps.visible === true) || + (this.props.visible === undefined && + this.state.visible === false && + prevState.visible === true) + ) { + this.clearPosition(); + this.removeEventListeners(); + } + } + + componentWillUnmount() { + this.mounted = false; + this.removeEventListeners(); + this.clearTimeouts(); + } + + static contextType = ThemeContext; + + addEventListeners = () => { + window.addEventListener('resize', this.throttledPositionTooltip); + window.addEventListener('scroll', this.throttledPositionTooltip); + }; + + removeEventListeners = () => { + window.removeEventListener('resize', this.throttledPositionTooltip); + window.removeEventListener('scroll', this.throttledPositionTooltip); + }; + + clearTimeouts = () => { + window.clearTimeout(this.mouseEnterTimeout); + window.clearTimeout(this.mouseLeaveTimeout); + }; + + isVisible = () => { + return this.props.visible !== undefined ? this.props.visible : this.state.visible; + }; + + getPlacement = (): Placement => { + return this.state.placement || 'bottom'; + }; + + tooltipNodeRef = (node: HTMLElement | null) => { + this.tooltipNode = node; + }; + + adjustArrowPosition = ( + placement: Placement, + { leftFix, topFix }: { leftFix: number; topFix: number } + ) => { + switch (placement) { + case 'left': + case 'right': + return { marginTop: -topFix }; + default: + return { marginLeft: -leftFix }; + } + }; + + positionTooltip = () => { + // `findDOMNode(this)` will search for the DOM node for the current component + // first it will find a React.Fragment (see `render`), + // so it will get the DOM node of the first child, i.e. DOM node of `this.props.children` + // docs: https://reactjs.org/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components + + // eslint-disable-next-line react/no-find-dom-node + const toggleNode = findDOMNode(this); + + if (toggleNode && toggleNode instanceof Element && this.tooltipNode) { + const toggleRect = toggleNode.getBoundingClientRect(); + const tooltipRect = this.tooltipNode.getBoundingClientRect(); + const { width, height } = tooltipRect; + + let left = 0; + let top = 0; + + switch (this.getPlacement()) { + case 'bottom': + left = toggleRect.left + toggleRect.width / 2 - width / 2; + top = toggleRect.top + toggleRect.height; + break; + case 'top': + left = toggleRect.left + toggleRect.width / 2 - width / 2; + top = toggleRect.top - height; + break; + case 'right': + left = toggleRect.left + toggleRect.width; + top = toggleRect.top + toggleRect.height / 2 - height / 2; + break; + case 'left': + left = toggleRect.left - width; + top = toggleRect.top + toggleRect.height / 2 - height / 2; + break; + } + + // save width and height (and later set in `render`) to avoid resizing the tooltip element, + // when it's placed close to the window edge + this.setState({ + left: window.pageXOffset + left, + top: window.pageYOffset + top, + width, + height + }); + } + }; + + clearPosition = () => { + this.setState({ + flipped: false, + left: undefined, + top: undefined, + width: undefined, + height: undefined, + placement: this.props.placement + }); + }; + + handleMouseEnter = () => { + this.mouseEnterTimeout = window.setTimeout(() => { + // for some reason even after the `this.mouseEnterTimeout` is cleared, it still triggers + // to workaround this issue, check that its value is not `undefined` + // (if it's `undefined`, it means the timer has been reset) + if ( + this.mounted && + this.props.visible === undefined && + this.mouseEnterTimeout !== undefined + ) { + this.setState({ visible: true }); + } + }, (this.props.mouseEnterDelay || 0) * 1000); + + if (this.props.onShow) { + this.props.onShow(); + } + }; + + handleMouseLeave = () => { + if (this.mouseEnterTimeout !== undefined) { + window.clearTimeout(this.mouseEnterTimeout); + this.mouseEnterTimeout = undefined; + } + + if (!this.mouseIn) { + this.mouseLeaveTimeout = window.setTimeout(() => { + if (this.mounted && this.props.visible === undefined && !this.mouseIn) { + this.setState({ visible: false }); + } + }, (this.props.mouseLeaveDelay || 0) * 1000); + + if (this.props.onHide) { + this.props.onHide(); + } + } + }; + + handleOverlayMouseEnter = () => { + this.mouseIn = true; + }; + + handleOverlayMouseLeave = () => { + this.mouseIn = false; + this.handleMouseLeave(); + }; + + needsFlipping = (leftFix: number, topFix: number) => { + // We can live with a tooltip that's slightly positioned over the toggle + // node. Only trigger if it really starts overlapping, as the re-positioning + // is quite expensive, needing 2 re-renders. + const threshold = this.context.rawSizes.grid; + switch (this.getPlacement()) { + case 'left': + case 'right': + return Math.abs(leftFix) > threshold; + case 'top': + case 'bottom': + return Math.abs(topFix) > threshold; + } + return false; + }; + + renderActual = ({ leftFix = 0, topFix = 0 }) => { + if ( + !this.state.flipped && + (leftFix !== 0 || topFix !== 0) && + this.needsFlipping(leftFix, topFix) + ) { + // Update state in a render function... Not a good idea, but we need to + // render in order to know if we need to flip... To prevent React from + // complaining, we update the state using a setTimeout() call. + setTimeout(() => { + this.setState( + ({ placement = 'bottom' }) => ({ + flipped: true, + // Set height to undefined to force ScreenPositionFixer to + // re-compute our positioning. + height: undefined, + placement: FLIP_MAP[placement] + }), + () => { + if (this.state.visible) { + // Force a re-positioning, as "only" updating the state doesn't + // recompute the position, only re-renders with the previous + // position (which is no longer correct). + this.positionTooltip(); + } + } + ); + }, 1); + return null; + } + + const { classNameSpace = 'tooltip' } = this.props; + const placement = this.getPlacement(); + const style = isMeasured(this.state) + ? { + left: this.state.left + leftFix, + top: this.state.top + topFix, + width: this.state.width, + height: this.state.height + } + : undefined; + + return ( +
    +
    {this.props.overlay}
    +
    +
    + ); + }; + + render() { + return ( + <> + {React.cloneElement(this.props.children, { + onMouseEnter: this.handleMouseEnter, + onMouseLeave: this.handleMouseLeave + })} + {this.isVisible() && ( + + + {this.renderActual} + + + )} + + ); + } +} + +class TooltipPortal extends React.Component { + el: HTMLElement; + + constructor(props: {}) { + super(props); + this.el = document.createElement('div'); + } + + componentDidMount() { + document.body.appendChild(this.el); + } + + componentWillUnmount() { + document.body.removeChild(this.el); + } + + render() { + return createPortal(this.props.children, this.el); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/ValidationForm.tsx b/server/sonar-web/src/main/js/components/controls/ValidationForm.tsx new file mode 100644 index 00000000000..37e7127014a --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ValidationForm.tsx @@ -0,0 +1,72 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { Formik, FormikActions, FormikProps } from 'formik'; +import * as React from 'react'; + +export type ChildrenProps = T.Omit, 'handleSubmit'>; + +interface Props { + children: (props: ChildrenProps) => React.ReactNode; + initialValues: V; + isInitialValid?: boolean; + onSubmit: (data: V) => Promise; + validate: (data: V) => { [P in keyof V]?: string } | Promise<{ [P in keyof V]?: string }>; +} + +export default class ValidationForm extends React.Component> { + mounted = false; + + componentDidMount() { + this.mounted = true; + } + + componentWillUnmount() { + this.mounted = false; + } + + handleSubmit = (data: V, { setSubmitting }: FormikActions) => { + const result = this.props.onSubmit(data); + const stopSubmitting = () => { + if (this.mounted) { + setSubmitting(false); + } + }; + + if (result) { + result.then(stopSubmitting, stopSubmitting); + } else { + stopSubmitting(); + } + }; + + render() { + return ( + + initialValues={this.props.initialValues} + isInitialValid={this.props.isInitialValid} + onSubmit={this.handleSubmit} + validate={this.props.validate}> + {({ handleSubmit, ...props }) => ( +
    {this.props.children(props)}
    + )} + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/ValidationInput.tsx b/server/sonar-web/src/main/js/components/controls/ValidationInput.tsx new file mode 100644 index 00000000000..1f966232028 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ValidationInput.tsx @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import AlertErrorIcon from '../icons/AlertErrorIcon'; +import AlertSuccessIcon from '../icons/AlertSuccessIcon'; +import MandatoryFieldMarker from '../ui/MandatoryFieldMarker'; +import HelpTooltip from './HelpTooltip'; + +interface Props { + description?: React.ReactNode; + children: React.ReactNode; + className?: string; + error: string | undefined; + help?: string; + id: string; + isInvalid: boolean; + isValid: boolean; + label: React.ReactNode; + required?: boolean; +} + +export default function ValidationInput(props: Props) { + const hasError = props.isInvalid && props.error !== undefined; + return ( +
    + +
    + {props.children} + {props.isInvalid && } + {hasError && ( + {props.error} + )} + {props.isValid && } +
    + {props.description &&
    {props.description}
    } +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/ValidationModal.tsx b/server/sonar-web/src/main/js/components/controls/ValidationModal.tsx new file mode 100644 index 00000000000..e3df97e8591 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/ValidationModal.tsx @@ -0,0 +1,83 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import DeferredSpinner from '../ui/DeferredSpinner'; +import { ResetButtonLink, SubmitButton } from './buttons'; +import Modal, { ModalProps } from './Modal'; +import ValidationForm, { ChildrenProps } from './ValidationForm'; + +interface Props extends ModalProps { + children: (props: ChildrenProps) => React.ReactNode; + confirmButtonText: string; + header: string; + initialValues: V; + isDestructive?: boolean; + isInitialValid?: boolean; + onClose: () => void; + onSubmit: (data: V) => Promise; + validate: (data: V) => { [P in keyof V]?: string }; +} + +export default class ValidationModal extends React.PureComponent> { + handleSubmit = (data: V) => { + return this.props.onSubmit(data).then(() => { + this.props.onClose(); + }); + }; + + render() { + return ( + + + {props => ( + <> +
    +

    {this.props.header}

    +
    + +
    {this.props.children(props)}
    + +
    + + + {this.props.confirmButtonText} + + + {translate('cancel')} + +
    + + )} +
    +
    + ); + } +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ActionsDropdown-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ActionsDropdown-test.tsx new file mode 100644 index 00000000000..8646ec806c0 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ActionsDropdown-test.tsx @@ -0,0 +1,91 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount, shallow } from 'enzyme'; +import * as React from 'react'; +import { click } from '../../../helpers/testUtils'; +import { PopupPlacement } from '../../ui/popups'; +import ActionsDropdown, { + ActionsDropdownDivider, + ActionsDropdownItem, + ActionsDropdownProps +} from '../ActionsDropdown'; + +describe('ActionsDropdown', () => { + it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + expect(shallowRender({ small: false })).toMatchSnapshot(); + }); + + function shallowRender(props: Partial = {}) { + return shallow( + + Hello world + + ); + } +}); + +describe('ActionsDropdownItem', () => { + it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + expect(shallowRender({ destructive: true, id: 'baz', to: 'path/name' })).toMatchSnapshot(); + expect(shallowRender({ download: 'foo/bar', to: 'path/name' })).toMatchSnapshot(); + }); + + it('should trigger click', () => { + const onClick = jest.fn(); + const wrapper = shallowRender({ onClick }); + click(wrapper.find('a')); + expect(onClick).toBeCalled(); + }); + + it('should render correctly copy item', () => { + const wrapper = mountRender({ copyValue: 'my content to copy to clipboard' }); + expect(wrapper).toMatchSnapshot(); + }); + + function shallowRender(props: Partial = {}) { + return shallow(renderContent(props)); + } + + function mountRender(props: Partial = {}) { + return mount(renderContent(props)); + } + + function renderContent(props: Partial = {}) { + return ( + + Hello world + + ); + } +}); + +describe('ActionsDropdownDivider', () => { + it('should render correctly', () => { + expect(shallow()).toMatchSnapshot(); + }); +}); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/BackButton-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/BackButton-test.tsx new file mode 100644 index 00000000000..ba9cff070af --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/BackButton-test.tsx @@ -0,0 +1,48 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import testTheme from '../../../../../../config/jest/testTheme'; +import { click } from '../../../helpers/testUtils'; +import { ThemeProvider } from '../../theme'; +import BackButton from '../BackButton'; + +it('should render properly', () => { + const wrapper = shallowRender(); + expect(wrapper).toMatchSnapshot(); + expect(wrapper.find('ContextConsumer').dive()).toMatchSnapshot(); +}); + +it('should handle click', () => { + const onClick = jest.fn(); + const wrapper = shallowRender({ onClick }); + expect(wrapper).toMatchSnapshot(); + click(wrapper.find('a')); + expect(onClick).toBeCalled(); +}); + +function shallowRender(props: Partial = {}) { + return shallow(, { + wrappingComponent: ThemeProvider, + wrappingComponentProps: { + theme: testTheme + } + }); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/BoxedGroupAccordion-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/BoxedGroupAccordion-test.tsx new file mode 100644 index 00000000000..970a3546c3a --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/BoxedGroupAccordion-test.tsx @@ -0,0 +1,52 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { click } from '../../../helpers/testUtils'; +import BoxedGroupAccordion from '../BoxedGroupAccordion'; + +it('should render correctly', () => { + expect(getWrapper()).toMatchSnapshot(); +}); + +it('should show the inner content after a click', () => { + const onClick = jest.fn(); + const wrapper = getWrapper({ onClick }); + click(wrapper.find('.boxed-group-header')); + + expect(onClick).lastCalledWith('foo'); + wrapper.setProps({ open: true }); + + expect(wrapper.find('.boxed-group-inner').exists()).toBe(true); +}); + +function getWrapper(props = {}) { + return shallow( + {}} + open={false} + renderHeader={() =>
    header content
    } + title="Foo" + {...props}> +
    inner content
    +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/BoxedTabs-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/BoxedTabs-test.tsx new file mode 100644 index 00000000000..12a58f34fe5 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/BoxedTabs-test.tsx @@ -0,0 +1,69 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount, shallow } from 'enzyme'; +import * as React from 'react'; +import BoxedTabs, { BoxedTabsProps } from '../BoxedTabs'; + +it('should render correctly', () => { + expect(mountRender()).toMatchSnapshot(); +}); + +it('should call onSelect when a tab is clicked', () => { + const onSelect = jest.fn(); + const wrapper = shallowRender({ onSelect }); + + wrapper + .find('Styled(button)') + .get(1) + .props.onClick(); + + expect(onSelect).toHaveBeenCalledWith('b'); +}); + +function shallowRender(overrides: Partial> = {}) { + return shallow(dom(overrides)); +} + +function mountRender(overrides: Partial> = {}) { + return mount(dom(overrides)); +} + +function dom(overrides: Partial>) { + return ( + + Complex label !!! + + ) + } + ]} + {...overrides} + /> + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/Checkbox-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/Checkbox-test.tsx new file mode 100644 index 00000000000..b56cce6c559 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/Checkbox-test.tsx @@ -0,0 +1,115 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { click } from '../../../helpers/testUtils'; +import Checkbox from '../Checkbox'; + +it('should render', () => { + const checkbox = shallow( {}} title="Title value" />); + expect(checkbox).toMatchSnapshot(); +}); + +it('should render unchecked', () => { + const checkbox = shallow( true} />); + expect(checkbox.is('.icon-checkbox-checked')).toBe(false); + expect(checkbox.prop('aria-checked')).toBe(false); +}); + +it('should render checked', () => { + const checkbox = shallow( true} />); + expect(checkbox.is('.icon-checkbox-checked')).toBe(true); + expect(checkbox.prop('aria-checked')).toBe(true); +}); + +it('should render disabled', () => { + const checkbox = shallow( true} />); + expect(checkbox.is('.icon-checkbox-disabled')).toBe(true); +}); + +it('should render unchecked third state', () => { + const checkbox = shallow( true} thirdState={true} />); + expect(checkbox.is('.icon-checkbox-single')).toBe(true); + expect(checkbox.is('.icon-checkbox-checked')).toBe(false); +}); + +it('should render checked third state', () => { + const checkbox = shallow( true} thirdState={true} />); + expect(checkbox.is('.icon-checkbox-single')).toBe(true); + expect(checkbox.is('.icon-checkbox-checked')).toBe(true); +}); + +it('should render with a spinner', () => { + const checkbox = shallow( true} />); + expect(checkbox.find('DeferredSpinner').exists()).toBe(true); +}); + +it('should render children', () => { + const checkbox = shallow( + true}> + foo + + ); + expect(checkbox.hasClass('link-checkbox')).toBe(true); + expect(checkbox.find('span').exists()).toBe(true); +}); + +it('should render children with a spinner', () => { + const checkbox = shallow( + true}> + foo + + ); + expect(checkbox.hasClass('link-checkbox')).toBe(true); + expect(checkbox.find('span').exists()).toBe(true); + expect(checkbox.find('DeferredSpinner').exists()).toBe(true); +}); + +it('should call onCheck', () => { + const onCheck = jest.fn(); + const checkbox = shallow(); + click(checkbox); + expect(onCheck).toBeCalledWith(true, undefined); +}); + +it('should not call onCheck when disabled', () => { + const onCheck = jest.fn(); + const checkbox = shallow(); + click(checkbox); + expect(onCheck).toHaveBeenCalledTimes(0); +}); + +it('should call onCheck with id as second parameter', () => { + const onCheck = jest.fn(); + const checkbox = shallow(); + click(checkbox); + expect(onCheck).toBeCalledWith(true, 'foo'); +}); + +it('should apply custom class', () => { + const checkbox = shallow( + true} /> + ); + expect(checkbox.is('.customclass')).toBe(true); +}); + +it('should render the checkbox on the right', () => { + expect(shallow( true} right={true} />)).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ClickEventBoundary-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ClickEventBoundary-test.tsx new file mode 100644 index 00000000000..c2f6d701a76 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ClickEventBoundary-test.tsx @@ -0,0 +1,49 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount } from 'enzyme'; +import * as React from 'react'; +import ClickEventBoundary from '../ClickEventBoundary'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +it('should correctly capture a click event', () => { + const parentOnClick = jest.fn(); + const childOnClick = jest.fn(); + const wrapper = shallowRender({ onClick: parentOnClick }, { onClick: childOnClick }); + // Don't use our click() helper, so we make sure the bubbling works correctly. + wrapper.find('button').simulate('click'); + expect(childOnClick).toBeCalled(); + expect(parentOnClick).not.toBeCalled(); +}); + +function shallowRender(parentProps = {}, childProps = {}) { + // We need to mount in order to support event bubbling. + return mount( +
    + + + +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx index c32443d6d23..d686202ef12 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx @@ -29,7 +29,7 @@ import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage' import { mockBranch } from '../../../helpers/mocks/branch-like'; import { mockComponentReportStatus } from '../../../helpers/mocks/component-report'; import { mockComponent, mockCurrentUser } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { ComponentQualifier } from '../../../types/component'; import { ComponentReportActions } from '../ComponentReportActions'; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ConfirmButton-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ConfirmButton-test.tsx new file mode 100644 index 00000000000..39e315f1254 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ConfirmButton-test.tsx @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import ConfirmButton from '../ConfirmButton'; + +it('should display a modal button', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +it('should display a confirm modal', () => { + expect( + shallowRender() + .find('ModalButton') + .prop('modal')({ onClose: jest.fn() }) + ).toMatchSnapshot(); +}); + +function shallowRender() { + return shallow( + } + modalHeader="title" + onConfirm={jest.fn()}> + {() => 'Confirm button'} + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ConfirmModal-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ConfirmModal-test.tsx new file mode 100644 index 00000000000..cfefbac465a --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ConfirmModal-test.tsx @@ -0,0 +1,60 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { submit, waitAndUpdate } from '../../../helpers/testUtils'; +import ConfirmModal from '../ConfirmModal'; + +it('should render correctly', () => { + const wrapper = shallow( + +

    My confirm message

    +
    + ); + expect(wrapper).toMatchSnapshot(); + expect(wrapper.find('SimpleModal').dive()).toMatchSnapshot(); +}); + +it('should confirm and close after confirm', async () => { + const onClose = jest.fn(); + const onConfirm = jest.fn(() => Promise.resolve()); + const wrapper = shallow( + +

    My confirm message

    +
    + ); + const modalContent = wrapper.find('SimpleModal').dive(); + submit(modalContent.find('form')); + expect(onConfirm).toBeCalledWith('data'); + expect(modalContent.find('footer')).toMatchSnapshot(); + + await waitAndUpdate(wrapper); + expect(onClose).toHaveBeenCalled(); +}); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/DateInput-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/DateInput-test.tsx index 64bbec9b825..6cab7176e1c 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/DateInput-test.tsx +++ b/server/sonar-web/src/main/js/components/controls/__tests__/DateInput-test.tsx @@ -24,7 +24,7 @@ import * as subDays from 'date-fns/sub_days'; import * as subMonths from 'date-fns/sub_months'; import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import DateInput from '../DateInput'; beforeAll(() => { diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/DateRangeInput-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/DateRangeInput-test.tsx index 0d023f19e01..802bb054e22 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/DateRangeInput-test.tsx +++ b/server/sonar-web/src/main/js/components/controls/__tests__/DateRangeInput-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { parseDate } from '../../../sonar-ui-common/helpers/dates'; +import { parseDate } from '../../../helpers/dates'; import DateRangeInput from '../DateRangeInput'; const dateA = parseDate('2018-01-17T00:00:00.000Z'); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/Dropdown-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/Dropdown-test.tsx new file mode 100644 index 00000000000..e08d8293fba --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/Dropdown-test.tsx @@ -0,0 +1,120 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/* eslint-disable jest/expect-expect */ + +import { mount, shallow, ShallowWrapper } from 'enzyme'; +import * as React from 'react'; +import { click } from '../../../helpers/testUtils'; +import { Popup, PopupPlacement } from '../../ui/popups'; +import { Button } from '../buttons'; +import Dropdown, { DropdownOverlay } from '../Dropdown'; +import ScreenPositionFixer from '../ScreenPositionFixer'; + +describe('Dropdown', () => { + it('renders', () => { + expect( + shallow(}>{() =>
    }) + .find('div') + .exists() + ).toBe(true); + }); + + it('toggles with element child', () => { + checkToggle( + shallow( + }> + + ); + const wrapper = shallowRender({ children, onClose }); + click(wrapper.find('Button')); + expect(onClose).toBeCalled(); +}); + +it('submits', async () => { + const onSubmit = jest.fn(() => Promise.resolve()); + const children = ({ onSubmitClick, submitting }: ChildrenProps) => ( + + ); + const wrapper = shallowRender({ children, onSubmit }); + wrapper.instance().mounted = true; + expect(wrapper).toMatchSnapshot(); + + click(wrapper.find('Button')); + expect(onSubmit).toBeCalled(); + expect(wrapper).toMatchSnapshot(); + + await waitAndUpdate(wrapper); + expect(wrapper).toMatchSnapshot(); +}); + +function shallowRender({ children = () =>
    , ...props }: Partial = {}) { + return shallow( + + {children} + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/Tabs-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/Tabs-test.tsx new file mode 100644 index 00000000000..60982c290e4 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/Tabs-test.tsx @@ -0,0 +1,81 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { click } from '../../../helpers/testUtils'; +import Tabs, { Tab } from '../Tabs'; + +it('should render correctly', () => { + const wrapper = shallow( + + ); + + expect(wrapper).toMatchSnapshot(); +}); + +it('should switch tabs', () => { + const onChange = jest.fn(); + const wrapper = shallow( + + ); + + click(shallow(wrapper.find('Tab').get(0)).find('.js-foo')); + expect(onChange).toBeCalledWith('foo'); + click(shallow(wrapper.find('Tab').get(1)).find('.js-bar')); + expect(onChange).toBeCalledWith('bar'); +}); + +it('should render single tab correctly', () => { + const onSelect = jest.fn(); + const wrapper = shallow( + + Foo + + ); + expect(wrapper).toMatchSnapshot(); + click(wrapper.find('a')); + expect(onSelect).toBeCalledWith('foo'); +}); + +it('should disable single tab', () => { + const onSelect = jest.fn(); + const wrapper = shallow( + + Foo + + ); + expect(wrapper).toMatchSnapshot(); + click(wrapper.find('a')); + expect(onSelect).not.toBeCalled(); +}); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/Toggle-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/Toggle-test.tsx new file mode 100644 index 00000000000..f3e39aca5df --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/Toggle-test.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { click } from '../../../helpers/testUtils'; +import { Button } from '../buttons'; +import Toggle from '../Toggle'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot('on'); + expect(shallowRender({ value: false })).toMatchSnapshot('off'); + expect(shallowRender({ disabled: true })).toMatchSnapshot('disabled'); +}); + +it('should call onChange when clicked', () => { + const onChange = jest.fn(); + const wrapper = shallowRender({ disabled: false, onChange, value: true }); + click(wrapper.find(Button)); + expect(onChange).toBeCalledWith(false); +}); + +function shallowRender(props?: Partial) { + return shallow( + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/Toggler-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/Toggler-test.tsx new file mode 100644 index 00000000000..679177cfda3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/Toggler-test.tsx @@ -0,0 +1,48 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import Toggler from '../Toggler'; + +it('should render only children', () => { + expect(shallowRender({ open: false })).toMatchSnapshot(); +}); + +it('should render children and overlay', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +it('should render when closeOnClick=true', () => { + expect(shallowRender({ closeOnClick: true })).toMatchSnapshot(); +}); + +it('should not render click wrappers', () => { + expect( + shallowRender({ closeOnClick: false, closeOnClickOutside: false, closeOnEscape: false }) + ).toMatchSnapshot(); +}); + +function shallowRender(props?: Partial) { + return shallow( + } {...props}> +
    + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/Tooltip-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/Tooltip-test.tsx new file mode 100644 index 00000000000..ae4b58e7b35 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/Tooltip-test.tsx @@ -0,0 +1,118 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import Tooltip, { TooltipInner, TooltipProps } from '../Tooltip'; + +jest.useFakeTimers(); +jest.mock('react-dom', () => { + const actual = jest.requireActual('react-dom'); + return Object.assign({}, actual, { + findDOMNode: jest.fn().mockReturnValue(undefined) + }); +}); + +beforeEach(jest.clearAllMocks); + +it('should render', () => { + expect(shallowRenderTooltipInner()).toMatchSnapshot(); + expect( + shallow( + } visible={true}> +
    + , + { disableLifecycleMethods: true } + ) + ).toMatchSnapshot(); +}); + +it('should open & close', () => { + const onShow = jest.fn(); + const onHide = jest.fn(); + const wrapper = shallowRenderTooltipInner({ onHide, onShow }); + + wrapper.find('#tooltip').simulate('mouseenter'); + jest.runOnlyPendingTimers(); + wrapper.update(); + expect(wrapper.find('TooltipPortal').exists()).toBe(true); + expect(onShow).toBeCalled(); + + wrapper.find('#tooltip').simulate('mouseleave'); + jest.runOnlyPendingTimers(); + wrapper.update(); + expect(wrapper.find('TooltipPortal').exists()).toBe(false); + expect(onHide).toBeCalled(); +}); + +it('should not open when mouse goes away quickly', () => { + const onShow = jest.fn(); + const onHide = jest.fn(); + const wrapper = shallowRenderTooltipInner({ onHide, onShow }); + + wrapper.find('#tooltip').simulate('mouseenter'); + wrapper.find('#tooltip').simulate('mouseleave'); + jest.runOnlyPendingTimers(); + wrapper.update(); + + expect(wrapper.find('TooltipPortal').exists()).toBe(false); +}); + +it('should not render tooltip without overlay', () => { + const wrapper = shallowRenderTooltip(); + expect(wrapper.type()).toBe('div'); +}); + +it('should not render empty tooltips', () => { + expect(shallowRenderTooltip()).toMatchSnapshot(); + expect(shallowRenderTooltip()).toMatchSnapshot(); +}); + +it('should adjust arrow position', () => { + const wrapper = shallowRenderTooltipInner(); + + expect(wrapper.instance().adjustArrowPosition('left', { leftFix: 10, topFix: 20 })).toEqual({ + marginTop: -20 + }); + expect(wrapper.instance().adjustArrowPosition('right', { leftFix: 10, topFix: 20 })).toEqual({ + marginTop: -20 + }); + expect(wrapper.instance().adjustArrowPosition('top', { leftFix: 10, topFix: 20 })).toEqual({ + marginLeft: -10 + }); + expect(wrapper.instance().adjustArrowPosition('bottom', { leftFix: 10, topFix: 20 })).toEqual({ + marginLeft: -10 + }); +}); + +function shallowRenderTooltip() { + return shallow( + +
    + + ); +} + +function shallowRenderTooltipInner(props?: Partial) { + return shallow( + } {...props}> +
    + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ValidationForm-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationForm-test.tsx new file mode 100644 index 00000000000..64827f932ed --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationForm-test.tsx @@ -0,0 +1,47 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import ValidationForm from '../ValidationForm'; + +it('should render and submit', async () => { + const render = jest.fn(); + const onSubmit = jest.fn(); + const setSubmitting = jest.fn(); + const wrapper = shallow( + + {render} + + ); + expect(wrapper).toMatchSnapshot(); + wrapper.dive(); + expect(render).toBeCalledWith( + expect.objectContaining({ dirty: false, errors: {}, values: { foo: 'bar' } }) + ); + + wrapper.prop('onSubmit')({ foo: 'bar' }, { setSubmitting }); + expect(setSubmitting).toBeCalledWith(false); + + onSubmit.mockResolvedValue(undefined).mockClear(); + setSubmitting.mockClear(); + wrapper.prop('onSubmit')({ foo: 'bar' }, { setSubmitting }); + await new Promise(setImmediate); + expect(setSubmitting).toBeCalledWith(false); +}); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx new file mode 100644 index 00000000000..97d4a2a5937 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import ValidationInput from '../ValidationInput'; + +it('should render', () => { + expect( + shallow( + +
    + + ) + ).toMatchSnapshot(); +}); + +it('should render with error', () => { + expect( + shallow( + My description
    } + error="Field error message" + id="field-id" + isInvalid={true} + isValid={false} + label="Field label"> +
    + + ) + ).toMatchSnapshot(); +}); + +it('should render when valid', () => { + expect( + shallow( + +
    + + ) + ).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ValidationModal-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationModal-test.tsx new file mode 100644 index 00000000000..3bbb8e5dc4d --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationModal-test.tsx @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { waitAndUpdate } from '../../../helpers/testUtils'; +import ValidationForm from '../ValidationForm'; +import ValidationModal from '../ValidationModal'; + +it('should render correctly', () => { + const wrapper = shallowRender(); + expect(wrapper).toMatchSnapshot(); + expect( + wrapper + .find(ValidationForm) + .dive() + .dive() + ).toMatchSnapshot(); +}); + +it('should handle submit', async () => { + const data = { field: 'foo' }; + const onSubmit = jest.fn().mockResolvedValue({}); + const onClose = jest.fn(); + const wrapper = shallowRender({ onClose, onSubmit }); + + wrapper.instance().handleSubmit(data); + expect(onSubmit).toBeCalledWith(data); + + await waitAndUpdate(wrapper); + expect(onClose).toBeCalled(); +}); + +function shallowRender(props: Partial['props']> = {}) { + return shallow>( + + confirmButtonText="confirm" + header="title" + initialValues={{ field: 'foo' }} + isDestructive={true} + isInitialValid={true} + onClose={jest.fn()} + onSubmit={jest.fn()} + validate={jest.fn()} + {...props}> + {props => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ActionsDropdown-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ActionsDropdown-test.tsx.snap new file mode 100644 index 00000000000..4bd6a2ea46d --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ActionsDropdown-test.tsx.snap @@ -0,0 +1,143 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ActionsDropdown should render correctly 1`] = ` + + + Hello world + + + } + overlayPlacement="bottom" +> + + +`; + +exports[`ActionsDropdown should render correctly 2`] = ` + + + Hello world + + + } + overlayPlacement="bottom" +> + + +`; + +exports[`ActionsDropdownDivider should render correctly 1`] = ` +
  • +`; + +exports[`ActionsDropdownItem should render correctly 1`] = ` +
  • + + + Hello world + + +
  • +`; + +exports[`ActionsDropdownItem should render correctly 2`] = ` +
  • + + + Hello world + + +
  • +`; + +exports[`ActionsDropdownItem should render correctly 3`] = ` +
  • + + + Hello world + + +
  • +`; + +exports[`ActionsDropdownItem should render correctly copy item 1`] = ` + + + + +
  • + + + Hello world + + +
  • +
    +
    +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BackButton-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BackButton-test.tsx.snap new file mode 100644 index 00000000000..57a5f2c6135 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BackButton-test.tsx.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should handle click 1`] = ` + + + + + + + +`; + +exports[`should render properly 1`] = ` + + + + + + + +`; + +exports[`should render properly 2`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedGroupAccordion-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedGroupAccordion-test.tsx.snap new file mode 100644 index 00000000000..0c7b74b79d9 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedGroupAccordion-test.tsx.snap @@ -0,0 +1,26 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +
    +
    + + + Foo + +
    + header content +
    +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedTabs-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedTabs-test.tsx.snap new file mode 100644 index 00000000000..22d8f761533 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/BoxedTabs-test.tsx.snap @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +.emotion-6 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; +} + +.emotion-1 { + position: relative; + background-color: white; + border-top: 1px solid #e6e6e6; + border-left: 1px solid #e6e6e6; + border-right: none; + border-bottom: none; + margin-bottom: -1px; + min-width: 128px; + min-height: 56px; + outline: 0; + padding: calc(2 * 8px); +} + +.emotion-1:last-child { + border-right: 1px solid #e6e6e6; +} + +.emotion-0 { + display: block; + background-color: #4b9fd5; + height: 3px; + width: 100%; + position: absolute; + left: 0; + top: -1px; +} + +.emotion-3 { + position: relative; + background-color: #f3f3f3; + border-top: 1px solid #e6e6e6; + border-left: 1px solid #e6e6e6; + border-right: none; + border-bottom: none; + margin-bottom: -1px; + min-width: 128px; + min-height: 56px; + cursor: pointer; + outline: 0; + padding: calc(2 * 8px); +} + +.emotion-3:hover { + background-color: #f8f8f8; +} + +.emotion-3:last-child { + border-right: 1px solid #e6e6e6; +} + +.emotion-2 { + display: none; + background-color: #4b9fd5; + height: 3px; + width: 100%; + position: absolute; + left: 0; + top: -1px; +} + + + Complex label + + !!! + + , + }, + ] + } +> + +
    + + + + + + + + + +
    +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Checkbox-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Checkbox-test.tsx.snap new file mode 100644 index 00000000000..69c0c60af8c --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Checkbox-test.tsx.snap @@ -0,0 +1,22 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render 1`] = ` + +`; + +exports[`should render the checkbox on the right 1`] = ` + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ClickEventBoundary-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ClickEventBoundary-test.tsx.snap new file mode 100644 index 00000000000..62eac278e7f --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ClickEventBoundary-test.tsx.snap @@ -0,0 +1,14 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +
    + + + +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmButton-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmButton-test.tsx.snap new file mode 100644 index 00000000000..f94c3829503 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmButton-test.tsx.snap @@ -0,0 +1,20 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should display a confirm modal 1`] = ` + +
    + +`; + +exports[`should display a modal button 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmModal-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmModal-test.tsx.snap new file mode 100644 index 00000000000..f1367ae048a --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ConfirmModal-test.tsx.snap @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should confirm and close after confirm 1`] = ` +
    + + + confirm + + + cancel + +
    +`; + +exports[`should render correctly 1`] = ` + + + +`; + +exports[`should render correctly 2`] = ` + + +
    +
    +

    + title +

    +
    +
    +

    + My confirm message +

    +
    +
    + + + confirm + + + cancel + +
    +
    +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/EscKeydownHandler-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/EscKeydownHandler-test.tsx.snap new file mode 100644 index 00000000000..239d6bfe358 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/EscKeydownHandler-test.tsx.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + + Hi there + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/FavoriteButton-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/FavoriteButton-test.tsx.snap new file mode 100644 index 00000000000..f66e2ddd464 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/FavoriteButton-test.tsx.snap @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render favorite 1`] = ` + + + + + +`; + +exports[`should render not favorite 1`] = ` + + + + + +`; + +exports[`should update properly 1`] = ` + + + + + +`; + +exports[`should update properly 2`] = ` + + + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/GlobalMessages-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/GlobalMessages-test.tsx.snap new file mode 100644 index 00000000000..fdeaf6c28e4 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/GlobalMessages-test.tsx.snap @@ -0,0 +1,212 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly with a message 1`] = ` + + + + +`; + +exports[`should render correctly with a message 2`] = ` + + Test + + +`; + +exports[`should render correctly with a message 3`] = ` + + Test 2 + + +`; + +exports[`should render with correct css 1`] = ` +@keyframes animation-0 { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +@keyframes animation-0 { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +.emotion-4 { + position: fixed; + z-index: 7000; + top: 0; + left: 50%; + width: 350px; + margin-left: -175px; +} + +.emotion-1 { + position: relative; + padding: 0 30px 0 10px; + line-height: 24px; + border-radius: 0 0 3px 3px; + box-sizing: border-box; + color: #ffffff; + background-color: #d4333f; + text-align: center; + opacity: 0; + -webkit-animation: animation-0 0.2s ease forwards; + animation: animation-0 0.2s ease forwards; +} + +.emotion-1 + .emotion-1 { + margin-top: calc(8px / 2); + border-radius: 3px; +} + +.emotion-0 { + position: absolute; + top: calc(8px / 4); + right: calc(8px / 4); +} + +.emotion-0:hover svg, +.emotion-0:focus svg { + color: #d4333f; +} + +.emotion-3 { + position: relative; + padding: 0 30px 0 10px; + line-height: 24px; + border-radius: 0 0 3px 3px; + box-sizing: border-box; + color: #ffffff; + background-color: #00aa00; + text-align: center; + opacity: 0; + -webkit-animation: animation-0 0.2s ease forwards; + animation: animation-0 0.2s ease forwards; +} + +.emotion-3 + .emotion-3 { + margin-top: calc(8px / 2); + border-radius: 3px; +} + +.emotion-2 { + position: absolute; + top: calc(8px / 4); + right: calc(8px / 4); +} + +.emotion-2:hover svg, +.emotion-2:focus svg { + color: #00aa00; +} + +
    + +
    + Test 2 + +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/HelpTooltip-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/HelpTooltip-test.tsx.snap new file mode 100644 index 00000000000..abf28dfdd32 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/HelpTooltip-test.tsx.snap @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render dark helptooltip properly: dark 1`] = ` + + } +> + + + + +`; + +exports[`should render dark helptooltip properly: dark icon 1`] = ` + +`; + +exports[`should render properly: default 1`] = ` +
    + + } + > + + + + + + +
    +`; + +exports[`should render properly: default icon 1`] = ` + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/IdentityProviderLink-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/IdentityProviderLink-test.tsx.snap new file mode 100644 index 00000000000..d3a38a52376 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/IdentityProviderLink-test.tsx.snap @@ -0,0 +1,21 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +
    + Foo + Link text + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/InputValidationField-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/InputValidationField-test.tsx.snap new file mode 100644 index 00000000000..16f3e1c2dfa --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/InputValidationField-test.tsx.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ListFooter-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ListFooter-test.tsx.snap new file mode 100644 index 00000000000..2d55aa0d03b --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ListFooter-test.tsx.snap @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: default 1`] = ` +
    + x_of_y_shown.3.5 + +
    +`; + +exports[`should render correctly: empty if everything is loaded 1`] = ` +
    + x_of_y_shown.5.5 +
    +`; + +exports[`should render correctly: empty if no loadMore nor reload props 1`] = ` +
    + x_of_y_shown.3.5 +
    +`; + +exports[`should render correctly: loading 1`] = ` +
    + x_of_y_shown.3.5 + + +
    +`; + +exports[`should render correctly: reload 1`] = ` +
    + x_of_y_shown.3.5 + +
    +`; + +exports[`should render correctly: reload, loading 1`] = ` +
    + x_of_y_shown.3.5 + + +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ModalValidationField-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ModalValidationField-test.tsx.snap new file mode 100644 index 00000000000..4b4e605c0ad --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ModalValidationField-test.tsx.snap @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should display the field as valid 1`] = ` +
    + + + +
    +`; + +exports[`should display the field with an error 1`] = ` +
    + + + +

    + Is required +

    +
    +`; + +exports[`should display the field without any error/validation 1`] = ` +
    + + +
    + Describe Foo. +
    +
    +`; + +exports[`should display the field without any error/validation 2`] = ` +
    + + +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/OutsideClickHandler-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/OutsideClickHandler-test.tsx.snap new file mode 100644 index 00000000000..a4f533d8e3a --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/OutsideClickHandler-test.tsx.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Radio-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Radio-test.tsx.snap new file mode 100644 index 00000000000..8649fba79b8 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/Radio-test.tsx.snap @@ -0,0 +1,29 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render properly: checked 1`] = ` + + + +`; + +exports[`should render properly: not checked 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioCard-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioCard-test.tsx.snap new file mode 100644 index 00000000000..e58f9d73597 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioCard-test.tsx.snap @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should be actionable 1`] = ` +
    +

    + + + Radio Card + +

    +
    +
    + content +
    +
    +
    +`; + +exports[`should be actionable 2`] = ` +
    +

    + + + Radio Card + + info +

    +
    +
    + content +
    +
    +
    +`; + +exports[`should render correctly 1`] = ` +
    +

    + + Radio Card + + info +

    +
    +
    + content +
    +
    +
    + + + recommended + , + } + } + /> +
    +
    +`; + +exports[`should render correctly 2`] = ` +
    +

    + + Radio Card Vertical + + info +

    +
    +
    + content +
    +
    +
    + + + recommended + , + } + } + /> +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap new file mode 100644 index 00000000000..791d312e720 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`accepts advanced options fields 1`] = ` +
      +
    • + + + + +
    • +
    • + + + + +
    • +
    +`; + +exports[`renders 1`] = ` +
      +
    • + + + + +
    • +
    • + + + + +
    • +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ReloadButton-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ReloadButton-test.tsx.snap new file mode 100644 index 00000000000..9510ca69cca --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ReloadButton-test.tsx.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should handle click 1`] = ` + + + + + + + +`; + +exports[`should render properly 1`] = ` + + + + + + + +`; + +exports[`should render properly 2`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchBox-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchBox-test.tsx.snap new file mode 100644 index 00000000000..4ed69eb6a29 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchBox-test.tsx.snap @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders 1`] = ` +
    + + + + + +
    +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchSelect-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchSelect-test.tsx.snap new file mode 100644 index 00000000000..792343f1a73 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchSelect-test.tsx.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render Select 1`] = ` + +
    +
    + + + confirm + + + cancel + +
    + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/buttons-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/buttons-test.tsx.snap new file mode 100644 index 00000000000..8d915b89387 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/buttons-test.tsx.snap @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Button should render correctly 1`] = ` + +`; + +exports[`ButtonIcon should render correctly 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/clipboard-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/clipboard-test.tsx.snap new file mode 100644 index 00000000000..de2081cb464 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/clipboard-test.tsx.snap @@ -0,0 +1,52 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ClipboardBase should display correctly 1`] = ` + +`; + +exports[`ClipboardButton should display correctly 1`] = ` + + + +`; + +exports[`ClipboardButton should render a custom label if provided 1`] = ` + + + +`; + +exports[`ClipboardIconButton should display correctly 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/buttons-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/buttons-test.tsx new file mode 100644 index 00000000000..c199c5778cc --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/buttons-test.tsx @@ -0,0 +1,77 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { click, mockEvent } from '../../../helpers/testUtils'; +import { Button, ButtonIcon, ButtonIconProps } from '../buttons'; + +describe('Button', () => { + it('should render correctly', () => { + const onClick = jest.fn(); + const preventDefault = jest.fn(); + const stopPropagation = jest.fn(); + const wrapper = shallowRender({ onClick }); + expect(wrapper).toMatchSnapshot(); + click(wrapper.find('button'), mockEvent({ preventDefault, stopPropagation })); + expect(onClick).toBeCalled(); + expect(preventDefault).toBeCalled(); + expect(stopPropagation).not.toBeCalled(); + }); + + it('should not stop propagation, but prevent default of the click event', () => { + const preventDefault = jest.fn(); + const stopPropagation = jest.fn(); + const wrapper = shallowRender({ preventDefault: false, stopPropagation: true }); + click(wrapper.find('button'), mockEvent({ preventDefault, stopPropagation })); + expect(preventDefault).not.toBeCalled(); + expect(stopPropagation).toBeCalled(); + }); + + it('should disable buttons with a class', () => { + const preventDefault = jest.fn(); + const onClick = jest.fn(); + const button = shallowRender({ disabled: true, onClick, preventDefault: false }).find('button'); + expect(button.props().disabled).toBeUndefined(); + expect(button.props().className).toContain('disabled'); + expect(button.props()['aria-disabled']).toBe(true); + click(button, mockEvent({ preventDefault })); + expect(onClick).not.toBeCalled(); + expect(preventDefault).toBeCalled(); + }); + + function shallowRender(props: Partial = {}) { + return shallow); + } +}); + +describe('ButtonIcon', () => { + it('should render correctly', () => { + const wrapper = shallowRender(); + expect(wrapper).toMatchSnapshot(); + }); + + function shallowRender(props: Partial = {}) { + return shallow( + + + + ).dive(); + } +}); diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/clipboard-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/clipboard-test.tsx new file mode 100644 index 00000000000..891f667e98b --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/__tests__/clipboard-test.tsx @@ -0,0 +1,102 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount, shallow } from 'enzyme'; +import * as React from 'react'; +import { Button } from '../buttons'; +import { ClipboardBase, ClipboardButton, ClipboardIconButton } from '../clipboard'; + +const constructor = jest.fn(); +const destroy = jest.fn(); +const on = jest.fn(); + +jest.mock( + 'clipboard', + () => + function(...args: any) { + constructor(...args); + return { + destroy, + on + }; + } +); + +jest.useFakeTimers(); + +describe('ClipboardBase', () => { + it('should display correctly', () => { + const children = jest.fn().mockReturnValue(); + const wrapper = shallowRender(children); + const instance = wrapper.instance(); + expect(wrapper).toMatchSnapshot(); + instance.handleSuccessCopy(); + expect(children).toBeCalledWith({ copySuccess: true, setCopyButton: instance.setCopyButton }); + jest.runAllTimers(); + expect(children).toBeCalledWith({ copySuccess: false, setCopyButton: instance.setCopyButton }); + }); + + it('should allow its content to be copied', () => { + const wrapper = mountRender(({ setCopyButton }) => ( + + )); + const button = wrapper.find('button').getDOMNode(); + const instance = wrapper.instance(); + + expect(constructor).toBeCalledWith(button); + expect(on).toBeCalledWith('success', instance.handleSuccessCopy); + + jest.clearAllMocks(); + + wrapper.unmount(); + expect(destroy).toBeCalled(); + }); + + function shallowRender(children?: ClipboardBase['props']['children']) { + return shallow({children || (() => null)}); + } + + function mountRender(children?: ClipboardBase['props']['children']) { + return mount({children || (() => null)}); + } +}); + +describe('ClipboardButton', () => { + it('should display correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + }); + + it('should render a custom label if provided', () => { + expect(shallowRender('Foo Bar')).toMatchSnapshot(); + }); + + function shallowRender(children?: React.ReactNode) { + return shallow({children}).dive(); + } +}); + +describe('ClipboardIconButton', () => { + it('should display correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + }); + + function shallowRender() { + return shallow().dive(); + } +}); diff --git a/server/sonar-web/src/main/js/components/controls/buttons.css b/server/sonar-web/src/main/js/components/controls/buttons.css new file mode 100644 index 00000000000..8a8f9447cb3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/buttons.css @@ -0,0 +1,322 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.button { + display: inline-flex; + align-items: center; + justify-content: center; + vertical-align: middle; + height: var(--controlHeight); + line-height: calc(var(--controlHeight) - 2px); + padding: 0 var(--gridSize); + border: 1px solid var(--darkBlue); + border-radius: 2px; + box-sizing: border-box; + background: transparent; + color: var(--darkBlue); + font-weight: 600; + font-size: var(--smallFontSize); + text-decoration: none; + cursor: pointer; + outline: none; + transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; +} + +.button:hover, +.button.button-active { + background: var(--darkBlue); + color: var(--white); +} + +.button:active { + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} + +.button:focus { + box-shadow: 0 0 0 3px rgba(35, 106, 151, 0.25); +} + +.button-primary { + background: var(--darkBlue); + border-color: var(--darkBlue); + color: var(--white); +} + +.button-primary:hover { + background: var(--veryDarkBlue); + border-color: var(--veryDarkBlue); +} + +.button-primary.button-light { + background: var(--blue); + border-color: var(--blue); + color: var(--white); +} + +.button-primary.button-light:hover { + background: var(--darkBlue); + border-color: var(--darkBlue); +} + +.button.disabled { + color: var(--disableGrayText) !important; + border-color: var(--disableGrayBorder) !important; + background: var(--disableGrayBg) !important; + cursor: not-allowed !important; + box-shadow: none !important; +} + +/* #region .button-red */ +.button-red { + border-color: var(--red); + color: var(--red); +} + +.button-red:hover, +.button-red.active { + background: var(--red); + color: var(--white); +} + +.button-red:focus { + box-shadow: 0 0 0 3px rgba(212, 51, 63, 0.25); +} + +/* #endregion */ + +/* #region .button-success */ +.button-success { + border-color: var(--green); + color: var(--green); +} + +.button-success:hover, +.button-success.active { + background: var(--green); + color: var(--white); +} + +.button-success:focus { + box-shadow: 0 0 0 3px rgba(0, 170, 0, 0.25); +} + +/* #endregion */ + +/* #region .button-link */ +.button-link { + display: inline-flex; + height: auto; + /* Keep this to not inherit the height from .button */ + line-height: 1; + margin: 0; + padding: 0; + border: none; + border-radius: 0; + background: transparent; + color: var(--darkBlue); + border-bottom: 1px solid var(--lightBlue); + font-weight: 400; + font-size: inherit; + transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-bottom 0.2s ease; +} + +.dropdown .button-link { + border-bottom: none; +} + +.button-link:hover { + background: transparent; + color: var(--blue); +} + +.button-link:active, +.button-link:focus { + box-shadow: none; + outline: 1px dotted var(--blue); +} + +.button-link.disabled { + color: var(--secondFontColor); + background: transparent !important; + cursor: default; +} + +/* #endregion */ + +.button-small { + height: var(--smallControlHeight); + line-height: 18px; + padding: 0 6px; + font-size: 11px; +} + +.button-tiny { + height: var(--tinyControlHeight); + line-height: var(--tinyControlHeight); + padding: 0 calc(var(--gridSize) / 2); +} + +.button-large { + height: var(--largeControlHeight); + padding: 0 16px; + font-size: var(--mediumFontSize); +} + +.button-huge { + flex-direction: column; + padding: calc(2 * var(--gridSize)); + width: 200px; + height: 200px; + background-color: var(--white); + border: solid 1px var(--white); + border-radius: 3px; + transition: all 0.2s ease; + box-shadow: 0 1px 1px 1px var(--barBorderColor); +} + +.button-huge:hover, +.button-huge:focus, +.button-huge:active { + background-color: var(--white); + color: var(--darkBlue); + box-shadow: var(--defaultShadow); + transform: translateY(-2px); +} + +/* #region .button-group */ +/* TODO drop usage of this class in SQ (already dropped from SC) */ +.button-group { + display: inline-block; + vertical-align: middle; + font-size: 0; + white-space: nowrap; +} + +.button-group > button, +.button-group > .button { + position: relative; + z-index: var(--normalZIndex); + display: inline-block; + vertical-align: middle; + margin: 0; + cursor: pointer; +} + +.button-group > .button:hover:not(.disabled), +.button-group > .button:focus:not(.disabled), +.button-group > .button:active:not(.disabled), +.button-group > .button.active:not(.disabled) { + z-index: var(--aboveNormalZIndex); +} + +.button-group > .button.disabled { + z-index: var(--belowNormalZIndex); +} + +.button-group > .button:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.button-group > .button:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.button-group > .button + .button { + margin-left: -1px; +} + +.button-group > a:not(.button) { + vertical-align: middle; + margin: 0 8px; + font-size: var(--smallFontSize); +} + +/* #endregion */ + +/* #region .button-icon */ +.button-icon { + display: inline-flex; + justify-content: center; + align-items: center; + vertical-align: middle; + width: var(--controlHeight); + height: var(--controlHeight); + padding: 0; + border: none; + color: inherit; +} + +.button-icon.button-small { + width: var(--smallControlHeight); + height: var(--smallControlHeight); + padding: 0; +} + +.button-icon.button-small svg { + margin-top: 0; +} + +.button-icon.button-tiny { + width: var(--tinyControlHeight); + height: var(--tinyControlHeight); + padding: 0; +} + +.button-icon.button-tiny svg { + margin-top: 0; +} + +.button-icon:hover, +.button-icon:focus { + background-color: currentColor; +} + +.button-icon:not(.disabled):hover svg, +.button-icon:not(.disabled):focus svg { + color: var(--white); +} + +.button.button-icon.disabled { + background: transparent !important; +} + +/* #endregion */ + +.button-list { + display: inline-flex; + justify-content: space-between; + height: auto; + border: 1px solid var(--barBorderColor); + padding: var(--gridSize); + margin: calc(var(--gridSize) / 2); + color: var(--secondFontColor); + font-weight: normal; +} + +.button-list:hover { + background-color: white; + border-color: var(--blue); + color: var(--darkBlue); +} + +.no-select { + user-select: none !important; +} diff --git a/server/sonar-web/src/main/js/components/controls/buttons.tsx b/server/sonar-web/src/main/js/components/controls/buttons.tsx new file mode 100644 index 00000000000..742b50f1191 --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/buttons.tsx @@ -0,0 +1,182 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import ChevronRightIcon from '../icons/ChevronRightIcon'; +import ClearIcon, { ClearIconProps } from '../icons/ClearIcon'; +import DeleteIcon from '../icons/DeleteIcon'; +import EditIcon from '../icons/EditIcon'; +import { IconProps } from '../icons/Icon'; +import { ThemeConsumer } from '../theme'; +import './buttons.css'; +import Tooltip, { TooltipProps } from './Tooltip'; + +type AllowedButtonAttributes = Pick< + React.ButtonHTMLAttributes, + 'className' | 'disabled' | 'id' | 'style' | 'title' +>; + +interface ButtonProps extends AllowedButtonAttributes { + autoFocus?: boolean; + children?: React.ReactNode; + innerRef?: (node: HTMLElement | null) => void; + name?: string; + onClick?: () => void; + preventDefault?: boolean; + stopPropagation?: boolean; + type?: 'button' | 'submit' | 'reset' | undefined; +} + +export class Button extends React.PureComponent { + handleClick = (event: React.MouseEvent) => { + const { disabled, onClick, preventDefault = true, stopPropagation = false } = this.props; + + event.currentTarget.blur(); + if (preventDefault || disabled) { + event.preventDefault(); + } + if (stopPropagation) { + event.stopPropagation(); + } + + if (onClick && !disabled) { + onClick(); + } + }; + + render() { + const { + className, + disabled, + innerRef, + onClick, + preventDefault, + stopPropagation, + type = 'button', + ...props + } = this.props; + return ( + + ); +} diff --git a/server/sonar-web/src/main/js/components/controls/clipboard.tsx b/server/sonar-web/src/main/js/components/controls/clipboard.tsx new file mode 100644 index 00000000000..6d91192275c --- /dev/null +++ b/server/sonar-web/src/main/js/components/controls/clipboard.tsx @@ -0,0 +1,148 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as Clipboard from 'clipboard'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import CopyIcon from '../icons/CopyIcon'; +import { Button, ButtonIcon } from './buttons'; +import Tooltip from './Tooltip'; + +export interface State { + copySuccess: boolean; +} + +interface RenderProps { + setCopyButton: (node: HTMLElement | null) => void; + copySuccess: boolean; +} + +interface BaseProps { + children: (props: RenderProps) => React.ReactNode; +} + +export class ClipboardBase extends React.PureComponent { + private clipboard?: Clipboard; + private copyButton?: HTMLElement | null; + mounted = false; + state: State = { copySuccess: false }; + + componentDidMount() { + this.mounted = true; + if (this.copyButton) { + this.clipboard = new Clipboard(this.copyButton); + this.clipboard.on('success', this.handleSuccessCopy); + } + } + + componentDidUpdate() { + if (this.clipboard) { + this.clipboard.destroy(); + } + if (this.copyButton) { + this.clipboard = new Clipboard(this.copyButton); + this.clipboard.on('success', this.handleSuccessCopy); + } + } + + componentWillUnmount() { + this.mounted = false; + if (this.clipboard) { + this.clipboard.destroy(); + } + } + + setCopyButton = (node: HTMLElement | null) => { + this.copyButton = node; + }; + + handleSuccessCopy = () => { + if (this.mounted) { + this.setState({ copySuccess: true }); + setTimeout(() => { + if (this.mounted) { + this.setState({ copySuccess: false }); + } + }, 1000); + } + }; + + render() { + return this.props.children({ + setCopyButton: this.setCopyButton, + copySuccess: this.state.copySuccess + }); + } +} + +interface ButtonProps { + className?: string; + copyValue: string; + children?: React.ReactNode; +} + +export function ClipboardButton({ className, children, copyValue }: ButtonProps) { + return ( + + {({ setCopyButton, copySuccess }) => ( + + + + )} + + ); +} + +interface IconButtonProps { + 'aria-label'?: string; + className?: string; + copyValue: string; +} + +export function ClipboardIconButton(props: IconButtonProps) { + const { className, copyValue } = props; + return ( + + {({ setCopyButton, copySuccess }) => { + return ( + + + + ); + }} + + ); +} diff --git a/server/sonar-web/src/main/js/components/docs/DocCollapsibleBlock.tsx b/server/sonar-web/src/main/js/components/docs/DocCollapsibleBlock.tsx index e335ee3eb8c..c235eea28db 100644 --- a/server/sonar-web/src/main/js/components/docs/DocCollapsibleBlock.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocCollapsibleBlock.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import OpenCloseIcon from '../../sonar-ui-common/components/icons/OpenCloseIcon'; +import OpenCloseIcon from '../../components/icons/OpenCloseIcon'; interface State { open: boolean; diff --git a/server/sonar-web/src/main/js/components/docs/DocImg.tsx b/server/sonar-web/src/main/js/components/docs/DocImg.tsx index f2836e9a18f..d8baf103eab 100644 --- a/server/sonar-web/src/main/js/components/docs/DocImg.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocImg.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { getBaseUrl } from '../../sonar-ui-common/helpers/urls'; +import { getBaseUrl } from '../../helpers/urls'; export default function DocImg(props: React.ImgHTMLAttributes) { const { alt, src, ...other } = props; diff --git a/server/sonar-web/src/main/js/components/docs/DocLink.tsx b/server/sonar-web/src/main/js/components/docs/DocLink.tsx index 3cb93cf5812..ff51324b907 100644 --- a/server/sonar-web/src/main/js/components/docs/DocLink.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocLink.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import DetachIcon from '../../components/icons/DetachIcon'; import { isSonarCloud } from '../../helpers/system'; -import DetachIcon from '../../sonar-ui-common/components/icons/DetachIcon'; import { withAppState } from '../hoc/withAppState'; interface OwnProps { diff --git a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx index b183a8ad4f5..1fe7220a0e8 100644 --- a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx @@ -25,7 +25,7 @@ import rehypeSlug from 'rehype-slug'; import remark from 'remark'; import remarkCustomBlocks from 'remark-custom-blocks'; import remarkRehype from 'remark-rehype'; -import { scrollToElement } from '../../sonar-ui-common/helpers/scrolling'; +import { scrollToElement } from '../../helpers/scrolling'; import DocCollapsibleBlock from './DocCollapsibleBlock'; import DocImg from './DocImg'; import DocLink from './DocLink'; diff --git a/server/sonar-web/src/main/js/components/docs/DocToc.tsx b/server/sonar-web/src/main/js/components/docs/DocToc.tsx index 18a455c0192..edcc71da2ef 100644 --- a/server/sonar-web/src/main/js/components/docs/DocToc.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocToc.tsx @@ -23,7 +23,7 @@ import * as React from 'react'; import { findDOMNode } from 'react-dom'; import remark from 'remark'; import reactRenderer from 'remark-react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import onlyToc from './plugins/remark-only-toc'; interface Props { diff --git a/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx b/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx index f1624dcc954..b2d853e180f 100644 --- a/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx @@ -20,7 +20,7 @@ import { forEach } from 'lodash'; import * as React from 'react'; import { Link } from 'react-router'; -import DetachIcon from '../../sonar-ui-common/components/icons/DetachIcon'; +import DetachIcon from '../../components/icons/DetachIcon'; interface OwnProps { customProps?: T.Dict; diff --git a/server/sonar-web/src/main/js/components/docs/__tests__/DocCollapsibleBlock-test.tsx b/server/sonar-web/src/main/js/components/docs/__tests__/DocCollapsibleBlock-test.tsx index 8e8827d5d61..e06f5ee7d60 100644 --- a/server/sonar-web/src/main/js/components/docs/__tests__/DocCollapsibleBlock-test.tsx +++ b/server/sonar-web/src/main/js/components/docs/__tests__/DocCollapsibleBlock-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import DocCollapsibleBlock from '../DocCollapsibleBlock'; const children = ( diff --git a/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx b/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx index 47cccf1ef0c..eb1c3e0208a 100644 --- a/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx +++ b/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { scrollToElement } from '../../../helpers/scrolling'; import { mockEvent } from '../../../helpers/testMocks'; -import { scrollToElement } from '../../../sonar-ui-common/helpers/scrolling'; import DocMarkdownBlock from '../DocMarkdownBlock'; const CONTENT = ` @@ -50,7 +50,7 @@ jest.mock('rehype-raw', () => ({ default: jest.requireActual('rehype-raw') })); jest.mock('rehype-react', () => ({ default: jest.requireActual('rehype-react') })); jest.mock('rehype-slug', () => ({ default: jest.requireActual('rehype-slug') })); -jest.mock('../../../sonar-ui-common/helpers/scrolling', () => ({ +jest.mock('../../../helpers/scrolling', () => ({ scrollToElement: jest.fn() })); diff --git a/server/sonar-web/src/main/js/components/docs/__tests__/DocToc-test.tsx b/server/sonar-web/src/main/js/components/docs/__tests__/DocToc-test.tsx index 3113d2972ae..78838e2d971 100644 --- a/server/sonar-web/src/main/js/components/docs/__tests__/DocToc-test.tsx +++ b/server/sonar-web/src/main/js/components/docs/__tests__/DocToc-test.tsx @@ -19,7 +19,7 @@ */ import { mount } from 'enzyme'; import * as React from 'react'; -import { click, scrollTo } from '../../../sonar-ui-common/helpers/testUtils'; +import { click, scrollTo } from '../../../helpers/testUtils'; import DocToc from '../DocToc'; const OFFSET = 300; diff --git a/server/sonar-web/src/main/js/components/facet/FacetHeader.tsx b/server/sonar-web/src/main/js/components/facet/FacetHeader.tsx index cb7a7de515d..090fbf5005c 100644 --- a/server/sonar-web/src/main/js/components/facet/FacetHeader.tsx +++ b/server/sonar-web/src/main/js/components/facet/FacetHeader.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../sonar-ui-common/components/controls/buttons'; -import HelpTooltip from '../../sonar-ui-common/components/controls/HelpTooltip'; -import OpenCloseIcon from '../../sonar-ui-common/components/icons/OpenCloseIcon'; -import DeferredSpinner from '../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../components/controls/buttons'; +import HelpTooltip from '../../components/controls/HelpTooltip'; +import OpenCloseIcon from '../../components/icons/OpenCloseIcon'; +import DeferredSpinner from '../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../helpers/l10n'; interface Props { children?: React.ReactNode; diff --git a/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx b/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx index dacee4ebd96..822e5964faa 100644 --- a/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx +++ b/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx @@ -20,13 +20,13 @@ import * as classNames from 'classnames'; import { sortBy, without } from 'lodash'; import * as React from 'react'; -import ListFooter from '../../sonar-ui-common/components/controls/ListFooter'; -import SearchBox from '../../sonar-ui-common/components/controls/SearchBox'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import { Alert } from '../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; -import { queriesEqual } from '../../sonar-ui-common/helpers/query'; +import ListFooter from '../../components/controls/ListFooter'; +import SearchBox from '../../components/controls/SearchBox'; +import Tooltip from '../../components/controls/Tooltip'; +import { Alert } from '../../components/ui/Alert'; +import { translate } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; +import { queriesEqual } from '../../helpers/query'; import FacetBox from './FacetBox'; import FacetHeader from './FacetHeader'; import FacetItem from './FacetItem'; diff --git a/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx b/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx index 1afa9718fa0..7d1091502ba 100644 --- a/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx +++ b/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import { translate, translateWithParameters } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/facet/MultipleSelectionHint.tsx b/server/sonar-web/src/main/js/components/facet/MultipleSelectionHint.tsx index 913644ad6aa..ab922570fb5 100644 --- a/server/sonar-web/src/main/js/components/facet/MultipleSelectionHint.tsx +++ b/server/sonar-web/src/main/js/components/facet/MultipleSelectionHint.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import './MultipleSelectionHint.css'; interface Props { diff --git a/server/sonar-web/src/main/js/components/facet/__tests__/FacetHeader-test.tsx b/server/sonar-web/src/main/js/components/facet/__tests__/FacetHeader-test.tsx index c135b73d803..c8e1a03fbb1 100644 --- a/server/sonar-web/src/main/js/components/facet/__tests__/FacetHeader-test.tsx +++ b/server/sonar-web/src/main/js/components/facet/__tests__/FacetHeader-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import FacetHeader from '../FacetHeader'; it('should render open facet with value', () => { diff --git a/server/sonar-web/src/main/js/components/facet/__tests__/FacetItem-test.tsx b/server/sonar-web/src/main/js/components/facet/__tests__/FacetItem-test.tsx index 54f0cba0272..1629e9bbea2 100644 --- a/server/sonar-web/src/main/js/components/facet/__tests__/FacetItem-test.tsx +++ b/server/sonar-web/src/main/js/components/facet/__tests__/FacetItem-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import FacetItem, { Props } from '../FacetItem'; it('should render active', () => { diff --git a/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx b/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx index 72e4ff445e4..ac2a06ad937 100644 --- a/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx +++ b/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx @@ -19,7 +19,7 @@ */ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import ListStyleFacet, { Props } from '../ListStyleFacet'; it('should render', () => { diff --git a/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacetFooter-test.tsx b/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacetFooter-test.tsx index cf4edc30d25..a1e58c3bcd7 100644 --- a/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacetFooter-test.tsx +++ b/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacetFooter-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import ListStyleFacetFooter from '../ListStyleFacetFooter'; it('should not render "show more"', () => { diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx index 18de0d584b1..cdf4910523f 100644 --- a/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx +++ b/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx @@ -19,11 +19,11 @@ */ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; +import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; import { mockStore } from '../../../helpers/testMocks'; -import handleRequiredAuthentication from '../../../sonar-ui-common/helpers/handleRequiredAuthentication'; import { whenLoggedIn } from '../whenLoggedIn'; -jest.mock('../../../sonar-ui-common/helpers/handleRequiredAuthentication', () => ({ +jest.mock('../../../helpers/handleRequiredAuthentication', () => ({ default: jest.fn() })); diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx index 60a8ba13cca..db142bb8684 100644 --- a/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx +++ b/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx @@ -20,7 +20,7 @@ import { mount, shallow } from 'enzyme'; import * as React from 'react'; import { mockComponent } from '../../../helpers/testMocks'; -import { KEYCODE_MAP, keydown } from '../../../sonar-ui-common/helpers/testUtils'; +import { KEYCODE_MAP, keydown } from '../../../helpers/testUtils'; import withKeyboardNavigation, { WithKeyboardNavigationProps } from '../withKeyboardNavigation'; class X extends React.Component<{ diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx index babc0bf1e25..187ed2bd022 100644 --- a/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx +++ b/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { addNotification, getNotifications, removeNotification } from '../../../api/notifications'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../helpers/testUtils'; import { withNotifications, WithNotificationsProps } from '../withNotifications'; jest.mock('../../../api/notifications', () => ({ diff --git a/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx b/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx index 250ecb9e3d7..d258303c773 100644 --- a/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx +++ b/server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import handleRequiredAuthentication from '../../helpers/handleRequiredAuthentication'; import { isLoggedIn } from '../../helpers/users'; -import handleRequiredAuthentication from '../../sonar-ui-common/helpers/handleRequiredAuthentication'; import { getWrappedDisplayName } from './utils'; import { withCurrentUser } from './withCurrentUser'; diff --git a/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx b/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx index 4db6963967b..531ea3a5962 100644 --- a/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx +++ b/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx @@ -19,7 +19,7 @@ */ import * as key from 'keymaster'; import * as React from 'react'; -import PageActions from '../../sonar-ui-common/components/ui/PageActions'; +import PageActions from '../../components/ui/PageActions'; import { getWrappedDisplayName } from './utils'; export interface WithKeyboardNavigationProps { diff --git a/server/sonar-web/src/main/js/components/icons/AlertErrorIcon.tsx b/server/sonar-web/src/main/js/components/icons/AlertErrorIcon.tsx new file mode 100644 index 00000000000..c6c71782d7a --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/AlertErrorIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function AlertErrorIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/AlertSuccessIcon.tsx b/server/sonar-web/src/main/js/components/icons/AlertSuccessIcon.tsx new file mode 100644 index 00000000000..707d0f9e9f6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/AlertSuccessIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function AlertSuccessIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/AlertWarnIcon.tsx b/server/sonar-web/src/main/js/components/icons/AlertWarnIcon.tsx new file mode 100644 index 00000000000..7dc322657d2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/AlertWarnIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function AlertWarnIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx b/server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx new file mode 100644 index 00000000000..c27e7307897 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx @@ -0,0 +1,50 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +interface Props extends IconProps { + animated?: boolean; + inverseDirection?: boolean; +} + +export default function ArrowIcon({ + animated = false, + fill = 'currentColor', + inverseDirection = false, + ...iconProps +}: Props) { + const style: React.CSSProperties = {}; + if (inverseDirection) { + style.transform = 'scaleX(-1)'; + } + + if (animated) { + style.transition = 'transform 0.2s'; + } + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/BackIcon.tsx b/server/sonar-web/src/main/js/components/icons/BackIcon.tsx new file mode 100644 index 00000000000..34974ee8374 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/BackIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function BackIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/BranchIcon.tsx b/server/sonar-web/src/main/js/components/icons/BranchIcon.tsx new file mode 100644 index 00000000000..b6e9207cc58 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/BranchIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function BranchIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/BranchLikeIcon.tsx b/server/sonar-web/src/main/js/components/icons/BranchLikeIcon.tsx index 8b301c9aed0..af23676da6a 100644 --- a/server/sonar-web/src/main/js/components/icons/BranchLikeIcon.tsx +++ b/server/sonar-web/src/main/js/components/icons/BranchLikeIcon.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import BranchIcon from '../../components/icons/BranchIcon'; +import { IconProps } from '../../components/icons/Icon'; +import PullRequestIcon from '../../components/icons/PullRequestIcon'; import { isPullRequest } from '../../helpers/branch-like'; -import BranchIcon from '../../sonar-ui-common/components/icons/BranchIcon'; -import { IconProps } from '../../sonar-ui-common/components/icons/Icon'; -import PullRequestIcon from '../../sonar-ui-common/components/icons/PullRequestIcon'; import { BranchLike } from '../../types/branch-like'; export interface BranchLikeIconProps extends IconProps { diff --git a/server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx b/server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx new file mode 100644 index 00000000000..50a40c5c2f5 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function BubblesIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/BugIcon.tsx b/server/sonar-web/src/main/js/components/icons/BugIcon.tsx new file mode 100644 index 00000000000..77f19836614 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/BugIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function BugIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/BugTrackerIcon.tsx b/server/sonar-web/src/main/js/components/icons/BugTrackerIcon.tsx new file mode 100644 index 00000000000..db03eee3115 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/BugTrackerIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function BugTrackerIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/BulletListIcon.tsx b/server/sonar-web/src/main/js/components/icons/BulletListIcon.tsx new file mode 100644 index 00000000000..bceb30427a4 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/BulletListIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function BulletListIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/CalendarIcon.tsx b/server/sonar-web/src/main/js/components/icons/CalendarIcon.tsx new file mode 100644 index 00000000000..bb70dfd4d6e --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/CalendarIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function CalendarIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ChartLegendIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChartLegendIcon.tsx new file mode 100644 index 00000000000..4d4d305190a --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ChartLegendIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { ThemedIcon } from './Icon'; + +interface Props { + className?: string; + index: number; + size?: number; +} + +export default function ChartLegendIcon({ index, ...iconProps }: Props) { + return ( + + {({ theme }) => { + const COLORS = [theme.colors.blue, theme.colors.darkBlue, '#24c6e0']; + return ( + + ); + }} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/CheckIcon.tsx b/server/sonar-web/src/main/js/components/icons/CheckIcon.tsx new file mode 100644 index 00000000000..9248e6178e8 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/CheckIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function CheckIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronDownIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronDownIcon.tsx new file mode 100644 index 00000000000..0931930ee5c --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ChevronDownIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ChevronDownIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx new file mode 100644 index 00000000000..8f4824699ab --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ChevronLeftIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronRightIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronRightIcon.tsx new file mode 100644 index 00000000000..21d6049ed6f --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ChevronRightIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ChevronRightIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx new file mode 100644 index 00000000000..842fc9f69a8 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ChevronUpIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx new file mode 100644 index 00000000000..2ad6f90ed97 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ChevronsIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ClearIcon.tsx b/server/sonar-web/src/main/js/components/icons/ClearIcon.tsx new file mode 100644 index 00000000000..91eb6f706d6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ClearIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export interface ClearIconProps extends IconProps { + thin?: boolean; +} + +export default function ClearIcon({ fill = 'currentColor', thin, ...iconProps }: ClearIconProps) { + return ( + + {thin ? ( + + ) : ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ClockIcon.tsx b/server/sonar-web/src/main/js/components/icons/ClockIcon.tsx new file mode 100644 index 00000000000..c777a4a8e60 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ClockIcon.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ClockIcon({ className, ...iconProps }: IconProps) { + return ( + + + + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/CodeSmellIcon.tsx b/server/sonar-web/src/main/js/components/icons/CodeSmellIcon.tsx new file mode 100644 index 00000000000..d705bcd0ec7 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/CodeSmellIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function CodeSmellIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/CogIcon.tsx b/server/sonar-web/src/main/js/components/icons/CogIcon.tsx new file mode 100644 index 00000000000..4d7da4238f6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/CogIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function CogIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/CollapseIcon.tsx b/server/sonar-web/src/main/js/components/icons/CollapseIcon.tsx new file mode 100644 index 00000000000..688f7e1a54f --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/CollapseIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function CollapseIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ContinuousIntegrationIcon.tsx b/server/sonar-web/src/main/js/components/icons/ContinuousIntegrationIcon.tsx new file mode 100644 index 00000000000..62ab2447fd1 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ContinuousIntegrationIcon.tsx @@ -0,0 +1,35 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ContinuousIntegrationIcon({ + fill = 'currentColor', + ...iconProps +}: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/CopyIcon.tsx b/server/sonar-web/src/main/js/components/icons/CopyIcon.tsx new file mode 100644 index 00000000000..2787990b1f3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/CopyIcon.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function CopyIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/DeleteIcon.tsx b/server/sonar-web/src/main/js/components/icons/DeleteIcon.tsx new file mode 100644 index 00000000000..1fb013182da --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/DeleteIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function DeleteIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/DetachIcon.tsx b/server/sonar-web/src/main/js/components/icons/DetachIcon.tsx new file mode 100644 index 00000000000..4066ddf3327 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/DetachIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function DetachIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/DropdownIcon.tsx b/server/sonar-web/src/main/js/components/icons/DropdownIcon.tsx new file mode 100644 index 00000000000..7abed26df45 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/DropdownIcon.tsx @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +interface DropdownIconProps { + turned?: boolean; +} + +export default function DropdownIcon({ + fill = 'currentColor', + size = 16, + turned = false, + ...iconProps +}: IconProps & DropdownIconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/EditIcon.tsx b/server/sonar-web/src/main/js/components/icons/EditIcon.tsx new file mode 100644 index 00000000000..45bf6814d46 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/EditIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function EditIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx b/server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx new file mode 100644 index 00000000000..c584514131a --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function EllipsisIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ExpandIcon.tsx b/server/sonar-web/src/main/js/components/icons/ExpandIcon.tsx new file mode 100644 index 00000000000..2de2405df9a --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ExpandIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ExpandIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx b/server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx new file mode 100644 index 00000000000..1b6a2ce7f52 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx @@ -0,0 +1,48 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ExpandSnippetIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + + + + + + + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/FavoriteIcon.tsx b/server/sonar-web/src/main/js/components/icons/FavoriteIcon.tsx new file mode 100644 index 00000000000..76af77cd4cc --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/FavoriteIcon.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { ThemeConsumer } from '../theme'; +import Icon, { IconProps } from './Icon'; + +interface Props extends IconProps { + favorite: boolean; +} + +export default function FavoriteIcon({ className, favorite, fill, ...iconProps }: Props) { + return ( + + {theme => ( + + + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/FilterIcon.tsx b/server/sonar-web/src/main/js/components/icons/FilterIcon.tsx new file mode 100644 index 00000000000..8d5851eb570 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/FilterIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function FilterIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/GroupIcon.tsx b/server/sonar-web/src/main/js/components/icons/GroupIcon.tsx new file mode 100644 index 00000000000..9efe35a17ab --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/GroupIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function GroupIcon({ fill, size = 36, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/HelpIcon.tsx b/server/sonar-web/src/main/js/components/icons/HelpIcon.tsx new file mode 100644 index 00000000000..641e76849d2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/HelpIcon.tsx @@ -0,0 +1,42 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +interface Props extends IconProps { + fillInner?: string; +} + +export default function HelpIcon({ fill = 'currentColor', fillInner, ...iconProps }: Props) { + return ( + + + {fillInner && ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/HistoryIcon.tsx b/server/sonar-web/src/main/js/components/icons/HistoryIcon.tsx new file mode 100644 index 00000000000..55d61aff599 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/HistoryIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function HistoryIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/HomeIcon.tsx b/server/sonar-web/src/main/js/components/icons/HomeIcon.tsx new file mode 100644 index 00000000000..c7814d90ed7 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/HomeIcon.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { ThemeConsumer } from '../theme'; +import Icon, { IconProps } from './Icon'; + +interface Props extends IconProps { + filled?: boolean; +} + +export default function HomeIcon({ className, fill, filled = false, ...iconProps }: Props) { + return ( + + {theme => ( + + + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/HouseIcon.tsx b/server/sonar-web/src/main/js/components/icons/HouseIcon.tsx new file mode 100644 index 00000000000..c4ff402ebb1 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/HouseIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function HouseIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/Icon.tsx b/server/sonar-web/src/main/js/components/icons/Icon.tsx new file mode 100644 index 00000000000..c47b1bd5391 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/Icon.tsx @@ -0,0 +1,81 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { Theme, ThemeConsumer } from '../theme'; + +export interface IconProps extends React.AriaAttributes { + className?: string; + fill?: string; + size?: number; +} + +interface Props extends React.AriaAttributes { + children: React.ReactNode; + className?: string; + size?: number; + style?: React.CSSProperties; + + // try to avoid using these: + width?: number; + height?: number; + viewBox?: string; +} + +export default function Icon({ + children, + className, + size = 16, + style, + height = size, + width = size, + viewBox = '0 0 16 16', + ...iconProps +}: Props) { + return ( + + {children} + + ); +} + +interface ThemedProps extends Props { + children: (themeContext: { theme: Theme }) => React.ReactNode; +} + +export function ThemedIcon({ children, ...iconProps }: ThemedProps) { + return ( + {theme => {children({ theme })}} + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/InfoIcon.tsx b/server/sonar-web/src/main/js/components/icons/InfoIcon.tsx new file mode 100644 index 00000000000..80029d0e93b --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/InfoIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function InfoIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/IssueIcon.tsx b/server/sonar-web/src/main/js/components/icons/IssueIcon.tsx new file mode 100644 index 00000000000..e78a91bbc44 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/IssueIcon.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import BugIcon from './BugIcon'; +import CodeSmellIcon from './CodeSmellIcon'; +import { IconProps } from './Icon'; +import SecurityHotspotIcon from './SecurityHotspotIcon'; +import VulnerabilityIcon from './VulnerabilityIcon'; + +interface Props extends IconProps { + type: T.IssueType; +} + +export default function IssueIcon({ type, ...iconProps }: Props) { + switch (type) { + case 'BUG': + return ; + case 'VULNERABILITY': + return ; + case 'CODE_SMELL': + return ; + case 'SECURITY_HOTSPOT': + return ; + default: + return null; + } +} diff --git a/server/sonar-web/src/main/js/components/icons/IssueTypeIcon.tsx b/server/sonar-web/src/main/js/components/icons/IssueTypeIcon.tsx new file mode 100644 index 00000000000..9815ce40a84 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/IssueTypeIcon.tsx @@ -0,0 +1,57 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps } from './Icon'; +import IssueIcon from './IssueIcon'; + +export interface Props extends IconProps { + query: string; +} + +export default function IssueTypeIcon({ query, ...iconProps }: Props) { + let type: T.IssueType; + + switch (query.toLowerCase()) { + case 'bug': + case 'bugs': + case 'new_bugs': + type = 'BUG'; + break; + case 'vulnerability': + case 'vulnerabilities': + case 'new_vulnerabilities': + type = 'VULNERABILITY'; + break; + case 'code_smell': + case 'code_smells': + case 'new_code_smells': + type = 'CODE_SMELL'; + break; + case 'security_hotspot': + case 'security_hotspots': + case 'new_security_hotspots': + type = 'SECURITY_HOTSPOT'; + break; + default: + return null; + } + + return ; +} diff --git a/server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx b/server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx new file mode 100644 index 00000000000..1ebcef9ed4e --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function LightBulbIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/LinkIcon.tsx b/server/sonar-web/src/main/js/components/icons/LinkIcon.tsx new file mode 100644 index 00000000000..04288a05331 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/LinkIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function LinkIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ListIcon.tsx b/server/sonar-web/src/main/js/components/icons/ListIcon.tsx new file mode 100644 index 00000000000..fdc9e5c840d --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ListIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function ListIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/LockIcon.tsx b/server/sonar-web/src/main/js/components/icons/LockIcon.tsx new file mode 100644 index 00000000000..f9cd73e4981 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/LockIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function LockIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx b/server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx new file mode 100644 index 00000000000..893c07178e4 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function LongLivingBranchIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/MeasuresIcon.tsx b/server/sonar-web/src/main/js/components/icons/MeasuresIcon.tsx new file mode 100644 index 00000000000..07ad0c47ecd --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/MeasuresIcon.tsx @@ -0,0 +1,29 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function MeasuresIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/MinimizeIcon.tsx b/server/sonar-web/src/main/js/components/icons/MinimizeIcon.tsx new file mode 100644 index 00000000000..66f64ed6157 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/MinimizeIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function MinimizeIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx b/server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx new file mode 100644 index 00000000000..10bf7da86d9 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx @@ -0,0 +1,52 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +interface Props extends IconProps { + hasUnread?: boolean; +} + +export default function NotificationIcon({ + fill = 'currentColor', + hasUnread, + ...iconProps +}: Props) { + return ( + + {({ theme }) => + hasUnread ? ( + <> + + + + ) : ( + + ) + } + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/OnboardingAddMembersIcon.tsx b/server/sonar-web/src/main/js/components/icons/OnboardingAddMembersIcon.tsx new file mode 100644 index 00000000000..255c2d8f391 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/OnboardingAddMembersIcon.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function OnboardingAddMembersIcon({ fill, size = 64, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/OnboardingProjectIcon.tsx b/server/sonar-web/src/main/js/components/icons/OnboardingProjectIcon.tsx new file mode 100644 index 00000000000..79fedae1598 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/OnboardingProjectIcon.tsx @@ -0,0 +1,35 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function OnboardingProjectIcon({ fill, size = 64, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/OnboardingTeamIcon.tsx b/server/sonar-web/src/main/js/components/icons/OnboardingTeamIcon.tsx new file mode 100644 index 00000000000..be4ab97b640 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/OnboardingTeamIcon.tsx @@ -0,0 +1,35 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function OnboardingTeamIcon({ fill, size = 64, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/OpenCloseIcon.tsx b/server/sonar-web/src/main/js/components/icons/OpenCloseIcon.tsx new file mode 100644 index 00000000000..8b50014773d --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/OpenCloseIcon.tsx @@ -0,0 +1,31 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import ChevronDownIcon from './ChevronDownIcon'; +import ChevronRightIcon from './ChevronRightIcon'; +import { IconProps } from './Icon'; + +interface Props extends IconProps { + open: boolean; +} + +export default function OpenCloseIcon({ open, ...iconProps }: Props) { + return open ? : ; +} diff --git a/server/sonar-web/src/main/js/components/icons/PendingIcon.tsx b/server/sonar-web/src/main/js/components/icons/PendingIcon.tsx new file mode 100644 index 00000000000..437abb33a70 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/PendingIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function PendingIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/PinIcon.tsx b/server/sonar-web/src/main/js/components/icons/PinIcon.tsx new file mode 100644 index 00000000000..4521f86a5e8 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/PinIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function PinIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/PlusCircleIcon.tsx b/server/sonar-web/src/main/js/components/icons/PlusCircleIcon.tsx new file mode 100644 index 00000000000..2591a7737db --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/PlusCircleIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function PlusCircleIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/PlusIcon.tsx b/server/sonar-web/src/main/js/components/icons/PlusIcon.tsx new file mode 100644 index 00000000000..39df3134c6f --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/PlusIcon.tsx @@ -0,0 +1,29 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function PlusIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx b/server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx new file mode 100644 index 00000000000..b158f9839b2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ProjectLinkIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import BugTrackerIcon from './BugTrackerIcon'; +import ContinuousIntegrationIcon from './ContinuousIntegrationIcon'; +import DetachIcon from './DetachIcon'; +import HouseIcon from './HouseIcon'; +import { IconProps } from './Icon'; +import SCMIcon from './SCMIcon'; + +interface ProjectLinkIconProps { + type: string; +} + +export default function ProjectLinkIcon({ type, ...iconProps }: IconProps & ProjectLinkIconProps) { + switch (type) { + case 'issue': + return ; + case 'homepage': + return ; + case 'ci': + return ; + case 'scm': + return ; + default: + return ; + } +} diff --git a/server/sonar-web/src/main/js/components/icons/PullRequestIcon.tsx b/server/sonar-web/src/main/js/components/icons/PullRequestIcon.tsx new file mode 100644 index 00000000000..dc249a94b71 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/PullRequestIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function PullRequestIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx b/server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx new file mode 100644 index 00000000000..c95948b878c --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx @@ -0,0 +1,185 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +const qualifierIcons: T.Dict<(props: IconProps) => React.ReactElement> = { + app: ApplicationIcon, + brc: SubProjectIcon, + dev: DeveloperIcon, + dir: DirectoryIcon, + fil: FileIcon, + svw: SubPortfolioIcon, + trk: ProjectIcon, + uts: UnitTestIcon, + vw: PortfolioIcon, + + // deprecated: + cla: UnitTestIcon, + dev_prj: ProjectIcon, + lib: LibraryIcon, + pac: DirectoryIcon +}; + +interface QualifierIconProps { + className?: string; + fill?: string; + qualifier: string | null | undefined; +} + +export default function QualifierIcon(props: QualifierIconProps) { + if (!props.qualifier) { + return null; + } + + const qualifier = props.qualifier.toLowerCase(); + const FoundIcon = qualifierIcons[qualifier]; + return FoundIcon ? : null; +} + +function ApplicationIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function DeveloperIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function DirectoryIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function FileIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function LibraryIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function PortfolioIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function ProjectIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function SubPortfolioIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function SubProjectIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function UnitTestIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/RecommendedIcon.tsx b/server/sonar-web/src/main/js/components/icons/RecommendedIcon.tsx new file mode 100644 index 00000000000..06b7abb5483 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/RecommendedIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function RecommendedIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/RocketIcon.tsx b/server/sonar-web/src/main/js/components/icons/RocketIcon.tsx new file mode 100644 index 00000000000..ad24c87365f --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/RocketIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function RocketIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx b/server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx new file mode 100644 index 00000000000..115da520908 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function RuleScopeIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/SCMIcon.tsx b/server/sonar-web/src/main/js/components/icons/SCMIcon.tsx new file mode 100644 index 00000000000..fdbd75fab76 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/SCMIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function SCMIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/SearchIcon.tsx b/server/sonar-web/src/main/js/components/icons/SearchIcon.tsx new file mode 100644 index 00000000000..0da433a21e2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/SearchIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function SearchIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/SecurityHotspotIcon.tsx b/server/sonar-web/src/main/js/components/icons/SecurityHotspotIcon.tsx new file mode 100644 index 00000000000..6ac2e9297ae --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/SecurityHotspotIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function SecurityHotspotIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/SettingsIcon.tsx b/server/sonar-web/src/main/js/components/icons/SettingsIcon.tsx new file mode 100644 index 00000000000..9156f96aa28 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/SettingsIcon.tsx @@ -0,0 +1,38 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function SettingsIcon({ + fill = 'currentColor', + size = 14, + ...iconProps +}: IconProps) { + return ( + + + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/SeverityIcon.tsx b/server/sonar-web/src/main/js/components/icons/SeverityIcon.tsx new file mode 100644 index 00000000000..dbf482baa8d --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/SeverityIcon.tsx @@ -0,0 +1,107 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +interface Props extends IconProps { + severity: string | null | undefined; +} + +const severityIcons: T.Dict<(props: IconProps) => React.ReactElement> = { + blocker: BlockerSeverityIcon, + critical: CriticalSeverityIcon, + major: MajorSeverityIcon, + minor: MinorSeverityIcon, + info: InfoSeverityIcon +}; + +export default function SeverityIcon({ severity, ...iconProps }: Props) { + if (!severity) { + return null; + } + + const Icon = severityIcons[severity.toLowerCase()]; + return Icon ? : null; +} + +function BlockerSeverityIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function CriticalSeverityIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function MajorSeverityIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function MinorSeverityIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function InfoSeverityIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx b/server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx new file mode 100644 index 00000000000..388bc50a262 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function ShortLivingBranchIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx b/server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx new file mode 100644 index 00000000000..34dc1ca3002 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function SortAscIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx b/server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx new file mode 100644 index 00000000000..9a4cba2e914 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function SortDescIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/StatusIcon.tsx b/server/sonar-web/src/main/js/components/icons/StatusIcon.tsx new file mode 100644 index 00000000000..70f2219c2b8 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/StatusIcon.tsx @@ -0,0 +1,106 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +interface Props extends IconProps { + status: string; +} + +const statusIcons: T.Dict<(props: IconProps) => React.ReactElement> = { + open: OpenStatusIcon, + confirmed: ConfirmedStatusIcon, + reopened: ReopenedStatusIcon, + resolved: ResolvedStatusIcon, + closed: ClosedStatusIcon, + to_review: OpenStatusIcon, + in_review: ConfirmedStatusIcon, + reviewed: ResolvedStatusIcon +}; + +export default function StatusIcon({ status, ...iconProps }: Props) { + const Icon = statusIcons[status.toLowerCase()]; + return Icon ? : null; +} + +function OpenStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function ConfirmedStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function ReopenedStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function ResolvedStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function ClosedStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/TagsIcon.tsx b/server/sonar-web/src/main/js/components/icons/TagsIcon.tsx new file mode 100644 index 00000000000..649256cf8fa --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/TagsIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function TagsIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx b/server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx new file mode 100644 index 00000000000..f555a85cffc --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx @@ -0,0 +1,89 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +interface Props extends IconProps { + status: string; +} + +const statusIcons: T.Dict<(props: IconProps) => React.ReactElement> = { + ok: OkTestStatusIcon, + failure: FailureTestStatusIcon, + error: ErrorTestStatusIcon, + skipped: SkippedTestStatusIcon +}; + +export default function TestStatusIcon({ status, ...iconProps }: Props) { + const Icon = statusIcons[status.toLowerCase()]; + return Icon ? : null; +} + +function OkTestStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function FailureTestStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function ErrorTestStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} + +function SkippedTestStatusIcon(iconProps: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/TreeIcon.tsx b/server/sonar-web/src/main/js/components/icons/TreeIcon.tsx new file mode 100644 index 00000000000..5b9992352e3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/TreeIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function TreeIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx b/server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx new file mode 100644 index 00000000000..66d14f39793 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function TreemapIcon({ fill = 'currentColor', size = 14, ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx b/server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx new file mode 100644 index 00000000000..d50d4d873d3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function VisibleIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/VulnerabilityIcon.tsx b/server/sonar-web/src/main/js/components/icons/VulnerabilityIcon.tsx new file mode 100644 index 00000000000..34da45580b4 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/VulnerabilityIcon.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import Icon, { IconProps } from './Icon'; + +export default function VulnerabilityIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/WarningIcon.tsx b/server/sonar-web/src/main/js/components/icons/WarningIcon.tsx new file mode 100644 index 00000000000..ceda2ea90ae --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/WarningIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { IconProps, ThemedIcon } from './Icon'; + +export default function WarningIcon({ fill, ...iconProps }: IconProps) { + return ( + + {({ theme }) => ( + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/Icon-test.tsx b/server/sonar-web/src/main/js/components/icons/__tests__/Icon-test.tsx new file mode 100644 index 00000000000..341eb88a17e --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/Icon-test.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import Icon, { IconProps } from '../Icon'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +function shallowRender(props: Partial = {}) { + return shallow( + + + + ); +} diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/IssueIcon-test.tsx b/server/sonar-web/src/main/js/components/icons/__tests__/IssueIcon-test.tsx new file mode 100644 index 00000000000..852beec5385 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/IssueIcon-test.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import IssueIcon from '../IssueIcon'; + +it('should render correctly', () => { + expect(shallowRender('BUG')).toMatchSnapshot(); + expect(shallowRender('VULNERABILITY')).toMatchSnapshot(); + expect(shallowRender('CODE_SMELL')).toMatchSnapshot(); + expect(shallowRender('SECURITY_HOTSPOT')).toMatchSnapshot(); +}); + +function shallowRender(type: T.IssueType) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/IssueTypeIcon-test.tsx b/server/sonar-web/src/main/js/components/icons/__tests__/IssueTypeIcon-test.tsx new file mode 100644 index 00000000000..dbd892fdb52 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/IssueTypeIcon-test.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import IssueTypeIcon, { Props } from '../IssueTypeIcon'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + expect(shallowRender({ className: 'my-class', query: 'security_hotspots' })).toMatchSnapshot(); + expect(shallowRender({ query: 'new_code_smells' })).toMatchSnapshot(); + expect(shallowRender({ query: 'vulnerability' })).toMatchSnapshot(); + expect(shallowRender({ query: 'unknown' }).type()).toBeNull(); +}); + +function shallowRender(props: Partial = {}) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/TestStatusIcon-test.tsx b/server/sonar-web/src/main/js/components/icons/__tests__/TestStatusIcon-test.tsx new file mode 100644 index 00000000000..c683e6cd02f --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/TestStatusIcon-test.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import TestStatusIcon from '../TestStatusIcon'; + +it('should render correctly', () => { + expect(shallowRender('OK')).toMatchSnapshot(); + expect(shallowRender('failure')).toMatchSnapshot(); + expect(shallowRender('skipped')).toMatchSnapshot(); + expect(shallowRender('Error')).toMatchSnapshot(); +}); + +function shallowRender(status: string) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/Icon-test.tsx.snap b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/Icon-test.tsx.snap new file mode 100644 index 00000000000..a61c0314f87 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/Icon-test.tsx.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueIcon-test.tsx.snap b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueIcon-test.tsx.snap new file mode 100644 index 00000000000..f3f5fcf1a7a --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueIcon-test.tsx.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ``; + +exports[`should render correctly 2`] = ``; + +exports[`should render correctly 3`] = ``; + +exports[`should render correctly 4`] = ``; diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueTypeIcon-test.tsx.snap b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueTypeIcon-test.tsx.snap new file mode 100644 index 00000000000..4373bb03f4c --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/IssueTypeIcon-test.tsx.snap @@ -0,0 +1,26 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + +`; + +exports[`should render correctly 2`] = ` + +`; + +exports[`should render correctly 3`] = ` + +`; + +exports[`should render correctly 4`] = ` + +`; diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/TestStatusIcon-test.tsx.snap b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/TestStatusIcon-test.tsx.snap new file mode 100644 index 00000000000..12b493c10ed --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/TestStatusIcon-test.tsx.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ``; + +exports[`should render correctly 2`] = ``; + +exports[`should render correctly 3`] = ``; + +exports[`should render correctly 4`] = ``; diff --git a/server/sonar-web/src/main/js/components/intl/DateFormatter.tsx b/server/sonar-web/src/main/js/components/intl/DateFormatter.tsx new file mode 100644 index 00000000000..c33b8a78ff5 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/DateFormatter.tsx @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { DateSource, FormattedDate } from 'react-intl'; +import { parseDate } from '../../helpers/dates'; + +export interface DateFormatterProps { + children?: (formattedDate: string) => React.ReactNode; + date: DateSource; + long?: boolean; +} + +export const formatterOption = { year: 'numeric', month: 'short', day: '2-digit' }; + +export const longFormatterOption = { year: 'numeric', month: 'long', day: 'numeric' }; + +export default function DateFormatter({ children, date, long }: DateFormatterProps) { + return ( + + {children} + + ); +} diff --git a/server/sonar-web/src/main/js/components/intl/DateFromNow.tsx b/server/sonar-web/src/main/js/components/intl/DateFromNow.tsx new file mode 100644 index 00000000000..713b31fdf8d --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/DateFromNow.tsx @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { differenceInHours } from 'date-fns'; +import * as React from 'react'; +import { DateSource, FormattedRelative } from 'react-intl'; +import { parseDate } from '../../helpers/dates'; +import { translate } from '../../helpers/l10n'; +import DateTimeFormatter from './DateTimeFormatter'; + +export interface DateFromNowProps { + children?: (formattedDate: string) => React.ReactNode; + date?: DateSource; + hourPrecision?: boolean; +} + +export default function DateFromNow(props: DateFromNowProps) { + const { children: originalChildren = (f: string) => f, date, hourPrecision } = props; + let children = originalChildren; + + if (!date) { + /* + * We return a JSX.Element to bypass typescript issue with functional components return type + * (https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20544) + */ + // eslint-disable-next-line react/jsx-no-useless-fragment + return <>{originalChildren(translate('never'))}; + } + + if (date && hourPrecision && differenceInHours(Date.now(), date) < 1) { + children = () => originalChildren(translate('less_than_1_hour_ago')); + } + + const parsedDate = parseDate(date); + + return ( + + {formattedDate => ( + + {children} + + )} + + ); +} diff --git a/server/sonar-web/src/main/js/components/intl/DateTimeFormatter.tsx b/server/sonar-web/src/main/js/components/intl/DateTimeFormatter.tsx new file mode 100644 index 00000000000..64394b80c58 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/DateTimeFormatter.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { DateSource, FormattedDate } from 'react-intl'; +import { parseDate } from '../../helpers/dates'; + +interface Props { + children?: (formattedDate: string) => React.ReactNode; + date: DateSource; +} + +export const formatterOption = { + year: 'numeric', + month: 'long', + day: 'numeric', + hour: 'numeric', + minute: 'numeric' +}; + +export default function DateTimeFormatter({ children, date }: Props) { + return ( + + {children} + + ); +} diff --git a/server/sonar-web/src/main/js/components/intl/TimeFormatter.tsx b/server/sonar-web/src/main/js/components/intl/TimeFormatter.tsx new file mode 100644 index 00000000000..8fb5af05440 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/TimeFormatter.tsx @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { DateSource, FormattedTime } from 'react-intl'; +import { parseDate } from '../../helpers/dates'; + +export interface TimeFormatterProps { + children?: (formattedDate: string) => React.ReactNode; + date: DateSource; + long?: boolean; +} + +export const formatterOption = { hour: 'numeric', minute: 'numeric' }; + +export const longFormatterOption = { hour: 'numeric', minute: 'numeric', second: 'numeric' }; + +export default function TimeFormatter({ children, date, long }: TimeFormatterProps) { + return ( + + {children} + + ); +} diff --git a/server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx b/server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx new file mode 100644 index 00000000000..76a585b4045 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__mocks__/DateFromNow.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { DateSource } from 'react-intl'; + +interface Props { + children?: (formattedDate: string) => React.ReactNode; + date: DateSource; +} + +export default function DateFromNow({ children, date }: Props) { + return children && children(date.toString()); +} diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/DateFormatter-test.tsx b/server/sonar-web/src/main/js/components/intl/__tests__/DateFormatter-test.tsx new file mode 100644 index 00000000000..d978428ced6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/DateFormatter-test.tsx @@ -0,0 +1,35 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import DateFormatter, { DateFormatterProps } from '../DateFormatter'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot('standard'); + expect(shallowRender({ long: true })).toMatchSnapshot('long'); +}); + +function shallowRender(overrides: Partial = {}) { + return shallow( + + {formatted => {formatted}} + + ); +} diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/DateFromNow-test.tsx b/server/sonar-web/src/main/js/components/intl/__tests__/DateFromNow-test.tsx new file mode 100644 index 00000000000..901b5cbba0c --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/DateFromNow-test.tsx @@ -0,0 +1,66 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { FormattedRelative, IntlProvider } from 'react-intl'; +import DateFromNow, { DateFromNowProps } from '../DateFromNow'; +import DateTimeFormatter from '../DateTimeFormatter'; + +const date = '2020-02-20T20:20:20Z'; + +it('should render correctly', () => { + const wrapper = shallowRender(); + + expect(wrapper).toMatchSnapshot(); + expect(wrapper.find(DateTimeFormatter).props().children!(date)).toMatchSnapshot('children'); +}); + +it('should render correctly when there is no date', () => { + const children = jest.fn(); + + shallowRender({ date: undefined }, children); + + expect(children).toHaveBeenCalledWith('never'); +}); + +it('should render correctly when the date is less than one hour in the past', () => { + const veryCloseDate = new Date(date); + veryCloseDate.setMinutes(veryCloseDate.getMinutes() - 10); + jest.spyOn(Date, 'now').mockImplementation(() => (new Date(date) as unknown) as number); + const children = jest.fn(); + + shallowRender({ date: veryCloseDate, hourPrecision: true }, children) + .dive() + .dive() + .find(FormattedRelative) + .props().children!(date); + + expect(children).toHaveBeenCalledWith('less_than_1_hour_ago'); +}); + +function shallowRender(overrides: Partial = {}, children: jest.Mock = jest.fn()) { + return shallow( + + + {formattedDate => children(formattedDate)} + + + ).dive(); +} diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx b/server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx new file mode 100644 index 00000000000..5fd7e0c0987 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import DateTimeFormatter from '../DateTimeFormatter'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot('standard'); +}); + +function shallowRender() { + return shallow( + + {formatted => {formatted}} + + ); +} diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/TimeFormatter-test.tsx b/server/sonar-web/src/main/js/components/intl/__tests__/TimeFormatter-test.tsx new file mode 100644 index 00000000000..ac73332ca38 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/TimeFormatter-test.tsx @@ -0,0 +1,35 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import TimeFormatter, { TimeFormatterProps } from '../TimeFormatter'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot('standard'); + expect(shallowRender({ long: true })).toMatchSnapshot('long'); +}); + +function shallowRender(overrides: Partial = {}) { + return shallow( + + {formatted => {formatted}} + + ); +} diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFormatter-test.tsx.snap b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFormatter-test.tsx.snap new file mode 100644 index 00000000000..2f603c6c1bd --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFormatter-test.tsx.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: long 1`] = ` + + + +`; + +exports[`should render correctly: standard 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFromNow-test.tsx.snap b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFromNow-test.tsx.snap new file mode 100644 index 00000000000..19ee5460047 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateFromNow-test.tsx.snap @@ -0,0 +1,22 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + + + +`; + +exports[`should render correctly: children 1`] = ` + + + [Function] + + +`; diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateTimeFormatter-test.tsx.snap b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateTimeFormatter-test.tsx.snap new file mode 100644 index 00000000000..c991112f771 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/DateTimeFormatter-test.tsx.snap @@ -0,0 +1,14 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: standard 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/TimeFormatter-test.tsx.snap b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/TimeFormatter-test.tsx.snap new file mode 100644 index 00000000000..7c19be3a479 --- /dev/null +++ b/server/sonar-web/src/main/js/components/intl/__tests__/__snapshots__/TimeFormatter-test.tsx.snap @@ -0,0 +1,22 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: long 1`] = ` + + + +`; + +exports[`should render correctly: standard 1`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/issue/IssueView.tsx b/server/sonar-web/src/main/js/components/issue/IssueView.tsx index dc2d5e9c82c..74975574922 100644 --- a/server/sonar-web/src/main/js/components/issue/IssueView.tsx +++ b/server/sonar-web/src/main/js/components/issue/IssueView.tsx @@ -20,7 +20,7 @@ import classNames from 'classnames'; import * as React from 'react'; import { deleteIssueComment, editIssueComment } from '../../api/issues'; -import Checkbox from '../../sonar-ui-common/components/controls/Checkbox'; +import Checkbox from '../../components/controls/Checkbox'; import { BranchLike } from '../../types/branch-like'; import { updateIssue } from './actions'; import IssueActionsBar from './components/IssueActionsBar'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.tsx index 5389b6c2ded..33558cf7f7d 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { IssueResponse } from '../../../types/issues'; import { updateIssue } from '../actions'; import IssueAssign from './IssueAssign'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueAssign.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueAssign.tsx index 11c7af41e71..6d91784ffa9 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueAssign.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueAssign.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import Avatar from '../../ui/Avatar'; import SetAssigneePopup from '../popups/SetAssigneePopup'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx index 10d6cbdae9d..a7b11c014e8 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import DateFromNow from '../../intl/DateFromNow'; import ChangelogPopup from '../popups/ChangelogPopup'; interface Props { diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx index 119f7799a59..16fb333578a 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; interface Props { diff: T.IssueChangelogDiff; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.tsx index 8373f5faeca..00f4f1e213c 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { addIssueComment } from '../../../api/issues'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import { translate } from '../../../helpers/l10n'; import { updateIssue } from '../actions'; import CommentPopup from '../popups/CommentPopup'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx index 0e598e235c5..301a32889b4 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { DeleteButton, EditButton } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { sanitizeString } from '../../../helpers/sanitize'; -import { DeleteButton, EditButton } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DateFromNow from '../../../sonar-ui-common/components/intl/DateFromNow'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import DateFromNow from '../../intl/DateFromNow'; import Avatar from '../../ui/Avatar'; import CommentDeletePopup from '../popups/CommentDeletePopup'; import CommentPopup from '../popups/CommentPopup'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx index 5c83e6f7a2b..3662530064e 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { RuleStatus } from '../../../types/rules'; import DocumentationTooltip from '../../common/DocumentationTooltip'; import { WorkspaceContextShape } from '../../workspace/context'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx index 9a3d77151db..c5f001d36e4 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { setIssueSeverity } from '../../../api/issues'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { IssueResponse } from '../../../types/issues'; import SeverityHelper from '../../shared/SeverityHelper'; import SetSeverityPopup from '../popups/SetSeverityPopup'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTags.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueTags.tsx index e1621611761..f5d4ee9fdeb 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTags.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTags.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { setIssueTags } from '../../../api/issues'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import { translate } from '../../../helpers/l10n'; import TagsList from '../../tags/TagsList'; import { updateIssue } from '../actions'; import SetIssueTagsPopup from '../popups/SetIssueTagsPopup'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx index 581ab6fcbd9..e4af5329dee 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx @@ -19,12 +19,12 @@ */ import * as React from 'react'; import { Link } from 'react-router'; +import Tooltip from '../../../components/controls/Tooltip'; +import LinkIcon from '../../../components/icons/LinkIcon'; import { getBranchLikeQuery } from '../../../helpers/branch-like'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure } from '../../../helpers/measures'; import { getComponentIssuesUrl } from '../../../helpers/urls'; -import Tooltip from '../../../sonar-ui-common/components/controls/Tooltip'; -import LinkIcon from '../../../sonar-ui-common/components/icons/LinkIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { formatMeasure } from '../../../sonar-ui-common/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { RuleStatus } from '../../../types/rules'; import LocationIndex from '../../common/LocationIndex'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTransition.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueTransition.tsx index 151b16b4c60..0371babb273 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTransition.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTransition.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { setIssueTransition } from '../../../api/issues'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import StatusHelper from '../../shared/StatusHelper'; import { updateIssue } from '../actions'; import SetTransitionPopup from '../popups/SetTransitionPopup'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx index dfb5884e687..8dc32e2ce15 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx @@ -20,11 +20,11 @@ import * as React from 'react'; import { setIssueType } from '../../../api/issues'; import { colors } from '../../../app/theme'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { IssueResponse } from '../../../types/issues'; import SetTypePopup from '../popups/SetTypePopup'; diff --git a/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.tsx b/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.tsx index 9719b16e892..097e398b946 100644 --- a/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import Toggler from '../../../sonar-ui-common/components/controls/Toggler'; -import DropdownIcon from '../../../sonar-ui-common/components/icons/DropdownIcon'; -import FilterIcon from '../../../sonar-ui-common/components/icons/FilterIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ButtonLink } from '../../../components/controls/buttons'; +import Toggler from '../../../components/controls/Toggler'; +import DropdownIcon from '../../../components/icons/DropdownIcon'; +import FilterIcon from '../../../components/icons/FilterIcon'; +import { translate } from '../../../helpers/l10n'; import SimilarIssuesPopup from '../popups/SimilarIssuesPopup'; interface Props { diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueAssign-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueAssign-test.tsx index b7a57ad8f6f..7ba490f0141 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueAssign-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueAssign-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockIssue } from '../../../../helpers/testMocks'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueAssign from '../IssueAssign'; const issue = mockIssue(false, { diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.tsx index 79c9f420d31..ef6f5e3ae6b 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueChangelog from '../IssueChangelog'; const issue = { diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentAction-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentAction-test.tsx index ea85db6caf3..066a36d8442 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentAction-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentAction-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueCommentAction from '../IssueCommentAction'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentLine-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentLine-test.tsx index 1bc3834007c..5888cba29dc 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentLine-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentLine-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueCommentLine from '../IssueCommentLine'; const comment: T.IssueComment = { diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueMessage-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueMessage-test.tsx index 76434929cdf..3e1d43c3c7e 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueMessage-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueMessage-test.tsx @@ -19,8 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { ButtonLink } from '../../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { ButtonLink } from '../../../../components/controls/buttons'; +import { click } from '../../../../helpers/testUtils'; import { RuleStatus } from '../../../../types/rules'; import IssueMessage, { IssueMessageProps } from '../IssueMessage'; diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueSeverity-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueSeverity-test.tsx index 0ab46df88ff..cf1eeb35049 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueSeverity-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueSeverity-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueSeverity from '../IssueSeverity'; const issue = { severity: 'BLOCKER' }; diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.tsx index bb66a22454d..9a8dd872cf4 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueTags from '../IssueTags'; const issue = { key: 'issuekey', tags: ['mytag', 'test'] }; diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTransition-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTransition-test.tsx index a781f587839..82aaf066958 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTransition-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTransition-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueTransition from '../IssueTransition'; const issue: IssueTransition['props']['issue'] = { diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueType-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueType-test.tsx index 82c0709b272..0e555b9d9d6 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueType-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueType-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import IssueType from '../IssueType'; const issue: Pick = { type: 'BUG' }; diff --git a/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx index f34b57ee112..eb240165cee 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { getIssueChangelog } from '../../../api/issues'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import DateTimeFormatter from '../../../sonar-ui-common/components/intl/DateTimeFormatter'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import DateTimeFormatter from '../../intl/DateTimeFormatter'; import Avatar from '../../ui/Avatar'; import IssueChangelogDiff from '../components/IssueChangelogDiff'; diff --git a/server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx index 6228c4531e2..0dbb1794809 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate } from '../../../helpers/l10n'; interface Props { onDelete: () => void; diff --git a/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.tsx index 2698e111960..e03c28cb175 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button, ResetButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, ResetButtonLink } from '../../../components/controls/buttons'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate } from '../../../helpers/l10n'; import FormattingTips from '../../common/FormattingTips'; interface Props { diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.tsx index 2ca2cdd3cf8..725fa526e5f 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.tsx @@ -20,10 +20,10 @@ import { map } from 'lodash'; import * as React from 'react'; import { searchUsers } from '../../../api/users'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import SearchBox from '../../../components/controls/SearchBox'; +import { translate } from '../../../helpers/l10n'; import { isLoggedIn, isUserActive } from '../../../helpers/users'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import SearchBox from '../../../sonar-ui-common/components/controls/SearchBox'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import SelectList from '../../common/SelectList'; import SelectListItem from '../../common/SelectListItem'; import { withCurrentUser } from '../../hoc/withCurrentUser'; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.tsx index 6a67ab9522f..b163ab90472 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.tsx @@ -20,8 +20,8 @@ import { difference, without } from 'lodash'; import * as React from 'react'; import { searchIssueTags } from '../../../api/issues'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import { PopupPlacement } from '../../../sonar-ui-common/components/ui/popups'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import { PopupPlacement } from '../../../components/ui/popups'; import TagsSelector from '../../tags/TagsSelector'; interface Props { diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.tsx index 9758367c83d..28e153b03f8 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import SeverityIcon from '../../../sonar-ui-common/components/icons/SeverityIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import SeverityIcon from '../../../components/icons/SeverityIcon'; +import { translate } from '../../../helpers/l10n'; import SelectList from '../../common/SelectList'; import SelectListItem from '../../common/SelectListItem'; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx index 1c5ccb83a53..4fa4cf0fc52 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import { hasMessage, translate } from '../../../sonar-ui-common/helpers/l10n'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import { hasMessage, translate } from '../../../helpers/l10n'; import SelectList from '../../common/SelectList'; import SelectListItem from '../../common/SelectListItem'; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.tsx index 39807141097..7cb044ffe98 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import { translate } from '../../../helpers/l10n'; import SelectList from '../../common/SelectList'; import SelectListItem from '../../common/SelectListItem'; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx index 32d6136db31..ea5636b26d8 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DropdownOverlay } from '../../../sonar-ui-common/components/controls/Dropdown'; -import IssueTypeIcon from '../../../sonar-ui-common/components/icons/IssueTypeIcon'; -import QualifierIcon from '../../../sonar-ui-common/components/icons/QualifierIcon'; -import TagsIcon from '../../../sonar-ui-common/components/icons/TagsIcon'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; -import { fileFromPath, limitComponentName } from '../../../sonar-ui-common/helpers/path'; +import { DropdownOverlay } from '../../../components/controls/Dropdown'; +import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; +import QualifierIcon from '../../../components/icons/QualifierIcon'; +import TagsIcon from '../../../components/icons/TagsIcon'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { fileFromPath, limitComponentName } from '../../../helpers/path'; import SelectList from '../../common/SelectList'; import SelectListItem from '../../common/SelectListItem'; import SeverityHelper from '../../shared/SeverityHelper'; diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/ChangelogPopup-test.tsx b/server/sonar-web/src/main/js/components/issue/popups/__tests__/ChangelogPopup-test.tsx index a2c1c2eb712..188040143b4 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/ChangelogPopup-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/ChangelogPopup-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getIssueChangelog } from '../../../../api/issues'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import ChangelogPopup from '../ChangelogPopup'; jest.mock('../../../../api/issues', () => ({ diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentDeletePopup-test.tsx b/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentDeletePopup-test.tsx index dc620384173..4824447420d 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentDeletePopup-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentDeletePopup-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import CommentDeletePopup from '../CommentDeletePopup'; it('should render the comment delete popup correctly', () => { diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentPopup-test.tsx b/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentPopup-test.tsx index 28364fe0a3f..3893fee0716 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentPopup-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/CommentPopup-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import CommentPopup from '../CommentPopup'; it('should render the comment popup correctly without existing comment', () => { diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetAssigneePopup-test.tsx b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetAssigneePopup-test.tsx index 71861beb06b..a18dedc5feb 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetAssigneePopup-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetAssigneePopup-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { searchUsers } from '../../../../api/users'; import { mockLoggedInUser, mockUser } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { SetAssigneePopup } from '../SetAssigneePopup'; jest.mock('../../../../api/users', () => { diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetTransitionPopup-test.tsx b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetTransitionPopup-test.tsx index bcd199f2a18..517e398c1bc 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetTransitionPopup-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetTransitionPopup-test.tsx @@ -19,11 +19,11 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { hasMessage } from '../../../../sonar-ui-common/helpers/l10n'; +import { hasMessage } from '../../../../helpers/l10n'; import SetTransitionPopup, { Props } from '../SetTransitionPopup'; -jest.mock('../../../../sonar-ui-common/helpers/l10n', () => ({ - ...jest.requireActual('../../../../sonar-ui-common/helpers/l10n'), +jest.mock('../../../../helpers/l10n', () => ({ + ...jest.requireActual('../../../../helpers/l10n'), hasMessage: jest.fn().mockReturnValue(false) })); diff --git a/server/sonar-web/src/main/js/components/lazyLoadComponent.tsx b/server/sonar-web/src/main/js/components/lazyLoadComponent.tsx new file mode 100644 index 00000000000..d45577895dc --- /dev/null +++ b/server/sonar-web/src/main/js/components/lazyLoadComponent.tsx @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { Alert } from '../components/ui/Alert'; +import { IS_SSR } from '../helpers/init'; +import { translate } from '../helpers/l10n'; +import { requestTryAndRepeatUntil } from '../helpers/request'; + +export function lazyLoadComponent>( + factory: () => Promise<{ default: T }>, + displayName?: string +) { + const LazyComponent = React.lazy(() => + requestTryAndRepeatUntil(factory, { max: 2, slowThreshold: 2 }, () => true) + ); + + function LazyComponentWrapper(props: React.ComponentProps) { + if (IS_SSR) { + return null; + } + return ( + + + + + + ); + } + + LazyComponentWrapper.displayName = displayName; + return LazyComponentWrapper; +} + +interface ErrorBoundaryProps { + children: React.ReactNode; +} + +interface ErrorBoundaryState { + hasError: boolean; +} + +export class LazyErrorBoundary extends React.Component { + state: ErrorBoundaryState = { hasError: false }; + + static getDerivedStateFromError() { + // Update state so the next render will show the fallback UI. + return { hasError: true }; + } + + render() { + if (this.state.hasError) { + return {translate('default_error_message')}; + } + return this.props.children; + } +} diff --git a/server/sonar-web/src/main/js/components/measure/Measure.tsx b/server/sonar-web/src/main/js/components/measure/Measure.tsx index f1d0d8469e0..85afa5e6d7e 100644 --- a/server/sonar-web/src/main/js/components/measure/Measure.tsx +++ b/server/sonar-web/src/main/js/components/measure/Measure.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import Level from '../../sonar-ui-common/components/ui/Level'; -import Rating from '../../sonar-ui-common/components/ui/Rating'; -import { formatMeasure } from '../../sonar-ui-common/helpers/measures'; +import Tooltip from '../../components/controls/Tooltip'; +import Level from '../../components/ui/Level'; +import Rating from '../../components/ui/Rating'; +import { formatMeasure } from '../../helpers/measures'; import { getRatingTooltip } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx b/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx index 222222308c2..8ffb1046c3e 100644 --- a/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx +++ b/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import SeverityIcon from '../../sonar-ui-common/components/icons/SeverityIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import SeverityIcon from '../../components/icons/SeverityIcon'; +import { translate } from '../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx b/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx index bc9de1dd8a0..368ef64250e 100644 --- a/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx +++ b/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import StatusIcon from '../../sonar-ui-common/components/icons/StatusIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import StatusIcon from '../../components/icons/StatusIcon'; +import { translate } from '../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx b/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx index 18ac7cc516f..d3502aac741 100644 --- a/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx +++ b/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import IssueTypeIcon from '../../sonar-ui-common/components/icons/IssueTypeIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import IssueTypeIcon from '../../components/icons/IssueTypeIcon'; +import { translate } from '../../helpers/l10n'; interface Props { className?: string; diff --git a/server/sonar-web/src/main/js/components/tags/TagsList.tsx b/server/sonar-web/src/main/js/components/tags/TagsList.tsx index 00853bc998b..e6d80810f39 100644 --- a/server/sonar-web/src/main/js/components/tags/TagsList.tsx +++ b/server/sonar-web/src/main/js/components/tags/TagsList.tsx @@ -19,9 +19,9 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import DropdownIcon from '../../sonar-ui-common/components/icons/DropdownIcon'; -import TagsIcon from '../../sonar-ui-common/components/icons/TagsIcon'; -import { translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import DropdownIcon from '../../components/icons/DropdownIcon'; +import TagsIcon from '../../components/icons/TagsIcon'; +import { translateWithParameters } from '../../helpers/l10n'; import './TagsList.css'; interface Props { diff --git a/server/sonar-web/src/main/js/components/tags/TagsSelector.tsx b/server/sonar-web/src/main/js/components/tags/TagsSelector.tsx index ae83cabad8c..4834983abc2 100644 --- a/server/sonar-web/src/main/js/components/tags/TagsSelector.tsx +++ b/server/sonar-web/src/main/js/components/tags/TagsSelector.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../helpers/l10n'; import MultiSelect from '../common/MultiSelect'; import './TagsList.css'; diff --git a/server/sonar-web/src/main/js/components/theme.ts b/server/sonar-web/src/main/js/components/theme.ts new file mode 100644 index 00000000000..1dabe475f62 --- /dev/null +++ b/server/sonar-web/src/main/js/components/theme.ts @@ -0,0 +1,65 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { css, ThemeContext as EmotionThemeContext } from '@emotion/core'; +import emotionStyled, { CreateStyled } from '@emotion/styled'; +import { + ThemeProvider as EmotionThemeProvider, + ThemeProviderProps, + useTheme as emotionUseTheme, + withTheme +} from 'emotion-theming'; +import * as React from 'react'; + +export interface Theme { + colors: T.Dict; + sizes: T.Dict; + rawSizes: T.Dict; + fonts: T.Dict; + zIndexes: T.Dict; + others: T.Dict; +} + +export interface ThemedProps { + theme: Theme; +} + +const ThemeContext = EmotionThemeContext as React.Context; + +export const styled = emotionStyled as CreateStyled; +export const ThemeConsumer = ThemeContext.Consumer; +export const ThemeProvider = EmotionThemeProvider as React.ProviderExoticComponent< + ThemeProviderProps +>; +export const useTheme = emotionUseTheme as () => Theme; + +export function themeGet(type: keyof Theme, name: string | number) { + return function({ theme }: Partial) { + return theme?.[type][name]; + }; +} +export function themeColor(name: keyof Theme['colors']) { + return themeGet('colors', name); +} +export function themeSize(name: keyof Theme['sizes']) { + return themeGet('sizes', name); +} + +export { css, withTheme }; +export default ThemeContext; diff --git a/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx b/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx index 43588b85c38..2379c9f0e15 100644 --- a/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { WithRouterProps } from 'react-router'; import { getAlmSettingsNoCatch } from '../../api/alm-settings'; import { getValues } from '../../api/settings'; -import { getHostUrl } from '../../sonar-ui-common/helpers/urls'; +import { getHostUrl } from '../../helpers/urls'; import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings'; import { SettingsKey } from '../../types/settings'; import { withRouter } from '../hoc/withRouter'; diff --git a/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx b/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx index af7d93ee15d..39b7a6449ed 100644 --- a/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import EllipsisIcon from '../../sonar-ui-common/components/icons/EllipsisIcon'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../sonar-ui-common/helpers/urls'; +import EllipsisIcon from '../../components/icons/EllipsisIcon'; +import { translate } from '../../helpers/l10n'; +import { getBaseUrl } from '../../helpers/urls'; import { AlmKeys, AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings'; import AzurePipelinesTutorial from './azure-pipelines/AzurePipelinesTutorial'; import BitbucketPipelinesTutorial from './bitbucket-pipelines/BitbucketPipelinesTutorial'; diff --git a/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-test.tsx b/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-test.tsx index 6eab55cfecf..db0f2d3055e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-test.tsx @@ -31,13 +31,13 @@ import { mockLoggedInUser, mockRouter } from '../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../sonar-ui-common/helpers/testUtils'; -import { getHostUrl } from '../../../sonar-ui-common/helpers/urls'; +import { waitAndUpdate } from '../../../helpers/testUtils'; +import { getHostUrl } from '../../../helpers/urls'; import { SettingsKey } from '../../../types/settings'; import { TutorialSelection } from '../TutorialSelection'; import { TutorialModes } from '../types'; -jest.mock('../../../sonar-ui-common/helpers/urls', () => ({ +jest.mock('../../../helpers/urls', () => ({ getHostUrl: jest.fn().mockReturnValue('http://host.url') })); diff --git a/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelectionRenderer-test.tsx b/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelectionRenderer-test.tsx index a6c45ad79f7..35d284ecb0b 100644 --- a/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelectionRenderer-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelectionRenderer-test.tsx @@ -28,7 +28,7 @@ import { mockProjectGitLabBindingResponse } from '../../../helpers/mocks/alm-settings'; import { mockComponent, mockLoggedInUser } from '../../../helpers/testMocks'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../helpers/testUtils'; import TutorialSelectionRenderer, { TutorialSelectionRendererProps } from '../TutorialSelectionRenderer'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/AzurePipelinesTutorial.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/AzurePipelinesTutorial.tsx index e54a817f490..114bdf13839 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/AzurePipelinesTutorial.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/AzurePipelinesTutorial.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys } from '../../../types/alm-settings'; import AllSetStep from '../components/AllSetStep'; import FinishButton from '../components/FinishButton'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/BranchAnalysisStepContent.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/BranchAnalysisStepContent.tsx index 7bd83625b83..f621a8f2732 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/BranchAnalysisStepContent.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/BranchAnalysisStepContent.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getLanguages, Store } from '../../../store/rootReducer'; import RenderOptions from '../components/RenderOptions'; import { BuildTools } from '../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx index 457a3c85238..9a5ecb42dd8 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export default function ExtensionInstallationStepContent() { return ( diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx index 4f357e41299..5e14ff14c3e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; function renderSentenceWithFieldAndValue(props: { field: React.ReactNode; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ServiceEndpointStepContent.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ServiceEndpointStepContent.tsx index 330d2175399..18663b7871e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ServiceEndpointStepContent.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ServiceEndpointStepContent.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import EditTokenModal from '../components/EditTokenModal'; import SentenceWithHighlights from '../components/SentenceWithHighlights'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-test.tsx index 245a6279f4c..9109d04627e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { Button } from '../../../../components/controls/buttons'; import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import Step from '../../components/Step'; import AzurePipelinesTutorial, { AzurePipelinesTutorialProps } from '../AzurePipelinesTutorial'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ServiceEndpointStepContent-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ServiceEndpointStepContent-test.tsx index 05d0a5e3de6..513b9a5a0af 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ServiceEndpointStepContent-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ServiceEndpointStepContent-test.tsx @@ -19,9 +19,9 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { Button } from '../../../../components/controls/buttons'; import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks'; -import { Button } from '../../../../sonar-ui-common/components/controls/buttons'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import EditTokenModal from '../../components/EditTokenModal'; import ServiceEndpointStepContent from '../ServiceEndpointStepContent'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/AlertClassicEditor.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/AlertClassicEditor.tsx index 136242ab73b..f4585e2bd90 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/AlertClassicEditor.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/AlertClassicEditor.tsx @@ -21,9 +21,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../../components/ui/Alert'; import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmKeys } from '../../../../types/alm-settings'; export default function AlertClassicEditor() { diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/ClangGCC.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/ClangGCC.tsx index 1cdc13e7ed5..3fd4df99852 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/ClangGCC.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/ClangGCC.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; -import { getHostUrl } from '../../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../../helpers/l10n'; +import { getHostUrl } from '../../../../helpers/urls'; import CodeSnippet from '../../../common/CodeSnippet'; import { CompilationInfo } from '../../components/CompilationInfo'; import RenderOptions from '../../components/RenderOptions'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx index ac9b306252d..28b921103af 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; import { BuildTools } from '../../types'; import JavaToolInstallation from '../JavaToolInstallation'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx index 50f84fce710..2e866b853cf 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; -import { translate, translateWithParameters } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate, translateWithParameters } from '../../../../helpers/l10n'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; import { BuildTools } from '../../types'; import JavaToolInstallation from '../JavaToolInstallation'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx index b43b6ce906e..a9ba41378e1 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { ClipboardIconButton } from '../../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../../components/controls/clipboard'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; import { BuildTools } from '../../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PublishSteps.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PublishSteps.tsx index a4b99aaa31b..85a29d9ddd3 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PublishSteps.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PublishSteps.tsx @@ -21,9 +21,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; +import { Alert } from '../../../../components/ui/Alert'; import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { AlmKeys } from '../../../../types/alm-settings'; import { withAppState } from '../../../hoc/withAppState'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx index 7366acaa63e..08131943c92 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/PreambuleYaml.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/PreambuleYaml.tsx index bfc5e8499be..bf690adc31f 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/PreambuleYaml.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/PreambuleYaml.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import CodeSnippet from '../../common/CodeSnippet'; import DefaultProjectKey from '../components/DefaultProjectKey'; import { BuildTools } from '../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/RepositoryVariables.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/RepositoryVariables.tsx index c3227e8a063..840b3a258ef 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/RepositoryVariables.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/RepositoryVariables.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../../types/alm-settings'; import SentenceWithHighlights from '../components/SentenceWithHighlights'; import TokenStepGenerator from '../components/TokenStepGenerator'; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/AllSet.tsx b/server/sonar-web/src/main/js/components/tutorials/components/AllSet.tsx index 5e71426c94d..806d1e4215c 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/AllSet.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/AllSet.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../helpers/l10n'; +import { getBaseUrl } from '../../../helpers/urls'; import { AlmKeys } from '../../../types/alm-settings'; import { withAppState } from '../../hoc/withAppState'; import SentenceWithHighlights from './SentenceWithHighlights'; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx b/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx index 5f823cc2075..75dd5d1c11d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys } from '../../../types/alm-settings'; import AllSet from './AllSet'; import Step from './Step'; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx b/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx index 51cbcf43cbd..336c5013549 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; export interface CompilationInfoProps { className?: string; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx b/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx index a08f0ab767d..cbd74abdc32 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import CodeSnippet from '../../common/CodeSnippet'; export interface CreateYmlFileProps { diff --git a/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx b/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx index fff4339ec1b..0812e977c29 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx @@ -21,12 +21,12 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { generateToken, getTokens, revokeToken } from '../../../api/user-tokens'; -import { Button, DeleteButton } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import SimpleModal from '../../../sonar-ui-common/components/controls/SimpleModal'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import DeferredSpinner from '../../../sonar-ui-common/components/ui/DeferredSpinner'; -import { translate, translateWithParameters } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, DeleteButton } from '../../../components/controls/buttons'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import SimpleModal from '../../../components/controls/SimpleModal'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getUniqueTokenName } from '../utils'; interface State { diff --git a/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx b/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx index 317c5b35fc0..21b53377277 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { rawSizes } from '../../../app/theme'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ChevronRightIcon from '../../../sonar-ui-common/components/icons/ChevronRightIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import ChevronRightIcon from '../../../components/icons/ChevronRightIcon'; +import { translate } from '../../../helpers/l10n'; export interface FinishButtonProps { onClick: () => void; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/LabelActionPair.tsx b/server/sonar-web/src/main/js/components/tutorials/components/LabelActionPair.tsx index 962c4ec10e3..b50d3edb962 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/LabelActionPair.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/LabelActionPair.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface LabelActionPairProps { translationKey: string; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/LabelValuePair.tsx b/server/sonar-web/src/main/js/components/tutorials/components/LabelValuePair.tsx index 9ee3babea90..62604c06c00 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/LabelValuePair.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/LabelValuePair.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; export interface LabelValuePairProps { translationKey: string; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/RenderOptions.tsx b/server/sonar-web/src/main/js/components/tutorials/components/RenderOptions.tsx index ae796aa23ce..8b29e737d4a 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/RenderOptions.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/RenderOptions.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioToggle from '../../../sonar-ui-common/components/controls/RadioToggle'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import RadioToggle from '../../../components/controls/RadioToggle'; +import { translate } from '../../../helpers/l10n'; export interface RenderOptionsProps { checked: string | undefined; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithFilename.tsx b/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithFilename.tsx index d8d392d1a9a..3a59b610e03 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithFilename.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithFilename.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface SentenceWithFilenameProps { filename: string; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithHighlights.tsx b/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithHighlights.tsx index de7b5b23a0f..46281bed618 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithHighlights.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/SentenceWithHighlights.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface SentenceWithHighlightsProps { highlightKeys: string[]; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/TokenStepGenerator.tsx b/server/sonar-web/src/main/js/components/tutorials/components/TokenStepGenerator.tsx index cbafc901032..822850e309e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/TokenStepGenerator.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/TokenStepGenerator.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import EditTokenModal from './EditTokenModal'; export interface TokenStepGeneratorProps { diff --git a/server/sonar-web/src/main/js/components/tutorials/components/YamlFileStep.tsx b/server/sonar-web/src/main/js/components/tutorials/components/YamlFileStep.tsx index 21d108c479d..e8bbc19a1b5 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/YamlFileStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/YamlFileStep.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { withCLanguageFeature } from '../../hoc/withCLanguageFeature'; import RenderOptions from '../components/RenderOptions'; import { BuildTools } from '../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/EditTokenModal-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/EditTokenModal-test.tsx index 062c1cef18f..685792f114b 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/EditTokenModal-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/EditTokenModal-test.tsx @@ -21,7 +21,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { generateToken, getTokens, revokeToken } from '../../../../api/user-tokens'; import { mockComponent, mockEvent, mockLoggedInUser } from '../../../../helpers/testMocks'; -import { waitAndUpdate } from '../../../../sonar-ui-common/helpers/testUtils'; +import { waitAndUpdate } from '../../../../helpers/testUtils'; import { getUniqueTokenName } from '../../utils'; import EditTokenModal from '../EditTokenModal'; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/Step-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/Step-test.tsx index 4672e3b653e..2fd72841f4e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/Step-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/Step-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { click } from '../../../../sonar-ui-common/helpers/testUtils'; +import { click } from '../../../../helpers/testUtils'; import Step from '../Step'; it('renders', () => { diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/GitHubActionTutorial.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/GitHubActionTutorial.tsx index c990ecce3d3..51a728699dc 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/GitHubActionTutorial.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/GitHubActionTutorial.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx index 6253a56bdf6..a3e2c0146ec 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../../types/alm-settings'; import SentenceWithHighlights from '../components/SentenceWithHighlights'; import TokenStepGenerator from '../components/TokenStepGenerator'; diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx index 0a223beaf08..a75146f9f2b 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { CompilationInfo } from '../../components/CompilationInfo'; import CreateYmlFile from '../../components/CreateYmlFile'; import DefaultProjectKey from '../../components/DefaultProjectKey'; diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx index 8f7ba36e3ce..a40b93b6156 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { ClipboardIconButton } from '../../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../../components/controls/clipboard'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import CreateYmlFile from '../../components/CreateYmlFile'; import FinishButton from '../../components/FinishButton'; diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx index 73618bc6b5b..bec436b363f 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { ClipboardIconButton } from '../../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../../components/controls/clipboard'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import CreateYmlFile from '../../components/CreateYmlFile'; import FinishButton from '../../components/FinishButton'; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/EnvironmentVariablesStep.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/EnvironmentVariablesStep.tsx index 4c770fed88a..a0ccf13f7b1 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/EnvironmentVariablesStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/EnvironmentVariablesStep.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import Step from '../components/Step'; import TokenStepGenerator from '../components/TokenStepGenerator'; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/GitLabCITutorial.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/GitLabCITutorial.tsx index c302598a3a7..83103e54ada 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/GitLabCITutorial.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/GitLabCITutorial.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys } from '../../../types/alm-settings'; import AllSetStep from '../components/AllSetStep'; import { BuildTools } from '../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx index f1f095cc228..1860bac7170 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import CodeSnippet from '../../common/CodeSnippet'; import { withCLanguageFeature } from '../../hoc/withCLanguageFeature'; import RenderOptions from '../components/RenderOptions'; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx index 6620ccdaada..0c0e01cc62f 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { ClipboardIconButton } from '../../../sonar-ui-common/components/controls/clipboard'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; import { withAppState } from '../../hoc/withAppState'; import FinishButton from '../components/FinishButton'; import Step from '../components/Step'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsTutorial.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsTutorial.tsx index 43393164c70..e7e5de36c31 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsTutorial.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsTutorial.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { connect } from 'react-redux'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { getAppState, getCurrentUserSetting, Store } from '../../../store/rootReducer'; import { setCurrentUserSetting } from '../../../store/users'; import { diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsfileStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsfileStep.tsx index 057511e09e5..e47e66b1677 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsfileStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsfileStep.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { withCLanguageFeature } from '../../hoc/withCLanguageFeature'; import RenderOptions from '../components/RenderOptions'; import Step from '../components/Step'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/MultiBranchPipelineStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/MultiBranchPipelineStep.tsx index 475df4e7d67..01c46ed270e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/MultiBranchPipelineStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/MultiBranchPipelineStep.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { rawSizes } from '../../../app/theme'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ChevronRightIcon from '../../../sonar-ui-common/components/icons/ChevronRightIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import ChevronRightIcon from '../../../components/icons/ChevronRightIcon'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/PipelineStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/PipelineStep.tsx index a75017cf628..e12de3fb7ce 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/PipelineStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/PipelineStep.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { rawSizes } from '../../../app/theme'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import ChevronRightIcon from '../../../sonar-ui-common/components/icons/ChevronRightIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import ChevronRightIcon from '../../../components/icons/ChevronRightIcon'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys } from '../../../types/alm-settings'; import LabelActionPair from '../components/LabelActionPair'; import SentenceWithHighlights from '../components/SentenceWithHighlights'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/PreRequisitesStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/PreRequisitesStep.tsx index ec20d0ddc73..a4be8717597 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/PreRequisitesStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/PreRequisitesStep.tsx @@ -21,11 +21,11 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { rawSizes } from '../../../app/theme'; -import { Button } from '../../../sonar-ui-common/components/controls/buttons'; -import Checkbox from '../../../sonar-ui-common/components/controls/Checkbox'; -import ChevronRightIcon from '../../../sonar-ui-common/components/icons/ChevronRightIcon'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import Checkbox from '../../../components/controls/Checkbox'; +import ChevronRightIcon from '../../../components/icons/ChevronRightIcon'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys } from '../../../types/alm-settings'; import SentenceWithHighlights from '../components/SentenceWithHighlights'; import Step from '../components/Step'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/SelectAlmStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/SelectAlmStep.tsx index f2bc56e759a..8ff002b05ac 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/SelectAlmStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/SelectAlmStep.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioToggle from '../../../sonar-ui-common/components/controls/RadioToggle'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import { hasMessage, translate } from '../../../sonar-ui-common/helpers/l10n'; +import RadioToggle from '../../../components/controls/RadioToggle'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import { hasMessage, translate } from '../../../helpers/l10n'; import { AlmKeys } from '../../../types/alm-settings'; import Step from '../components/Step'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.tsx index 11dbe47aa07..281f72a3b60 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.tsx @@ -20,9 +20,9 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { rawSizes } from '../../../app/theme'; -import { Button, ButtonLink } from '../../../sonar-ui-common/components/controls/buttons'; -import ChevronRightIcon from '../../../sonar-ui-common/components/icons/ChevronRightIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, ButtonLink } from '../../../components/controls/buttons'; +import ChevronRightIcon from '../../../components/icons/ChevronRightIcon'; +import { translate } from '../../../helpers/l10n'; import { AlmKeys, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepBitbucket.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepBitbucket.tsx index 05fd27ef083..93631109f6c 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepBitbucket.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepBitbucket.tsx @@ -19,9 +19,9 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { Alert } from '../../../components/ui/Alert'; +import { translate } from '../../../helpers/l10n'; import { stripTrailingSlash } from '../../../helpers/urls'; -import { Alert } from '../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; import { AlmKeys, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGitLab.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGitLab.tsx index c94a66d0288..33a144d712d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGitLab.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGitLab.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import CodeSnippet from '../../common/CodeSnippet'; import LabelActionPair from '../components/LabelActionPair'; import SentenceWithHighlights from '../components/SentenceWithHighlights'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGithub.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGithub.tsx index 9c446ea7185..d1c43de7e31 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGithub.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStepGithub.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../../types/alm-settings'; import CodeSnippet from '../../common/CodeSnippet'; import LabelActionPair from '../components/LabelActionPair'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/SelectAlmStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/SelectAlmStep-test.tsx index 4096d4a347a..cc92d883ed4 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/SelectAlmStep-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/SelectAlmStep-test.tsx @@ -24,7 +24,7 @@ import { AlmKeys } from '../../../../types/alm-settings'; import Step from '../../components/Step'; import SelectAlmStep, { SelectAlmStepProps } from '../SelectAlmStep'; -jest.mock('../../../../sonar-ui-common/helpers/l10n', () => ({ +jest.mock('../../../../helpers/l10n', () => ({ hasMessage: (_a: string, k: string, _b: string) => k === AlmKeys.BitbucketCloud, translate: (...k: string[]) => k.join('.') })); diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx index 03376585600..ad394741e29 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { CompilationInfo } from '../../components/CompilationInfo'; import DefaultProjectKey from '../../components/DefaultProjectKey'; import FinishButton from '../../components/FinishButton'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx index 3a4beda931e..1a0bdfe0aba 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import HelpTooltip from '../../../../sonar-ui-common/components/controls/HelpTooltip'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; +import HelpTooltip from '../../../../components/controls/HelpTooltip'; +import { Alert } from '../../../../components/ui/Alert'; import CodeSnippet from '../../../common/CodeSnippet'; import SentenceWithFilename from '../../components/SentenceWithFilename'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNet.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNet.tsx index fe6c15d88cf..de4e4b75140 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNet.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNet.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import FinishButton from '../../components/FinishButton'; import RenderOptions from '../../components/RenderOptions'; import { OSs } from '../../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsMSBuild.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsMSBuild.tsx index 3db98dc4ed2..5c83523c60a 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsMSBuild.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsMSBuild.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClipboardIconButton } from '../../../../sonar-ui-common/components/controls/clipboard'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../../components/controls/clipboard'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; export default function DotNetPrereqsMSBuild() { diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsScanner.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsScanner.tsx index 708e4518ddc..8485de77617 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsScanner.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNetPrereqsScanner.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClipboardIconButton } from '../../../../sonar-ui-common/components/controls/clipboard'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { ClipboardIconButton } from '../../../../components/controls/clipboard'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; export default function DotNetPrereqsScanner() { diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/BuildToolForm.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/BuildToolForm.tsx index aad059d1c9b..296d481d2c2 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/BuildToolForm.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/BuildToolForm.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import RadioToggle from '../../../sonar-ui-common/components/controls/RadioToggle'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import RadioToggle from '../../../components/controls/RadioToggle'; +import { translate } from '../../../helpers/l10n'; import { withCLanguageFeature } from '../../hoc/withCLanguageFeature'; import RenderOptions from '../components/RenderOptions'; import { BuildTools, ManualTutorialConfig, OSs } from '../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/DoneNextSteps.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/DoneNextSteps.tsx index d7cf0a1ec1b..5043267237f 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/DoneNextSteps.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/DoneNextSteps.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; export interface DoneNextStepsProps { component: T.Component; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/ManualTutorial.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/ManualTutorial.tsx index 4dfcedaef7a..2b262228165 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/ManualTutorial.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/ManualTutorial.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import InstanceMessage from '../../common/InstanceMessage'; import ProjectAnalysisStep from './ProjectAnalysisStep'; import TokenStep from './TokenStep'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/ProjectAnalysisStep.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/ProjectAnalysisStep.tsx index 10d35f2fd04..d5e9334567f 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/ProjectAnalysisStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/ProjectAnalysisStep.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import Step from '../components/Step'; import { ManualTutorialConfig } from '../types'; import BuildToolForm from './BuildToolForm'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/TokenStep.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/TokenStep.tsx index 02b53819950..0be6726f953 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/TokenStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/TokenStep.tsx @@ -21,15 +21,11 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { generateToken, getTokens, revokeToken } from '../../../api/user-tokens'; -import { - Button, - DeleteButton, - SubmitButton -} from '../../../sonar-ui-common/components/controls/buttons'; -import Radio from '../../../sonar-ui-common/components/controls/Radio'; -import AlertErrorIcon from '../../../sonar-ui-common/components/icons/AlertErrorIcon'; -import AlertSuccessIcon from '../../../sonar-ui-common/components/icons/AlertSuccessIcon'; -import { translate } from '../../../sonar-ui-common/helpers/l10n'; +import { Button, DeleteButton, SubmitButton } from '../../../components/controls/buttons'; +import Radio from '../../../components/controls/Radio'; +import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon'; +import { translate } from '../../../helpers/l10n'; +import AlertErrorIcon from '../../icons/AlertErrorIcon'; import Step from '../components/Step'; import { getUniqueTokenName } from '../utils'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/__tests__/TokenStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/__tests__/TokenStep-test.tsx index f12c9486df2..c7106339c46 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/__tests__/TokenStep-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/__tests__/TokenStep-test.tsx @@ -19,12 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { - change, - click, - submit, - waitAndUpdate -} from '../../../../sonar-ui-common/helpers/testUtils'; +import { change, click, submit, waitAndUpdate } from '../../../../helpers/testUtils'; import TokenStep from '../TokenStep'; jest.mock('../../../../api/user-tokens', () => ({ diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/AnalysisCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/AnalysisCommand.tsx index 120757ccf6e..5bdbc8dd825 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/AnalysisCommand.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/AnalysisCommand.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { getHostUrl } from '../../../../sonar-ui-common/helpers/urls'; +import { getHostUrl } from '../../../../helpers/urls'; import { BuildTools, ManualTutorialConfig } from '../../types'; import ClangGCCCustom from './ClangGCCCommand'; import DotNet from './DotNet'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetCore.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetCore.tsx index ba3b40b0650..5db3dbdb4d5 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetCore.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetCore.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; -import { Alert } from '../../../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { Alert } from '../../../../components/ui/Alert'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import { DotNetProps } from './DotNet'; import DotNetExecute from './DotNetExecute'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetExecute.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetExecute.tsx index 9d3daf27387..5a4bc942d95 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetExecute.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetExecute.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import InstanceMessage from '../../../common/InstanceMessage'; import DoneNextSteps from '../DoneNextSteps'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx index 2f22d88b1ad..864ad342930 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { DotNetProps } from './DotNet'; import DotNetExecute from './DotNetExecute'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadBuildWrapper.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadBuildWrapper.tsx index d7c90aa69d2..7f53c2048fe 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadBuildWrapper.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadBuildWrapper.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from '../../../../sonar-ui-common/helpers/urls'; +import { translate } from '../../../../helpers/l10n'; +import { getBaseUrl } from '../../../../helpers/urls'; import { OSs } from '../../types'; export interface DownloadBuildWrapperProps { diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx index f30d9f50657..b322b9135b4 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import { OSs } from '../../types'; interface Props { diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecBuildWrapper.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecBuildWrapper.tsx index 57b60f8aaa2..49f750eb697 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecBuildWrapper.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecBuildWrapper.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import { OSs } from '../../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecScanner.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecScanner.tsx index ae71a14ddaa..cd2632eb7a6 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecScanner.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecScanner.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import InstanceMessage from '../../../common/InstanceMessage'; import { OSs } from '../../types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaGradle.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaGradle.tsx index 2a39fd02072..13572d1258d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaGradle.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaGradle.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import InstanceMessage from '../../../common/InstanceMessage'; import DoneNextSteps from '../DoneNextSteps'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaMaven.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaMaven.tsx index b934fa55c32..cd9e6a5b5c3 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaMaven.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaMaven.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; -import { translate } from '../../../../sonar-ui-common/helpers/l10n'; +import { translate } from '../../../../helpers/l10n'; import CodeSnippet from '../../../common/CodeSnippet'; import InstanceMessage from '../../../common/InstanceMessage'; import DoneNextSteps from '../DoneNextSteps'; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/AnalysisCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/AnalysisCommand-test.tsx index ccd19e18c92..55b3f92b160 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/AnalysisCommand-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/AnalysisCommand-test.tsx @@ -23,7 +23,7 @@ import { mockComponent } from '../../../../../helpers/testMocks'; import { BuildTools, OSs } from '../../../types'; import AnalysisCommand, { AnalysisCommandProps } from '../AnalysisCommand'; -jest.mock('../../../../../sonar-ui-common/helpers/urls', () => ({ +jest.mock('../../../../../helpers/urls', () => ({ getHostUrl: () => 'HOST' })); diff --git a/server/sonar-web/src/main/js/components/ui/Alert.tsx b/server/sonar-web/src/main/js/components/ui/Alert.tsx new file mode 100644 index 00000000000..abd339da10d --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/Alert.tsx @@ -0,0 +1,159 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import AlertErrorIcon from '../icons/AlertErrorIcon'; +import AlertSuccessIcon from '../icons/AlertSuccessIcon'; +import AlertWarnIcon from '../icons/AlertWarnIcon'; +import InfoIcon from '../icons/InfoIcon'; +import { css, styled, Theme, themeColor, ThemedProps, themeSize, useTheme } from '../theme'; +import DeferredSpinner from './DeferredSpinner'; + +type AlertDisplay = 'banner' | 'inline' | 'block'; +type AlertVariant = 'error' | 'warning' | 'success' | 'info' | 'loading'; + +export interface AlertProps { + display?: AlertDisplay; + variant: AlertVariant; +} + +interface AlertVariantInformation { + icon: JSX.Element; + color: string; + borderColor: string; + backGroundColor: string; +} + +const StyledAlertIcon = styled.div<{ isBanner: boolean; variantInfo: AlertVariantInformation }>` + flex: 0 0 auto; + display: flex; + justify-content: center; + align-items: center; + width: calc(${({ isBanner }) => (isBanner ? 2 : 4)} * ${themeSize('gridSize')}); + border-right: ${({ isBanner }) => (!isBanner ? '1px solid' : 'none')}; + border-color: ${({ variantInfo }) => variantInfo.borderColor}; +`; + +const StyledAlertContent = styled.div` + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: ${themeSize('gridSize')} calc(2 * ${themeSize('gridSize')}); +`; + +const alertInnerIsBannerMixin = ({ theme }: ThemedProps) => css` + min-width: ${theme.sizes.minPageWidth}; + max-width: ${theme.sizes.maxPageWidth}; + margin-left: auto; + margin-right: auto; + padding-left: ${theme.sizes.pagePadding}; + padding-right: ${theme.sizes.pagePadding}; + box-sizing: border-box; +`; + +const StyledAlertInner = styled.div<{ isBanner: boolean }>` + display: flex; + align-items: stretch; + ${({ isBanner }) => (isBanner ? alertInnerIsBannerMixin : null)} +`; + +const StyledAlert = styled.div<{ isInline: boolean; variantInfo: AlertVariantInformation }>` + border: 1px solid; + border-radius: 2px; + margin-bottom: ${themeSize('gridSize')}; + border-color: ${({ variantInfo }) => variantInfo.borderColor}; + background-color: ${({ variantInfo }) => variantInfo.backGroundColor}; + color: ${({ variantInfo }) => variantInfo.color}; + display: ${({ isInline }) => (isInline ? 'inline-block' : 'block')}; + + :empty { + display: none; + } + + a, + .button-link { + border-color: ${themeColor('darkBlue')}; + } +`; + +function getAlertVariantInfo({ colors }: Theme, variant: AlertVariant): AlertVariantInformation { + const variantList: T.Dict = { + error: { + icon: , + color: colors.alertTextError, + borderColor: colors.alertBorderError, + backGroundColor: colors.alertBackgroundError + }, + warning: { + icon: , + color: colors.alertTextWarning, + borderColor: colors.alertBorderWarning, + backGroundColor: colors.alertBackgroundWarning + }, + success: { + icon: , + color: colors.alertTextSuccess, + borderColor: colors.alertBorderSuccess, + backGroundColor: colors.alertBackgroundSuccess + }, + info: { + icon: , + color: colors.alertTextInfo, + borderColor: colors.alertBorderInfo, + backGroundColor: colors.alertBackgroundInfo + }, + loading: { + icon: , + color: colors.alertTextInfo, + borderColor: colors.alertBorderInfo, + backGroundColor: colors.alertBackgroundInfo + } + }; + + return variantList[variant]; +} + +export function Alert(props: AlertProps & React.HTMLAttributes) { + const theme = useTheme(); + const { className, display, variant, ...domProps } = props; + const isInline = display === 'inline'; + const isBanner = display === 'banner'; + const variantInfo = getAlertVariantInfo(theme, variant); + + return ( + + + + {variantInfo.icon} + + {props.children} + + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx b/server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx new file mode 100644 index 00000000000..f1ceb43ddea --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx @@ -0,0 +1,88 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import classNames from 'classnames'; +import * as React from 'react'; + +type EllipsisPredicate = ( + node: HTMLElement, + props: Omit +) => boolean; + +interface AutoEllipsisProps { + customShouldEllipsis?: EllipsisPredicate; + maxHeight?: number; + maxWidth?: number; + useParent?: boolean; +} + +interface Props extends AutoEllipsisProps { + children: React.ReactElement; +} + +/* + * This component allows to automatically add the .text-ellipsis class on it's children if this one + * might overflow the max width/height passed as props. + * If one of maxHeight or maxWidth is not specified, they will be ignored in the conditions to add the ellipsis class. + * If useParent is true, then the parent size will be used instead of the undefined maxHeight/maxWidth + */ +export default function AutoEllipsis(props: Props) { + const { children, ...autoEllipsisProps } = props; + const [autoEllispis, ref] = useAutoEllipsis(autoEllipsisProps); + + return React.cloneElement(children, { + className: classNames(children.props.className, { 'text-ellipsis': autoEllispis }), + ref + }); +} + +export function useAutoEllipsis(props: AutoEllipsisProps): [boolean, (node: HTMLElement) => void] { + const [autoEllipsis, setAutoEllipsis] = React.useState(false); + + // useCallback instead of useRef to be able to compute if the flag is needed as soon as the ref is attached + // useRef doesn't accept a callback to notify us that the current ref value was attached, + // see https://reactjs.org/docs/hooks-faq.html#how-can-i-measure-a-dom-node for more info on this. + const ref = React.useCallback( + (node: HTMLElement) => { + if (!autoEllipsis && node) { + const shouldEllipsis = props.customShouldEllipsis ?? defaultShouldEllipsis; + setAutoEllipsis(shouldEllipsis(node, props)); + } + }, + // We don't want to apply this effect when ellipsis state change, only this effect can change it + // eslint-disable-next-line react-hooks/exhaustive-deps + [props.customShouldEllipsis, props.maxHeight, props.maxWidth, props.useParent] + ); + + return [autoEllipsis, ref]; +} + +export const defaultShouldEllipsis: EllipsisPredicate = ( + node, + { useParent = true, maxWidth, maxHeight } +) => { + if (node.parentElement && useParent) { + maxWidth = maxWidth ?? node.parentElement.clientWidth; + maxHeight = maxHeight ?? node.parentElement.clientHeight; + } + return ( + (maxWidth !== undefined && node.clientWidth > maxWidth) || + (maxHeight !== undefined && node.clientHeight > maxHeight) + ); +}; diff --git a/server/sonar-web/src/main/js/components/ui/Avatar.tsx b/server/sonar-web/src/main/js/components/ui/Avatar.tsx index 3f7548db439..274b99892c1 100644 --- a/server/sonar-web/src/main/js/components/ui/Avatar.tsx +++ b/server/sonar-web/src/main/js/components/ui/Avatar.tsx @@ -20,7 +20,7 @@ import * as classNames from 'classnames'; import * as React from 'react'; import { connect } from 'react-redux'; -import GenericAvatar from '../../sonar-ui-common/components/ui/GenericAvatar'; +import GenericAvatar from '../../components/ui/GenericAvatar'; import { getGlobalSettingValue, Store } from '../../store/rootReducer'; interface Props { diff --git a/server/sonar-web/src/main/js/components/ui/ContextNavBar.css b/server/sonar-web/src/main/js/components/ui/ContextNavBar.css new file mode 100644 index 00000000000..2c3865a835d --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/ContextNavBar.css @@ -0,0 +1,99 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.navbar-context, +.navbar-context .navbar-inner { + background-color: #fff; + z-index: var(--contextbarZIndex); +} + +.navbar-context .navbar-inner { + padding-top: var(--gridSize); + border-bottom: 1px solid var(--barBorderColor); +} + +.navbar-context .navbar-inner-with-notif { + border-bottom: none; +} + +.navbar-context-justified { + display: flex; + justify-content: space-between; +} + +/* use `min-width: 0` to cut breadcrumb links (to end with "...") */ +/* https://stackoverflow.com/questions/38223879/white-space-nowrap-breaks-flexbox-layout */ +.navbar-context-header { + display: flex; + align-items: center; + min-width: 0; + height: calc(4 * var(--gridSize)); + font-size: var(--bigFontSize); +} + +/* disallow icons and slash separators to shrink */ +.navbar-context-header > *:not(.navbar-context-header-breadcrumb-link) { + flex-shrink: 0; +} + +.navbar-context-header-breadcrumb-link { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.navbar-context-header .slash-separator { + margin-left: var(--gridSize); + margin-right: var(--gridSize); + font-size: 24px; +} + +.navbar-context-header .slash-separator::after { + color: rgba(68, 68, 68, 0.2); +} + +/* set `min-width: 0` to allow flexbox item to shrink */ +/* https://stackoverflow.com/questions/38223879/white-space-nowrap-breaks-flexbox-layout */ +.navbar-context-meta { + display: flex; + align-items: center; + height: calc(4 * var(--gridSize)); + padding-left: 20px; + color: var(--secondFontColor); + font-size: var(--smallFontSize); + text-align: right; +} + +.navbar-context-meta-secondary { + position: absolute; + top: 34px; + right: 0; + padding: 0 20px; + white-space: nowrap; +} + +.navbar-context-description { + display: inline-block; + line-height: var(--controlHeight); + margin-left: var(--gridSize); + padding-top: 4px; + color: var(--secondFontColor); + font-size: var(--smallFontSize); +} diff --git a/server/sonar-web/src/main/js/components/ui/ContextNavBar.tsx b/server/sonar-web/src/main/js/components/ui/ContextNavBar.tsx new file mode 100644 index 00000000000..07a75d15ae5 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/ContextNavBar.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import './ContextNavBar.css'; +import NavBar from './NavBar'; + +interface Props { + className?: string; + height: number; + [attr: string]: any; +} + +export default function ContextNavBar({ className, ...other }: Props) { + return ; +} diff --git a/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx b/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx index a73ae9b4bd1..7d9c798060e 100644 --- a/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx +++ b/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx @@ -19,10 +19,10 @@ */ import * as React from 'react'; import { colors } from '../../app/theme'; -import { lazyLoadComponent } from '../../sonar-ui-common/components/lazyLoadComponent'; +import { lazyLoadComponent } from '../lazyLoadComponent'; const DonutChart = lazyLoadComponent( - () => import('../../sonar-ui-common/components/charts/DonutChart'), + () => import('../../components/charts/DonutChart'), 'DonutChart' ); diff --git a/server/sonar-web/src/main/js/components/ui/DeferredSpinner.css b/server/sonar-web/src/main/js/components/ui/DeferredSpinner.css new file mode 100644 index 00000000000..22569c0c6b6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/DeferredSpinner.css @@ -0,0 +1,78 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.deferred-spinner { + position: relative; + vertical-align: middle; + width: 16px; + height: 16px; + border: 2px solid var(--blue); + border-radius: 50%; + animation: spin 0.75s infinite linear; +} + +.deferred-spinner:before, +.deferred-spinner:after { + left: -2px; + top: -2px; + display: none; + position: absolute; + content: ''; + width: inherit; + height: inherit; + border: inherit; + border-radius: inherit; +} + +.deferred-spinner, +.deferred-spinner:before, +.deferred-spinner:after { + display: inline-block; + box-sizing: border-box; + border-color: transparent; + border-top-color: var(--blue); + animation-duration: 1.2s; +} + +.deferred-spinner:before { + transform: rotate(120deg); +} + +.deferred-spinner:after { + transform: rotate(240deg); +} + +.deferred-spinner-placeholder { + position: relative; + display: inline-block; + vertical-align: middle; + width: 16px; + height: 16px; + visibility: hidden; +} + +@keyframes spin { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); + } +} diff --git a/server/sonar-web/src/main/js/components/ui/DeferredSpinner.tsx b/server/sonar-web/src/main/js/components/ui/DeferredSpinner.tsx new file mode 100644 index 00000000000..7021917c0bc --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/DeferredSpinner.tsx @@ -0,0 +1,91 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import './DeferredSpinner.css'; + +interface Props { + children?: React.ReactNode; + className?: string; + customSpinner?: JSX.Element; + loading?: boolean; + placeholder?: boolean; + timeout?: number; +} + +interface State { + showSpinner: boolean; +} + +const DEFAULT_TIMEOUT = 100; + +export default class DeferredSpinner extends React.PureComponent { + timer?: number; + + state: State = { showSpinner: false }; + + componentDidMount() { + if (this.props.loading == null || this.props.loading === true) { + this.startTimer(); + } + } + + componentDidUpdate(prevProps: Props) { + if (prevProps.loading === false && this.props.loading === true) { + this.stopTimer(); + this.startTimer(); + } + if (prevProps.loading === true && this.props.loading === false) { + this.stopTimer(); + this.setState({ showSpinner: false }); + } + } + + componentWillUnmount() { + this.stopTimer(); + } + + startTimer = () => { + this.timer = window.setTimeout( + () => this.setState({ showSpinner: true }), + this.props.timeout || DEFAULT_TIMEOUT + ); + }; + + stopTimer = () => { + window.clearTimeout(this.timer); + }; + + render() { + if (this.state.showSpinner) { + return ( + this.props.customSpinner || ( + + ) + ); + } + return ( + this.props.children || + (this.props.placeholder ? ( + + ) : null) + ); + } +} diff --git a/server/sonar-web/src/main/js/components/ui/DismissableAlert.tsx b/server/sonar-web/src/main/js/components/ui/DismissableAlert.tsx index 8e2ac8ca4da..2f99e376f51 100644 --- a/server/sonar-web/src/main/js/components/ui/DismissableAlert.tsx +++ b/server/sonar-web/src/main/js/components/ui/DismissableAlert.tsx @@ -19,11 +19,11 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import { ButtonIcon } from '../../sonar-ui-common/components/controls/buttons'; -import ClearIcon from '../../sonar-ui-common/components/icons/ClearIcon'; -import { Alert, AlertProps } from '../../sonar-ui-common/components/ui/Alert'; -import { translate } from '../../sonar-ui-common/helpers/l10n'; -import { get, save } from '../../sonar-ui-common/helpers/storage'; +import { ButtonIcon } from '../../components/controls/buttons'; +import ClearIcon from '../../components/icons/ClearIcon'; +import { Alert, AlertProps } from '../../components/ui/Alert'; +import { translate } from '../../helpers/l10n'; +import { get, save } from '../../helpers/storage'; import './DismissableAlert.css'; export interface DismissableAlertProps extends AlertProps { diff --git a/server/sonar-web/src/main/js/components/ui/DuplicationsRating.css b/server/sonar-web/src/main/js/components/ui/DuplicationsRating.css new file mode 100644 index 00000000000..82f4024bca3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/DuplicationsRating.css @@ -0,0 +1,171 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.duplications-rating { + position: relative; + display: inline-flex; + vertical-align: top; + justify-content: center; + align-items: center; + width: var(--controlHeight); + height: var(--controlHeight); + border: 3px solid var(--orange); + border-radius: var(--controlHeight); + box-sizing: border-box; +} + +.duplications-rating-small { + width: 16px; + height: 16px; + border-width: 2px; +} + +.duplications-rating-big { + width: 40px; + height: 40px; + border-width: 3px; +} + +.duplications-rating-huge { + width: 60px; + height: 60px; + border-width: 4px; + border-radius: 30px; +} + +.duplications-rating-muted { + border-color: #bdbdbd !important; +} + +.duplications-rating-muted:after { + background-color: #bdbdbd !important; +} + +.duplications-rating:after { + border-radius: var(--controlHeight); + content: ''; +} + +.duplications-rating-A { + border-color: var(--green); +} + +.duplications-rating-A:after { + display: none; +} + +.duplications-rating-B { + border-color: var(--lightGreen); +} + +.duplications-rating-B:after { + width: 6px; + height: 6px; + background-color: var(--lightGreen); +} + +.duplications-rating-small.duplications-rating-B:after { + width: 2px; + height: 2px; +} + +.duplications-rating-big.duplications-rating-B:after { + width: var(--smallFontSize); + height: var(--smallFontSize); +} + +.duplications-rating-huge.duplications-rating-B:after { + width: 18px; + height: 18px; +} + +.duplications-rating-C { + border-color: var(--yellow); +} + +.duplications-rating-C:after { + width: 8px; + height: 8px; + background-color: var(--yellow); +} + +.duplications-rating-small.duplications-rating-C:after { + width: 6px; + height: 6px; +} + +.duplications-rating-big.duplications-rating-C:after { + width: 16px; + height: 16px; +} + +.duplications-rating-huge.duplications-rating-C:after { + width: var(--controlHeight); + height: var(--controlHeight); +} + +.duplications-rating-D { + border-color: var(--orange); +} + +.duplications-rating-D:after { + width: var(--smallFontSize); + height: var(--smallFontSize); + background-color: var(--orange); +} + +.duplications-rating-small.duplications-rating-D:after { + width: 8px; + height: 8px; +} + +.duplications-rating-big.duplications-rating-D:after { + width: var(--controlHeight); + height: var(--controlHeight); +} + +.duplications-rating-huge.duplications-rating-D:after { + width: 36px; + height: 36px; +} + +.duplications-rating-E { + border-color: var(--red); +} + +.duplications-rating-E:after { + width: 14px; + height: 14px; + background-color: var(--red); +} + +.duplications-rating-small.duplications-rating-E:after { + width: 10px; + height: 10px; +} + +.duplications-rating-big.duplications-rating-E:after { + width: 28px; + height: 28px; +} + +.duplications-rating-huge.duplications-rating-E:after { + width: 42px; + height: 42px; +} diff --git a/server/sonar-web/src/main/js/components/ui/DuplicationsRating.tsx b/server/sonar-web/src/main/js/components/ui/DuplicationsRating.tsx new file mode 100644 index 00000000000..1c1d2595e32 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/DuplicationsRating.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { inRange } from 'lodash'; +import * as React from 'react'; +import './DuplicationsRating.css'; + +interface Props { + muted?: boolean; + size?: 'small' | 'normal' | 'big' | 'huge'; + value: number | null | undefined; +} + +export default function DuplicationsRating({ muted = false, size = 'normal', value }: Props) { + const className = classNames('duplications-rating', { + 'duplications-rating-small': size === 'small', + 'duplications-rating-big': size === 'big', + 'duplications-rating-huge': size === 'huge', + 'duplications-rating-muted': muted || value == null || isNaN(value), + 'duplications-rating-A': inRange(value || 0, 0, 3), + 'duplications-rating-B': inRange(value || 0, 3, 5), + 'duplications-rating-C': inRange(value || 0, 5, 10), + 'duplications-rating-D': inRange(value || 0, 10, 20), + 'duplications-rating-E': (value || 0) >= 20 + }); + + return
    ; +} diff --git a/server/sonar-web/src/main/js/components/ui/FilesCounter.tsx b/server/sonar-web/src/main/js/components/ui/FilesCounter.tsx new file mode 100644 index 00000000000..60b96c223fa --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/FilesCounter.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; + +interface Props { + className?: string; + current?: number; + total: number; +} + +export default function FilesCounter({ className, current, total }: Props) { + return ( + + + {current !== undefined && ( + + {formatMeasure(current, 'INT')} + {' / '} + + )} + {formatMeasure(total, 'INT')} + {' '} + {translate('component_measures.files')} + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/GenericAvatar.tsx b/server/sonar-web/src/main/js/components/ui/GenericAvatar.tsx new file mode 100644 index 00000000000..d9c78da675d --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/GenericAvatar.tsx @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { getTextColor, stringToColor } from '../../helpers/colors'; + +interface Props { + className?: string; + name: string; + round?: boolean; + size: number; +} + +export default function GenericAvatar({ className, name, round, size }: Props) { + const color = stringToColor(name); + + let text = ''; + const words = name.split(/\s+/).filter(word => word.length > 0); + if (words.length >= 2) { + text = words[0][0] + words[1][0]; + } else if (name.length > 0) { + text = name[0]; + } + + return ( +
    + {text.toUpperCase()} +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/Level.css b/server/sonar-web/src/main/js/components/ui/Level.css new file mode 100644 index 00000000000..a4d722f01ce --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/Level.css @@ -0,0 +1,82 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.level { + display: inline-block; + width: auto; + min-width: 80px; + padding-left: 9px; + padding-right: 9px; + height: var(--controlHeight); + line-height: var(--controlHeight); + border-radius: var(--controlHeight); + box-sizing: border-box; + color: #fff; + letter-spacing: 0.02em; + font-size: var(--baseFontSize); + font-weight: 400; + text-align: center; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.35); +} + +.level-small { + width: auto; + min-width: 64px; + padding-left: 9px; + padding-right: 9px; + margin-top: -1px; + margin-bottom: -1px; + height: var(--smallControlHeight); + line-height: var(--smallControlHeight); + font-size: var(--smallFontSize); +} + +.level-muted { + background-color: #bdbdbd !important; +} + +a > .level { + margin-bottom: -1px; + border-bottom: 1px solid; + transition: all 0.2s ease; +} + +a > .level:hover { + opacity: 0.8; +} + +.level-OK { + background-color: var(--green); +} + +.level-WARN { + background-color: var(--orange); +} + +.level-ERROR { + background-color: var(--red); +} + +.level-NONE { + background-color: var(--gray71); +} + +.level-NOT_COMPUTED { + background-color: var(--gray40); +} diff --git a/server/sonar-web/src/main/js/components/ui/Level.tsx b/server/sonar-web/src/main/js/components/ui/Level.tsx new file mode 100644 index 00000000000..5b5174470cc --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/Level.tsx @@ -0,0 +1,49 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { formatMeasure } from '../../helpers/measures'; +import './Level.css'; + +export interface LevelProps { + 'aria-label'?: string; + 'aria-labelledby'?: string; + className?: string; + level: string; + small?: boolean; + muted?: boolean; +} + +export default function Level(props: LevelProps) { + const formatted = formatMeasure(props.level, 'LEVEL'); + const className = classNames(props.className, 'level', 'level-' + props.level, { + 'level-small': props.small, + 'level-muted': props.muted + }); + + return ( + + {formatted} + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/MandatoryFieldMarker.tsx b/server/sonar-web/src/main/js/components/ui/MandatoryFieldMarker.tsx new file mode 100644 index 00000000000..bedf016d2a6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/MandatoryFieldMarker.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; + +export interface MandatoryFieldMarkerProps { + className?: string; +} + +export default function MandatoryFieldMarker({ className }: MandatoryFieldMarkerProps) { + return ( + + * + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/MandatoryFieldsExplanation.tsx b/server/sonar-web/src/main/js/components/ui/MandatoryFieldsExplanation.tsx new file mode 100644 index 00000000000..67ef7370bca --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/MandatoryFieldsExplanation.tsx @@ -0,0 +1,39 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; +import { translate } from '../../helpers/l10n'; + +export interface MandatoryFieldsExplanationProps { + className?: string; +} + +export default function MandatoryFieldsExplanation({ className }: MandatoryFieldsExplanationProps) { + return ( +
    + * }} + /> +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/NavBar.css b/server/sonar-web/src/main/js/components/ui/NavBar.css new file mode 100644 index 00000000000..c9e5757121d --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/NavBar.css @@ -0,0 +1,50 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.navbar, +[class^='navbar-'], +[class*=' navbar-'] { + box-sizing: border-box; +} + +.navbar { +} + +.navbar-inner { + position: fixed; + left: 0; + right: 0; +} + +.navbar-inner > div { + position: relative; + min-width: var(--minPageWidth); + padding-left: var(--pagePadding); + padding-right: var(--pagePadding); +} + +.navbar-limited { + max-width: var(--maxPageWidth); + margin-left: auto; + margin-right: auto; +} + +.ReactModal__Body--open .navbar-inner { + padding-right: var(--sbw); +} diff --git a/server/sonar-web/src/main/js/components/ui/NavBar.tsx b/server/sonar-web/src/main/js/components/ui/NavBar.tsx new file mode 100644 index 00000000000..5f6de14ffaa --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/NavBar.tsx @@ -0,0 +1,77 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { throttle } from 'lodash'; +import * as React from 'react'; +import './NavBar.css'; + +export interface NavBarProps { + children?: React.ReactNode; + className?: string; + height: number; + limited?: boolean; + top?: number; + notif?: React.ReactNode; +} + +interface State { + left: number; +} + +export default class NavBar extends React.PureComponent< + NavBarProps & React.HTMLProps, + State +> { + throttledFollowHorizontalScroll: () => void; + + constructor(props: NavBarProps) { + super(props); + this.state = { left: 0 }; + this.throttledFollowHorizontalScroll = throttle(this.followHorizontalScroll, 10); + } + + componentDidMount() { + document.addEventListener('scroll', this.throttledFollowHorizontalScroll); + } + + componentWillUnmount() { + document.removeEventListener('scroll', this.throttledFollowHorizontalScroll); + } + + followHorizontalScroll = () => { + if (document.documentElement) { + this.setState({ left: -document.documentElement.scrollLeft }); + } + }; + + render() { + const { children, className, height, limited = true, top, notif, ...other } = this.props; + return ( + + ); + } +} diff --git a/server/sonar-web/src/main/js/components/ui/NavBarTabs.css b/server/sonar-web/src/main/js/components/ui/NavBarTabs.css new file mode 100644 index 00000000000..f43e1389f07 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/NavBarTabs.css @@ -0,0 +1,47 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.navbar-tabs { + display: flex; + align-items: center; + clear: left; + height: var(--controlHeight); + margin-top: var(--gridSize); +} + +.navbar-tabs > li + li { + margin-left: 20px; +} + +.navbar-tabs > li > a { + display: block; + height: var(--controlHeight); + line-height: 16px; + padding-top: 2px; + border-bottom: 3px solid transparent; + box-sizing: border-box; + color: var(--baseFontColor); + transition: none; +} + +.navbar-tabs > li > a.active, +.navbar-tabs > li > a:hover, +.navbar-tabs > li > a:focus { + border-bottom-color: var(--blue); +} diff --git a/server/sonar-web/src/main/js/components/ui/NavBarTabs.tsx b/server/sonar-web/src/main/js/components/ui/NavBarTabs.tsx new file mode 100644 index 00000000000..0cc09e5abc6 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/NavBarTabs.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import './NavBarTabs.css'; + +interface Props { + children?: any; + className?: string; + [attr: string]: any; +} + +export default function NavBarTabs({ children, className, ...other }: Props) { + return ( +
      + {children} +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/NewsBox.css b/server/sonar-web/src/main/js/components/ui/NewsBox.css new file mode 100644 index 00000000000..1adae9f9102 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/NewsBox.css @@ -0,0 +1,31 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.news-box { + border: 1px solid var(--alertBorderInfo); + border-radius: 2px; + background-color: var(--veryLightBlue); + padding: var(--gridSize); +} + +.news-box-header { + display: flex; + align-items: center; + justify-content: space-between; +} diff --git a/server/sonar-web/src/main/js/components/ui/NewsBox.tsx b/server/sonar-web/src/main/js/components/ui/NewsBox.tsx new file mode 100644 index 00000000000..27626765848 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/NewsBox.tsx @@ -0,0 +1,50 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import { ClearButton } from '../controls/buttons'; +import './NewsBox.css'; + +export interface Props { + children: React.ReactNode; + className?: string; + onClose: () => void; + title: string; +} + +export default function NewsBox({ children, className, onClose, title }: Props) { + return ( +
    +
    +
    + {translate('new')} + {title} +
    + +
    +
    {children}
    +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/PageActions.tsx b/server/sonar-web/src/main/js/components/ui/PageActions.tsx new file mode 100644 index 00000000000..8c2e4106b16 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/PageActions.tsx @@ -0,0 +1,57 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { translate } from '../../helpers/l10n'; +import FilesCounter from './FilesCounter'; + +export interface Props { + current?: number; + showShortcuts?: boolean; + total?: number; +} + +export default function PageActions(props: Props) { + const { current, showShortcuts, total = 0 } = props; + + return ( +
    + {showShortcuts && ( + + + + + {translate('component_measures.to_select_files')} + + + + + + {translate('component_measures.to_navigate')} + + + )} + {total > 0 && ( +
    + +
    + )} +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/PageShortcutsTooltip.tsx b/server/sonar-web/src/main/js/components/ui/PageShortcutsTooltip.tsx index 4f20d315791..00cffc0f4bf 100644 --- a/server/sonar-web/src/main/js/components/ui/PageShortcutsTooltip.tsx +++ b/server/sonar-web/src/main/js/components/ui/PageShortcutsTooltip.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Tooltip from '../../sonar-ui-common/components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../sonar-ui-common/helpers/l10n'; +import Tooltip from '../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../helpers/l10n'; export interface PageShortcutsTooltipProps { className?: string; diff --git a/server/sonar-web/src/main/js/components/ui/Rating.css b/server/sonar-web/src/main/js/components/ui/Rating.css new file mode 100644 index 00000000000..8bd2dda1a3d --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/Rating.css @@ -0,0 +1,98 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.rating { + display: inline-block; + width: var(--controlHeight); + height: var(--controlHeight); + line-height: var(--controlHeight); + border-radius: var(--controlHeight); + box-sizing: border-box; + color: #fff; + font-size: var(--bigFontSize); + font-weight: 400; + text-align: center; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.35); +} + +.rating-muted { + background-color: #bdbdbd !important; + color: #fff !important; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.35) !important; +} + +a > .rating { + margin-bottom: -1px; + border-bottom: 1px solid; + transition: all 0.2s ease; +} + +a > .rating:hover { + opacity: 0.8; +} + +.rating-A { + line-height: 23px; + background-color: var(--green); +} + +a > .rating-A { + border-bottom-color: var(--green); +} + +.rating-B { + background-color: var(--lightGreen); +} + +a .rating-B { + border-bottom-color: var(--lightGreen); +} + +.rating-C { + background-color: var(--yellow); +} + +a .rating-C { + border-bottom-color: var(--yellow); +} + +.rating-D { + background-color: var(--orange); +} + +a .rating-D { + border-bottom-color: var(--orange); +} + +.rating-E { + background-color: var(--red); +} + +a .rating-E { + border-bottom-color: var(--red); +} + +.rating-small { + width: 18px; + height: 18px; + line-height: 18px; + margin-top: -1px; + margin-bottom: -1px; + font-size: var(--smallFontSize); +} diff --git a/server/sonar-web/src/main/js/components/ui/Rating.tsx b/server/sonar-web/src/main/js/components/ui/Rating.tsx new file mode 100644 index 00000000000..91c661ffc97 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/Rating.tsx @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import * as React from 'react'; +import { translate, translateWithParameters } from '../../helpers/l10n'; +import { formatMeasure } from '../../helpers/measures'; +import './Rating.css'; + +interface Props extends React.AriaAttributes { + className?: string; + muted?: boolean; + small?: boolean; + value: string | number | undefined; +} + +export default function Rating({ + className, + muted = false, + small = false, + value, + ...ariaAttrs +}: Props) { + if (value === undefined) { + return ( + + – + + ); + } + const formatted = formatMeasure(value, 'RATING'); + return ( + + {formatted} + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/SizeRating.css b/server/sonar-web/src/main/js/components/ui/SizeRating.css new file mode 100644 index 00000000000..4403c162271 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/SizeRating.css @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +.size-rating { + display: inline-block; + vertical-align: top; + width: var(--controlHeight); + height: var(--controlHeight); + line-height: var(--controlHeight); + border-radius: var(--controlHeight); + background-color: var(--blue); + color: #fff; + font-size: var(--smallFontSize); + text-align: center; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.35); +} + +.size-rating-small { + width: 18px; + height: 18px; + line-height: 18px; + margin-top: -1px; + margin-bottom: -1px; + font-size: 10px; +} + +.size-rating-muted { + background-color: #bdbdbd; +} diff --git a/server/sonar-web/src/main/js/components/ui/SizeRating.tsx b/server/sonar-web/src/main/js/components/ui/SizeRating.tsx new file mode 100644 index 00000000000..c6c71072fdb --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/SizeRating.tsx @@ -0,0 +1,59 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as classNames from 'classnames'; +import { inRange } from 'lodash'; +import * as React from 'react'; +import './SizeRating.css'; + +export interface Props { + muted?: boolean; + small?: boolean; + value: number | null | undefined; +} + +export default function SizeRating({ small = false, muted = false, value }: Props) { + if (value == null) { + return
     
    ; + } + + let letter; + if (inRange(value, 0, 1000)) { + letter = 'XS'; + } else if (inRange(value, 1000, 10000)) { + letter = 'S'; + } else if (inRange(value, 10000, 100000)) { + letter = 'M'; + } else if (inRange(value, 100000, 500000)) { + letter = 'L'; + } else if (value >= 500000) { + letter = 'XL'; + } + + const className = classNames('size-rating', { + 'size-rating-small': small, + 'size-rating-muted': muted + }); + + return ( + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/Alert-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/Alert-test.tsx new file mode 100644 index 00000000000..f7df09a4d99 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/Alert-test.tsx @@ -0,0 +1,62 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { Alert, AlertProps } from '../Alert'; + +it('should render properly', () => { + expect(shallowRender({ variant: 'error' })).toMatchSnapshot(); +}); + +it('verification of all variants of alert', () => { + const variants: AlertProps['variant'][] = ['error', 'warning', 'success', 'info', 'loading']; + variants.forEach(variant => { + const wrapper = shallowRender({ variant }); + expect(wrapper.prop('variantInfo')).toMatchSnapshot(); + }); +}); + +it('should render inline alert', () => { + expect( + shallowRender({ display: 'inline' }) + .find('Styled(div)[isInline=true]') + .exists() + ).toBe(true); +}); + +it('should render banner alert', () => { + expect( + shallowRender({ display: 'banner' }) + .find('Styled(div)[isBanner=true]') + .exists() + ).toBe(true); +}); + +it('should render banner alert with correct css', () => { + expect(shallowRender({ display: 'banner' }).render()).toMatchSnapshot(); +}); + +function shallowRender(props: Partial) { + return shallow( + + This is an error! + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/AutoEllipsis-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/AutoEllipsis-test.tsx new file mode 100644 index 00000000000..5d3411078cf --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/AutoEllipsis-test.tsx @@ -0,0 +1,75 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount, shallow } from 'enzyme'; +import * as React from 'react'; +import AutoEllipsis, { defaultShouldEllipsis } from '../AutoEllipsis'; + +it('should render', () => { + const wrapper = shallow( + + my test text + + ); + + expect(wrapper).toMatchSnapshot(); +}); + +it('should render with text-ellipsis class', () => { + const wrapper = mount( + true} maxWidth={5} useParent={false}> + my test text + + ); + + expect(wrapper.find('span').hasClass('medium')).toBe(true); + expect(wrapper.find('span').hasClass('text-ellipsis')).toBe(true); +}); + +const node5 = { clientWidth: 5, clientHeight: 5 } as any; +const node10 = { clientWidth: 10, clientHeight: 10 } as any; +const nodeParentSmaller = { ...node10, parentElement: node5 }; +const nodeParentBigger = { ...node5, parentElement: node10 }; + +it('should correctly compute the auto-ellipsis', () => { + expect(defaultShouldEllipsis(node10, { maxWidth: 5, useParent: false })).toBe(true); + expect(defaultShouldEllipsis(node10, { maxHeight: 5, useParent: false })).toBe(true); + expect(defaultShouldEllipsis(node10, { maxWidth: 5, maxHeight: 5, useParent: false })).toBe(true); + expect(defaultShouldEllipsis(node10, { maxWidth: 5, maxHeight: 10, useParent: false })).toBe( + true + ); + expect(defaultShouldEllipsis(node10, { maxWidth: 10, maxHeight: 5, useParent: false })).toBe( + true + ); + expect(defaultShouldEllipsis(node10, { maxWidth: 10, useParent: false })).toBe(false); + expect(defaultShouldEllipsis(node10, { maxHeight: 10, useParent: false })).toBe(false); + + expect(defaultShouldEllipsis(nodeParentSmaller, { maxWidth: 10, useParent: false })).toBe(false); + expect(defaultShouldEllipsis(nodeParentSmaller, { maxHeight: 10, useParent: false })).toBe(false); +}); + +it('should correctly compute the auto-ellipsis with a parent node', () => { + expect(defaultShouldEllipsis(nodeParentSmaller, {})).toBe(true); + expect(defaultShouldEllipsis(nodeParentSmaller, { maxWidth: 10 })).toBe(true); + expect(defaultShouldEllipsis(nodeParentSmaller, { maxHeight: 10 })).toBe(true); + expect(defaultShouldEllipsis(nodeParentSmaller, { maxWidth: 10, maxHeight: 10 })).toBe(false); + expect(defaultShouldEllipsis(nodeParentBigger, {})).toBe(false); + expect(defaultShouldEllipsis(nodeParentBigger, { maxWidth: 2 })).toBe(true); + expect(defaultShouldEllipsis(nodeParentBigger, { maxHeight: 2 })).toBe(true); +}); diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/DeferredSpinner-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/DeferredSpinner-test.tsx new file mode 100644 index 00000000000..8a7bc268499 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/DeferredSpinner-test.tsx @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { mount } from 'enzyme'; +import * as React from 'react'; +import DeferredSpinner from '../DeferredSpinner'; + +jest.useFakeTimers(); + +it('renders spinner after timeout', () => { + const spinner = mount(); + expect(spinner).toMatchSnapshot(); + jest.runAllTimers(); + spinner.update(); + expect(spinner).toMatchSnapshot(); +}); + +it('add custom className', () => { + const spinner = mount(); + jest.runAllTimers(); + spinner.update(); + expect(spinner).toMatchSnapshot(); +}); + +it('renders children before timeout', () => { + const spinner = mount( + +
    foo
    +
    + ); + expect(spinner).toMatchSnapshot(); + jest.runAllTimers(); + spinner.update(); + expect(spinner).toMatchSnapshot(); +}); + +it('is controlled by loading prop', () => { + const spinner = mount( + +
    foo
    +
    + ); + expect(spinner).toMatchSnapshot(); + spinner.setProps({ loading: true }); + expect(spinner).toMatchSnapshot(); + jest.runAllTimers(); + spinner.update(); + expect(spinner).toMatchSnapshot(); + spinner.setProps({ loading: false }); + spinner.update(); + expect(spinner).toMatchSnapshot(); +}); + +it('renders a placeholder while waiting', () => { + const spinner = mount(); + expect(spinner).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/DismissableAlert-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/DismissableAlert-test.tsx index 2de4b43a827..2dced3bd8b9 100644 --- a/server/sonar-web/src/main/js/components/ui/__tests__/DismissableAlert-test.tsx +++ b/server/sonar-web/src/main/js/components/ui/__tests__/DismissableAlert-test.tsx @@ -20,15 +20,15 @@ import { shallow } from 'enzyme'; import * as React from 'react'; -import { ButtonIcon } from '../../../sonar-ui-common/components/controls/buttons'; -import { save } from '../../../sonar-ui-common/helpers/storage'; -import { click } from '../../../sonar-ui-common/helpers/testUtils'; +import { ButtonIcon } from '../../../components/controls/buttons'; +import { save } from '../../../helpers/storage'; +import { click } from '../../../helpers/testUtils'; import DismissableAlert, { DismissableAlertProps, DISMISSED_ALERT_STORAGE_KEY } from '../DismissableAlert'; -jest.mock('../../../sonar-ui-common/helpers/storage', () => ({ +jest.mock('../../../helpers/storage', () => ({ get: jest.fn((_: string, suffix: string) => (suffix === 'bar' ? 'true' : undefined)), save: jest.fn() })); diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/FilesCounter-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/FilesCounter-test.tsx new file mode 100644 index 00000000000..2f020368cdb --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/FilesCounter-test.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import FilesCounter from '../FilesCounter'; + +it('should display x files on y total', () => { + expect(shallow()).toMatchSnapshot(); +}); + +it('should display only total of files', () => { + expect(shallow()).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/GenericAvatar-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/GenericAvatar-test.tsx new file mode 100644 index 00000000000..d244490dcd9 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/GenericAvatar-test.tsx @@ -0,0 +1,27 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import GenericAvatar from '../GenericAvatar'; + +it('should render properly', () => { + expect(shallow()).toMatchSnapshot(); + expect(shallow()).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/Level-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/Level-test.tsx new file mode 100644 index 00000000000..8f52a420665 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/Level-test.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import Level, { LevelProps } from '../Level'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot('default ok'); + expect(shallowRender({ level: 'ERROR' })).toMatchSnapshot('default error'); + expect(shallowRender({ muted: true, small: true })).toMatchSnapshot('muted and small'); + expect(shallowRender({ 'aria-label': 'ARIA Label' })).toMatchSnapshot('with aria-label'); + expect(shallowRender({ 'aria-labelledby': 'element-id' })).toMatchSnapshot( + 'with aria-labelledby' + ); +}); + +function shallowRender(props: Partial = {}) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldMarker-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldMarker-test.tsx new file mode 100644 index 00000000000..8cd043086c2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldMarker-test.tsx @@ -0,0 +1,31 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import MandatoryFieldMarker, { MandatoryFieldMarkerProps } from '../MandatoryFieldMarker'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot('default'); + expect(shallowRender({ className: 'foo-bar' })).toMatchSnapshot('with className'); +}); + +function shallowRender(props: Partial = {}) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldsExplanation-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldsExplanation-test.tsx new file mode 100644 index 00000000000..8ba8b451e08 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/MandatoryFieldsExplanation-test.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import MandatoryFieldsExplanation, { + MandatoryFieldsExplanationProps +} from '../MandatoryFieldsExplanation'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot('default'); + expect(shallowRender({ className: 'foo-bar' })).toMatchSnapshot('with className'); +}); + +function shallowRender(props: Partial = {}) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/NavBar-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/NavBar-test.tsx new file mode 100644 index 00000000000..1db05af50e0 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/NavBar-test.tsx @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import NavBar, { NavBarProps } from '../NavBar'; + +it('should render correctly', () => { + const wrapper = shallowRender(); + expect(wrapper).toMatchSnapshot(); +}); + +it('should render correctly with notif and not limited', () => { + const wrapper = shallowRender({ limited: false, notif:
    }); + expect(wrapper).toMatchSnapshot(); +}); + +function shallowRender(props: Partial = {}) { + return shallow( + +
    + + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/NewsBox-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/NewsBox-test.tsx new file mode 100644 index 00000000000..8b46a49efbc --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/NewsBox-test.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import { click } from '../../../helpers/testUtils'; +import NewsBox, { Props } from '../NewsBox'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +it('should call onClose', () => { + const onClose = jest.fn(); + const wrapper = shallowRender({ onClose }); + + click(wrapper.find('ClearButton')); + expect(onClose).toBeCalled(); +}); + +function shallowRender(props: Partial = {}) { + return shallow( + +
    description
    +
    + ); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/PageActions-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/PageActions-test.tsx new file mode 100644 index 00000000000..46594418d3a --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/PageActions-test.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import PageActions, { Props } from '../PageActions'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + expect(shallowRender({ total: 10 })).toMatchSnapshot(); + expect(shallowRender({ current: 12, showShortcuts: false, total: 120 })).toMatchSnapshot(); +}); + +function shallowRender(props: Partial = {}) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/Rating-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/Rating-test.tsx new file mode 100644 index 00000000000..f8f1540adfc --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/Rating-test.tsx @@ -0,0 +1,41 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import Rating from '../Rating'; + +it('renders numeric value', () => { + expect(shallow()).toMatchSnapshot(); +}); + +it('renders string value', () => { + expect(shallow()).toMatchSnapshot(); +}); + +it('renders undefined value', () => { + expect(shallow()).toMatchSnapshot(); +}); + +it('renders with a custom aria-label', () => { + expect(shallow()).toMatchSnapshot(); + expect( + shallow() + ).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/SizeRating-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/SizeRating-test.tsx new file mode 100644 index 00000000000..7c3b8e3b005 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/SizeRating-test.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import SizeRating, { Props } from '../SizeRating'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); + expect(shallowRender({ muted: true, small: true, value: 1000 })).toMatchSnapshot(); + expect(shallowRender({ value: 10000 })).toMatchSnapshot(); + expect(shallowRender({ value: 100000 })).toMatchSnapshot(); + expect(shallowRender({ value: 500000 })).toMatchSnapshot(); +}); + +function shallowRender(props: Partial = {}) { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap new file mode 100644 index 00000000000..893212cc564 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap @@ -0,0 +1,207 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render banner alert with correct css 1`] = ` +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #f4b1b0; + background-color: #f2dede; + color: #862422; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-width: 1080px; + max-width: 1320px; + margin-left: auto; + margin-right: auto; + padding-left: 20px; + padding-right: 20px; + box-sizing: border-box; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(2 * 8px); + border-right: none; + border-color: #f4b1b0; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + + +`; + +exports[`should render properly 1`] = ` +, + } + } +> + + , + } + } + > + + + + This is an error! + + + +`; + +exports[`verification of all variants of alert 1`] = ` +Object { + "backGroundColor": "#f2dede", + "borderColor": "#f4b1b0", + "color": "#862422", + "icon": , +} +`; + +exports[`verification of all variants of alert 2`] = ` +Object { + "backGroundColor": "#fcf8e3", + "borderColor": "#faebcc", + "color": "#6f4f17", + "icon": , +} +`; + +exports[`verification of all variants of alert 3`] = ` +Object { + "backGroundColor": "#dff0d8", + "borderColor": "#d6e9c6", + "color": "#215821", + "icon": , +} +`; + +exports[`verification of all variants of alert 4`] = ` +Object { + "backGroundColor": "#d9edf7", + "borderColor": "#b1dff3", + "color": "#0e516f", + "icon": , +} +`; + +exports[`verification of all variants of alert 5`] = ` +Object { + "backGroundColor": "#d9edf7", + "borderColor": "#b1dff3", + "color": "#0e516f", + "icon": , +} +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/AutoEllipsis-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/AutoEllipsis-test.tsx.snap new file mode 100644 index 00000000000..84212d45e27 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/AutoEllipsis-test.tsx.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render 1`] = ` + + my test text + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/DeferredSpinner-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/DeferredSpinner-test.tsx.snap new file mode 100644 index 00000000000..6822674e7d2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/DeferredSpinner-test.tsx.snap @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`add custom className 1`] = ` + + + +`; + +exports[`is controlled by loading prop 1`] = ` + +
    + foo +
    +
    +`; + +exports[`is controlled by loading prop 2`] = ` + +
    + foo +
    +
    +`; + +exports[`is controlled by loading prop 3`] = ` + + + +`; + +exports[`is controlled by loading prop 4`] = ` + +
    + foo +
    +
    +`; + +exports[`renders a placeholder while waiting 1`] = ` + + + +`; + +exports[`renders children before timeout 1`] = ` + +
    + foo +
    +
    +`; + +exports[`renders children before timeout 2`] = ` + + + +`; + +exports[`renders spinner after timeout 1`] = ``; + +exports[`renders spinner after timeout 2`] = ` + + + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/FilesCounter-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/FilesCounter-test.tsx.snap new file mode 100644 index 00000000000..bb01a6121da --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/FilesCounter-test.tsx.snap @@ -0,0 +1,25 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should display only total of files 1`] = ` + + + 123,455 + + + component_measures.files + +`; + +exports[`should display x files on y total 1`] = ` + + + + 12 + / + + 123,455 + + + component_measures.files + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/GenericAvatar-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/GenericAvatar-test.tsx.snap new file mode 100644 index 00000000000..9c2bb0fa7fd --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/GenericAvatar-test.tsx.snap @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render properly 1`] = ` +
    + F +
    +`; + +exports[`should render properly 2`] = ` +
    + F +
    +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Level-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Level-test.tsx.snap new file mode 100644 index 00000000000..089171fcc17 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Level-test.tsx.snap @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: default error 1`] = ` + + ERROR + +`; + +exports[`should render correctly: default ok 1`] = ` + + OK + +`; + +exports[`should render correctly: muted and small 1`] = ` + + OK + +`; + +exports[`should render correctly: with aria-label 1`] = ` + + OK + +`; + +exports[`should render correctly: with aria-labelledby 1`] = ` + + OK + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldMarker-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldMarker-test.tsx.snap new file mode 100644 index 00000000000..1adb77718dd --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldMarker-test.tsx.snap @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: default 1`] = ` + + * + +`; + +exports[`should render correctly: with className 1`] = ` + + * + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldsExplanation-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldsExplanation-test.tsx.snap new file mode 100644 index 00000000000..ca469b7e71c --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/MandatoryFieldsExplanation-test.tsx.snap @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly: default 1`] = ` +
    + + * + , + } + } + /> +
    +`; + +exports[`should render correctly: with className 1`] = ` +
    + + * + , + } + } + /> +
    +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NavBar-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NavBar-test.tsx.snap new file mode 100644 index 00000000000..a039d0ebb24 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NavBar-test.tsx.snap @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + +`; + +exports[`should render correctly with notif and not limited 1`] = ` + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NewsBox-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NewsBox-test.tsx.snap new file mode 100644 index 00000000000..91e58894fbf --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/NewsBox-test.tsx.snap @@ -0,0 +1,42 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +
    +
    +
    + + new + + + title + +
    + +
    +
    +
    + description +
    +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/PageActions-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/PageActions-test.tsx.snap new file mode 100644 index 00000000000..bb220fbacaf --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/PageActions-test.tsx.snap @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +
    + + + + ↑ + + + ↓ + + component_measures.to_select_files + + + + ← + + + → + + component_measures.to_navigate + + +
    +`; + +exports[`should render correctly 2`] = ` +
    + + + + ↑ + + + ↓ + + component_measures.to_select_files + + + + ← + + + → + + component_measures.to_navigate + + +
    + +
    +
    +`; + +exports[`should render correctly 3`] = ` +
    +
    + +
    +
    +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Rating-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Rating-test.tsx.snap new file mode 100644 index 00000000000..9455ce98965 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Rating-test.tsx.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders numeric value 1`] = ` + + B + +`; + +exports[`renders string value 1`] = ` + + B + +`; + +exports[`renders undefined value 1`] = ` + + – + +`; + +exports[`renders with a custom aria-label 1`] = ` + + B + +`; + +exports[`renders with a custom aria-label 2`] = ` + + – + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/SizeRating-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/SizeRating-test.tsx.snap new file mode 100644 index 00000000000..a35517cc685 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/SizeRating-test.tsx.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + +`; + +exports[`should render correctly 2`] = ` + +`; + +exports[`should render correctly 3`] = ` + +`; + +exports[`should render correctly 4`] = ` + +`; + +exports[`should render correctly 5`] = ` + +`; diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/popups-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/popups-test.tsx.snap new file mode 100644 index 00000000000..87b7811eb17 --- /dev/null +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/popups-test.tsx.snap @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Popup should render Popup 1`] = ` + +
    + +
    +
    +`; + +exports[`Popup should render PopupArrow 1`] = ` +
    +`; + +exports[`PortalPopup should render correctly with overlay 1`] = ` + +