]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15945 Get rid of T namespace in sonar-web
authorphilippe-perrin-sonarsource <philippe.perrin@sonarsource.com>
Thu, 27 Jan 2022 10:06:59 +0000 (11:06 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 27 Jan 2022 20:03:05 +0000 (20:03 +0000)
730 files changed:
server/sonar-web/src/main/js/api/alm-integrations.ts
server/sonar-web/src/main/js/api/components.ts
server/sonar-web/src/main/js/api/issues.ts
server/sonar-web/src/main/js/api/languages.ts
server/sonar-web/src/main/js/api/measures.ts
server/sonar-web/src/main/js/api/metrics.ts
server/sonar-web/src/main/js/api/nav.ts
server/sonar-web/src/main/js/api/newCodePeriod.ts
server/sonar-web/src/main/js/api/notifications.ts
server/sonar-web/src/main/js/api/permissions.ts
server/sonar-web/src/main/js/api/projectActivity.ts
server/sonar-web/src/main/js/api/projectLinks.ts
server/sonar-web/src/main/js/api/quality-gates.ts
server/sonar-web/src/main/js/api/quality-profiles.ts
server/sonar-web/src/main/js/api/rules.ts
server/sonar-web/src/main/js/api/security-hotspots.ts
server/sonar-web/src/main/js/api/system.ts
server/sonar-web/src/main/js/api/time-machine.ts
server/sonar-web/src/main/js/api/user-tokens.ts
server/sonar-web/src/main/js/api/user_groups.ts
server/sonar-web/src/main/js/api/users.ts
server/sonar-web/src/main/js/api/web-api.ts
server/sonar-web/src/main/js/api/webhooks.ts
server/sonar-web/src/main/js/app/components/AdminContainer.tsx
server/sonar-web/src/main/js/app/components/AdminContext.tsx
server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
server/sonar-web/src/main/js/app/components/ComponentContext.tsx
server/sonar-web/src/main/js/app/components/Landing.tsx
server/sonar-web/src/main/js/app/components/NonAdminPagesContainer.tsx
server/sonar-web/src/main/js/app/components/PluginRiskConsent.tsx
server/sonar-web/src/main/js/app/components/ProjectAdminContainer.tsx
server/sonar-web/src/main/js/app/components/ResetPassword.tsx
server/sonar-web/src/main/js/app/components/StartupModal.tsx
server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx
server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx
server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx
server/sonar-web/src/main/js/app/components/a11y/A11yContext.tsx
server/sonar-web/src/main/js/app/components/a11y/A11yProvider.tsx
server/sonar-web/src/main/js/app/components/a11y/A11ySkipTarget.tsx
server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx
server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsContext.ts
server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx
server/sonar-web/src/main/js/app/components/extensions/Extension.tsx
server/sonar-web/src/main/js/app/components/extensions/GlobalAdminPageExtension.tsx
server/sonar-web/src/main/js/app/components/extensions/GlobalPageExtension.tsx
server/sonar-web/src/main/js/app/components/extensions/PortfolioPage.tsx
server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx
server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx
server/sonar-web/src/main/js/app/components/indexation/IndexationContextProvider.tsx
server/sonar-web/src/main/js/app/components/indexation/IndexationNotification.tsx
server/sonar-web/src/main/js/app/components/indexation/PageUnavailableDueToIndexation.tsx
server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx
server/sonar-web/src/main/js/app/components/nav/component/Header.tsx
server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx
server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeParams-test.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx
server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx
server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx
server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx
server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx
server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx
server/sonar-web/src/main/js/app/components/promotion-notification/PromotionNotification.tsx
server/sonar-web/src/main/js/app/components/search/Search.tsx
server/sonar-web/src/main/js/app/components/search/SearchResult.tsx
server/sonar-web/src/main/js/app/components/update-notification/UpdateNotification.tsx
server/sonar-web/src/main/js/app/index.ts
server/sonar-web/src/main/js/app/utils/getStore.ts
server/sonar-web/src/main/js/app/utils/startReactApp.tsx
server/sonar-web/src/main/js/apps/account/components/Account.tsx
server/sonar-web/src/main/js/apps/account/components/Security.tsx
server/sonar-web/src/main/js/apps/account/components/UserCard.tsx
server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.tsx
server/sonar-web/src/main/js/apps/account/notifications/NotificationsList.tsx
server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx
server/sonar-web/src/main/js/apps/account/notifications/ProjectNotifications.tsx
server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx
server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx
server/sonar-web/src/main/js/apps/account/profile/Profile.tsx
server/sonar-web/src/main/js/apps/account/profile/UserExternalIdentity.tsx
server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx
server/sonar-web/src/main/js/apps/account/projects/Projects.tsx
server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx
server/sonar-web/src/main/js/apps/account/projects/__tests__/ProjectCard-test.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/Stats.tsx
server/sonar-web/src/main/js/apps/code/__tests__/buckets-test.tsx
server/sonar-web/src/main/js/apps/code/bucket.ts
server/sonar-web/src/main/js/apps/code/components/Breadcrumbs.tsx
server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx
server/sonar-web/src/main/js/apps/code/components/Component.tsx
server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx
server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx
server/sonar-web/src/main/js/apps/code/components/ComponentPin.tsx
server/sonar-web/src/main/js/apps/code/components/Components.tsx
server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx
server/sonar-web/src/main/js/apps/code/components/Search.tsx
server/sonar-web/src/main/js/apps/code/components/SourceViewerWrapper.tsx
server/sonar-web/src/main/js/apps/code/utils.ts
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleButton.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/InheritanceFacet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsParameters.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleInheritanceIcon.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/PageActions-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetails-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsDescription-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsMeta-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/query.ts
server/sonar-web/src/main/js/apps/coding-rules/routes.ts
server/sonar-web/src/main/js/apps/component-measures/__tests__/utils-test.ts
server/sonar-web/src/main/js/apps/component-measures/components/App.tsx
server/sonar-web/src/main/js/apps/component-measures/components/Breadcrumb.tsx
server/sonar-web/src/main/js/apps/component-measures/components/Breadcrumbs.tsx
server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureViewSelect.tsx
server/sonar-web/src/main/js/apps/component-measures/components/__tests__/LeakPeriodLegend-test.tsx
server/sonar-web/src/main/js/apps/component-measures/components/__tests__/MeasureHeader-test.tsx
server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts
server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsListRow.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx
server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx
server/sonar-web/src/main/js/apps/component-measures/sidebar/FacetMeasureValue.tsx
server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx
server/sonar-web/src/main/js/apps/component-measures/utils.ts
server/sonar-web/src/main/js/apps/create/project/AzureProjectCreate.tsx
server/sonar-web/src/main/js/apps/create/project/AzureProjectCreateRenderer.tsx
server/sonar-web/src/main/js/apps/create/project/AzureProjectsList.tsx
server/sonar-web/src/main/js/apps/create/project/BitbucketCloudProjectCreate.tsx
server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx
server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx
server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreate.tsx
server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx
server/sonar-web/src/main/js/apps/create/project/GitlabProjectCreate.tsx
server/sonar-web/src/main/js/apps/create/project/GitlabProjectCreateRenderer.tsx
server/sonar-web/src/main/js/apps/create/project/GitlabProjectSelectionForm.tsx
server/sonar-web/src/main/js/apps/documentation/__tests__/pages-test.ts
server/sonar-web/src/main/js/apps/documentation/components/App.tsx
server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx
server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx
server/sonar-web/src/main/js/apps/documentation/pages.ts
server/sonar-web/src/main/js/apps/groups/components/App.tsx
server/sonar-web/src/main/js/apps/groups/components/DeleteForm.tsx
server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx
server/sonar-web/src/main/js/apps/groups/components/EditMembersModal.tsx
server/sonar-web/src/main/js/apps/groups/components/Form.tsx
server/sonar-web/src/main/js/apps/groups/components/List.tsx
server/sonar-web/src/main/js/apps/groups/components/ListItem.tsx
server/sonar-web/src/main/js/apps/issues/components/AppContainer.tsx
server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx
server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx
server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx
server/sonar-web/src/main/js/apps/issues/components/IssuesList.tsx
server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx
server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx
server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx
server/sonar-web/src/main/js/apps/issues/components/__tests__/BulkChangeModal-test.tsx
server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesApp-test.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssue.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueBox.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocations.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssueLocationsNavigator.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/ConciseIssuesList.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/CrossFileLocationsNavigator.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssue-test.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueLocationsNavigator-test.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssuesList-test.tsx
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/CrossFileLocationsNavigator-test.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewerWrapper.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/ComponentSourceSnippetGroupViewer-test.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts
server/sonar-web/src/main/js/apps/issues/redirects.ts
server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/ScopeFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx
server/sonar-web/src/main/js/apps/issues/utils.ts
server/sonar-web/src/main/js/apps/marketplace/AppContainer.tsx
server/sonar-web/src/main/js/apps/marketplace/utils.ts
server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx
server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx
server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx
server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx
server/sonar-web/src/main/js/apps/overview/branches/DebtValue.tsx
server/sonar-web/src/main/js/apps/overview/branches/DrilldownMeasureValue.tsx
server/sonar-web/src/main/js/apps/overview/branches/Event.tsx
server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx
server/sonar-web/src/main/js/apps/overview/branches/LeakPeriodInfo.tsx
server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanel.tsx
server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelIssueMeasureRow.tsx
server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx
server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx
server/sonar-web/src/main/js/apps/overview/branches/ProjectLeakPeriodInfo.tsx
server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx
server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx
server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx
server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-test.tsx
server/sonar-web/src/main/js/apps/overview/branches/__tests__/Event-test.tsx
server/sonar-web/src/main/js/apps/overview/branches/__tests__/ProjectLeakPeriodInfo-test.tsx
server/sonar-web/src/main/js/apps/overview/components/App.tsx
server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx
server/sonar-web/src/main/js/apps/overview/components/IssueLabel.tsx
server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx
server/sonar-web/src/main/js/apps/overview/components/LeakPeriodLegend.tsx
server/sonar-web/src/main/js/apps/overview/components/MeasurementLabel.tsx
server/sonar-web/src/main/js/apps/overview/components/QualityGateCondition.tsx
server/sonar-web/src/main/js/apps/overview/components/QualityGateConditions.tsx
server/sonar-web/src/main/js/apps/overview/components/SonarLintPromotion.tsx
server/sonar-web/src/main/js/apps/overview/components/__tests__/LeakPeriodLegend-test.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/AfterMergeEstimate.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/LargeQualityGateBadge.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/App.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/DeleteForm.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/List.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/ListItem.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/TemplateDetails.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.tsx
server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/Defaults-test.tsx
server/sonar-web/src/main/js/apps/permission-templates/utils.ts
server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx
server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx
server/sonar-web/src/main/js/apps/permissions/project/components/AllHoldersList.tsx
server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx
server/sonar-web/src/main/js/apps/permissions/project/components/ApplyTemplate.tsx
server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx
server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx
server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx
server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionCell.tsx
server/sonar-web/src/main/js/apps/permissions/shared/components/PermissionHeader.tsx
server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx
server/sonar-web/src/main/js/apps/permissions/utils.ts
server/sonar-web/src/main/js/apps/projectActivity/actions.ts
server/sonar-web/src/main/js/apps/projectActivity/components/DefinitionChangeEventInner.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/Event.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/Events.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityGraphs.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFooter.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageHeader.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/RichQualityGateEventInner.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddEventForm.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeEventForm.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.tsx
server/sonar-web/src/main/js/apps/projectActivity/utils.ts
server/sonar-web/src/main/js/apps/projectBaseline/components/App.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingAnalysis.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingDays.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingPreviousVersion.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisList.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BranchBaselineSettingModal.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BranchList.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BranchListRow.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx
server/sonar-web/src/main/js/apps/projectBaseline/utils.ts
server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx
server/sonar-web/src/main/js/apps/projectDeletion/App.tsx
server/sonar-web/src/main/js/apps/projectDeletion/Form.tsx
server/sonar-web/src/main/js/apps/projectDeletion/Header.tsx
server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx
server/sonar-web/src/main/js/apps/projectKey/Key.tsx
server/sonar-web/src/main/js/apps/projectKey/UpdateForm.tsx
server/sonar-web/src/main/js/apps/projectLinks/App.tsx
server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx
server/sonar-web/src/main/js/apps/projectLinks/Table.tsx
server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx
server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx
server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesApp.tsx
server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx
server/sonar-web/src/main/js/apps/projectQualityProfiles/components/AddLanguageModal.tsx
server/sonar-web/src/main/js/apps/projectQualityProfiles/components/SetQualityProfileModal.tsx
server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx
server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx
server/sonar-web/src/main/js/apps/projects/components/EmptyInstance.tsx
server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.tsx
server/sonar-web/src/main/js/apps/projects/components/PageHeader.tsx
server/sonar-web/src/main/js/apps/projects/components/PageSidebar.tsx
server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx
server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx
server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx
server/sonar-web/src/main/js/apps/projects/components/__tests__/DefaultPageSelector-test.tsx
server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx
server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardLanguages.tsx
server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx
server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCard-test.tsx
server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCardMeasures-test.tsx
server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx
server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx
server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
server/sonar-web/src/main/js/apps/projects/query.ts
server/sonar-web/src/main/js/apps/projects/types.ts
server/sonar-web/src/main/js/apps/projects/utils.ts
server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
server/sonar-web/src/main/js/apps/projectsManagement/App.tsx
server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx
server/sonar-web/src/main/js/apps/projectsManagement/ChangeDefaultVisibilityForm.tsx
server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx
server/sonar-web/src/main/js/apps/projectsManagement/Header.tsx
server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx
server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx
server/sonar-web/src/main/js/apps/projectsManagement/Projects.tsx
server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx
server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/Condition.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/ConditionModal.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/ConditionOperator.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/MetricSelect.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/PermissionItem.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/Projects.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissions.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsRenderer.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.tsx
server/sonar-web/src/main/js/apps/quality-gates/utils.ts
server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangesList.tsx
server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx
server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsForm-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfilePermissionsUser-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx
server/sonar-web/src/main/js/apps/quality-profiles/types.ts
server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/__tests__/utils-test.ts
server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotList.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainerRenderer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/Assignee.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeRenderer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelection.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/AssigneeSelectionRenderer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/Assignee-test.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeRenderer-test.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeSelection-test.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/assignee/__tests__/AssigneeSelectionRenderer-test.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/status/Status.tsx
server/sonar-web/src/main/js/apps/security-hotspots/utils.ts
server/sonar-web/src/main/js/apps/sessions/components/Login.tsx
server/sonar-web/src/main/js/apps/sessions/components/LoginContainer.tsx
server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx
server/sonar-web/src/main/js/apps/settings/components/AdditionalCategories.tsx
server/sonar-web/src/main/js/apps/settings/components/AllCategoriesList.tsx
server/sonar-web/src/main/js/apps/settings/components/CategoryDefinitionsList.tsx
server/sonar-web/src/main/js/apps/settings/components/CategoryOverrides.ts
server/sonar-web/src/main/js/apps/settings/components/Definition.tsx
server/sonar-web/src/main/js/apps/settings/components/DefinitionsList.tsx
server/sonar-web/src/main/js/apps/settings/components/EmailForm.tsx
server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx
server/sonar-web/src/main/js/apps/settings/components/PageHeader.tsx
server/sonar-web/src/main/js/apps/settings/components/SettingsApp.tsx
server/sonar-web/src/main/js/apps/settings/components/SettingsSearch.tsx
server/sonar-web/src/main/js/apps/settings/components/SettingsSearchRenderer.tsx
server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmIntegration.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmIntegrationRenderer.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTab.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx
server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/AlmSpecificForm.tsx
server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBinding.tsx
server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx
server/sonar-web/src/main/js/apps/settings/store/definitions.ts
server/sonar-web/src/main/js/apps/settings/store/settingsPage.ts
server/sonar-web/src/main/js/apps/settings/store/values.ts
server/sonar-web/src/main/js/apps/settings/utils.ts
server/sonar-web/src/main/js/apps/system/__tests__/utils-test.ts
server/sonar-web/src/main/js/apps/system/components/App.tsx
server/sonar-web/src/main/js/apps/system/components/ClusterSysInfos.tsx
server/sonar-web/src/main/js/apps/system/components/StandaloneSysInfos.tsx
server/sonar-web/src/main/js/apps/system/components/info-items/HealthCard.tsx
server/sonar-web/src/main/js/apps/system/components/info-items/HealthCauseItem.tsx
server/sonar-web/src/main/js/apps/system/components/info-items/HealthItem.tsx
server/sonar-web/src/main/js/apps/system/components/info-items/Section.tsx
server/sonar-web/src/main/js/apps/system/components/info-items/SysInfoItem.tsx
server/sonar-web/src/main/js/apps/system/utils.ts
server/sonar-web/src/main/js/apps/tutorials/components/TutorialsApp.tsx
server/sonar-web/src/main/js/apps/users/UsersApp.tsx
server/sonar-web/src/main/js/apps/users/UsersList.tsx
server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx
server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx
server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx
server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx
server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx
server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx
server/sonar-web/src/main/js/apps/users/components/UserActions.tsx
server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx
server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx
server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx
server/sonar-web/src/main/js/apps/users/components/__tests__/TokensFormItem-test.tsx
server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx
server/sonar-web/src/main/js/apps/users/utils.ts
server/sonar-web/src/main/js/apps/web-api/components/Action.tsx
server/sonar-web/src/main/js/apps/web-api/components/ActionChangelog.tsx
server/sonar-web/src/main/js/apps/web-api/components/Domain.tsx
server/sonar-web/src/main/js/apps/web-api/components/Menu.tsx
server/sonar-web/src/main/js/apps/web-api/components/Params.tsx
server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.tsx
server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx
server/sonar-web/src/main/js/apps/web-api/components/__tests__/Menu-test.tsx
server/sonar-web/src/main/js/apps/web-api/components/__tests__/Params-test.tsx
server/sonar-web/src/main/js/apps/web-api/utils.ts
server/sonar-web/src/main/js/apps/webhooks/components/App.tsx
server/sonar-web/src/main/js/apps/webhooks/components/CreateWebhookForm.tsx
server/sonar-web/src/main/js/apps/webhooks/components/DeleteWebhookForm.tsx
server/sonar-web/src/main/js/apps/webhooks/components/DeliveriesForm.tsx
server/sonar-web/src/main/js/apps/webhooks/components/DeliveryAccordion.tsx
server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx
server/sonar-web/src/main/js/apps/webhooks/components/LatestDeliveryForm.tsx
server/sonar-web/src/main/js/apps/webhooks/components/WebhookActions.tsx
server/sonar-web/src/main/js/apps/webhooks/components/WebhookItem.tsx
server/sonar-web/src/main/js/apps/webhooks/components/WebhookItemLatestDelivery.tsx
server/sonar-web/src/main/js/apps/webhooks/components/WebhooksList.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerContext.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx
server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeader-test.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineCoverage.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesIndicator.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesList.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineNumber.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineOptionsPopup.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/LineSCM.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/SCMPopup.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesList-test.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx
server/sonar-web/src/main/js/components/SourceViewer/helpers/duplications.ts
server/sonar-web/src/main/js/components/SourceViewer/helpers/getCoverageStatus.ts
server/sonar-web/src/main/js/components/SourceViewer/helpers/highlight.ts
server/sonar-web/src/main/js/components/SourceViewer/helpers/indexing.ts
server/sonar-web/src/main/js/components/SourceViewer/helpers/issueLocations.ts
server/sonar-web/src/main/js/components/SourceViewer/helpers/lines.ts
server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts
server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx
server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx
server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx
server/sonar-web/src/main/js/components/activity-graph/GraphsHistory.tsx
server/sonar-web/src/main/js/components/activity-graph/GraphsTooltips.tsx
server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentEvents.tsx
server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentIssues.tsx
server/sonar-web/src/main/js/components/activity-graph/utils.ts
server/sonar-web/src/main/js/components/charts/AdvancedTimeline.tsx
server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx
server/sonar-web/src/main/js/components/charts/TreeMap.tsx
server/sonar-web/src/main/js/components/charts/ZoomTimeLine.tsx
server/sonar-web/src/main/js/components/charts/__tests__/AdvancedTimeline-test.tsx
server/sonar-web/src/main/js/components/charts/__tests__/BubbleChart-test.tsx
server/sonar-web/src/main/js/components/common/AnalysisWarningsModal.tsx
server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx
server/sonar-web/src/main/js/components/common/ResetPasswordForm.tsx
server/sonar-web/src/main/js/components/common/RestartButton.tsx
server/sonar-web/src/main/js/components/common/VisibilitySelector.tsx
server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx
server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx
server/sonar-web/src/main/js/components/controls/DateInput.tsx
server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx
server/sonar-web/src/main/js/components/controls/ValidationForm.tsx
server/sonar-web/src/main/js/components/controls/__tests__/HomePageSelect-test.tsx
server/sonar-web/src/main/js/components/controls/buttons.tsx
server/sonar-web/src/main/js/components/docs/DocLink.tsx
server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx
server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx
server/sonar-web/src/main/js/components/hoc/__tests__/withCurrentUser-test.tsx
server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx
server/sonar-web/src/main/js/components/hoc/whenLoggedIn.tsx
server/sonar-web/src/main/js/components/hoc/withAppState.tsx
server/sonar-web/src/main/js/components/hoc/withCurrentUser.tsx
server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx
server/sonar-web/src/main/js/components/hoc/withNotifications.tsx
server/sonar-web/src/main/js/components/hoc/withRouter.tsx
server/sonar-web/src/main/js/components/icons/IssueIcon.tsx
server/sonar-web/src/main/js/components/icons/IssueTypeIcon.tsx
server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx
server/sonar-web/src/main/js/components/icons/SeverityIcon.tsx
server/sonar-web/src/main/js/components/icons/StatusIcon.tsx
server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx
server/sonar-web/src/main/js/components/icons/__tests__/IssueIcon-test.tsx
server/sonar-web/src/main/js/components/issue/Issue.tsx
server/sonar-web/src/main/js/components/issue/IssueView.tsx
server/sonar-web/src/main/js/components/issue/actions.ts
server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.tsx
server/sonar-web/src/main/js/components/issue/components/IssueAssign.tsx
server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx
server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx
server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.tsx
server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx
server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx
server/sonar-web/src/main/js/components/issue/components/IssueTags.tsx
server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx
server/sonar-web/src/main/js/components/issue/components/IssueTransition.tsx
server/sonar-web/src/main/js/components/issue/components/IssueType.tsx
server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.tsx
server/sonar-web/src/main/js/components/issue/components/__tests__/IssueActionsBar-test.tsx
server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelogDiff-test.tsx
server/sonar-web/src/main/js/components/issue/components/__tests__/IssueCommentLine-test.tsx
server/sonar-web/src/main/js/components/issue/components/__tests__/IssueType-test.tsx
server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx
server/sonar-web/src/main/js/components/issue/popups/CommentPopup.tsx
server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.tsx
server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.tsx
server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx
server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.tsx
server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx
server/sonar-web/src/main/js/components/measure/utils.ts
server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
server/sonar-web/src/main/js/components/shared/TypeHelper.tsx
server/sonar-web/src/main/js/components/tutorials/TutorialSelection.tsx
server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx
server/sonar-web/src/main/js/components/tutorials/__tests__/utils-test.ts
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/AzurePipelinesTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/BranchAnalysisStepContent.tsx
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ServiceEndpointStepContent.tsx
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PublishSteps.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/PreambuleYaml.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/RepositoryVariables.tsx
server/sonar-web/src/main/js/components/tutorials/components/AllSet.tsx
server/sonar-web/src/main/js/components/tutorials/components/DefaultProjectKey.tsx
server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx
server/sonar-web/src/main/js/components/tutorials/components/SentenceWithHighlights.tsx
server/sonar-web/src/main/js/components/tutorials/components/TokenStepGenerator.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/AnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/GitHubActionTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/Others.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/EnvironmentVariablesStep.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/GitLabCITutorial.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/ProjectKeyStep.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsfileStep.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNet.tsx
server/sonar-web/src/main/js/components/tutorials/manual/DoneNextSteps.tsx
server/sonar-web/src/main/js/components/tutorials/manual/ManualTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/manual/ProjectAnalysisStep.tsx
server/sonar-web/src/main/js/components/tutorials/manual/TokenStep.tsx
server/sonar-web/src/main/js/components/tutorials/manual/__tests__/TokenStep-test.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/AnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/ClangGCCCommand.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNet.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetExecute.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecScanner.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaGradle.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaMaven.tsx
server/sonar-web/src/main/js/components/tutorials/manual/commands/Other.tsx
server/sonar-web/src/main/js/components/tutorials/utils.ts
server/sonar-web/src/main/js/components/ui/Alert.tsx
server/sonar-web/src/main/js/components/upgrade/SystemUpgradeForm.tsx
server/sonar-web/src/main/js/components/workspace/Workspace.tsx
server/sonar-web/src/main/js/components/workspace/WorkspaceComponentViewer.tsx
server/sonar-web/src/main/js/components/workspace/WorkspaceRuleDetails.tsx
server/sonar-web/src/main/js/components/workspace/WorkspaceRuleViewer.tsx
server/sonar-web/src/main/js/components/workspace/context.ts
server/sonar-web/src/main/js/helpers/__tests__/request-test.ts
server/sonar-web/src/main/js/helpers/component.ts
server/sonar-web/src/main/js/helpers/constants.ts
server/sonar-web/src/main/js/helpers/cookies.ts
server/sonar-web/src/main/js/helpers/extensionsHandler.ts
server/sonar-web/src/main/js/helpers/issues.ts
server/sonar-web/src/main/js/helpers/l10n.ts
server/sonar-web/src/main/js/helpers/measures.ts
server/sonar-web/src/main/js/helpers/mocks/component.ts
server/sonar-web/src/main/js/helpers/mocks/issues.ts
server/sonar-web/src/main/js/helpers/mocks/permissions.ts
server/sonar-web/src/main/js/helpers/mocks/quality-gates.ts
server/sonar-web/src/main/js/helpers/mocks/users.ts
server/sonar-web/src/main/js/helpers/periods.ts
server/sonar-web/src/main/js/helpers/projectLinks.ts
server/sonar-web/src/main/js/helpers/query.ts
server/sonar-web/src/main/js/helpers/request.ts
server/sonar-web/src/main/js/helpers/strings.ts
server/sonar-web/src/main/js/helpers/testMocks.ts
server/sonar-web/src/main/js/helpers/urls.ts
server/sonar-web/src/main/js/helpers/users.ts
server/sonar-web/src/main/js/store/__tests__/branches-test.ts
server/sonar-web/src/main/js/store/__tests__/users-test.tsx
server/sonar-web/src/main/js/store/appState.ts
server/sonar-web/src/main/js/store/branches.ts
server/sonar-web/src/main/js/store/languages.ts
server/sonar-web/src/main/js/store/metrics.ts
server/sonar-web/src/main/js/store/rootActions.ts
server/sonar-web/src/main/js/store/rootReducer.ts
server/sonar-web/src/main/js/store/users.ts
server/sonar-web/src/main/js/store/utils/actions.ts
server/sonar-web/src/main/js/types/alm-integration.ts
server/sonar-web/src/main/js/types/branch-like.ts
server/sonar-web/src/main/js/types/browser.ts
server/sonar-web/src/main/js/types/coding-rules.ts
server/sonar-web/src/main/js/types/component.ts
server/sonar-web/src/main/js/types/extension.ts
server/sonar-web/src/main/js/types/issues.ts
server/sonar-web/src/main/js/types/l10n.ts
server/sonar-web/src/main/js/types/measures.ts
server/sonar-web/src/main/js/types/quality-gates.ts
server/sonar-web/src/main/js/types/security-hotspots.ts
server/sonar-web/src/main/js/types/security.ts
server/sonar-web/src/main/js/types/settings.ts
server/sonar-web/src/main/js/types/types.d.ts [deleted file]
server/sonar-web/src/main/js/types/types.ts [new file with mode: 0644]

index d2849f70b8ad39c54f2b09dd03e6b60d9f048ba1..c83b6772707dae2e60704e48a415e836657c8d81 100644 (file)
@@ -29,6 +29,7 @@ import {
   GithubRepository,
   GitlabProject
 } from '../types/alm-integration';
+import { Paging } from '../types/types';
 import { ProjectBase } from './components';
 
 export function setAlmPersonalAccessToken(
@@ -198,7 +199,7 @@ export function getGithubRepositories(data: {
   pageSize: number;
   page?: number;
   query?: string;
-}): Promise<{ repositories: GithubRepository[]; paging: T.Paging }> {
+}): Promise<{ repositories: GithubRepository[]; paging: Paging }> {
   const { almSetting, organization, pageSize, page = 1, query } = data;
   return getJSON('/api/alm_integrations/list_github_repositories', {
     almSetting,
@@ -214,7 +215,7 @@ export function getGitlabProjects(data: {
   page?: number;
   pageSize?: number;
   query?: string;
-}): Promise<{ projects: GitlabProject[]; projectsPaging: T.Paging }> {
+}): Promise<{ projects: GitlabProject[]; projectsPaging: Paging }> {
   const { almSetting, pageSize, page, query } = data;
   return getJSON('/api/alm_integrations/search_gitlab_repos', {
     almSetting,
index 6d719bceaeb7dac46b6cf1ea688f5669d1753a57..53441bed47495c14054b8d3d6aa6d317a4b9b913 100644 (file)
@@ -21,6 +21,18 @@ import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON, RequestData } from '../helpers/request';
 import { BranchParameters } from '../types/branch-like';
 import { ComponentQualifier, TreeComponent, TreeComponentWithPath } from '../types/component';
+import {
+  ComponentMeasure,
+  Dict,
+  DuplicatedFile,
+  Duplication,
+  Metric,
+  MyProject,
+  Paging,
+  SourceLine,
+  SourceViewerFile,
+  Visibility
+} from '../types/types';
 
 export interface BaseSearchProjectsParameters {
   analyzedBefore?: string;
@@ -28,14 +40,14 @@ export interface BaseSearchProjectsParameters {
   projects?: string;
   q?: string;
   qualifiers?: string;
-  visibility?: T.Visibility;
+  visibility?: Visibility;
 }
 
 export interface ProjectBase {
   key: string;
   name: string;
   qualifier: string;
-  visibility: T.Visibility;
+  visibility: Visibility;
 }
 
 export interface Project extends ProjectBase {
@@ -52,7 +64,7 @@ export function getComponents(
   parameters: SearchProjectsParameters
 ): Promise<{
   components: Project[];
-  paging: T.Paging;
+  paging: Paging;
 }> {
   return getJSON('/api/projects/search', parameters);
 }
@@ -74,7 +86,7 @@ export function deletePortfolio(portfolio: string): Promise<void | Response> {
 export function createProject(data: {
   name: string;
   project: string;
-  visibility?: T.Visibility;
+  visibility?: Visibility;
 }): Promise<{ project: ProjectBase }> {
   return postJSON('/api/projects/create', data).catch(throwGlobalError);
 }
@@ -97,10 +109,10 @@ export function getComponentTree(
   metrics: string[] = [],
   additional: RequestData = {}
 ): Promise<{
-  baseComponent: T.ComponentMeasure;
-  components: T.ComponentMeasure[];
-  metrics: T.Metric[];
-  paging: T.Paging;
+  baseComponent: ComponentMeasure;
+  components: ComponentMeasure[];
+  metrics: Metric[];
+  paging: Paging;
 }> {
   const url = '/api/measures/component_tree';
   const data = { ...additional, component, metricKeys: metrics.join(','), strategy };
@@ -125,7 +137,7 @@ export function getComponentLeaves(
 
 export function getComponent(
   data: { component: string; metricKeys: string } & BranchParameters
-): Promise<{ component: T.ComponentMeasure }> {
+): Promise<{ component: ComponentMeasure }> {
   return getJSON('/api/measures/component', data);
 }
 
@@ -141,7 +153,7 @@ type GetTreeParams = {
 
 export function getTree<T = TreeComponent>(
   data: GetTreeParams & { qualifiers?: string }
-): Promise<{ baseComponent: TreeComponent; components: T[]; paging: T.Paging }> {
+): Promise<{ baseComponent: TreeComponent; components: T[]; paging: Paging }> {
   return getJSON('/api/components/tree', data).catch(throwGlobalError);
 }
 
@@ -184,7 +196,7 @@ export function getBreadcrumbs(data: { component: string } & BranchParameters):
 export function getMyProjects(data: {
   p?: number;
   ps?: number;
-}): Promise<{ paging: T.Paging; projects: T.MyProject[] }> {
+}): Promise<{ paging: Paging; projects: MyProject[] }> {
   return getJSON('/api/projects/search_my_projects', data);
 }
 
@@ -196,7 +208,7 @@ export interface Component {
   analysisDate?: string;
   qualifier: ComponentQualifier;
   tags: string[];
-  visibility: T.Visibility;
+  visibility: Visibility;
   leakPeriodDate?: string;
   needIssueSync?: boolean;
 }
@@ -211,7 +223,7 @@ export function searchProjects(
 ): Promise<{
   components: Component[];
   facets: Facet[];
-  paging: T.Paging;
+  paging: Paging;
 }> {
   const url = '/api/components/search_projects';
   return getJSON(url, data);
@@ -266,19 +278,19 @@ export function getSuggestions(
 
 export function getComponentForSourceViewer(
   data: { component: string } & BranchParameters
-): Promise<T.SourceViewerFile> {
+): Promise<SourceViewerFile> {
   return getJSON('/api/components/app', data);
 }
 
 export function getSources(
   data: { key: string; from?: number; to?: number } & BranchParameters
-): Promise<T.SourceLine[]> {
+): Promise<SourceLine[]> {
   return getJSON('/api/sources/lines', data).then(r => r.sources);
 }
 
 export function getDuplications(
   data: { key: string } & BranchParameters
-): Promise<{ duplications: T.Duplication[]; files: T.Dict<T.DuplicatedFile> }> {
+): Promise<{ duplications: Duplication[]; files: Dict<DuplicatedFile> }> {
   return getJSON('/api/duplications/show', data).catch(throwGlobalError);
 }
 
index 47f94bf9fd48f37e527a68521b428836b10dfec4..b9260e3e903a9206624a5fcadca16f51a0ffed67 100644 (file)
@@ -21,6 +21,7 @@ import throwGlobalError from '../app/utils/throwGlobalError';
 import getCoverageStatus from '../components/SourceViewer/helpers/getCoverageStatus';
 import { getJSON, post, postJSON, RequestData } from '../helpers/request';
 import { IssueResponse, RawIssuesResponse } from '../types/issues';
+import { Dict, FacetValue, IssueChangelog, SnippetsByComponent, SourceLine } from '../types/types';
 
 type FacetName =
   | 'assigned_to_me'
@@ -50,7 +51,7 @@ export function getFacets(
   query: RequestData,
   facets: FacetName[]
 ): Promise<{
-  facets: Array<{ property: string; values: T.FacetValue[] }>;
+  facets: Array<{ property: string; values: FacetValue[] }>;
   response: RawIssuesResponse;
 }> {
   const data = {
@@ -85,7 +86,7 @@ export function searchIssueTags(data: {
     .catch(throwGlobalError);
 }
 
-export function getIssueChangelog(issue: string): Promise<{ changelog: T.IssueChangelog[] }> {
+export function getIssueChangelog(issue: string): Promise<{ changelog: IssueChangelog[] }> {
   return getJSON('/api/issues/changelog', { issue }).catch(throwGlobalError);
 }
 
@@ -143,12 +144,12 @@ export function searchIssueAuthors(data: {
   return getJSON('/api/issues/authors', data).then(r => r.authors, throwGlobalError);
 }
 
-export function getIssueFlowSnippets(issueKey: string): Promise<T.Dict<T.SnippetsByComponent>> {
+export function getIssueFlowSnippets(issueKey: string): Promise<Dict<SnippetsByComponent>> {
   return getJSON('/api/sources/issue_snippets', { issueKey }).then(result => {
     Object.keys(result).forEach(k => {
       if (result[k].sources) {
         result[k].sources = result[k].sources.reduce(
-          (lineMap: T.Dict<T.SourceLine>, line: T.SourceLine) => {
+          (lineMap: Dict<SourceLine>, line: SourceLine) => {
             line.coverageStatus = getCoverageStatus(line);
             lineMap[line.line] = line;
             return lineMap;
index 603acf899ca9175802b77123ad2bca80b4f3c67d..a0d2c0d8bd97def1b69031eac89b9ae78dda943c 100644 (file)
@@ -19,7 +19,8 @@
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON } from '../helpers/request';
+import { Language } from '../types/types';
 
-export function getLanguages(): Promise<T.Language[]> {
+export function getLanguages(): Promise<Language[]> {
   return getJSON('/api/languages/list').then(r => r.languages, throwGlobalError);
 }
index 482af37a61be20bf3bf7d4d86a11c18b704bee7c..4930375e55498558ed802679d4606ec69018cdb3 100644 (file)
@@ -25,12 +25,13 @@ import {
   MeasuresAndMetaWithPeriod,
   MeasuresForProjects
 } from '../types/measures';
+import { Measure } from '../types/types';
 
 const COMPONENT_URL = '/api/measures/component';
 
 export function getMeasures(
   data: { component: string; metricKeys: string } & BranchParameters
-): Promise<T.Measure[]> {
+): Promise<Measure[]> {
   return getJSON(COMPONENT_URL, data).then(r => r.component.measures, throwGlobalError);
 }
 
index b6230b51b7eb22e1439cfe2066129e39ce7d1e8f..342c4df20bf0a58c148e9832f371c09897c1dc21 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON } from '../helpers/request';
+import { Metric } from '../types/types';
 
 export interface MetricsResponse {
-  metrics: T.Metric[];
+  metrics: Metric[];
   p: number;
   ps: number;
   total: number;
@@ -39,13 +40,13 @@ export function getAllMetrics(data?: {
   isCustom?: boolean;
   p?: number;
   ps?: number;
-}): Promise<T.Metric[]> {
+}): Promise<Metric[]> {
   return inner(data);
 
   function inner(
     data: { p?: number; ps?: number } = { ps: 500 },
     prev?: MetricsResponse
-  ): Promise<T.Metric[]> {
+  ): Promise<Metric[]> {
     return getMetrics(data).then(r => {
       const result = prev ? prev.metrics.concat(r.metrics) : r.metrics;
       if (r.p * r.ps >= r.total) {
index 8b89c9f4f8918e56279de5cb8e0e9b49e8162622..df8599f8c45450843b48e8624dabaeef2f82f8f8 100644 (file)
@@ -20,8 +20,9 @@
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON } from '../helpers/request';
 import { BranchParameters } from '../types/branch-like';
+import { Component } from '../types/types';
 
-type NavComponent = T.Omit<T.Component, 'alm' | 'qualifier' | 'leakPeriodDate' | 'path' | 'tags'>;
+type NavComponent = Omit<Component, 'alm' | 'qualifier' | 'leakPeriodDate' | 'path' | 'tags'>;
 
 export function getComponentNavigation(
   data: { component: string } & BranchParameters
index 60048a6fe0beed4d71c9fec503af22c6143567b4..e3962b39e2d953e658159ab9083a7f42e4964c62 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post } from '../helpers/request';
+import { NewCodePeriod, NewCodePeriodBranch, NewCodePeriodSettingType } from '../types/types';
 
 export function getNewCodePeriod(data?: {
   project?: string;
   branch?: string;
-}): Promise<T.Omit<T.NewCodePeriod, 'effectiveValue'>> {
+}): Promise<Omit<NewCodePeriod, 'effectiveValue'>> {
   return getJSON('/api/new_code_periods/show', data).catch(throwGlobalError);
 }
 
 export function setNewCodePeriod(data: {
   project?: string;
   branch?: string;
-  type: T.NewCodePeriodSettingType;
+  type: NewCodePeriodSettingType;
   value?: string;
 }): Promise<void> {
   return post('/api/new_code_periods/set', data).catch(throwGlobalError);
@@ -42,6 +43,6 @@ export function resetNewCodePeriod(data: { project?: string; branch?: string }):
 
 export function listBranchesNewCodePeriod(data: {
   project: string;
-}): Promise<{ newCodePeriods: T.NewCodePeriodBranch[] }> {
+}): Promise<{ newCodePeriods: NewCodePeriodBranch[] }> {
   return getJSON('/api/new_code_periods/list', data).catch(throwGlobalError);
 }
index f6c3111c6a28a3778723f16b0a952ca76cdbabfa..2dfd9f7a6855186bfbf16aade9fbffdb980bbf39 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post } from '../helpers/request';
+import { Notification } from '../types/types';
 
 export function getNotifications(): Promise<{
   channels: string[];
   globalTypes: string[];
-  notifications: T.Notification[];
+  notifications: Notification[];
   perProjectTypes: string[];
 }> {
   return getJSON('/api/notifications/list').catch(throwGlobalError);
index f2a726ee1cc76f292053c424f19b4fdd87d74887..2f1b25ce8cb699dc2c0d082364f02b2ac4e3a409 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON, RequestData } from '../helpers/request';
+import {
+  Paging,
+  PermissionGroup,
+  PermissionTemplate,
+  PermissionUser,
+  Visibility
+} from '../types/types';
 import { BaseSearchProjectsParameters } from './components';
 
 const PAGE_SIZE = 100;
@@ -56,7 +63,7 @@ export function revokePermissionFromGroup(data: {
 }
 
 interface GetPermissionTemplatesResponse {
-  permissionTemplates: T.PermissionTemplate[];
+  permissionTemplates: PermissionTemplate[];
   defaultTemplates: Array<{ templateId: string; qualifier: string }>;
   permissions: Array<{ key: string; name: string; description: string }>;
 }
@@ -134,7 +141,7 @@ export function getPermissionsUsersForComponent(data: {
   permission?: string;
   p?: number;
   ps?: number;
-}): Promise<{ paging: T.Paging; users: T.PermissionUser[] }> {
+}): Promise<{ paging: Paging; users: PermissionUser[] }> {
   if (!data.ps) {
     data.ps = PAGE_SIZE;
   }
@@ -147,7 +154,7 @@ export function getPermissionsGroupsForComponent(data: {
   permission?: string;
   p?: number;
   ps?: number;
-}): Promise<{ paging: T.Paging; groups: T.PermissionGroup[] }> {
+}): Promise<{ paging: Paging; groups: PermissionGroup[] }> {
   if (!data.ps) {
     data.ps = PAGE_SIZE;
   }
@@ -159,7 +166,7 @@ export function getGlobalPermissionsUsers(data: {
   permission?: string;
   p?: number;
   ps?: number;
-}): Promise<{ paging: T.Paging; users: T.PermissionUser[] }> {
+}): Promise<{ paging: Paging; users: PermissionUser[] }> {
   if (!data.ps) {
     data.ps = PAGE_SIZE;
   }
@@ -171,7 +178,7 @@ export function getGlobalPermissionsGroups(data: {
   permission?: string;
   p?: number;
   ps?: number;
-}): Promise<{ paging: T.Paging; groups: T.PermissionGroup[] }> {
+}): Promise<{ paging: Paging; groups: PermissionGroup[] }> {
   if (!data.ps) {
     data.ps = PAGE_SIZE;
   }
@@ -210,13 +217,13 @@ export function getPermissionTemplateGroups(
 
 export function changeProjectVisibility(
   project: string,
-  visibility: T.Visibility
+  visibility: Visibility
 ): Promise<void | Response> {
   return post('/api/projects/update_visibility', { project, visibility }).catch(throwGlobalError);
 }
 
 export function changeProjectDefaultVisibility(
-  projectVisibility: T.Visibility
+  projectVisibility: Visibility
 ): Promise<void | Response> {
   return post('/api/projects/update_default_visibility', { projectVisibility }).catch(
     throwGlobalError
index 4d12622b743ab2cd0195414f17497e8540033c5d..e43a6a9562251391ec9b57943714cd820cf62b76 100644 (file)
@@ -20,6 +20,7 @@
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON, RequestData } from '../helpers/request';
 import { BranchParameters } from '../types/branch-like';
+import { Analysis, Paging } from '../types/types';
 
 export function getProjectActivity(
   data: {
@@ -29,7 +30,7 @@ export function getProjectActivity(
     p?: number;
     ps?: number;
   } & BranchParameters
-): Promise<{ analyses: T.Analysis[]; paging: T.Paging }> {
+): Promise<{ analyses: Analysis[]; paging: Paging }> {
   return getJSON('/api/project_analyses/search', data).catch(throwGlobalError);
 }
 
index a77b313f1447dd731a57ce219b38a5bf20be029e..f1273863c87c33845d2d8c8f6fee397cf42a6f28 100644 (file)
@@ -19,8 +19,9 @@
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON } from '../helpers/request';
+import { ProjectLink } from '../types/types';
 
-export function getProjectLinks(projectKey: string): Promise<T.ProjectLink[]> {
+export function getProjectLinks(projectKey: string): Promise<ProjectLink[]> {
   return getJSON('/api/project_links/search', { projectKey }).then(r => r.links, throwGlobalError);
 }
 
@@ -32,6 +33,6 @@ export function createLink(data: {
   name: string;
   projectKey: string;
   url: string;
-}): Promise<T.ProjectLink> {
+}): Promise<ProjectLink> {
   return postJSON('/api/project_links/create', data).then(r => r.link, throwGlobalError);
 }
index 1c86cc84767fb8e3b70e2862a668ccd59c647a9a..19dda5b43223f020c5c3bd60daeba80241240fe6 100644 (file)
@@ -28,19 +28,20 @@ import {
   QualityGateProjectStatus,
   SearchPermissionsParameters
 } from '../types/quality-gates';
+import { Condition, Paging, QualityGate, UserBase } from '../types/types';
 
 export function fetchQualityGates(): Promise<{
   actions: { create: boolean };
-  qualitygates: T.QualityGate[];
+  qualitygates: QualityGate[];
 }> {
   return getJSON('/api/qualitygates/list').catch(throwGlobalError);
 }
 
-export function fetchQualityGate(data: { id: number | string }): Promise<T.QualityGate> {
+export function fetchQualityGate(data: { id: number | string }): Promise<QualityGate> {
   return getJSON('/api/qualitygates/show', data).catch(throwGlobalError);
 }
 
-export function createQualityGate(data: { name: string }): Promise<T.QualityGate> {
+export function createQualityGate(data: { name: string }): Promise<QualityGate> {
   return postJSON('/api/qualitygates/create', data).catch(throwGlobalError);
 }
 
@@ -52,7 +53,7 @@ export function renameQualityGate(data: { id: string; name: string }): Promise<v
   return post('/api/qualitygates/rename', data).catch(throwGlobalError);
 }
 
-export function copyQualityGate(data: { id: string; name: string }): Promise<T.QualityGate> {
+export function copyQualityGate(data: { id: string; name: string }): Promise<QualityGate> {
   return postJSON('/api/qualitygates/copy', data).catch(throwGlobalError);
 }
 
@@ -63,12 +64,12 @@ export function setQualityGateAsDefault(data: { id: string }): Promise<void | Re
 export function createCondition(
   data: {
     gateId: string;
-  } & T.Omit<T.Condition, 'id'>
-): Promise<T.Condition> {
+  } & Omit<Condition, 'id'>
+): Promise<Condition> {
   return postJSON('/api/qualitygates/create_condition', data).catch(throwGlobalError);
 }
 
-export function updateCondition(data: T.Condition): Promise<T.Condition> {
+export function updateCondition(data: Condition): Promise<Condition> {
   return postJSON('/api/qualitygates/update_condition', data).catch(throwGlobalError);
 }
 
@@ -76,7 +77,7 @@ export function deleteCondition(data: { id: number }): Promise<void> {
   return post('/api/qualitygates/delete_condition', data);
 }
 
-export function getGateForProject(data: { project: string }): Promise<T.QualityGate | undefined> {
+export function getGateForProject(data: { project: string }): Promise<QualityGate | undefined> {
   return getJSON('/api/qualitygates/get_by_project', data).then(
     ({ qualityGate }) =>
       qualityGate && {
@@ -94,7 +95,7 @@ export function searchProjects(data: {
   query?: string;
   selected?: string;
 }): Promise<{
-  paging: T.Paging;
+  paging: Paging;
   results: Array<{ key: string; name: string; selected: boolean }>;
 }> {
   return getJSON('/api/qualitygates/search', data).catch(throwGlobalError);
@@ -140,7 +141,7 @@ export function removeUser(data: AddDeleteUserPermissionsParameters) {
   return post('/api/qualitygates/remove_user', data).catch(throwGlobalError);
 }
 
-export function searchUsers(data: SearchPermissionsParameters): Promise<{ users: T.UserBase[] }> {
+export function searchUsers(data: SearchPermissionsParameters): Promise<{ users: UserBase[] }> {
   return getJSON('/api/qualitygates/search_users', data).catch(throwGlobalError);
 }
 
index 551eb65e5c6fc7967b4f05139e3f4bc44124589f..8b96a4eef77efb5c10f6385791727b867f636e5b 100644 (file)
@@ -22,6 +22,7 @@ import throwGlobalError from '../app/utils/throwGlobalError';
 import { Exporter, ProfileChangelogEvent } from '../apps/quality-profiles/types';
 import { csvEscape } from '../helpers/csv';
 import { getJSON, post, postJSON, RequestData } from '../helpers/request';
+import { Dict, Paging, ProfileInheritanceDetails, UserSelected } from '../types/types';
 
 export interface ProfileActions {
   associateProjects?: boolean;
@@ -98,7 +99,7 @@ export interface ProfileProject {
 
 export function getProfileProjects(
   data: RequestData
-): Promise<{ more: boolean; paging: T.Paging; results: ProfileProject[] }> {
+): Promise<{ more: boolean; paging: Paging; results: ProfileProject[] }> {
   return getJSON('/api/qualityprofiles/projects', data).catch(throwGlobalError);
 }
 
@@ -106,9 +107,9 @@ export function getProfileInheritance({
   language,
   name: qualityProfile
 }: Profile): Promise<{
-  ancestors: T.ProfileInheritanceDetails[];
-  children: T.ProfileInheritanceDetails[];
-  profile: T.ProfileInheritanceDetails;
+  ancestors: ProfileInheritanceDetails[];
+  children: ProfileInheritanceDetails[];
+  profile: ProfileInheritanceDetails;
 }> {
   return getJSON('/api/qualityprofiles/inheritance', {
     language,
@@ -201,8 +202,8 @@ export interface CompareResponse {
   modified: Array<{
     key: string;
     name: string;
-    left: { params: T.Dict<string>; severity: string };
-    right: { params: T.Dict<string>; severity: string };
+    left: { params: Dict<string>; severity: string };
+    right: { params: Dict<string>; severity: string };
   }>;
 }
 
@@ -234,8 +235,8 @@ export interface SearchUsersGroupsParameters {
 }
 
 interface SearchUsersResponse {
-  users: T.UserSelected[];
-  paging: T.Paging;
+  users: UserSelected[];
+  paging: Paging;
 }
 
 export function searchUsers(parameters: SearchUsersGroupsParameters): Promise<SearchUsersResponse> {
@@ -244,7 +245,7 @@ export function searchUsers(parameters: SearchUsersGroupsParameters): Promise<Se
 
 export interface SearchGroupsResponse {
   groups: Array<{ name: string }>;
-  paging: T.Paging;
+  paging: Paging;
 }
 
 export function searchGroups(
@@ -314,7 +315,7 @@ export function bulkDeactivateRules(data: BulkActivateParameters) {
 
 export function activateRule(data: {
   key: string;
-  params?: T.Dict<string>;
+  params?: Dict<string>;
   reset?: boolean;
   rule: string;
   severity?: string;
index cf22ee7fbcb687dd240974710fe56916bf5b6496..1fae18f0649b3dd89b979bac7d7c1874d355481f 100644 (file)
@@ -20,6 +20,7 @@
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON } from '../helpers/request';
 import { GetRulesAppResponse, SearchRulesResponse } from '../types/coding-rules';
+import { RuleActivation, RuleDetails } from '../types/types';
 
 export function getRulesApp(): Promise<GetRulesAppResponse> {
   return getJSON('/api/rules/app').catch(throwGlobalError);
@@ -73,7 +74,7 @@ export function getRuleRepositories(parameters: {
 export function getRuleDetails(parameters: {
   actives?: boolean;
   key: string;
-}): Promise<{ actives?: T.RuleActivation[]; rule: T.RuleDetails }> {
+}): Promise<{ actives?: RuleActivation[]; rule: RuleDetails }> {
   return getJSON('/api/rules/show', parameters).catch(throwGlobalError);
 }
 
@@ -91,7 +92,7 @@ export function createRule(data: {
   status?: string;
   template_key: string;
   type?: string;
-}): Promise<T.RuleDetails> {
+}): Promise<RuleDetails> {
   return postJSON('/api/rules/create', data).then(
     r => r.rule,
     response => {
@@ -122,6 +123,6 @@ export function updateRule(data: {
   severity?: string;
   status?: string;
   tags?: string;
-}): Promise<T.RuleDetails> {
+}): Promise<RuleDetails> {
   return postJSON('/api/rules/update', data).then(r => r.rule, throwGlobalError);
 }
index ed6094e24f090287e2b5f7f4a1b494860ad24186..71ccfa9d1c87b50a7802e9472d18c23d7026a186 100644 (file)
@@ -29,6 +29,7 @@ import {
   HotspotSetStatusRequest,
   HotspotStatus
 } from '../types/security-hotspots';
+import { UserBase } from '../types/types';
 
 const HOTSPOTS_SEARCH_URL = '/api/hotspots/search';
 
@@ -94,7 +95,7 @@ export function getSecurityHotspotList(
 
 export function getSecurityHotspotDetails(securityHotspotKey: string): Promise<Hotspot> {
   return getJSON('/api/hotspots/show', { hotspot: securityHotspotKey })
-    .then((response: Hotspot & { users: T.UserBase[] }) => {
+    .then((response: Hotspot & { users: UserBase[] }) => {
       const { users, ...hotspot } = response;
 
       if (users) {
index 7a613374ec34f95450e2d622a113f3cc81ab9924..28856dfe6517789f6097395600a42bb8c6d59de5 100644 (file)
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON, requestTryAndRepeatUntil } from '../helpers/request';
 import { SystemUpgrade } from '../types/system';
+import { SysInfoCluster, SysInfoStandalone, SysStatus } from '../types/types';
 
 export function setLogLevel(level: string): Promise<void | Response> {
   return post('/api/system/change_log_level', { level }).catch(throwGlobalError);
 }
 
-export function getSystemInfo(): Promise<T.SysInfoCluster | T.SysInfoStandalone> {
+export function getSystemInfo(): Promise<SysInfoCluster | SysInfoStandalone> {
   return getJSON('/api/system/info').catch(throwGlobalError);
 }
 
-export function getSystemStatus(): Promise<{ id: string; version: string; status: T.SysStatus }> {
+export function getSystemStatus(): Promise<{ id: string; version: string; status: SysStatus }> {
   return getJSON('/api/system/status');
 }
 
@@ -64,7 +65,7 @@ export function restart(): Promise<void | Response> {
 export function waitSystemUPStatus(): Promise<{
   id: string;
   version: string;
-  status: T.SysStatus;
+  status: SysStatus;
 }> {
   return requestTryAndRepeatUntil(
     getSystemStatus,
index 5ea6da6053f1f41487a82cb96df970c1f24ca63a..25d327b665d2877dd243bc8c5b4467d389497949 100644 (file)
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON } from '../helpers/request';
 import { BranchParameters } from '../types/branch-like';
+import { Paging } from '../types/types';
 
 interface TimeMachineResponse {
   measures: {
     metric: string;
     history: Array<{ date: string; value?: string }>;
   }[];
-  paging: T.Paging;
+  paging: Paging;
 }
 
 export function getTimeMachineData(
index da711f559146e24785cae158c87828273a23feae..a0cac21841c409a0e2164377cce1f0c9c157f480 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON } from '../helpers/request';
+import { NewUserToken, UserToken } from '../types/types';
 
 /** List tokens for given user login */
-export function getTokens(login: string): Promise<T.UserToken[]> {
+export function getTokens(login: string): Promise<UserToken[]> {
   return getJSON('/api/user_tokens/search', { login }).then(r => r.userTokens, throwGlobalError);
 }
 
-export function generateToken(data: { name: string; login?: string }): Promise<T.NewUserToken> {
+export function generateToken(data: { name: string; login?: string }): Promise<NewUserToken> {
   return postJSON('/api/user_tokens/generate', data).catch(throwGlobalError);
 }
 
index bbb8e95a5f808c308e7dbd44350dbbb64ff5e462..09ba9bad0231ff8c367bedbcb9d1348cd4c4ff28 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON } from '../helpers/request';
+import { Group, Paging, UserSelected } from '../types/types';
 
 export function searchUsersGroups(data: {
   f?: string;
   p?: number;
   ps?: number;
   q?: string;
-}): Promise<{ groups: T.Group[]; paging: T.Paging }> {
+}): Promise<{ groups: Group[]; paging: Paging }> {
   return getJSON('/api/user_groups/search', data).catch(throwGlobalError);
 }
 
@@ -36,7 +37,7 @@ export function getUsersInGroup(data: {
   ps?: number;
   q?: string;
   selected?: string;
-}): Promise<T.Paging & { users: T.UserSelected[] }> {
+}): Promise<Paging & { users: UserSelected[] }> {
   return getJSON('/api/user_groups/users', data).catch(throwGlobalError);
 }
 
@@ -48,7 +49,7 @@ export function removeUserFromGroup(data: { id?: string; name?: string; login?:
   return post('/api/user_groups/remove_user', data).catch(throwGlobalError);
 }
 
-export function createGroup(data: { description?: string; name: string }): Promise<T.Group> {
+export function createGroup(data: { description?: string; name: string }): Promise<Group> {
   return postJSON('/api/user_groups/create', data).then(r => r.group, throwGlobalError);
 }
 
index 73cee845733a9ba5c69852b9f53db632ea4eb07b..575e72c986af1c5e9244a28f446dec57531beabe 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON } from '../helpers/request';
+import {
+  CurrentUser,
+  CurrentUserSetting,
+  HomePage,
+  IdentityProvider,
+  Paging,
+  User
+} from '../types/types';
 
-export function getCurrentUser(): Promise<T.CurrentUser> {
+export function getCurrentUser(): Promise<CurrentUser> {
   return getJSON('/api/users/current');
 }
 
@@ -46,11 +54,11 @@ export function getUserGroups(data: {
   ps?: number;
   q?: string;
   selected?: string;
-}): Promise<{ paging: T.Paging; groups: UserGroup[] }> {
+}): Promise<{ paging: Paging; groups: UserGroup[] }> {
   return getJSON('/api/users/groups', data);
 }
 
-export function getIdentityProviders(): Promise<{ identityProviders: T.IdentityProvider[] }> {
+export function getIdentityProviders(): Promise<{ identityProviders: IdentityProvider[] }> {
   return getJSON('/api/users/identity_providers').catch(throwGlobalError);
 }
 
@@ -58,7 +66,7 @@ export function searchUsers(data: {
   p?: number;
   ps?: number;
   q?: string;
-}): Promise<{ paging: T.Paging; users: T.User[] }> {
+}): Promise<{ paging: Paging; users: User[] }> {
   data.q = data.q || undefined;
   return getJSON('/api/users/search', data).catch(throwGlobalError);
 }
@@ -79,22 +87,22 @@ export function updateUser(data: {
   login: string;
   name?: string;
   scmAccount: string[];
-}): Promise<T.User> {
+}): Promise<User> {
   return postJSON('/api/users/update', {
     ...data,
     scmAccount: data.scmAccount.length > 0 ? data.scmAccount : ''
   });
 }
 
-export function deactivateUser(data: { login: string }): Promise<T.User> {
+export function deactivateUser(data: { login: string }): Promise<User> {
   return postJSON('/api/users/deactivate', data).catch(throwGlobalError);
 }
 
-export function setHomePage(homepage: T.HomePage): Promise<void | Response> {
+export function setHomePage(homepage: HomePage): Promise<void | Response> {
   return post('/api/users/set_homepage', homepage).catch(throwGlobalError);
 }
 
-export function setUserSetting(setting: T.CurrentUserSetting): Promise<void | Response> {
+export function setUserSetting(setting: CurrentUserSetting): Promise<void | Response> {
   return post('/api/users/set_setting', setting).catch(throwGlobalError);
 }
 
index c5bd4d8a535458b20d645f1ad2fcc268f66a6edc..7ea902083be3e1d861f1d654583a4641422a4d42 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON } from '../helpers/request';
+import { WebApi } from '../types/types';
 
 interface RawDomain {
-  actions: T.WebApi.Action[];
+  actions: WebApi.Action[];
   deprecatedSince?: string;
   description: string;
   internal: boolean;
@@ -35,7 +36,7 @@ export function fetchWebApi(showInternal = true): Promise<RawDomain[]> {
     .catch(throwGlobalError);
 }
 
-export function fetchResponseExample(domain: string, action: string): Promise<T.WebApi.Example> {
+export function fetchResponseExample(domain: string, action: string): Promise<WebApi.Example> {
   return getJSON('/api/webservices/response_example', { controller: domain, action }).catch(
     throwGlobalError
   );
index 0cb8b283a773abb4287b0376203df699cd4000ea..2da2c594edb9ed39584ff4a125f405507c4d47cf 100644 (file)
  */
 import throwGlobalError from '../app/utils/throwGlobalError';
 import { getJSON, post, postJSON } from '../helpers/request';
+import { Paging, Webhook, WebhookDelivery } from '../types/types';
 
 export function createWebhook(data: {
   name: string;
   project?: string;
   secret?: string;
   url: string;
-}): Promise<{ webhook: T.Webhook }> {
+}): Promise<{ webhook: Webhook }> {
   return postJSON('/api/webhooks/create', data).catch(throwGlobalError);
 }
 
@@ -33,7 +34,7 @@ export function deleteWebhook(data: { webhook: string }): Promise<void | Respons
   return post('/api/webhooks/delete', data).catch(throwGlobalError);
 }
 
-export function searchWebhooks(data: { project?: string }): Promise<{ webhooks: T.Webhook[] }> {
+export function searchWebhooks(data: { project?: string }): Promise<{ webhooks: Webhook[] }> {
   return getJSON('/api/webhooks/list', data).catch(throwGlobalError);
 }
 
@@ -53,14 +54,14 @@ export function searchDeliveries(data: {
   p?: number;
   ps?: number;
 }): Promise<{
-  deliveries: T.WebhookDelivery[];
-  paging: T.Paging;
+  deliveries: WebhookDelivery[];
+  paging: Paging;
 }> {
   return getJSON('/api/webhooks/deliveries', data).catch(throwGlobalError);
 }
 
 export function getDelivery(data: {
   deliveryId: string;
-}): Promise<{ delivery: T.WebhookDelivery & { payload: string } }> {
+}): Promise<{ delivery: WebhookDelivery & { payload: string } }> {
   return getJSON('/api/webhooks/delivery', data).catch(throwGlobalError);
 }
index 655061e58ec4f3307ae1863832876f62772df90d..d46f69d7701b8493a9437e8efb525612196b4059 100644 (file)
@@ -28,18 +28,19 @@ import { translate } from '../../helpers/l10n';
 import { setAdminPages } from '../../store/appState';
 import { getAppState, Store } from '../../store/rootReducer';
 import { PendingPluginResult } from '../../types/plugins';
+import { AppState, Extension, SysStatus } from '../../types/types';
 import AdminContext, { defaultPendingPlugins, defaultSystemStatus } from './AdminContext';
 import SettingsNav from './nav/settings/SettingsNav';
 
 interface Props {
-  appState: Pick<T.AppState, 'adminPages' | 'canAdmin'>;
+  appState: Pick<AppState, 'adminPages' | 'canAdmin'>;
   location: {};
-  setAdminPages: (adminPages: T.Extension[]) => void;
+  setAdminPages: (adminPages: Extension[]) => void;
 }
 
 interface State {
   pendingPlugins: PendingPluginResult;
-  systemStatus: T.SysStatus;
+  systemStatus: SysStatus;
 }
 
 export class AdminContainer extends React.PureComponent<Props, State> {
index 20efcc7a98e5c093c51fcd84b22fd177ec58639c..d0d4b32edcae45a7e2be78d7feefa4163a0d8110 100644 (file)
  */
 import * as React from 'react';
 import { PendingPluginResult } from '../../types/plugins';
+import { SysStatus } from '../../types/types';
 
 export interface AdminContextInterface {
   fetchSystemStatus: () => void;
   fetchPendingPlugins: () => void;
   pendingPlugins: PendingPluginResult;
-  systemStatus: T.SysStatus;
+  systemStatus: SysStatus;
 }
 
 export const defaultPendingPlugins = { installing: [], removing: [], updating: [] };
index ddf887c160e97e37472dd2e92917ec29df739c87..8a156351d98979f37f94f10a12f2a7d3b1017cdc 100644 (file)
@@ -43,16 +43,17 @@ import {
 import { BranchLike } from '../../types/branch-like';
 import { ComponentQualifier, isPortfolioLike } from '../../types/component';
 import { Task, TaskStatuses, TaskTypes, TaskWarning } from '../../types/tasks';
+import { AppState, Component, Status } from '../../types/types';
 import ComponentContainerNotFound from './ComponentContainerNotFound';
 import { ComponentContext } from './ComponentContext';
 import PageUnavailableDueToIndexation from './indexation/PageUnavailableDueToIndexation';
 import ComponentNav from './nav/component/ComponentNav';
 
 interface Props {
-  appState: Pick<T.AppState, 'branchesEnabled'>;
+  appState: Pick<AppState, 'branchesEnabled'>;
   children: React.ReactElement;
   location: Pick<Location, 'query' | 'pathname'>;
-  registerBranchStatus: (branchLike: BranchLike, component: string, status: T.Status) => void;
+  registerBranchStatus: (branchLike: BranchLike, component: string, status: Status) => void;
   requireAuthorization: (router: Pick<Router, 'replace'>) => void;
   router: Pick<Router, 'replace'>;
 }
@@ -60,7 +61,7 @@ interface Props {
 interface State {
   branchLike?: BranchLike;
   branchLikes: BranchLike[];
-  component?: T.Component;
+  component?: Component;
   currentTask?: Task;
   isPending: boolean;
   loading: boolean;
@@ -153,7 +154,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     }
   };
 
-  fetchBranches = async (componentWithQualifier: T.Component) => {
+  fetchBranches = async (componentWithQualifier: Component) => {
     const breadcrumb = componentWithQualifier.breadcrumbs.find(({ qualifier }) => {
       return ([ComponentQualifier.Application, ComponentQualifier.Project] as string[]).includes(
         qualifier
@@ -228,7 +229,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     );
   };
 
-  fetchWarnings = (component: T.Component, branchLike?: BranchLike) => {
+  fetchWarnings = (component: Component, branchLike?: BranchLike) => {
     if (component.qualifier === ComponentQualifier.Project) {
       getAnalysisStatus({
         component: component.key,
@@ -242,7 +243,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     }
   };
 
-  fetchProjectBindingErrors = async (component: T.Component) => {
+  fetchProjectBindingErrors = async (component: Component) => {
     if (
       component.qualifier === ComponentQualifier.Project &&
       component.analysisDate === undefined &&
@@ -257,7 +258,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     }
   };
 
-  addQualifier = (component: T.Component) => ({
+  addQualifier = (component: Component) => ({
     ...component,
     qualifier: component.breadcrumbs[component.breadcrumbs.length - 1].qualifier
   });
@@ -298,7 +299,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     newTasksInProgress: Task[],
     currentTask: Task | undefined,
     newCurrentTask: Task | undefined,
-    component: T.Component | undefined
+    component: Component | undefined
   ) => {
     const progressHasChanged = Boolean(
       tasksInProgress &&
@@ -329,7 +330,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
 
   needsAnotherCheck = (
     shouldFetchComponent: boolean,
-    component: T.Component | undefined,
+    component: Component | undefined,
     newTasksInProgress: Task[]
   ) => {
     return (
@@ -354,7 +355,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     return !task.branch && !task.pullRequest;
   };
 
-  registerBranchStatuses = (branchLikes: BranchLike[], component: T.Component) => {
+  registerBranchStatuses = (branchLikes: BranchLike[], component: Component) => {
     branchLikes.forEach(branchLike => {
       if (branchLike.status) {
         this.props.registerBranchStatus(
@@ -366,11 +367,11 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     });
   };
 
-  handleComponentChange = (changes: Partial<T.Component>) => {
+  handleComponentChange = (changes: Partial<Component>) => {
     if (this.mounted) {
       this.setState(state => {
         if (state.component) {
-          const newComponent: T.Component = { ...state.component, ...changes };
+          const newComponent: Component = { ...state.component, ...changes };
           return { component: newComponent };
         }
         return null;
index 6c04fc4714927759cb8fa8f4193c98a7f765e144..d4f76af1aefb061315a8afc95db36e0db03b241c 100644 (file)
  */
 import * as React from 'react';
 import { BranchLike } from '../../types/branch-like';
+import { Component } from '../../types/types';
 
 interface ComponentContextType {
   branchLike: BranchLike | undefined;
-  component: T.Component | undefined;
+  component: Component | undefined;
 }
 
 export const ComponentContext = React.createContext<ComponentContextType>({
index cf30a1dc2a28460dbd4b0c88b46d63f2c84c6ddb..e83e6db014e85e7a8430b32ff535cde28c09e728 100644 (file)
@@ -22,9 +22,10 @@ import { withCurrentUser } from '../../components/hoc/withCurrentUser';
 import { Router, withRouter } from '../../components/hoc/withRouter';
 import { getHomePageUrl } from '../../helpers/urls';
 import { isLoggedIn } from '../../helpers/users';
+import { CurrentUser } from '../../types/types';
 
 export interface LandingProps {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   router: Router;
 }
 
index 52ba2178c463bc4416591e1307f21caf1061ce9f..0b43a747dc9a708bf7267052e9e77530c7ad0ddc 100644 (file)
@@ -22,12 +22,13 @@ import { Alert } from '../../components/ui/Alert';
 import { translate } from '../../helpers/l10n';
 import { BranchLike } from '../../types/branch-like';
 import { isApplication } from '../../types/component';
+import { Component } from '../../types/types';
 
 export interface NonAdminPagesContainerProps {
   children: JSX.Element;
   branchLike?: BranchLike;
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   isInProgress?: boolean;
   isPending?: boolean;
   onBranchesChange: () => void;
index fa61f086bbe38c8b964ddecf7bc67e1db65669cc..e13a73c357bc84a47a75c021107a97ce6fbbbf7b 100644 (file)
@@ -27,11 +27,12 @@ import { hasGlobalPermission } from '../../helpers/users';
 import { Permissions } from '../../types/permissions';
 import { RiskConsent } from '../../types/plugins';
 import { SettingsKey } from '../../types/settings';
+import { LoggedInUser } from '../../types/types';
 import GlobalMessagesContainer from './GlobalMessagesContainer';
 import './PluginRiskConsent.css';
 
 export interface PluginRiskConsentProps {
-  currentUser: T.LoggedInUser;
+  currentUser: LoggedInUser;
   router: Router;
 }
 
index 4f5256a68c19fc18cd80f53dac326bac27b05809..0f0f62a7cc35fdbd97430710c50285d82ad985aa 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { BranchLike } from '../../types/branch-like';
+import { Component } from '../../types/types';
 import handleRequiredAuthorization from '../utils/handleRequiredAuthorization';
 import A11ySkipTarget from './a11y/A11ySkipTarget';
 
@@ -26,7 +27,7 @@ interface Props {
   children: JSX.Element;
   branchLike?: BranchLike;
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   isInProgress?: boolean;
   isPending?: boolean;
   onBranchesChange: () => void;
index 2ae0a133426d3a598a5d6fdf6a9c1cbf1f910204..39e92d7bc4dc3a7959cabc2e4f7f29c250ceb4c3 100644 (file)
@@ -22,10 +22,11 @@ import ResetPasswordForm from '../../components/common/ResetPasswordForm';
 import { whenLoggedIn } from '../../components/hoc/whenLoggedIn';
 import { translate } from '../../helpers/l10n';
 import { getBaseUrl } from '../../helpers/system';
+import { LoggedInUser } from '../../types/types';
 import GlobalMessagesContainer from './GlobalMessagesContainer';
 
 export interface ResetPasswordProps {
-  currentUser: T.LoggedInUser;
+  currentUser: LoggedInUser;
 }
 
 export function ResetPassword({ currentUser }: ResetPasswordProps) {
index 30c6dd2189f20f188701b570dbb6b38723f520f9..1a8bfbdb0e751222be0231c65ed6d7b7813d76c9 100644 (file)
@@ -29,6 +29,7 @@ import { get, save } from '../../helpers/storage';
 import { isLoggedIn } from '../../helpers/users';
 import { getAppState, getCurrentUser, Store } from '../../store/rootReducer';
 import { EditionKey } from '../../types/editions';
+import { CurrentUser } from '../../types/types';
 
 const LicensePromptModal = lazyLoadComponent(
   () => import('../../apps/marketplace/components/LicensePromptModal'),
@@ -38,7 +39,7 @@ const LicensePromptModal = lazyLoadComponent(
 interface StateProps {
   canAdmin?: boolean;
   currentEdition?: EditionKey;
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
 interface OwnProps {
index 89dc782256193ff77e65e44ad5ec0a4cd325b40a..b57efcbeeba00c873e7a61dee6e12de33175c761 100644 (file)
@@ -33,6 +33,7 @@ import { waitAndUpdate } from '../../../helpers/testUtils';
 import { AlmKeys } from '../../../types/alm-settings';
 import { ComponentQualifier } from '../../../types/component';
 import { TaskStatuses, TaskTypes } from '../../../types/tasks';
+import { Component } from '../../../types/types';
 import { ComponentContainer } from '../ComponentContainer';
 import PageUnavailableDueToIndexation from '../indexation/PageUnavailableDueToIndexation';
 
@@ -87,7 +88,7 @@ it('changes component', () => {
   const wrapper = shallowRender();
   wrapper.setState({
     branchLikes: [mockMainBranch()],
-    component: { qualifier: 'TRK', visibility: 'public' } as T.Component,
+    component: { qualifier: 'TRK', visibility: 'public' } as Component,
     loading: false
   });
 
index afb7e647292d4e2fcb3e4d1b30be43603bb76ede..445027a56d04f1261e6809ee3bf1b8e926852411 100644 (file)
@@ -21,6 +21,7 @@
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { mockCurrentUser, mockLoggedInUser, mockRouter } from '../../../helpers/testMocks';
+import { CurrentUser } from '../../../types/types';
 import { Landing } from '../Landing';
 
 it.each([
@@ -30,7 +31,7 @@ it.each([
     mockLoggedInUser({ homepage: { type: 'ISSUES' } }),
     expect.objectContaining({ pathname: '/issues' })
   ]
-])('should render correctly', (currentUser: T.CurrentUser, homepageUrl: string) => {
+])('should render correctly', (currentUser: CurrentUser, homepageUrl: string) => {
   const router = mockRouter();
   shallowRender({ router, currentUser });
   expect(router.replace).toHaveBeenCalledWith(homepageUrl);
index 79d76ac2f1f61ed64639e58fe75a1716671bd0a7..66b38284f94058a6efc9ab0d4eda5429d3f47f98 100644 (file)
@@ -26,6 +26,7 @@ import { hasMessage } from '../../../helpers/l10n';
 import { get, save } from '../../../helpers/storage';
 import { waitAndUpdate } from '../../../helpers/testUtils';
 import { EditionKey } from '../../../types/editions';
+import { LoggedInUser } from '../../../types/types';
 import { StartupModal } from '../StartupModal';
 
 jest.mock('../../../api/marketplace', () => ({
@@ -48,7 +49,7 @@ jest.mock('../../../helpers/dates', () => ({
 
 jest.mock('date-fns', () => ({ differenceInDays: jest.fn().mockReturnValue(1) }));
 
-const LOGGED_IN_USER: T.LoggedInUser = {
+const LOGGED_IN_USER: LoggedInUser = {
   groups: [],
   isLoggedIn: true,
   login: 'luke',
index 7ce06095713fc33960aa72147394987d7f0ae788..fc77dcc865f425dbaea5ea45d4951ebc218f779a 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { createContext } from 'react';
+import { A11ySkipLink } from '../../../types/types';
 
 export interface A11yContextShape {
-  addA11ySkipLink: (link: T.A11ySkipLink) => void;
-  removeA11ySkipLink: (link: T.A11ySkipLink) => void;
-  links: T.A11ySkipLink[];
+  addA11ySkipLink: (link: A11ySkipLink) => void;
+  removeA11ySkipLink: (link: A11ySkipLink) => void;
+  links: A11ySkipLink[];
 }
 
 export const A11yContext = createContext<A11yContextShape>({
index 7cf824997afaab4643cccbbfee15f8f368cdcf7a..94878df365bb3ee4f0d58b591c3bd6ef83b0162f 100644 (file)
  */
 import { sortBy } from 'lodash';
 import * as React from 'react';
+import { A11ySkipLink } from '../../../types/types';
 import { A11yContext } from './A11yContext';
 
 interface State {
-  links: T.A11ySkipLink[];
+  links: A11ySkipLink[];
 }
 
 export default class A11yProvider extends React.Component<{}, State> {
   keys: string[] = [];
   state: State = { links: [] };
 
-  addA11ySkipLink = (link: T.A11ySkipLink) => {
+  addA11ySkipLink = (link: A11ySkipLink) => {
     this.setState(prevState => {
       const links = [...prevState.links];
       links.push({ ...link, weight: link.weight || 0 });
@@ -37,7 +38,7 @@ export default class A11yProvider extends React.Component<{}, State> {
     });
   };
 
-  removeA11ySkipLink = (link: T.A11ySkipLink) => {
+  removeA11ySkipLink = (link: A11ySkipLink) => {
     this.setState(prevState => {
       const links = prevState.links.filter(l => l.key !== link.key);
       return { links };
index 59775b7e133ed61f9afb8116db8d73d8fcc61e09..ba6eed4486663d351bb7000d624444c53689d3cf 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { A11ySkipLink } from '../../../types/types';
 import { A11yContext } from './A11yContext';
 
 interface Props {
@@ -42,8 +43,8 @@ export default function A11ySkipTarget(props: Props) {
 }
 
 interface InnerProps {
-  addA11ySkipLink: (link: T.A11ySkipLink) => void;
-  removeA11ySkipLink: (link: T.A11ySkipLink) => void;
+  addA11ySkipLink: (link: A11ySkipLink) => void;
+  removeA11ySkipLink: (link: A11ySkipLink) => void;
 }
 
 export class A11ySkipTargetInner extends React.PureComponent<Props & InnerProps> {
@@ -55,7 +56,7 @@ export class A11ySkipTargetInner extends React.PureComponent<Props & InnerProps>
     this.props.removeA11ySkipLink(this.getLink());
   }
 
-  getLink = (): T.A11ySkipLink => {
+  getLink = (): A11ySkipLink => {
     const { anchor: key, label = translate('skip_to_content'), weight } = this.props;
     return { key, label, weight };
   };
index d924b95db37f94c3b98387cca6870533bd0325ae..ad28ea1fae7fe42e95a698a93947eb746d55de16 100644 (file)
@@ -22,6 +22,7 @@ import { Link } from 'react-router';
 import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import { translate } from '../../../helpers/l10n';
 import { getBaseUrl } from '../../../helpers/system';
+import { SuggestionLink } from '../../../types/types';
 import { SuggestionsContext } from './SuggestionsContext';
 
 interface Props {
@@ -33,7 +34,7 @@ export default class EmbedDocsPopup extends React.PureComponent<Props> {
     return <li className="menu-header">{text}</li>;
   }
 
-  renderSuggestions = ({ suggestions }: { suggestions: T.SuggestionLink[] }) => {
+  renderSuggestions = ({ suggestions }: { suggestions: SuggestionLink[] }) => {
     if (suggestions.length === 0) {
       return null;
     }
index 10df414861b805f739fdbdab62fda487dcd82e24..1309f651165bb41b97192574a83bccf8689eb611 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { createContext } from 'react';
+import { SuggestionLink } from '../../../types/types';
 
 interface SuggestionsContextShape {
   addSuggestions: (key: string) => void;
   removeSuggestions: (key: string) => void;
-  suggestions: T.SuggestionLink[];
+  suggestions: SuggestionLink[];
 }
 
 export const SuggestionsContext = createContext<SuggestionsContextShape>({
index 969173db085d08b9372e46864aeb797e5239c10d..dee13bfe4d1e0cb78f5692ee26ff23a5e641f829 100644 (file)
 import suggestionsJson from 'Docs/EmbedDocsSuggestions.json';
 import * as React from 'react';
 import { isSonarCloud } from '../../../helpers/system';
+import { Dict, SuggestionLink } from '../../../types/types';
 import { SuggestionsContext } from './SuggestionsContext';
 
-type SuggestionsJson = T.Dict<T.SuggestionLink[]>;
+type SuggestionsJson = Dict<SuggestionLink[]>;
 
 interface State {
-  suggestions: T.SuggestionLink[];
+  suggestions: SuggestionLink[];
 }
 
 export default class SuggestionsProvider extends React.Component<{}, State> {
@@ -34,7 +35,7 @@ export default class SuggestionsProvider extends React.Component<{}, State> {
 
   fetchSuggestions = () => {
     const jsonList = suggestionsJson as SuggestionsJson;
-    let suggestions: T.SuggestionLink[] = [];
+    let suggestions: SuggestionLink[] = [];
     this.keys.forEach(key => {
       if (jsonList[key]) {
         suggestions = [...jsonList[key], ...suggestions];
index 8d4e5dea4eabcdc910301221b08d9cf766bc8efe..8d82d94ba3d7010626d95e8dab46bad290c5aea3 100644 (file)
@@ -28,15 +28,16 @@ import { getBaseUrl } from '../../../helpers/system';
 import { addGlobalErrorMessage } from '../../../store/globalMessages';
 import { getCurrentUser, Store } from '../../../store/rootReducer';
 import { ExtensionStartMethod } from '../../../types/extension';
+import { CurrentUser, Dict, Extension as TypeExtension } from '../../../types/types';
 import * as theme from '../../theme';
 import getStore from '../../utils/getStore';
 
 interface Props extends WrappedComponentProps {
-  currentUser: T.CurrentUser;
-  extension: T.Extension;
+  currentUser: CurrentUser;
+  extension: TypeExtension;
   location: Location;
   onFail: (message: string) => void;
-  options?: T.Dict<any>;
+  options?: Dict<any>;
   router: Router;
 }
 
index 136b8ba03637ccc65d50973723964acc1c7ba78a..0cfce78a66b9c1cbcacb1b8732fe6611cf238f8b 100644 (file)
 import * as React from 'react';
 import { connect } from 'react-redux';
 import { getAppState, Store } from '../../../store/rootReducer';
+import { Extension as TypeExtension } from '../../../types/types';
 import NotFound from '../NotFound';
 import Extension from './Extension';
 
 interface Props {
-  adminPages: T.Extension[] | undefined;
+  adminPages: TypeExtension[] | undefined;
   params: { extensionKey: string; pluginKey: string };
 }
 
index 5f0e1b1aee0cc3e3a6c8cccc1ad00d363bab29f0..6d241c737c26dd71f3406b3d0c223ff13a559f07 100644 (file)
 import * as React from 'react';
 import { connect } from 'react-redux';
 import { getAppState, Store } from '../../../store/rootReducer';
+import { Extension as TypeExtension } from '../../../types/types';
 import NotFound from '../NotFound';
 import Extension from './Extension';
 
 interface Props {
-  globalPages: T.Extension[] | undefined;
+  globalPages: TypeExtension[] | undefined;
   params: { extensionKey: string; pluginKey: string };
 }
 
index 24b95c4f8b5eb7fd0ab83b3d498ddf4b0d0fcf6c..7cb9ebfa62b0b70e4e97943103b0fd9ef38d9083 100644 (file)
 import * as React from 'react';
 import { WithRouterProps } from 'react-router';
 import withIndexationGuard from '../../../components/hoc/withIndexationGuard';
+import { Component } from '../../../types/types';
 import { PageContext } from '../indexation/PageUnavailableDueToIndexation';
 import ProjectPageExtension from './ProjectPageExtension';
 
 export interface PortfolioPageProps extends WithRouterProps {
-  component: T.Component;
+  component: Component;
 }
 
 export function PortfolioPage({ component, location }: PortfolioPageProps) {
index 9c3dede7d2f63bb2e90cc09f43bf9c11aa15dc2b..c0de02046e7db8009052b7244579df698706ac86 100644 (file)
@@ -21,11 +21,12 @@ import { Location } from 'history';
 import * as React from 'react';
 import { connect } from 'react-redux';
 import { addGlobalErrorMessage } from '../../../store/globalMessages';
+import { Component } from '../../../types/types';
 import NotFound from '../NotFound';
 import Extension from './Extension';
 
 export interface ProjectAdminPageExtensionProps {
-  component: T.Component;
+  component: Component;
   location: Location;
   params: { extensionKey: string; pluginKey: string };
 }
index 756bae9d23f36cba80b4c2c849e8905bb3db487e..2e61a8461cf64e07e92e3fdeb66956f7a5042638 100644 (file)
  */
 import * as React from 'react';
 import { BranchLike } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 import NotFound from '../NotFound';
 import Extension from './Extension';
 
 export interface ProjectPageExtensionProps {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   location: { query: { id: string } };
   params: {
     extensionKey: string;
index 699a502505ba6200bd398bee42cb37afbc29a62e..2b6b74ea49faa0c05fa2b9ea29c832aee969a18c 100644 (file)
 import * as React from 'react';
 import { withAppState } from '../../../components/hoc/withAppState';
 import { IndexationContextInterface, IndexationStatus } from '../../../types/indexation';
+import { AppState } from '../../../types/types';
 import { IndexationContext } from './IndexationContext';
 import IndexationNotificationHelper from './IndexationNotificationHelper';
 
 interface Props {
-  appState: Pick<T.AppState, 'needIssueSync'>;
+  appState: Pick<AppState, 'needIssueSync'>;
 }
 
 export class IndexationContextProvider extends React.PureComponent<
index 6111cb3bd0dc236570e6546cc469e3df82e1431f..bfae18e371c8481fd95dcd27cfaed5aae6957209 100644 (file)
@@ -25,12 +25,13 @@ import withIndexationContext, {
 import { hasGlobalPermission, isLoggedIn } from '../../../helpers/users';
 import { IndexationNotificationType } from '../../../types/indexation';
 import { Permissions } from '../../../types/permissions';
+import { CurrentUser } from '../../../types/types';
 import './IndexationNotification.css';
 import IndexationNotificationHelper from './IndexationNotificationHelper';
 import IndexationNotificationRenderer from './IndexationNotificationRenderer';
 
 interface Props extends WithIndexationContextProps {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
 interface State {
index 5c43f41c6606dca8e6bd0523cc75475652539a56..4f2a907df5e1a79b16b27a1e1cf4b0b616032670 100644 (file)
@@ -24,10 +24,11 @@ import withIndexationContext, {
 } from '../../../components/hoc/withIndexationContext';
 import { Alert } from '../../../components/ui/Alert';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 
 interface Props extends WithIndexationContextProps {
   pageContext?: PageContext;
-  component?: Pick<T.Component, 'qualifier' | 'name'>;
+  component?: Pick<Component, 'qualifier' | 'name'>;
 }
 
 export enum PageContext {
index 37a778383621f9db647c4669a68a7e26122d9d71..69e580ef0d9c9bd291ad71c2376866e4e1fc1679 100644 (file)
@@ -24,9 +24,10 @@ import QualifierIcon from '../../../../components/icons/QualifierIcon';
 import { isMainBranch } from '../../../../helpers/branch-like';
 import { getComponentOverviewUrl } from '../../../../helpers/urls';
 import { BranchLike } from '../../../../types/branch-like';
+import { Component } from '../../../../types/types';
 
 interface Props {
-  component: T.Component;
+  component: Component;
   currentBranchLike: BranchLike | undefined;
 }
 
index df02475cfcf6510ef9c891deb53bbd39f1b9dc93..4c25501f4c3a90b036864b422372fa0f83e095a8 100644 (file)
@@ -27,6 +27,7 @@ import {
 import { BranchLike } from '../../../../types/branch-like';
 import { ComponentQualifier } from '../../../../types/component';
 import { Task, TaskStatuses, TaskWarning } from '../../../../types/tasks';
+import { Component } from '../../../../types/types';
 import { rawSizes } from '../../../theme';
 import RecentHistory from '../../RecentHistory';
 import ComponentNavBgTaskNotif from './ComponentNavBgTaskNotif';
@@ -40,12 +41,12 @@ import ProjectInformation from './projectInformation/ProjectInformation';
 export interface ComponentNavProps {
   branchLikes: BranchLike[];
   currentBranchLike: BranchLike | undefined;
-  component: T.Component;
+  component: Component;
   currentTask?: Task;
   currentTaskOnSameBranch?: boolean;
   isInProgress?: boolean;
   isPending?: boolean;
-  onComponentChange: (changes: Partial<T.Component>) => void;
+  onComponentChange: (changes: Partial<Component>) => void;
   onWarningDismiss: () => void;
   projectBinding?: ProjectAlmBindingResponse;
   projectBindingErrors?: ProjectAlmBindingConfigurationErrors;
index a802c8392590649b0b6b3055c695a83644260961..2c3d19b4cb61ddc1e5256e7d29a43d94c480ed7a 100644 (file)
@@ -26,10 +26,11 @@ import { Alert } from '../../../../components/ui/Alert';
 import { hasMessage, translate } from '../../../../helpers/l10n';
 import { getComponentBackgroundTaskUrl } from '../../../../helpers/urls';
 import { Task, TaskStatuses } from '../../../../types/tasks';
+import { Component } from '../../../../types/types';
 import ComponentNavLicenseNotif from './ComponentNavLicenseNotif';
 
 interface Props extends Pick<WithRouterProps, 'location'> {
-  component: T.Component;
+  component: Component;
   currentTask?: Task;
   currentTaskOnSameBranch?: boolean;
   isInProgress?: boolean;
index 28a8a51a725f80e25ccaa26abcb4440234080a79..526be9ad3917ec534e4c200524ee3fecdb0c21ad 100644 (file)
@@ -25,9 +25,10 @@ import { Alert } from '../../../../components/ui/Alert';
 import { translate, translateWithParameters } from '../../../../helpers/l10n';
 import { ComponentQualifier } from '../../../../types/component';
 import { Task } from '../../../../types/tasks';
+import { AppState } from '../../../../types/types';
 
 interface Props {
-  appState: Pick<T.AppState, 'canAdmin'>;
+  appState: Pick<AppState, 'canAdmin'>;
   currentTask?: Task;
 }
 
index 5ceeb6675e93b8a747af50ce0476c9874eb208a6..ee50074ebbdb0e33255d59deac3ca6c3c202c009 100644 (file)
@@ -24,9 +24,10 @@ import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../../../apps/setti
 import { Alert } from '../../../../components/ui/Alert';
 import { translate } from '../../../../helpers/l10n';
 import { getProjectSettingsUrl } from '../../../../helpers/urls';
+import { Component } from '../../../../types/types';
 
 export interface ComponentNavProjectBindingErrorNotifProps {
-  component: T.Component;
+  component: Component;
 }
 
 export function ComponentNavProjectBindingErrorNotif(
index dfbb27a8db7066bd47b76d1a4c8bd50580320394..5d16418d4c358b23cfc3694ca09c32f7aca86d83 100644 (file)
@@ -25,15 +25,16 @@ import { isLoggedIn } from '../../../../helpers/users';
 import { getCurrentUser, Store } from '../../../../store/rootReducer';
 import { ProjectAlmBindingResponse } from '../../../../types/alm-settings';
 import { BranchLike } from '../../../../types/branch-like';
+import { Component, CurrentUser } from '../../../../types/types';
 import BranchLikeNavigation from './branch-like/BranchLikeNavigation';
 import CurrentBranchLikeMergeInformation from './branch-like/CurrentBranchLikeMergeInformation';
 import { Breadcrumb } from './Breadcrumb';
 
 export interface HeaderProps {
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   currentBranchLike: BranchLike | undefined;
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   projectBinding?: ProjectAlmBindingResponse;
 }
 
index 3a7f2a4c454f7f79c5849d65a3dcbd735ee41793..92937c38839783104066aeff29199aef79f8593c 100644 (file)
@@ -30,13 +30,14 @@ import { getCurrentUser, Store } from '../../../../store/rootReducer';
 import { BranchLike } from '../../../../types/branch-like';
 import { ComponentQualifier } from '../../../../types/component';
 import { TaskWarning } from '../../../../types/tasks';
+import { Component, CurrentUser, HomePage } from '../../../../types/types';
 import ComponentNavWarnings from './ComponentNavWarnings';
 import './HeaderMeta.css';
 
 export interface HeaderMetaProps {
   branchLike?: BranchLike;
-  currentUser: T.CurrentUser;
-  component: T.Component;
+  currentUser: CurrentUser;
+  component: Component;
   onWarningDismiss: () => void;
   warnings: TaskWarning[];
 }
@@ -93,8 +94,8 @@ export function HeaderMeta(props: HeaderMetaProps) {
   );
 }
 
-export function getCurrentPage(component: T.Component, branchLike: BranchLike | undefined) {
-  let currentPage: T.HomePage | undefined;
+export function getCurrentPage(component: Component, branchLike: BranchLike | undefined) {
+  let currentPage: HomePage | undefined;
 
   const branch = isBranch(branchLike) && !branchLike.isMain ? branchLike.name : undefined;
 
index 609f64613923b122833665ea5211bdf8156817d7..b40c25cb88ae00c9d3da381b5a9cf5f9cf3e4ddb 100644 (file)
@@ -33,6 +33,7 @@ import { hasMessage, translate, translateWithParameters } from '../../../../help
 import { getPortfolioUrl, getProjectQueryUrl } from '../../../../helpers/urls';
 import { BranchLike, BranchParameters } from '../../../../types/branch-like';
 import { ComponentQualifier, isPortfolioLike } from '../../../../types/component';
+import { AppState, Component, Extension } from '../../../../types/types';
 import './Menu.css';
 
 const SETTINGS_URLS = [
@@ -52,10 +53,10 @@ const SETTINGS_URLS = [
 ];
 
 interface Props {
-  appState: Pick<T.AppState, 'branchesEnabled'>;
+  appState: Pick<AppState, 'branchesEnabled'>;
   branchLike: BranchLike | undefined;
   branchLikes: BranchLike[] | undefined;
-  component: T.Component;
+  component: Component;
   isInProgress?: boolean;
   isPending?: boolean;
   onToggleProjectInfo: () => void;
@@ -539,7 +540,7 @@ export class Menu extends React.PureComponent<Props> {
     );
   };
 
-  renderExtension = ({ key, name }: T.Extension, isAdmin: boolean, baseQuery: Query) => {
+  renderExtension = ({ key, name }: Extension, isAdmin: boolean, baseQuery: Query) => {
     const pathname = isAdmin ? `/project/admin/extension/${key}` : `/project/extension/${key}`;
     const query = { ...baseQuery, qualifier: this.props.component.qualifier };
     return (
index 5b748818f9b99ccc8f9266232cf3e07d5fbcc7bd..457f73fd9770e212619d8d3eb1fc9c5b866ee811 100644 (file)
@@ -23,14 +23,15 @@ import Toggler from '../../../../../components/controls/Toggler';
 import { withAppState } from '../../../../../components/hoc/withAppState';
 import { ProjectAlmBindingResponse } from '../../../../../types/alm-settings';
 import { BranchLike } from '../../../../../types/branch-like';
+import { AppState, Component } from '../../../../../types/types';
 import './BranchLikeNavigation.css';
 import CurrentBranchLike from './CurrentBranchLike';
 import Menu from './Menu';
 
 export interface BranchLikeNavigationProps {
-  appState: Pick<T.AppState, 'branchesEnabled'>;
+  appState: Pick<AppState, 'branchesEnabled'>;
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   currentBranchLike: BranchLike;
   projectBinding?: ProjectAlmBindingResponse;
 }
index 8d8b3b7d837c05b495ad46759637a5eb0febb325..15bc425c6c0dc61ce2783189517c11db4aa84992 100644 (file)
@@ -30,11 +30,12 @@ import { getApplicationAdminUrl } from '../../../../../helpers/urls';
 import { AlmKeys, ProjectAlmBindingResponse } from '../../../../../types/alm-settings';
 import { BranchLike } from '../../../../../types/branch-like';
 import { ComponentQualifier } from '../../../../../types/component';
+import { Component } from '../../../../../types/types';
 import { colors } from '../../../../theme';
 
 export interface CurrentBranchLikeProps {
   branchesEnabled: boolean;
-  component: T.Component;
+  component: Component;
   currentBranchLike: BranchLike;
   hasManyBranches: boolean;
   projectBinding?: ProjectAlmBindingResponse;
index e9d079c80c65888e1de6321175fe517d84f4f21a..f5a0c4f746e72fef66257037df3fa1a09e44b287 100644 (file)
@@ -33,12 +33,13 @@ import { translate } from '../../../../../helpers/l10n';
 import { getBranchLikeUrl } from '../../../../../helpers/urls';
 import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like';
 import { ComponentQualifier } from '../../../../../types/component';
+import { Component } from '../../../../../types/types';
 import MenuItemList from './MenuItemList';
 
 interface Props {
   branchLikes: BranchLike[];
   canAdminComponent?: boolean;
-  component: T.Component;
+  component: Component;
   currentBranchLike: BranchLike;
   onClose: () => void;
   router: Pick<Router, 'push'>;
index 16631eeba2c5008d0b79179d3b90cbaa308883ea..07b0f84f772e743397be17a863c1c3e429ad1c92 100644 (file)
@@ -24,10 +24,11 @@ import BranchLikeIcon from '../../../../../components/icons/BranchLikeIcon';
 import { getBranchLikeDisplayName, isMainBranch } from '../../../../../helpers/branch-like';
 import { translate } from '../../../../../helpers/l10n';
 import { BranchLike } from '../../../../../types/branch-like';
+import { Component } from '../../../../../types/types';
 
 export interface MenuItemProps {
   branchLike: BranchLike;
-  component: T.Component;
+  component: Component;
   indent?: boolean;
   onSelect: (branchLike: BranchLike) => void;
   selected: boolean;
index cddc6aba4d86f9ac49865fcdafc998a7c96800a8..05d0d2caf67d31b0675c15777192e21c23e13fd4 100644 (file)
@@ -24,11 +24,12 @@ import { translate } from '../../../../../helpers/l10n';
 import { scrollToElement } from '../../../../../helpers/scrolling';
 import { isDefined } from '../../../../../helpers/types';
 import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like';
+import { Component } from '../../../../../types/types';
 import MenuItem from './MenuItem';
 
 export interface MenuItemListProps {
   branchLikeTree: BranchLikeTree;
-  component: T.Component;
+  component: Component;
   hasResults: boolean;
   onSelect: (branchLike: BranchLike) => void;
   selectedBranchLike: BranchLike | undefined;
index 3df9c2b97f0233348c2829975b4e1d8bd716e9f7..21f8af7f3abceb33427fc157006a1fe0d167b146 100644 (file)
@@ -26,6 +26,7 @@ import { getCurrentUser, getMetrics, Store } from '../../../../../store/rootRedu
 import { BranchLike } from '../../../../../types/branch-like';
 import { ComponentQualifier } from '../../../../../types/component';
 import { MetricKey } from '../../../../../types/metrics';
+import { Component, CurrentUser, Dict, Measure, Metric } from '../../../../../types/types';
 import ProjectBadges from './badges/ProjectBadges';
 import InfoDrawerPage from './InfoDrawerPage';
 import ProjectNotifications from './notifications/ProjectNotifications';
@@ -35,15 +36,15 @@ import ProjectInformationRenderer from './ProjectInformationRenderer';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.Component;
-  currentUser: T.CurrentUser;
+  component: Component;
+  currentUser: CurrentUser;
   fetchMetrics: () => void;
   onComponentChange: (changes: {}) => void;
-  metrics: T.Dict<T.Metric>;
+  metrics: Dict<Metric>;
 }
 
 interface State {
-  measures?: T.Measure[];
+  measures?: Measure[];
   page: ProjectInformationPages;
 }
 
index f322b691ee453ea15374630669016f731e932137..39d964949e862fe66daafbc3328696785c910ba5 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import PrivacyBadgeContainer from '../../../../../components/common/PrivacyBadgeContainer';
 import { translate } from '../../../../../helpers/l10n';
 import { ComponentQualifier } from '../../../../../types/component';
+import { Component, Measure } from '../../../../../types/types';
 import DrawerLink from './DrawerLink';
 import MetaKey from './meta/MetaKey';
 import MetaLinks from './meta/MetaLinks';
@@ -33,8 +34,8 @@ import { ProjectInformationPages } from './ProjectInformationPages';
 export interface ProjectInformationRendererProps {
   canConfigureNotifications: boolean;
   canUseBadges: boolean;
-  component: T.Component;
-  measures?: T.Measure[];
+  component: Component;
+  measures?: Measure[];
   onComponentChange: (changes: {}) => void;
   onPageChange: (page: ProjectInformationPages) => void;
 }
index 0327f91c6368e450646785068e9617ed929f1a8a..d546cf3a8f871ef47a2a88e7a94023dcdd698dd1 100644 (file)
@@ -22,11 +22,12 @@ import * as React from 'react';
 import { fetchWebApi } from '../../../../../../api/web-api';
 import SelectLegacy from '../../../../../../components/controls/SelectLegacy';
 import { getLocalizedMetricName, translate } from '../../../../../../helpers/l10n';
+import { Dict, Metric } from '../../../../../../types/types';
 import { BadgeFormats, BadgeOptions, BadgeType } from './utils';
 
 interface Props {
   className?: string;
-  metrics: T.Dict<T.Metric>;
+  metrics: Dict<Metric>;
   options: BadgeOptions;
   type: BadgeType;
   updateOptions: (options: Partial<BadgeOptions>) => void;
index b219a077baea1299eefef52112c603ddc726a318..ae3438a5ae6bf0f5213fcb374fe4caca2a55768a 100644 (file)
@@ -30,6 +30,7 @@ import { getBranchLikeQuery } from '../../../../../../helpers/branch-like';
 import { translate } from '../../../../../../helpers/l10n';
 import { BranchLike } from '../../../../../../types/branch-like';
 import { MetricKey } from '../../../../../../types/metrics';
+import { Component, Dict, Metric } from '../../../../../../types/types';
 import BadgeButton from './BadgeButton';
 import BadgeParams from './BadgeParams';
 import './styles.css';
@@ -37,8 +38,8 @@ import { BadgeOptions, BadgeType, getBadgeSnippet, getBadgeUrl } from './utils';
 
 interface Props {
   branchLike?: BranchLike;
-  metrics: T.Dict<T.Metric>;
-  component: T.Component;
+  metrics: Dict<Metric>;
+  component: Component;
 }
 
 interface State {
index 696ec84f04fff2ca5a3f5a78233a839e3a1d9a9f..436999cd6fea08291cf2be726b63bd92f0c307d4 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { Metric } from '../../../../../../../types/types';
 import BadgeParams from '../BadgeParams';
 import { BadgeType } from '../utils';
 
@@ -38,8 +39,8 @@ jest.mock('../../../../../../../api/web-api', () => ({
 }));
 
 const METRICS = {
-  alert_status: { key: 'alert_status', name: 'Quality Gate' } as T.Metric,
-  coverage: { key: 'coverage', name: 'Coverage' } as T.Metric
+  alert_status: { key: 'alert_status', name: 'Quality Gate' } as Metric,
+  coverage: { key: 'coverage', name: 'Coverage' } as Metric
 };
 
 it('should display measure badge params', () => {
index a8856725e8d31d3d7236b2b535e10ddb92870bbc..2df7e9933484ec93ff1cb91c3c41b3fe7e14dc8a 100644 (file)
@@ -21,11 +21,12 @@ import * as React from 'react';
 import { ClearButton } from '../../../../../../components/controls/buttons';
 import ProjectLinkIcon from '../../../../../../components/icons/ProjectLinkIcon';
 import { getLinkName } from '../../../../../../helpers/projectLinks';
+import { ProjectLink } from '../../../../../../types/types';
 import isValidUri from '../../../../../utils/isValidUri';
 
 interface Props {
   iconOnly?: boolean;
-  link: T.ProjectLink;
+  link: ProjectLink;
 }
 
 interface State {
index 0c6915d8dc178da25c98a1ae55253df510233c6a..7c9868e16e8e5ec44542aa3301e0dcbea961c9da 100644 (file)
@@ -21,14 +21,15 @@ import * as React from 'react';
 import { getProjectLinks } from '../../../../../../api/projectLinks';
 import { translate } from '../../../../../../helpers/l10n';
 import { orderLinks } from '../../../../../../helpers/projectLinks';
+import { LightComponent, ProjectLink } from '../../../../../../types/types';
 import MetaLink from './MetaLink';
 
 interface Props {
-  component: T.LightComponent;
+  component: LightComponent;
 }
 
 interface State {
-  links?: T.ProjectLink[];
+  links?: ProjectLink[];
 }
 
 export default class MetaLinks extends React.PureComponent<Props, State> {
index fdbcfeb82fd06cca6f3c09a0c340cf26de6792b0..abdc03228d2d95835b9e1926412b32957172d88f 100644 (file)
@@ -25,18 +25,19 @@ import Tooltip from '../../../../../../components/controls/Tooltip';
 import { translate, translateWithParameters } from '../../../../../../helpers/l10n';
 import { getQualityProfileUrl } from '../../../../../../helpers/urls';
 import { getLanguages, Store } from '../../../../../../store/rootReducer';
+import { ComponentQualityProfile, Dict, Languages } from '../../../../../../types/types';
 
 interface StateProps {
-  languages: T.Languages;
+  languages: Languages;
 }
 
 interface OwnProps {
   headerClassName?: string;
-  profiles: T.ComponentQualityProfile[];
+  profiles: ComponentQualityProfile[];
 }
 
 interface State {
-  deprecatedByKey: T.Dict<number>;
+  deprecatedByKey: Dict<number>;
 }
 
 export class MetaQualityProfiles extends React.PureComponent<StateProps & OwnProps, State> {
@@ -60,7 +61,7 @@ export class MetaQualityProfiles extends React.PureComponent<StateProps & OwnPro
     Promise.all(requests).then(
       responses => {
         if (this.mounted) {
-          const deprecatedByKey: T.Dict<number> = {};
+          const deprecatedByKey: Dict<number> = {};
           responses.forEach((count, i) => {
             const profileKey = existingProfiles[i].key;
             deprecatedByKey[profileKey] = count;
@@ -87,7 +88,7 @@ export class MetaQualityProfiles extends React.PureComponent<StateProps & OwnPro
     return count || 0;
   }
 
-  renderProfile(profile: T.ComponentQualityProfile) {
+  renderProfile(profile: ComponentQualityProfile) {
     const languageFromStore = this.props.languages[profile.language];
     const languageName = languageFromStore ? languageFromStore.name : profile.language;
 
index ebafe436f723b0c00ceb14b24e2dfaa0d1cff2b8..2c025b6af57e746a47a6f2125ec001e0cca21563 100644 (file)
@@ -24,10 +24,11 @@ import { translate } from '../../../../../../helpers/l10n';
 import { formatMeasure, localizeMetric } from '../../../../../../helpers/measures';
 import { ComponentQualifier } from '../../../../../../types/component';
 import { MetricKey } from '../../../../../../types/metrics';
+import { Component, Measure } from '../../../../../../types/types';
 
 export interface MetaSizeProps {
-  component: T.Component;
-  measures: T.Measure[];
+  component: Component;
+  measures: Measure[];
 }
 
 export default function MetaSize({ component, measures }: MetaSizeProps) {
index 5cd57a46e5be333b5f500e7504db78dfd711ea5e..25ff262bcc7ac344218f7eafbc872ee3d65fc79a 100644 (file)
@@ -25,10 +25,11 @@ import TagsList from '../../../../../../components/tags/TagsList';
 import { PopupPlacement } from '../../../../../../components/ui/popups';
 import { translate } from '../../../../../../helpers/l10n';
 import { ComponentQualifier } from '../../../../../../types/component';
+import { Component } from '../../../../../../types/types';
 import MetaTagsSelector from './MetaTagsSelector';
 
 interface Props {
-  component: T.Component;
+  component: Component;
   onComponentChange: (changes: {}) => void;
 }
 
index 835b0bf525559fde6f22f2117826ea09f8fa0cc1..1932ce09689601961c61ce96c4c7c411882f0067 100644 (file)
@@ -26,9 +26,10 @@ import {
 import { Alert } from '../../../../../../components/ui/Alert';
 import DeferredSpinner from '../../../../../../components/ui/DeferredSpinner';
 import { translate } from '../../../../../../helpers/l10n';
+import { Component } from '../../../../../../types/types';
 
 interface Props {
-  component: T.Component;
+  component: Component;
 }
 
 export function ProjectNotifications(props: WithNotificationsProps & Props) {
index fb04e40f614aeb021684fb9ae49d5c79f68c8b6c..eab30c61e227ef15322841464c53e79a864aaa54 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { connect } from 'react-redux';
 import NavBar from '../../../../components/ui/NavBar';
 import { getAppState, getCurrentUser, Store } from '../../../../store/rootReducer';
+import { AppState, CurrentUser } from '../../../../types/types';
 import { rawSizes } from '../../../theme';
 import EmbedDocsPopupHelper from '../../embed-docs-modal/EmbedDocsPopupHelper';
 import Search from '../../search/Search';
@@ -30,8 +31,8 @@ import GlobalNavMenu from './GlobalNavMenu';
 import GlobalNavUser from './GlobalNavUser';
 
 export interface GlobalNavProps {
-  appState: Pick<T.AppState, 'canAdmin' | 'globalPages' | 'qualifiers'>;
-  currentUser: T.CurrentUser;
+  appState: Pick<AppState, 'canAdmin' | 'globalPages' | 'qualifiers'>;
+  currentUser: CurrentUser;
   location: { pathname: string };
 }
 
index c72524bd66e8fcbaf264d2a3c53ed72b0c3acce6..4113762716f492f6d6be429d39b0b9bfe71fc5a4 100644 (file)
@@ -26,10 +26,11 @@ import DropdownIcon from '../../../../components/icons/DropdownIcon';
 import { translate } from '../../../../helpers/l10n';
 import { getQualityGatesUrl } from '../../../../helpers/urls';
 import { ComponentQualifier } from '../../../../types/component';
+import { AppState, CurrentUser, Extension } from '../../../../types/types';
 
 interface Props {
-  appState: Pick<T.AppState, 'canAdmin' | 'globalPages' | 'qualifiers'>;
-  currentUser: T.CurrentUser;
+  appState: Pick<AppState, 'canAdmin' | 'globalPages' | 'qualifiers'>;
+  currentUser: CurrentUser;
   location: { pathname: string };
 }
 
@@ -118,7 +119,7 @@ export default class GlobalNavMenu extends React.PureComponent<Props> {
     );
   }
 
-  renderGlobalPageLink = ({ key, name }: T.Extension) => {
+  renderGlobalPageLink = ({ key, name }: Extension) => {
     return (
       <li key={key}>
         <Link to={`/extension/${key}`}>{name}</Link>
index f1a1d0a989bc2f347a367dd8c053e2e4648a0a4c..5c4fdabb799af1f33a5db4fb3020f0383178c039 100644 (file)
@@ -25,10 +25,11 @@ import Avatar from '../../../../components/ui/Avatar';
 import { translate } from '../../../../helpers/l10n';
 import { getBaseUrl } from '../../../../helpers/system';
 import { isLoggedIn } from '../../../../helpers/users';
+import { CurrentUser, LoggedInUser } from '../../../../types/types';
 import { rawSizes } from '../../../theme';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   router: Pick<Router, 'push'>;
 }
 
@@ -46,7 +47,7 @@ export class GlobalNavUser extends React.PureComponent<Props> {
   };
 
   renderAuthenticated() {
-    const currentUser = this.props.currentUser as T.LoggedInUser;
+    const currentUser = this.props.currentUser as LoggedInUser;
     return (
       <Dropdown
         className="js-user-authenticated"
index 664f80ee8e19f79c1e4103a417eb4351be1b858d..da4fe7a37fae84e62ab808bcd7c1d6ddd98577e7 100644 (file)
@@ -26,12 +26,13 @@ import { Button } from '../../../../components/controls/buttons';
 import { Alert } from '../../../../components/ui/Alert';
 import { translate } from '../../../../helpers/l10n';
 import { PendingPluginResult } from '../../../../types/plugins';
+import { SysStatus } from '../../../../types/types';
 
 interface Props {
   fetchSystemStatus: () => void;
   pending: PendingPluginResult;
   refreshPending: () => void;
-  systemStatus: T.SysStatus;
+  systemStatus: SysStatus;
 }
 
 export default class PendingPluginsActionNotif extends React.PureComponent<Props> {
index e78a32524992223aed5fdc12767230af94d4af47..51974109b4cc7b81ad5054bedf3a5e8b75a5b36c 100644 (file)
@@ -28,17 +28,18 @@ import { translate } from '../../../../helpers/l10n';
 import { getBaseUrl } from '../../../../helpers/system';
 import { AdminPageExtension } from '../../../../types/extension';
 import { PendingPluginResult } from '../../../../types/plugins';
+import { Extension, SysStatus } from '../../../../types/types';
 import { rawSizes } from '../../../theme';
 import PendingPluginsActionNotif from './PendingPluginsActionNotif';
 import SystemRestartNotif from './SystemRestartNotif';
 
 interface Props {
-  extensions: T.Extension[];
+  extensions: Extension[];
   fetchPendingPlugins: () => void;
   fetchSystemStatus: () => void;
   location: {};
   pendingPlugins: PendingPluginResult;
-  systemStatus: T.SysStatus;
+  systemStatus: SysStatus;
 }
 
 export default class SettingsNav extends React.PureComponent<Props> {
@@ -81,7 +82,7 @@ export default class SettingsNav extends React.PureComponent<Props> {
     return this.isSomethingActive(urls);
   }
 
-  renderExtension = ({ key, name }: T.Extension) => {
+  renderExtension = ({ key, name }: Extension) => {
     return (
       <li key={key}>
         <Link activeClassName="active" to={`/admin/extension/${key}`}>
index 5390e76c6db573f0431f56f4ae707ea303b60ee2..ac4998c44fef22030d3fbda3f9fcf26c00eb2f50 100644 (file)
@@ -26,11 +26,12 @@ import { translate } from '../../../helpers/l10n';
 import { getBaseUrl } from '../../../helpers/system';
 import { isLoggedIn } from '../../../helpers/users';
 import { setSonarlintAd } from '../../../store/users';
+import { CurrentUser } from '../../../types/types';
 import './PromotionNotification.css';
 
 export interface PromotionNotificationProps {
   setSonarlintAd: () => void;
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
 export function PromotionNotification(props: PromotionNotificationProps) {
index 5bcfd07fec5f3a495f3c502b04475933c160a07a..df317990db2ae375bb5c5e71c15311a0da6f0d43 100644 (file)
@@ -34,6 +34,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { scrollToElement } from '../../../helpers/scrolling';
 import { getComponentOverviewUrl } from '../../../helpers/urls';
 import { ComponentQualifier } from '../../../types/component';
+import { CurrentUser, Dict } from '../../../types/types';
 import RecentHistory from '../RecentHistory';
 import './Search.css';
 import { ComponentResult, More, Results, sortQualifiers } from './utils';
@@ -42,7 +43,7 @@ const SearchResults = lazyLoadComponent(() => import('./SearchResults'));
 const SearchResult = lazyLoadComponent(() => import('./SearchResult'));
 
 interface OwnProps {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
 type Props = OwnProps & WithRouterProps;
@@ -52,7 +53,7 @@ interface State {
   loadingMore?: string;
   more: More;
   open: boolean;
-  projects: T.Dict<{ name: string }>;
+  projects: Dict<{ name: string }>;
   query: string;
   results: Results;
   selected?: string;
@@ -62,7 +63,7 @@ interface State {
 export class Search extends React.PureComponent<Props, State> {
   input?: HTMLInputElement | null;
   node?: HTMLElement | null;
-  nodes: T.Dict<HTMLElement>;
+  nodes: Dict<HTMLElement>;
   mounted = false;
 
   constructor(props: Props) {
index 373dc60c17371f48f48b09edddb0af37648c3b64..47535893f5af3d93a7aa6107efb0d3b68fb10d1d 100644 (file)
@@ -25,6 +25,7 @@ import ClockIcon from '../../../components/icons/ClockIcon';
 import FavoriteIcon from '../../../components/icons/FavoriteIcon';
 import QualifierIcon from '../../../components/icons/QualifierIcon';
 import { getComponentOverviewUrl } from '../../../helpers/urls';
+import { Dict } from '../../../types/types';
 import { ComponentResult } from './utils';
 
 interface Props {
@@ -32,7 +33,7 @@ interface Props {
   innerRef: (componentKey: string, node: HTMLElement | null) => void;
   onClose: () => void;
   onSelect: (componentKey: string) => void;
-  projects: T.Dict<{ name: string }>;
+  projects: Dict<{ name: string }>;
   selected: boolean;
 }
 
index e80c06fd3a21b2b9f2feb9266a9a58c6691d7b22..2893542fd475d0c0be3c5b305438249b4e35eed5 100644 (file)
@@ -31,15 +31,16 @@ import { translate } from '../../../helpers/l10n';
 import { hasGlobalPermission, isLoggedIn } from '../../../helpers/users';
 import { Permissions } from '../../../types/permissions';
 import { SystemUpgrade } from '../../../types/system';
+import { AppState, CurrentUser, Dict } from '../../../types/types';
 import './UpdateNotification.css';
 
 const MONTH_BEFOR_PREVIOUS_LTS_NOTIFICATION = 6;
 
 type GroupedSystemUpdate = {
-  [x: string]: T.Dict<SystemUpgrade[]>;
+  [x: string]: Dict<SystemUpgrade[]>;
 };
 
-const MAP_VARIANT: T.Dict<AlertVariant> = {
+const MAP_VARIANT: Dict<AlertVariant> = {
   [UpdateUseCase.NewMinorVersion]: 'info',
   [UpdateUseCase.NewPatch]: 'warning',
   [UpdateUseCase.PreLTS]: 'warning',
@@ -48,8 +49,8 @@ const MAP_VARIANT: T.Dict<AlertVariant> = {
 
 interface Props {
   dismissable: boolean;
-  appState: Pick<T.AppState, 'version'>;
-  currentUser: T.CurrentUser;
+  appState: Pick<AppState, 'version'>;
+  currentUser: CurrentUser;
 }
 
 interface State {
index 78db9a4e0d520c1901652259580d1d843d17e261..e2778f6546e1727d9b7301a5ed57b25f68516ffe 100644 (file)
@@ -21,6 +21,7 @@ import { installExtensionsHandler, installWebAnalyticsHandler } from '../helpers
 import { loadL10nBundle } from '../helpers/l10n';
 import { parseJSON, request } from '../helpers/request';
 import { getBaseUrl, getSystemStatus } from '../helpers/system';
+import { AppState } from '../types/types';
 import './styles/sonar.ts';
 
 installWebAnalyticsHandler();
@@ -43,7 +44,7 @@ if (isMainApp()) {
 } else {
   // login, maintenance or setup pages
 
-  const appStatePromise: Promise<T.AppState | undefined> = new Promise(resolve => {
+  const appStatePromise: Promise<AppState | undefined> = new Promise(resolve => {
     loadAppState()
       .then(data => {
         resolve(data);
index e4f077590cdac19f629f063fc7f71c6eae1f1f82..bce500729eced4a0e315fa1e116a7d190c59fae1 100644 (file)
@@ -22,10 +22,11 @@ import { setAppState } from '../../store/appState';
 import rootReducer, { Store as State } from '../../store/rootReducer';
 import { receiveCurrentUser } from '../../store/users';
 import configureStore from '../../store/utils/configureStore';
+import { AppState, CurrentUser } from '../../types/types';
 
 let store: Store<State, any>;
 
-const createStore = (currentUser?: T.CurrentUser, appState?: T.AppState) => {
+const createStore = (currentUser?: CurrentUser, appState?: AppState) => {
   store = configureStore(rootReducer);
   if (currentUser) {
     store.dispatch(receiveCurrentUser(currentUser));
@@ -36,5 +37,5 @@ const createStore = (currentUser?: T.CurrentUser, appState?: T.AppState) => {
   return store;
 };
 
-export default (currentUser?: T.CurrentUser, appState?: T.AppState) =>
+export default (currentUser?: CurrentUser, appState?: AppState) =>
   store ? store : createStore(currentUser, appState);
index 2b03991f6e38e6edaef239d27d3e2f2beab4845f..0448a4f94b2f1cfc564476f4eaee0d3f8b086e20 100644 (file)
@@ -60,6 +60,7 @@ import webhooksRoutes from '../../apps/webhooks/routes';
 import withIndexationGuard from '../../components/hoc/withIndexationGuard';
 import { lazyLoadComponent } from '../../components/lazyLoadComponent';
 import getHistory from '../../helpers/getHistory';
+import { AppState, CurrentUser } from '../../types/types';
 import App from '../components/App';
 import GlobalContainer from '../components/GlobalContainer';
 import { PageContext } from '../components/indexation/PageUnavailableDueToIndexation';
@@ -279,8 +280,8 @@ function renderAdminRoutes() {
 
 export default function startReactApp(
   lang: string,
-  currentUser?: T.CurrentUser,
-  appState?: T.AppState
+  currentUser?: CurrentUser,
+  appState?: AppState
 ) {
   attachToGlobal();
 
index 2a8bd25fc0adea8be03a84db70afecd8d7b3ccf6..4aa0dfe8817253776f41e85df18e764e36a7dad3 100644 (file)
@@ -24,12 +24,13 @@ import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
 import { withCurrentUser } from '../../../components/hoc/withCurrentUser';
 import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication';
 import { translate } from '../../../helpers/l10n';
+import { CurrentUser, LoggedInUser } from '../../../types/types';
 import '../account.css';
 import Nav from './Nav';
 import UserCard from './UserCard';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
 export class Account extends React.PureComponent<Props> {
@@ -54,7 +55,7 @@ export class Account extends React.PureComponent<Props> {
         <A11ySkipTarget anchor="account_main" />
         <header className="account-header">
           <div className="account-container clearfix">
-            <UserCard user={currentUser as T.LoggedInUser} />
+            <UserCard user={currentUser as LoggedInUser} />
             <Nav />
           </div>
         </header>
index 18a387913d0615825c3bbf21d6995a51ba11f22b..9e99cde6276623069b0cbf14866ba13b1c3b8e2f 100644 (file)
@@ -23,10 +23,11 @@ import { connect } from 'react-redux';
 import ResetPasswordForm from '../../../components/common/ResetPasswordForm';
 import { translate } from '../../../helpers/l10n';
 import { getCurrentUser, Store } from '../../../store/rootReducer';
+import { LoggedInUser } from '../../../types/types';
 import Tokens from './Tokens';
 
 export interface SecurityProps {
-  user: T.LoggedInUser;
+  user: LoggedInUser;
 }
 
 export function Security({ user }: SecurityProps) {
@@ -45,7 +46,7 @@ export function Security({ user }: SecurityProps) {
 }
 
 const mapStateToProps = (state: Store) => ({
-  user: getCurrentUser(state) as T.LoggedInUser
+  user: getCurrentUser(state) as LoggedInUser
 });
 
 export default connect(mapStateToProps)(Security);
index 2ce11f1460464ef17861d4338e660f958fb0a7b6..ba323e5a5a7db8d0436133135e14108402c65c19 100644 (file)
  */
 import * as React from 'react';
 import Avatar from '../../../components/ui/Avatar';
+import { LoggedInUser } from '../../../types/types';
 
 interface Props {
-  user: T.LoggedInUser;
+  user: LoggedInUser;
 }
 
 export default function UserCard({ user }: Props) {
index 22258c60a2164d8d1b8a9da5c771da3aa172bb68..5d645cba39f0a2dcb6493174571c966f6606d80a 100644 (file)
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { isSonarCloud } from '../../../helpers/system';
+import { Notification } from '../../../types/types';
 import NotificationsList from './NotificationsList';
 import SonarCloudNotifications from './SonarCloudNotifications';
 
 interface Props {
-  addNotification: (n: T.Notification) => void;
+  addNotification: (n: Notification) => void;
   channels: string[];
-  notifications: T.Notification[];
-  removeNotification: (n: T.Notification) => void;
+  notifications: Notification[];
+  removeNotification: (n: Notification) => void;
   types: string[];
 }
 
index 1dce17fd8b7c6f42145d92f34fd8e7bc967829bf..2500318d883970d113308de33540280e68fd6cb3 100644 (file)
 import * as React from 'react';
 import Checkbox from '../../../components/controls/Checkbox';
 import { hasMessage, translate } from '../../../helpers/l10n';
+import { Notification } from '../../../types/types';
 
 interface Props {
-  onAdd: (n: T.Notification) => void;
-  onRemove: (n: T.Notification) => void;
+  onAdd: (n: Notification) => void;
+  onRemove: (n: Notification) => void;
   channels: string[];
   checkboxId: (type: string, channel: string) => string;
   project?: boolean;
   types: string[];
-  notifications: T.Notification[];
+  notifications: Notification[];
 }
 
 export default class NotificationsList extends React.PureComponent<Props> {
index b83d7555ff6877c2286dd94be9bab23b40f9e5d5..47cf7d8f287a21b7db2bac466ef2079682177113 100644 (file)
@@ -27,20 +27,21 @@ import SearchBox from '../../../components/controls/SearchBox';
 import SimpleModal from '../../../components/controls/SimpleModal';
 import { KeyboardCodes } from '../../../helpers/keycodes';
 import { translate } from '../../../helpers/l10n';
+import { NotificationProject } from '../../../types/types';
 
 interface Props {
-  addedProjects: T.NotificationProject[];
+  addedProjects: NotificationProject[];
   closeModal: VoidFunction;
-  onSubmit: (project: T.NotificationProject) => void;
+  onSubmit: (project: NotificationProject) => void;
 }
 
 interface State {
-  highlighted?: T.NotificationProject;
+  highlighted?: NotificationProject;
   loading?: boolean;
   query?: string;
   open?: boolean;
-  selectedProject?: T.NotificationProject;
-  suggestions?: T.NotificationProject[];
+  selectedProject?: NotificationProject;
+  suggestions?: NotificationProject[];
 }
 
 export default class ProjectModal extends React.PureComponent<Props, State> {
@@ -151,7 +152,7 @@ export default class ProjectModal extends React.PureComponent<Props, State> {
     );
   };
 
-  handleSelect = (selectedProject: T.NotificationProject) => {
+  handleSelect = (selectedProject: NotificationProject) => {
     this.setState({
       open: false,
       query: selectedProject.projectName,
index 3e749bda99227ec4033d0d244f51dfcde3470e22..7219a9ad0a05dd40ab80a892328f18489b8ecc31 100644 (file)
 import * as React from 'react';
 import BoxedGroupAccordion from '../../../components/controls/BoxedGroupAccordion';
 import { translate } from '../../../helpers/l10n';
+import { Notification, NotificationProject } from '../../../types/types';
 import NotificationsList from './NotificationsList';
 
 interface Props {
-  addNotification: (n: T.Notification) => void;
+  addNotification: (n: Notification) => void;
   channels: string[];
   collapsed: boolean;
-  notifications: T.Notification[];
-  project: T.NotificationProject;
-  removeNotification: (n: T.Notification) => void;
+  notifications: Notification[];
+  project: NotificationProject;
+  removeNotification: (n: Notification) => void;
   types: string[];
 }
 
index cd3e69acd1985e2975c091df0174e994fcd7cf54..b828d96568756325d34189424337b82983efa875 100644 (file)
@@ -22,21 +22,22 @@ import * as React from 'react';
 import { Button } from '../../../components/controls/buttons';
 import SearchBox from '../../../components/controls/SearchBox';
 import { translate } from '../../../helpers/l10n';
+import { Notification, NotificationProject } from '../../../types/types';
 import ProjectModal from './ProjectModal';
 import ProjectNotifications from './ProjectNotifications';
 
 export interface Props {
-  addNotification: (n: T.Notification) => void;
+  addNotification: (n: Notification) => void;
   channels: string[];
-  notifications: T.Notification[];
-  removeNotification: (n: T.Notification) => void;
+  notifications: Notification[];
+  removeNotification: (n: Notification) => void;
   types: string[];
 }
 
 const THRESHOLD_COLLAPSED = 3;
 
 interface State {
-  addedProjects: T.NotificationProject[];
+  addedProjects: NotificationProject[];
   search: string;
   showModal: boolean;
 }
@@ -44,7 +45,7 @@ interface State {
 function isNotificationProject(project: {
   project?: string;
   projectName?: string;
-}): project is T.NotificationProject {
+}): project is NotificationProject {
   return project.project !== undefined && project.projectName !== undefined;
 }
 
@@ -55,11 +56,11 @@ export default class Projects extends React.PureComponent<Props, State> {
     showModal: false
   };
 
-  filterSearch = (project: T.NotificationProject, search: string) => {
+  filterSearch = (project: NotificationProject, search: string) => {
     return project.projectName && project.projectName.toLowerCase().includes(search);
   };
 
-  handleAddProject = (project: T.NotificationProject) => {
+  handleAddProject = (project: NotificationProject) => {
     this.setState(state => {
       return {
         addedProjects: [...state.addedProjects, project]
@@ -71,7 +72,7 @@ export default class Projects extends React.PureComponent<Props, State> {
     this.setState({ search: search.toLowerCase() });
   };
 
-  handleSubmit = (selectedProject: T.NotificationProject) => {
+  handleSubmit = (selectedProject: NotificationProject) => {
     if (selectedProject) {
       this.handleAddProject(selectedProject);
     }
@@ -87,7 +88,7 @@ export default class Projects extends React.PureComponent<Props, State> {
     this.setState({ showModal: true });
   };
 
-  removeNotification = (removed: T.Notification, allProjects: T.NotificationProject[]) => {
+  removeNotification = (removed: Notification, allProjects: NotificationProject[]) => {
     const projectToRemove = allProjects.find(p => p.project === removed.project);
     if (projectToRemove) {
       this.handleAddProject(projectToRemove);
@@ -102,7 +103,7 @@ export default class Projects extends React.PureComponent<Props, State> {
 
     const projects = uniqBy(notifications, project => project.project).filter(
       isNotificationProject
-    ) as T.NotificationProject[];
+    ) as NotificationProject[];
     const notificationsByProject = groupBy(notifications, n => n.project);
     const allProjects = uniqBy([...addedProjects, ...projects], project => project.project);
     const filteredProjects = sortBy(allProjects, 'projectName').filter(p =>
index d74356148e9c8d98f03b025e6c21cc336fa01039..6ab6be7fb76ecdfa64adc930b37000b66175591d 100644 (file)
@@ -23,10 +23,11 @@ import Checkbox from '../../../components/controls/Checkbox';
 import { translate } from '../../../helpers/l10n';
 import { getCurrentUserSetting, Store } from '../../../store/rootReducer';
 import { setCurrentUserSetting } from '../../../store/users';
+import { CurrentUserSetting } from '../../../types/types';
 
 interface Props {
   notificationsOptOut?: boolean;
-  setCurrentUserSetting: (setting: T.CurrentUserSetting) => void;
+  setCurrentUserSetting: (setting: CurrentUserSetting) => void;
 }
 
 export class SonarCloudNotifications extends React.PureComponent<Props> {
index 7eaa6093c493e857ed40f4e01ba21d27c5ca88a0..601b32bf885df830ce46771c5fe4b30a6b5b81cf 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
 import { translate } from '../../../helpers/l10n';
+import { LoggedInUser } from '../../../types/types';
 import UserExternalIdentity from './UserExternalIdentity';
 
 export interface ProfileProps {
-  currentUser: T.LoggedInUser;
+  currentUser: LoggedInUser;
 }
 
 export function Profile({ currentUser }: ProfileProps) {
index 096ec5c438252b8db8e4ed4984bf163b90410bf4..21fb7d25f620c9dc873340b0d7c9e8fa07398046 100644 (file)
@@ -22,13 +22,14 @@ import { getIdentityProviders } from '../../../api/users';
 import { colors } from '../../../app/theme';
 import { getTextColor } from '../../../helpers/colors';
 import { getBaseUrl } from '../../../helpers/system';
+import { IdentityProvider, LoggedInUser } from '../../../types/types';
 
 export interface UserExternalIdentityProps {
-  user: T.LoggedInUser;
+  user: LoggedInUser;
 }
 
 interface State {
-  identityProvider?: T.IdentityProvider;
+  identityProvider?: IdentityProvider;
   loading: boolean;
 }
 
index 36bc2a46a6e304d3a5d59ce7538a6010c3dabb47..ac1e98d6f30a5a907ca904d8a570466f4bfb3b1b 100644 (file)
@@ -26,15 +26,16 @@ import Level from '../../../components/ui/Level';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { orderLinks } from '../../../helpers/projectLinks';
 import { getProjectUrl } from '../../../helpers/urls';
+import { MyProject, ProjectLink } from '../../../types/types';
 
 interface Props {
-  project: T.MyProject;
+  project: MyProject;
 }
 
 export default function ProjectCard({ project }: Props) {
   const { links } = project;
 
-  const orderedLinks: T.ProjectLink[] = orderLinks(
+  const orderedLinks: ProjectLink[] = orderLinks(
     links.map((link, i) => {
       const { href, name, type } = link;
       return {
index 8ec4500ade3c256852ee3564f8f346773b183129..1057e0d76023081428196ff0c1a8344771fed30b 100644 (file)
 import * as React from 'react';
 import ListFooter from '../../../components/controls/ListFooter';
 import { translate } from '../../../helpers/l10n';
+import { MyProject } from '../../../types/types';
 import ProjectCard from './ProjectCard';
 
 interface Props {
   loading: boolean;
   loadMore: () => void;
-  projects: T.MyProject[];
+  projects: MyProject[];
   total?: number;
 }
 
index 3c737a10da0ad6aaed1ed7a2496655e4d2a991c3..094ee4ff83eb41c59e3afc1c4257563881b220d5 100644 (file)
@@ -21,12 +21,13 @@ import * as React from 'react';
 import { Helmet } from 'react-helmet-async';
 import { getMyProjects } from '../../../api/components';
 import { translate } from '../../../helpers/l10n';
+import { MyProject } from '../../../types/types';
 import Projects from './Projects';
 
 interface State {
   loading: boolean;
   page: number;
-  projects?: T.MyProject[];
+  projects?: MyProject[];
   total?: number;
 }
 
index 3d657320d67e92dd5b64688e9a239661f6acdf6a..3644f570232ef05113bf32946a35932f65b47b8e 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { MyProject } from '../../../../types/types';
 import ProjectCard from '../ProjectCard';
 
 it('should render key and name', () => {
@@ -73,6 +74,6 @@ it('should render links', () => {
   expect(wrapper.find('MetaLink').length).toBe(1);
 });
 
-function shallowRender(project: Partial<T.MyProject> = {}) {
+function shallowRender(project: Partial<MyProject> = {}) {
   return shallow(<ProjectCard project={{ key: 'key', links: [], name: 'name', ...project }} />);
 }
index 3c77ed5c9d06d3bff78fc86d6ea0595a2e860f88..78cc9486699b92d9c8c72bb1bb5ba3f202051dcc 100644 (file)
@@ -33,6 +33,7 @@ import { toShortNotSoISOString } from '../../../helpers/dates';
 import { translate } from '../../../helpers/l10n';
 import { parseAsDate } from '../../../helpers/query';
 import { Task, TaskStatuses } from '../../../types/tasks';
+import { Component } from '../../../types/types';
 import '../background-tasks.css';
 import { CURRENTS, DEBOUNCE_DELAY, DEFAULT_FILTERS } from '../constants';
 import { mapFiltersToParameters, Query, updateTask } from '../utils';
@@ -43,7 +44,7 @@ import Stats from './Stats';
 import Tasks from './Tasks';
 
 interface Props {
-  component?: Pick<T.Component, 'key'> & { id: string }; // id should be removed when api/ce/activity accept a component key instead of an id
+  component?: Pick<Component, 'key'> & { id: string }; // id should be removed when api/ce/activity accept a component key instead of an id
   location: Location;
   router: Pick<Router, 'push'>;
 }
index 23d0b3b329404cb91e4f150f1f063ca26d7baa85..1eecb6f7a5df426d27cf90c721feeb093f629a38 100644 (file)
@@ -21,13 +21,14 @@ import * as React from 'react';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { translate } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
+import { Component } from '../../../types/types';
 
 // Do not display the pending time for values smaller than this threshold (in ms)
 const MIN_PENDING_TIME_THRESHOLD = 1000;
 
 export interface Props {
   className?: string;
-  component?: Pick<T.Component, 'key'>;
+  component?: Pick<Component, 'key'>;
   pendingCount?: number;
   pendingTime?: number;
 }
index afa78ecd9a10ebb00a55fc1b79db811e9e8afa21..92d4eeaa9c17a694917b6055ca6dce026a56b75e 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../types/types';
 import StatPendingCount from './StatPendingCount';
 import StatPendingTime from './StatPendingTime';
 import StatStillFailing from './StatStillFailing';
 
 export interface Props {
-  component?: Pick<T.Component, 'key'>;
+  component?: Pick<Component, 'key'>;
   failingCount?: number;
   onCancelAllPending: () => void;
   onShowFailing: () => void;
index f72e9d0a9b0510ba08855c2cb51590dd76501c0a..65e6a09fc8d1e0ccde6187d724f6da40e748acfd 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import { ComponentMeasure } from '../../../types/types';
 import { addComponent, addComponentChildren, getComponent, getComponentChildren } from '../bucket';
 
-const component: T.ComponentMeasure = { key: 'frodo', name: 'frodo', qualifier: 'frodo' };
+const component: ComponentMeasure = { key: 'frodo', name: 'frodo', qualifier: 'frodo' };
 
 const componentKey: string = 'foo';
-const childrenA: T.ComponentMeasure[] = [
+const childrenA: ComponentMeasure[] = [
   { key: 'foo', name: 'foo', qualifier: 'foo' },
   { key: 'bar', name: 'bar', qualifier: 'bar' }
 ];
-const childrenB: T.ComponentMeasure[] = [
+const childrenB: ComponentMeasure[] = [
   { key: 'bart', name: 'bart', qualifier: 'bart' },
   { key: 'simpson', name: 'simpson', qualifier: 'simpson' }
 ];
index 9c385131cf44fe2304839e6299cba1b706c82fae..d6f6945ac8fc964ab0813889ea9a3ce064476088 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-let bucket: T.Dict<T.ComponentMeasure> = {};
-let childrenBucket: T.Dict<{
-  children: T.ComponentMeasure[];
+
+import { Breadcrumb, ComponentMeasure, Dict } from '../../types/types';
+
+let bucket: Dict<ComponentMeasure> = {};
+let childrenBucket: Dict<{
+  children: ComponentMeasure[];
   page: number;
   total: number;
 }> = {};
-let breadcrumbsBucket: T.Dict<T.Breadcrumb[]> = {};
+let breadcrumbsBucket: Dict<Breadcrumb[]> = {};
 
-export function addComponent(component: T.ComponentMeasure): void {
+export function addComponent(component: ComponentMeasure): void {
   bucket[component.key] = component;
 }
 
-export function getComponent(componentKey: string): T.ComponentMeasure {
+export function getComponent(componentKey: string): ComponentMeasure {
   return bucket[componentKey];
 }
 
 export function addComponentChildren(
   componentKey: string,
-  children: T.ComponentMeasure[],
+  children: ComponentMeasure[],
   total: number,
   page: number
 ): void {
@@ -49,18 +52,18 @@ export function addComponentChildren(
 export function getComponentChildren(
   componentKey: string
 ): {
-  children: T.ComponentMeasure[];
+  children: ComponentMeasure[];
   page: number;
   total: number;
 } {
   return childrenBucket[componentKey];
 }
 
-export function addComponentBreadcrumbs(componentKey: string, breadcrumbs: T.Breadcrumb[]): void {
+export function addComponentBreadcrumbs(componentKey: string, breadcrumbs: Breadcrumb[]): void {
   breadcrumbsBucket[componentKey] = breadcrumbs;
 }
 
-export function getComponentBreadcrumbs(componentKey: string): T.Breadcrumb[] {
+export function getComponentBreadcrumbs(componentKey: string): Breadcrumb[] {
   return breadcrumbsBucket[componentKey];
 }
 
index 782af6e179372b905807270817edbf13f1aeaeb4..59fa5120973a511149ea70ab0ca0e3e918364a29 100644 (file)
  */
 import * as React from 'react';
 import { BranchLike } from '../../../types/branch-like';
+import { Breadcrumb, ComponentMeasure } from '../../../types/types';
 import ComponentName from './ComponentName';
 
 interface Props {
   branchLike?: BranchLike;
-  breadcrumbs: T.Breadcrumb[];
-  rootComponent: T.ComponentMeasure;
+  breadcrumbs: Breadcrumb[];
+  rootComponent: ComponentMeasure;
 }
 
 export default function Breadcrumbs({ branchLike, breadcrumbs, rootComponent }: Props) {
index 9ad1391425d5587a789b3ebef33aa631f105ee64..a66a95fc915e1aeb549c7aa900678e7c80f63fe1 100644 (file)
@@ -37,6 +37,7 @@ import { fetchBranchStatus, fetchMetrics } from '../../../store/rootActions';
 import { getMetrics } from '../../../store/rootReducer';
 import { BranchLike } from '../../../types/branch-like';
 import { isPortfolioLike } from '../../../types/component';
+import { Breadcrumb, Component, ComponentMeasure, Dict, Issue, Metric } from '../../../types/types';
 import { addComponent, addComponentBreadcrumbs, clearBucket } from '../bucket';
 import '../code.css';
 import {
@@ -51,7 +52,7 @@ import Search from './Search';
 import SourceViewerWrapper from './SourceViewerWrapper';
 
 interface StateToProps {
-  metrics: T.Dict<T.Metric>;
+  metrics: Dict<Metric>;
 }
 
 interface DispatchToProps {
@@ -61,7 +62,7 @@ interface DispatchToProps {
 
 interface OwnProps {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   location: Pick<Location, 'query'>;
   router: Pick<InjectedRouter, 'push'>;
 }
@@ -69,14 +70,14 @@ interface OwnProps {
 type Props = StateToProps & DispatchToProps & OwnProps;
 
 interface State {
-  baseComponent?: T.ComponentMeasure;
-  breadcrumbs: T.Breadcrumb[];
-  components?: T.ComponentMeasure[];
-  highlighted?: T.ComponentMeasure;
+  baseComponent?: ComponentMeasure;
+  breadcrumbs: Breadcrumb[];
+  components?: ComponentMeasure[];
+  highlighted?: ComponentMeasure;
   loading: boolean;
   page: number;
-  searchResults?: T.ComponentMeasure[];
-  sourceViewer?: T.ComponentMeasure;
+  searchResults?: ComponentMeasure[];
+  sourceViewer?: ComponentMeasure;
   total: number;
   newCodeSelected: boolean;
 }
@@ -208,11 +209,11 @@ export class CodeApp extends React.Component<Props, State> {
     }
   };
 
-  handleHighlight = (highlighted: T.ComponentMeasure) => {
+  handleHighlight = (highlighted: ComponentMeasure) => {
     this.setState({ highlighted });
   };
 
-  handleIssueChange = (_: T.Issue) => {
+  handleIssueChange = (_: Issue) => {
     this.refreshBranchStatus();
   };
 
@@ -220,11 +221,11 @@ export class CodeApp extends React.Component<Props, State> {
     this.setState({ searchResults: undefined });
   };
 
-  handleSearchResults = (searchResults: T.ComponentMeasure[] = []) => {
+  handleSearchResults = (searchResults: ComponentMeasure[] = []) => {
     this.setState({ searchResults });
   };
 
-  handleSelect = (component: T.ComponentMeasure) => {
+  handleSelect = (component: ComponentMeasure) => {
     const { branchLike, component: rootComponent } = this.props;
 
     if (component.refKey) {
index 61e9f2d02a9eaac8c76f2dc983fbb3ac70d9ec75..24361a70a490e04966c85da375fd75d5a7ca9329 100644 (file)
@@ -24,6 +24,7 @@ import { WorkspaceContext } from '../../../components/workspace/context';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
 import { MetricType } from '../../../types/metrics';
+import { ComponentMeasure as TypeComponentMeasure, Metric } from '../../../types/types';
 import ComponentMeasure from './ComponentMeasure';
 import ComponentName from './ComponentName';
 import ComponentPin from './ComponentPin';
@@ -32,12 +33,12 @@ interface Props {
   branchLike?: BranchLike;
   canBePinned?: boolean;
   canBrowse?: boolean;
-  component: T.ComponentMeasure;
+  component: TypeComponentMeasure;
   hasBaseComponent: boolean;
   isBaseComponent?: boolean;
-  metrics: T.Metric[];
-  previous?: T.ComponentMeasure;
-  rootComponent: T.ComponentMeasure;
+  metrics: Metric[];
+  previous?: TypeComponentMeasure;
+  rootComponent: TypeComponentMeasure;
   selected?: boolean;
 }
 
index 0b68c399fd838d54f2a09b62f3bd1da5f1e6ba01..bc41026f1f96925c6a714ee56c133870aa866136 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import Measure from '../../../components/measure/Measure';
 import { getLeakValue } from '../../../components/measure/utils';
 import { isDiffMetric } from '../../../helpers/measures';
+import { ComponentMeasure as TypeComponentMeasure, Metric } from '../../../types/types';
 
 interface Props {
-  component: T.ComponentMeasure;
-  metric: T.Metric;
+  component: TypeComponentMeasure;
+  metric: Metric;
 }
 
 export default class ComponentMeasure extends React.PureComponent<Props> {
index cd67da0d00e9798f28204e8e735d44cf6d9ef9bc..3dc3d132c71251c1fa6f5660b6cb9f0e515d7485 100644 (file)
@@ -32,8 +32,9 @@ import {
   isPortfolioLike,
   isProject
 } from '../../../types/component';
+import { ComponentMeasure } from '../../../types/types';
 
-export function getTooltip(component: T.ComponentMeasure) {
+export function getTooltip(component: ComponentMeasure) {
   const isFile = component.qualifier === 'FIL' || component.qualifier === 'UTS';
 
   if (isFile && component.path) {
@@ -61,9 +62,9 @@ export function mostCommonPrefix(strings: string[]) {
 export interface Props {
   branchLike?: BranchLike;
   canBrowse?: boolean;
-  component: T.ComponentMeasure;
-  previous?: T.ComponentMeasure;
-  rootComponent: T.ComponentMeasure;
+  component: ComponentMeasure;
+  previous?: ComponentMeasure;
+  rootComponent: ComponentMeasure;
   unclickable?: boolean;
 }
 
index 34ac5a6e6543185a241217a8d9361372d6ac7ac4..cd77ea623f6778da5d0dceee5ce70046687ef4c0 100644 (file)
@@ -22,10 +22,11 @@ import PinIcon from '../../../components/icons/PinIcon';
 import { WorkspaceContextShape } from '../../../components/workspace/context';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import { ComponentMeasure } from '../../../types/types';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.ComponentMeasure;
+  component: ComponentMeasure;
   openComponent: WorkspaceContextShape['openComponent'];
 }
 
index 0946b2275b90387f670878fd46195de6febecc33..449a4020f22170b36dd7205c1e1d2448483fd095 100644 (file)
@@ -22,17 +22,18 @@ import * as React from 'react';
 import withKeyboardNavigation from '../../../components/hoc/withKeyboardNavigation';
 import { getComponentMeasureUniqueKey } from '../../../helpers/component';
 import { BranchLike } from '../../../types/branch-like';
+import { ComponentMeasure, Metric } from '../../../types/types';
 import Component from './Component';
 import ComponentsEmpty from './ComponentsEmpty';
 import ComponentsHeader from './ComponentsHeader';
 
 interface Props {
-  baseComponent?: T.ComponentMeasure;
+  baseComponent?: ComponentMeasure;
   branchLike?: BranchLike;
-  components: T.ComponentMeasure[];
-  metrics: T.Metric[];
-  rootComponent: T.ComponentMeasure;
-  selected?: T.ComponentMeasure;
+  components: ComponentMeasure[];
+  metrics: Metric[];
+  rootComponent: ComponentMeasure;
+  selected?: ComponentMeasure;
 }
 
 const BASE_COLUMN_COUNT = 4;
index f458cc98484bc03fc35087fbe4569f4d01886e02..8c9067457a748323010950d60b76dc8293c19b96 100644 (file)
 import classNames from 'classnames';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { ComponentMeasure } from '../../../types/types';
 
 interface Props {
-  baseComponent?: T.ComponentMeasure;
+  baseComponent?: ComponentMeasure;
   canBePinned?: boolean;
   metrics: string[];
-  rootComponent: T.ComponentMeasure;
+  rootComponent: ComponentMeasure;
 }
 
 const SHORT_NAME_METRICS = [
index 740504eabd97de2ee92bcbd283793075cd4487e9..ce9b0da5407224cb58e1f0f8768dbcaf70eb87c0 100644 (file)
@@ -27,16 +27,17 @@ import { getBranchLikeQuery } from '../../../helpers/branch-like';
 import { KeyboardCodes } from '../../../helpers/keycodes';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import { ComponentMeasure } from '../../../types/types';
 import PortfolioNewCodeToggle from './PortfolioNewCodeToggle';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.ComponentMeasure;
+  component: ComponentMeasure;
   location: Location;
   newCodeSelected: boolean;
   onSearchClear: () => void;
   onNewCodeToggle: (newCode: boolean) => void;
-  onSearchResults: (results?: T.ComponentMeasure[]) => void;
+  onSearchResults: (results?: ComponentMeasure[]) => void;
   router: Router;
 }
 
index 874c5b3379f2e911096306c8739c88312e2e306f..73fb535bf69035478f18c68422214e43c2be935a 100644 (file)
@@ -23,13 +23,14 @@ import withKeyboardNavigation from '../../../components/hoc/withKeyboardNavigati
 import SourceViewer from '../../../components/SourceViewer/SourceViewer';
 import { scrollToElement } from '../../../helpers/scrolling';
 import { BranchLike } from '../../../types/branch-like';
+import { Issue, Measure } from '../../../types/types';
 
 interface Props {
   branchLike?: BranchLike;
   component: string;
-  componentMeasures: T.Measure[] | undefined;
+  componentMeasures: Measure[] | undefined;
   location: Pick<Location, 'query'>;
-  onIssueChange?: (issue: T.Issue) => void;
+  onIssueChange?: (issue: Issue) => void;
 }
 
 export class SourceViewerWrapper extends React.PureComponent<Props> {
index 3f957269065d4da26c69502dea0d770c87fdd880..99e094128a19eae042c68a7bddc5de220bdcd5f3 100644 (file)
@@ -22,6 +22,7 @@ import { getBranchLikeQuery, isPullRequest } from '../../helpers/branch-like';
 import { BranchLike } from '../../types/branch-like';
 import { isPortfolioLike } from '../../types/component';
 import { MetricKey } from '../../types/metrics';
+import { Breadcrumb, ComponentMeasure } from '../../types/types';
 import {
   addComponent,
   addComponentBreadcrumbs,
@@ -74,7 +75,7 @@ const LEAK_METRICS = [
 const PAGE_SIZE = 100;
 
 interface Children {
-  components: T.ComponentMeasure[];
+  components: ComponentMeasure[];
   page: number;
   total: number;
 }
@@ -91,17 +92,17 @@ export function showLeakMeasure(branchLike?: BranchLike) {
   return isPullRequest(branchLike);
 }
 
-function skipRootDir(breadcrumbs: T.ComponentMeasure[]) {
+function skipRootDir(breadcrumbs: ComponentMeasure[]) {
   return breadcrumbs.filter(component => {
     return !(component.qualifier === 'DIR' && component.name === '/');
   });
 }
 
-function storeChildrenBase(children: T.ComponentMeasure[]) {
+function storeChildrenBase(children: ComponentMeasure[]) {
   children.forEach(addComponent);
 }
 
-function storeChildrenBreadcrumbs(parentComponentKey: string, children: T.Breadcrumb[]) {
+function storeChildrenBreadcrumbs(parentComponentKey: string, children: Breadcrumb[]) {
   const parentBreadcrumbs = getComponentBreadcrumbs(parentComponentKey);
   if (parentBreadcrumbs) {
     children.forEach(child => {
@@ -166,7 +167,7 @@ export function retrieveComponentChildren(
   qualifier: string,
   instance: { mounted: boolean },
   branchLike?: BranchLike
-): Promise<{ components: T.ComponentMeasure[]; page: number; total: number }> {
+): Promise<{ components: ComponentMeasure[]; page: number; total: number }> {
   const existing = getComponentChildren(componentKey);
   if (existing) {
     return Promise.resolve({
@@ -200,7 +201,7 @@ function retrieveComponentBreadcrumbs(
   component: string,
   instance: { mounted: boolean },
   branchLike?: BranchLike
-): Promise<T.Breadcrumb[]> {
+): Promise<Breadcrumb[]> {
   const existing = getComponentBreadcrumbs(component);
   if (existing) {
     return Promise.resolve(existing);
@@ -222,9 +223,9 @@ export function retrieveComponent(
   instance: { mounted: boolean },
   branchLike?: BranchLike
 ): Promise<{
-  breadcrumbs: T.Breadcrumb[];
-  component: T.ComponentMeasure;
-  components: T.ComponentMeasure[];
+  breadcrumbs: Breadcrumb[];
+  component: ComponentMeasure;
+  components: ComponentMeasure[];
   page: number;
   total: number;
 }> {
index 0d2b133c77cc2b05acc84fce0c1123f41a7009c7..da930cbf7793eb175155feab116092d39c7cbf92 100644 (file)
 import * as React from 'react';
 import { Profile as BaseProfile } from '../../../api/quality-profiles';
 import { Button } from '../../../components/controls/buttons';
+import { Rule, RuleActivation, RuleDetails } from '../../../types/types';
 import ActivationFormModal from './ActivationFormModal';
 
 interface Props {
-  activation?: T.RuleActivation;
+  activation?: RuleActivation;
   buttonText: string;
   className?: string;
   modalHeader: string;
   onDone: (severity: string) => Promise<void>;
   profiles: BaseProfile[];
-  rule: T.Rule | T.RuleDetails;
+  rule: Rule | RuleDetails;
 }
 
 interface State {
index dd4a680feb01e48b666da0d7c5d424018f4a2cde..1c963c7702d394e6d37c97da6a1d814e1f59ffe5 100644 (file)
@@ -28,19 +28,20 @@ import { Alert } from '../../../components/ui/Alert';
 import { SEVERITIES } from '../../../helpers/constants';
 import { translate } from '../../../helpers/l10n';
 import { sanitizeString } from '../../../helpers/sanitize';
+import { Dict, Rule, RuleActivation, RuleDetails } from '../../../types/types';
 import { sortProfiles } from '../../quality-profiles/utils';
 
 interface Props {
-  activation?: T.RuleActivation;
+  activation?: RuleActivation;
   modalHeader: string;
   onClose: () => void;
   onDone: (severity: string) => Promise<void>;
   profiles: Profile[];
-  rule: T.Rule | T.RuleDetails;
+  rule: Rule | RuleDetails;
 }
 
 interface State {
-  params: T.Dict<string>;
+  params: Dict<string>;
   profile: string;
   severity: string;
   submitting: boolean;
@@ -69,7 +70,7 @@ export default class ActivationFormModal extends React.PureComponent<Props, Stat
   }
 
   getParams = ({ activation, rule } = this.props) => {
-    const params: T.Dict<string> = {};
+    const params: Dict<string> = {};
     if (rule && rule.params) {
       for (const param of rule.params) {
         params[param.key] = param.defaultValue || '';
@@ -148,7 +149,7 @@ export default class ActivationFormModal extends React.PureComponent<Props, Stat
     const { profile, severity, submitting } = this.state;
     const { params = [] } = rule;
     const profilesWithDepth = this.getQualityProfilesWithDepth();
-    const isCustomRule = !!(rule as T.RuleDetails).templateKey;
+    const isCustomRule = !!(rule as RuleDetails).templateKey;
     const activeInAllProfiles = profilesWithDepth.length <= 0;
     const isUpdateMode = !!activation;
 
index 52157b6699847e6994e6c3397d14b024c5a959b2..90ca67697d9b419959be8b9c215ad2a20d06293c 100644 (file)
@@ -44,6 +44,15 @@ import { scrollToElement } from '../../../helpers/scrolling';
 import { isLoggedIn } from '../../../helpers/users';
 import { getCurrentUser, getLanguages, Store } from '../../../store/rootReducer';
 import { SecurityStandard } from '../../../types/security';
+import {
+  CurrentUser,
+  Dict,
+  Languages,
+  Paging,
+  RawQuery,
+  Rule,
+  RuleActivation
+} from '../../../types/types';
 import {
   shouldOpenSonarSourceSecurityFacet,
   shouldOpenStandardsChildFacet,
@@ -78,8 +87,8 @@ const MAX_SEARCH_LENGTH = 200;
 const LIMIT_BEFORE_LOAD_MORE = 5;
 
 interface Props extends WithRouterProps {
-  currentUser: T.CurrentUser;
-  languages: T.Languages;
+  currentUser: CurrentUser;
+  languages: Languages;
 }
 
 interface State {
@@ -88,12 +97,12 @@ interface State {
   facets?: Facets;
   loading: boolean;
   openFacets: OpenFacets;
-  openRule?: T.Rule;
-  paging?: T.Paging;
+  openRule?: Rule;
+  paging?: Paging;
   query: Query;
-  referencedProfiles: T.Dict<Profile>;
-  referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
-  rules: T.Rule[];
+  referencedProfiles: Dict<Profile>;
+  referencedRepositories: Dict<{ key: string; language: string; name: string }>;
+  rules: Rule[];
   selected?: string;
   usingPermalink?: boolean;
 }
@@ -184,7 +193,7 @@ export class App extends React.PureComponent<Props, State> {
 
   detachShortcuts = () => key.deleteScope('coding-rules');
 
-  getOpenRule = (props: Props, rules: T.Rule[]) => {
+  getOpenRule = (props: Props, rules: Rule[]) => {
     const open = getOpen(props.location.query);
     return open && rules.find(rule => rule.key === open);
   };
@@ -244,7 +253,7 @@ export class App extends React.PureComponent<Props, State> {
     );
   };
 
-  makeFetchRequest = (query?: T.RawQuery) =>
+  makeFetchRequest = (query?: RawQuery) =>
     searchRules({ ...this.getSearchParameters(), ...query }).then(
       ({ actives: rawActives, facets: rawFacets, p, ps, rules, total }) => {
         const actives = rawActives && parseActives(rawActives);
@@ -254,7 +263,7 @@ export class App extends React.PureComponent<Props, State> {
       }
     );
 
-  fetchFirstRules = (query?: T.RawQuery) => {
+  fetchFirstRules = (query?: RawQuery) => {
     this.setState({ loading: true });
     this.makeFetchRequest(query).then(({ actives, facets, paging, rules }) => {
       if (this.mounted) {
@@ -474,7 +483,7 @@ export class App extends React.PureComponent<Props, State> {
   handleReset = () => this.props.router.push({ pathname: this.props.location.pathname });
 
   /** Tries to take rule by index, or takes the last one  */
-  pickRuleAround = (rules: T.Rule[], selectedIndex: number | undefined) => {
+  pickRuleAround = (rules: Rule[], selectedIndex: number | undefined) => {
     if (selectedIndex === undefined || rules.length === 0) {
       return undefined;
     }
@@ -672,7 +681,7 @@ export class App extends React.PureComponent<Props, State> {
   }
 }
 
-function parseActives(rawActives: T.Dict<T.RuleActivation[]>) {
+function parseActives(rawActives: Dict<RuleActivation[]>) {
   const actives: Actives = {};
   for (const [rule, activations] of Object.entries(rawActives)) {
     actives[rule] = {};
@@ -686,7 +695,7 @@ function parseActives(rawActives: T.Dict<T.RuleActivation[]>) {
 function parseFacets(rawFacets: { property: string; values: { count: number; val: string }[] }[]) {
   const facets: Facets = {};
   for (const rawFacet of rawFacets) {
-    const values: T.Dict<number> = {};
+    const values: Dict<number> = {};
     for (const rawValue of rawFacet.values) {
       values[rawValue.val] = rawValue.count;
     }
index c1fa64a87585db6bfc055451206f2893260c736c..06b15dff35a21f74080396057f527c2310650eb0 100644 (file)
@@ -24,13 +24,14 @@ import Dropdown from '../../../components/controls/Dropdown';
 import Tooltip from '../../../components/controls/Tooltip';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { translate } from '../../../helpers/l10n';
+import { Dict, Languages } from '../../../types/types';
 import { Query } from '../query';
 import BulkChangeModal from './BulkChangeModal';
 
 interface Props {
-  languages: T.Languages;
+  languages: Languages;
   query: Query;
-  referencedProfiles: T.Dict<Profile>;
+  referencedProfiles: Dict<Profile>;
   total: number;
 }
 
index bb853cf92c57e6c1edff06208612a6190bf638f9..c286d89510e50afe3d6f3448fcc601f24a02225b 100644 (file)
@@ -25,15 +25,16 @@ import SelectLegacy from '../../../components/controls/SelectLegacy';
 import { Alert } from '../../../components/ui/Alert';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
+import { Dict, Languages } from '../../../types/types';
 import { Query, serializeQuery } from '../query';
 
 interface Props {
   action: string;
-  languages: T.Languages;
+  languages: Languages;
   onClose: () => void;
   profile?: Profile;
   query: Query;
-  referencedProfiles: T.Dict<Profile>;
+  referencedProfiles: Dict<Profile>;
   total: number;
 }
 
index d6c87f1c5c1a77c5cb4bc98827d71bb476f910b4..d1b0d9f28d36d78aab64af92f1c8c3e191e33b64 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { RuleDetails } from '../../../types/types';
 import CustomRuleFormModal from './CustomRuleFormModal';
 
 interface Props {
   children: (props: { onClick: () => void }) => React.ReactNode;
-  customRule?: T.RuleDetails;
-  onDone: (newRuleDetails: T.RuleDetails) => void;
-  templateRule: T.RuleDetails;
+  customRule?: RuleDetails;
+  onDone: (newRuleDetails: RuleDetails) => void;
+  templateRule: RuleDetails;
 }
 
 interface State {
@@ -53,7 +54,7 @@ export default class CustomRuleButton extends React.PureComponent<Props, State>
     }
   };
 
-  handleDone = (newRuleDetails: T.RuleDetails) => {
+  handleDone = (newRuleDetails: RuleDetails) => {
     this.handleModalClose();
     this.props.onDone(newRuleDetails);
   };
index 25fcb3c8e604de4d528dc2eabc21b27176f1f912..0d6482a6c73d5f444dc988c9382eecad21a7285e 100644 (file)
@@ -33,12 +33,13 @@ import { csvEscape } from '../../../helpers/csv';
 import { translate } from '../../../helpers/l10n';
 import { sanitizeString } from '../../../helpers/sanitize';
 import { latinize } from '../../../helpers/strings';
+import { Dict, RuleDetails, RuleParameter, RuleType } from '../../../types/types';
 
 interface Props {
-  customRule?: T.RuleDetails;
+  customRule?: RuleDetails;
   onClose: () => void;
-  onDone: (newRuleDetails: T.RuleDetails) => void;
-  templateRule: T.RuleDetails;
+  onDone: (newRuleDetails: RuleDetails) => void;
+  templateRule: RuleDetails;
 }
 
 interface State {
@@ -46,7 +47,7 @@ interface State {
   key: string;
   keyModifiedByUser: boolean;
   name: string;
-  params: T.Dict<string>;
+  params: Dict<string>;
   reactivating: boolean;
   severity: string;
   status: string;
@@ -59,7 +60,7 @@ export default class CustomRuleFormModal extends React.PureComponent<Props, Stat
 
   constructor(props: Props) {
     super(props);
-    const params: T.Dict<string> = {};
+    const params: Dict<string> = {};
     if (props.customRule && props.customRule.params) {
       for (const param of props.customRule.params) {
         params[param.key] = param.defaultValue || '';
@@ -211,7 +212,7 @@ export default class CustomRuleFormModal extends React.PureComponent<Props, Stat
     </div>
   );
 
-  renderTypeOption = ({ value }: { value: T.RuleType }) => {
+  renderTypeOption = ({ value }: { value: RuleType }) => {
     return <TypeHelper type={value} />;
   };
 
@@ -277,7 +278,7 @@ export default class CustomRuleFormModal extends React.PureComponent<Props, Stat
     </div>
   );
 
-  renderParameterField = (param: T.RuleParameter) => (
+  renderParameterField = (param: RuleParameter) => (
     <div className="modal-field" key={param.key}>
       <label className="capitalize" htmlFor={param.key}>
         {param.key}
index c5af27f619f863e6cd9b5fbe5428dcf2b2022483..6da6f1e5966ed5a80cbf20e3ac2986c25030ce15 100644 (file)
@@ -27,13 +27,14 @@ import FacetItem from '../../../components/facet/FacetItem';
 import FacetItemsList from '../../../components/facet/FacetItemsList';
 import { translate } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
+import { Dict } from '../../../types/types';
 import { FacetKey } from '../query';
 
 export interface BasicProps {
-  onChange: (changes: T.Dict<string | string[] | undefined>) => void;
+  onChange: (changes: Dict<string | string[] | undefined>) => void;
   onToggle: (facet: FacetKey) => void;
   open: boolean;
-  stats?: T.Dict<number>;
+  stats?: Dict<number>;
   values: string[];
 }
 
index 2cedf3297aab8a8320d83da38ed03d0381785833..fd68568f7235f92b94a523e23800723b709a4a5f 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { Profile } from '../../../api/quality-profiles';
+import { Dict } from '../../../types/types';
 import StandardFacet from '../../issues/sidebar/StandardFacet';
 import { Facets, OpenFacets, Query } from '../query';
 import ActivationSeverityFacet from './ActivationSeverityFacet';
@@ -40,8 +41,8 @@ export interface FacetsListProps {
   onFilterChange: (changes: Partial<Query>) => void;
   openFacets: OpenFacets;
   query: Query;
-  referencedProfiles: T.Dict<Profile>;
-  referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
+  referencedProfiles: Dict<Profile>;
+  referencedRepositories: Dict<{ key: string; language: string; name: string }>;
   selectedProfile?: Profile;
 }
 
index 73c9b85d5cb6f5af42538e44e1c985e78b586284..839997efa8a840242aa5498092c16fca5120466a 100644 (file)
  */
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { RuleInheritance } from '../../../types/types';
 import Facet, { BasicProps } from './Facet';
 
-interface Props extends T.Omit<BasicProps, 'values'> {
+interface Props extends Omit<BasicProps, 'values'> {
   disabled: boolean;
-  value: T.RuleInheritance | undefined;
+  value: RuleInheritance | undefined;
 }
 
 export default class InheritanceFacet extends React.PureComponent<Props> {
-  renderName = (value: T.RuleInheritance) =>
+  renderName = (value: RuleInheritance) =>
     translate('coding_rules.filters.inheritance', value.toLowerCase());
 
   render() {
index 29a76efda9cb8889b96b1e231f0427fbff50605f..41f81b86009e1b792e6a5698c42c0842c1481e84 100644 (file)
@@ -23,11 +23,12 @@ import ReloadButton from '../../../components/controls/ReloadButton';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import PageShortcutsTooltip from '../../../components/ui/PageShortcutsTooltip';
 import { translate } from '../../../helpers/l10n';
+import { Paging } from '../../../types/types';
 
 export interface PageActionsProps {
   loading: boolean;
   onReload: () => void;
-  paging?: T.Paging;
+  paging?: Paging;
   selectedIndex?: number;
 }
 
index bd968b073ab5d1fc7745b0dc758c1bdcee30a916..95708f97f095ef04efa29be2ef6efe9c1e8b4f84 100644 (file)
@@ -27,6 +27,7 @@ import FacetHeader from '../../../components/facet/FacetHeader';
 import FacetItem from '../../../components/facet/FacetItem';
 import FacetItemsList from '../../../components/facet/FacetItemsList';
 import { translate } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 import { FacetKey, Query } from '../query';
 
 interface Props {
@@ -36,7 +37,7 @@ interface Props {
   onChange: (changes: Partial<Query>) => void;
   onToggle: (facet: FacetKey) => void;
   open: boolean;
-  referencedProfiles: T.Dict<Profile>;
+  referencedProfiles: Dict<Profile>;
   value: string | undefined;
 }
 
index cc1b0767edbcca3ff566a3fcf33ea0a9b7382a25..b4588d7da8d7497010aa35889fa66d663513b77a 100644 (file)
@@ -24,14 +24,15 @@ import ListStyleFacet from '../../../components/facet/ListStyleFacet';
 import { translate } from '../../../helpers/l10n';
 import { highlightTerm } from '../../../helpers/search';
 import { getLanguages, Store } from '../../../store/rootReducer';
+import { Dict } from '../../../types/types';
 import { BasicProps } from './Facet';
 
 interface StateProps {
-  referencedLanguages: T.Dict<{ key: string; name: string }>;
+  referencedLanguages: Dict<{ key: string; name: string }>;
 }
 
 interface Props extends BasicProps, StateProps {
-  referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
+  referencedRepositories: Dict<{ key: string; language: string; name: string }>;
 }
 
 export class RepositoryFacet extends React.PureComponent<Props> {
index 09198ba7b40fb5b1992758ca9181aaf1519a73a7..df5379be796c82a612b04fe7e124d52302d2eeff 100644 (file)
@@ -25,6 +25,7 @@ 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 { Dict, RuleActivation, RuleDetails as TypeRuleDetails } from '../../../types/types';
 import { Activation, Query } from '../query';
 import CustomRuleButton from './CustomRuleButton';
 import RuleDetailsCustomRules from './RuleDetailsCustomRules';
@@ -42,16 +43,16 @@ interface Props {
   onDeactivate: (profile: string, rule: string) => void;
   onDelete: (rule: string) => void;
   onFilterChange: (changes: Partial<Query>) => void;
-  referencedProfiles: T.Dict<Profile>;
-  referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
+  referencedProfiles: Dict<Profile>;
+  referencedRepositories: Dict<{ key: string; language: string; name: string }>;
   ruleKey: string;
   selectedProfile?: Profile;
 }
 
 interface State {
-  actives?: T.RuleActivation[];
+  actives?: RuleActivation[];
   loading: boolean;
-  ruleDetails?: T.RuleDetails;
+  ruleDetails?: TypeRuleDetails;
 }
 
 export default class RuleDetails extends React.PureComponent<Props, State> {
@@ -93,7 +94,7 @@ export default class RuleDetails extends React.PureComponent<Props, State> {
     );
   };
 
-  handleRuleChange = (ruleDetails: T.RuleDetails) => {
+  handleRuleChange = (ruleDetails: TypeRuleDetails) => {
     if (this.mounted) {
       this.setState({ ruleDetails });
     }
index 7acce41dcb17ffbdd54b54f5c6165005e51ec552..c6a867a8bed0851f9824156d7b9f805512f6e171 100644 (file)
@@ -27,16 +27,17 @@ import SeverityHelper from '../../../components/shared/SeverityHelper';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { getRuleUrl } from '../../../helpers/urls';
+import { Rule, RuleDetails } from '../../../types/types';
 import CustomRuleButton from './CustomRuleButton';
 
 interface Props {
   canChange?: boolean;
-  ruleDetails: T.RuleDetails;
+  ruleDetails: RuleDetails;
 }
 
 interface State {
   loading: boolean;
-  rules?: T.Rule[];
+  rules?: Rule[];
 }
 
 export default class RuleDetailsCustomRules extends React.PureComponent<Props, State> {
@@ -77,7 +78,7 @@ export default class RuleDetailsCustomRules extends React.PureComponent<Props, S
     );
   };
 
-  handleRuleCreate = (newRuleDetails: T.RuleDetails) => {
+  handleRuleCreate = (newRuleDetails: RuleDetails) => {
     if (this.mounted) {
       this.setState(({ rules = [] }: State) => ({
         rules: [...rules, newRuleDetails]
@@ -95,7 +96,7 @@ export default class RuleDetailsCustomRules extends React.PureComponent<Props, S
     });
   };
 
-  renderRule = (rule: T.Rule) => (
+  renderRule = (rule: Rule) => (
     <tr data-rule={rule.key} key={rule.key}>
       <td className="coding-rules-detail-list-name">
         <Link to={getRuleUrl(rule.key)}>{rule.name}</Link>
index 79eb7b4007a40d67e2a4f5006fee7ef2c63141a1..83be0999eb9af9acdec748e5508bec518732089b 100644 (file)
@@ -23,12 +23,13 @@ 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 { RuleDetails } from '../../../types/types';
 import RemoveExtendedDescriptionModal from './RemoveExtendedDescriptionModal';
 
 interface Props {
   canWrite: boolean | undefined;
-  onChange: (newRuleDetails: T.RuleDetails) => void;
-  ruleDetails: T.RuleDetails;
+  onChange: (newRuleDetails: RuleDetails) => void;
+  ruleDetails: RuleDetails;
 }
 
 interface State {
index af2f02e39abbed2945ca9c5e126c1bacbcfc5e69..9012c4cbff858d269b8cc7bc8c4636edb1bb704a 100644 (file)
@@ -26,10 +26,11 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
 import { getIssuesUrl } from '../../../helpers/urls';
+import { AppState, RuleDetails } from '../../../types/types';
 
 interface Props {
-  appState: Pick<T.AppState, 'branchesEnabled'>;
-  ruleDetails: Pick<T.RuleDetails, 'key' | 'type'>;
+  appState: Pick<AppState, 'branchesEnabled'>;
+  ruleDetails: Pick<RuleDetails, 'key' | 'type'>;
 }
 
 interface Project {
index aa1a09e4e84a0025543cfa3c0738811ca9c55e0b..7f536e71b4d7cd5aad053f1bbcaa7aca95417efd 100644 (file)
@@ -31,6 +31,7 @@ import TagsList from '../../../components/tags/TagsList';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { getRuleUrl } from '../../../helpers/urls';
+import { Dict, RuleDetails } from '../../../types/types';
 import { Query } from '../query';
 import RuleDetailsTagsPopup from './RuleDetailsTagsPopup';
 import SimilarRulesFilter from './SimilarRulesFilter';
@@ -40,8 +41,8 @@ interface Props {
   hideSimilarRulesFilter?: boolean;
   onFilterChange: (changes: Partial<Query>) => void;
   onTagsChange: (tags: string[]) => void;
-  referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
-  ruleDetails: T.RuleDetails;
+  referencedRepositories: Dict<{ key: string; language: string; name: string }>;
+  ruleDetails: RuleDetails;
 }
 
 const EXTERNAL_RULE_REPO_PREFIX = 'external_';
index 58ff41b223a59e1695032bba5dc2ea7d67188539..0ac6449d6061863cf7222f338d367afcf6b137ef 100644 (file)
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { sanitizeString } from '../../../helpers/sanitize';
+import { RuleParameter } from '../../../types/types';
 
 interface Props {
-  params: T.RuleParameter[];
+  params: RuleParameter[];
 }
 
 export default class RuleDetailsParameters extends React.PureComponent<Props> {
-  renderParameter = (param: T.RuleParameter) => (
+  renderParameter = (param: RuleParameter) => (
     <tr className="coding-rules-detail-parameter" key={param.key}>
       <td className="coding-rules-detail-parameter-name">{param.key}</td>
       <td className="coding-rules-detail-parameter-description">
index 5155a3d0dbfff15ab21c9035065ec3f316e23998..28274295ed88bd67d248a84cfc64704cfcae1080 100644 (file)
@@ -28,17 +28,18 @@ import Tooltip from '../../../components/controls/Tooltip';
 import SeverityHelper from '../../../components/shared/SeverityHelper';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { getQualityProfileUrl } from '../../../helpers/urls';
+import { Dict, RuleActivation, RuleDetails } from '../../../types/types';
 import BuiltInQualityProfileBadge from '../../quality-profiles/components/BuiltInQualityProfileBadge';
 import ActivationButton from './ActivationButton';
 import RuleInheritanceIcon from './RuleInheritanceIcon';
 
 interface Props {
-  activations: T.RuleActivation[] | undefined;
+  activations: RuleActivation[] | undefined;
   canWrite: boolean | undefined;
   onActivate: () => Promise<void>;
   onDeactivate: () => Promise<void>;
-  referencedProfiles: T.Dict<Profile>;
-  ruleDetails: T.RuleDetails;
+  referencedProfiles: Dict<Profile>;
+  ruleDetails: RuleDetails;
 }
 
 export default class RuleDetailsProfiles extends React.PureComponent<Props> {
@@ -63,7 +64,7 @@ export default class RuleDetailsProfiles extends React.PureComponent<Props> {
     }
   };
 
-  renderInheritedProfile = (activation: T.RuleActivation, profile: Profile) => {
+  renderInheritedProfile = (activation: RuleActivation, profile: Profile) => {
     if (!profile.parentName) {
       return null;
     }
@@ -82,7 +83,7 @@ export default class RuleDetailsProfiles extends React.PureComponent<Props> {
     );
   };
 
-  renderSeverity = (activation: T.RuleActivation, parentActivation?: T.RuleActivation) => (
+  renderSeverity = (activation: RuleActivation, parentActivation?: RuleActivation) => (
     <td className="coding-rules-detail-quality-profile-severity">
       <Tooltip overlay={translate('coding_rules.activation_severity')}>
         <span>
@@ -97,10 +98,7 @@ export default class RuleDetailsProfiles extends React.PureComponent<Props> {
     </td>
   );
 
-  renderParameter = (
-    param: { key: string; value: string },
-    parentActivation?: T.RuleActivation
-  ) => {
+  renderParameter = (param: { key: string; value: string }, parentActivation?: RuleActivation) => {
     const originalParam =
       parentActivation && parentActivation.params.find(p => p.key === param.key);
     const originalValue = originalParam && originalParam.value;
@@ -121,13 +119,13 @@ export default class RuleDetailsProfiles extends React.PureComponent<Props> {
     );
   };
 
-  renderParameters = (activation: T.RuleActivation, parentActivation?: T.RuleActivation) => (
+  renderParameters = (activation: RuleActivation, parentActivation?: RuleActivation) => (
     <td className="coding-rules-detail-quality-profile-parameters">
       {activation.params.map(param => this.renderParameter(param, parentActivation))}
     </td>
   );
 
-  renderActions = (activation: T.RuleActivation, profile: Profile) => {
+  renderActions = (activation: RuleActivation, profile: Profile) => {
     const canEdit = profile.actions && profile.actions.edit && !profile.isBuiltIn;
     const { ruleDetails } = this.props;
     const hasParent = activation.inherit !== 'NONE' && profile.parentKey;
@@ -189,7 +187,7 @@ export default class RuleDetailsProfiles extends React.PureComponent<Props> {
     );
   };
 
-  renderActivation = (activation: T.RuleActivation) => {
+  renderActivation = (activation: RuleActivation) => {
     const { activations = [], ruleDetails } = this.props;
     const profile = this.props.referencedProfiles[activation.qProfile];
     if (!profile) {
index 958400360f537a395a9dbf3c8a0fbe318c84e34c..4e872e4f751cbbd19f952c671c630784a7950ac7 100644 (file)
  */
 import * as React from 'react';
 import { colors } from '../../../app/theme';
+import { RuleInheritance } from '../../../types/types';
 
 interface Props {
   className?: string;
-  inheritance: T.RuleInheritance;
+  inheritance: RuleInheritance;
 }
 
 export default function RuleInheritanceIcon({ className, inheritance, ...other }: Props) {
index 8900d75c92b45d304e47e5043a46cd1ee650964f..3ad661d4fa9fa7a3395a695716e2ec9ec86b9bda 100644 (file)
@@ -29,6 +29,7 @@ import SeverityIcon from '../../../components/icons/SeverityIcon';
 import TagsList from '../../../components/tags/TagsList';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { getRuleUrl } from '../../../helpers/urls';
+import { Rule } from '../../../types/types';
 import { Activation, Query } from '../query';
 import ActivationButton from './ActivationButton';
 import RuleInheritanceIcon from './RuleInheritanceIcon';
@@ -42,7 +43,7 @@ interface Props {
   onDeactivate: (profile: string, rule: string) => void;
   onFilterChange: (changes: Partial<Query>) => void;
   onOpen: (ruleKey: string) => void;
-  rule: T.Rule;
+  rule: Rule;
   selected: boolean;
   selectedProfile?: Profile;
 }
index c859875597c8f435bb0bd3ebca61bda73addc5fe..9ccadb9d90f8eb53c5105de61da2f18d4ef9f9c0 100644 (file)
@@ -25,11 +25,12 @@ import IssueTypeIcon from '../../../components/icons/IssueTypeIcon';
 import TagsIcon from '../../../components/icons/TagsIcon';
 import SeverityHelper from '../../../components/shared/SeverityHelper';
 import { translate } from '../../../helpers/l10n';
+import { Rule } from '../../../types/types';
 import { Query } from '../query';
 
 interface Props {
   onFilterChange: (changes: Partial<Query>) => void;
-  rule: T.Rule;
+  rule: Rule;
 }
 
 export default class SimilarRulesFilter extends React.PureComponent<Props> {
index 7cd1a8bcc195ddb2b405af9c641177a0a7133224..3dde2ac9a6d6ca7eba678ab4e02ac4cfacc17aae 100644 (file)
@@ -22,7 +22,7 @@ import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { translate } from '../../../helpers/l10n';
 import Facet, { BasicProps } from './Facet';
 
-interface Props extends T.Omit<BasicProps, 'onChange' | 'values'> {
+interface Props extends Omit<BasicProps, 'onChange' | 'values'> {
   onChange: (changes: { template: boolean | undefined }) => void;
   value: boolean | undefined;
 }
index a4b82a0412a07566da0af29d7448eda63fde5a32..8541df8727580c2bcb7772d793dd140aba1ce26f 100644 (file)
 
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { Paging } from '../../../../types/types';
 import PageActions, { PageActionsProps } from '../PageActions';
 
 it('should render correctly', () => {
   expect(shallowRender()).toMatchSnapshot('default');
   expect(shallowRender({ loading: true })).toMatchSnapshot('loading');
-  expect(shallowRender({ paging: { total: 100 } as T.Paging })).toMatchSnapshot('with paging');
+  expect(shallowRender({ paging: { total: 100 } as Paging })).toMatchSnapshot('with paging');
 });
 
 function shallowRender(props: Partial<PageActionsProps> = {}) {
index 2bda64184fe3f870b06807d42de3ef7094c718bf..bc56f355155c9a0b863484bc99cda4b31afaf561 100644 (file)
@@ -23,6 +23,7 @@ import * as React from 'react';
 import { deleteRule, getRuleDetails, updateRule } from '../../../../api/rules';
 import { mockQualityProfile } from '../../../../helpers/testMocks';
 import { waitAndUpdate } from '../../../../helpers/testUtils';
+import { RuleType } from '../../../../types/types';
 import RuleDetails from '../RuleDetails';
 
 jest.mock('../../../../api/rules', () => {
@@ -104,7 +105,7 @@ it('should correctly handle rule changes', () => {
     repo: 'bar',
     severity: 'MAJOR',
     status: 'READY',
-    type: 'BUG' as T.RuleType
+    type: 'BUG' as RuleType
   };
 
   wrapper.instance().handleRuleChange(ruleChange);
index 783583d9f57d011f728785eae699c90db50cd61e..4787fb62fe045886c5aad75d0ddd821abe461886 100644 (file)
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { change, click, waitAndUpdate } from '../../../../helpers/testUtils';
+import { RuleDetails } from '../../../../types/types';
 import RuleDetailsDescription from '../RuleDetailsDescription';
 
 jest.mock('../../../../api/rules', () => ({
   updateRule: jest.fn().mockResolvedValue('updatedrule')
 }));
 
-const RULE: T.RuleDetails = {
+const RULE: RuleDetails = {
   key: 'squid:S1133',
   repo: 'squid',
   name: 'Deprecated code should be removed',
@@ -40,7 +41,7 @@ const RULE: T.RuleDetails = {
   type: 'CODE_SMELL'
 };
 
-const EXTERNAL_RULE: T.RuleDetails = {
+const EXTERNAL_RULE: RuleDetails = {
   createdAt: '2013-07-26T09:40:51+0200',
   key: 'external_xoo:OneExternalIssuePerLine',
   repo: 'external_xoo',
@@ -51,7 +52,7 @@ const EXTERNAL_RULE: T.RuleDetails = {
   type: 'UNKNOWN'
 };
 
-const EXTERNAL_RULE_WITH_DATA: T.RuleDetails = {
+const EXTERNAL_RULE_WITH_DATA: RuleDetails = {
   key: 'external_xoo:OneExternalIssueWithDetailsPerLine',
   repo: 'external_xoo',
   name: 'One external issue per line',
index cddc097c8721e8cc5226806a70dba4d3a445801d..a8fe6708c9d5c7d0482664e5a8780621f4d5046f 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { RuleDetails } from '../../../../types/types';
 import RuleDetailsMeta from '../RuleDetailsMeta';
 import RuleDetailsTagsPopup from '../RuleDetailsTagsPopup';
 
-const RULE: T.RuleDetails = {
+const RULE: RuleDetails = {
   key: 'squid:S1133',
   repo: 'squid',
   name: 'Deprecated code should be removed',
@@ -35,7 +36,7 @@ const RULE: T.RuleDetails = {
   type: 'CODE_SMELL'
 };
 
-const EXTERNAL_RULE: T.RuleDetails = {
+const EXTERNAL_RULE: RuleDetails = {
   key: 'external_xoo:OneExternalIssuePerLine',
   repo: 'external_xoo',
   name: 'xoo:OneExternalIssuePerLine',
@@ -47,7 +48,7 @@ const EXTERNAL_RULE: T.RuleDetails = {
   type: 'UNKNOWN'
 };
 
-const EXTERNAL_RULE_WITH_DATA: T.RuleDetails = {
+const EXTERNAL_RULE_WITH_DATA: RuleDetails = {
   key: 'external_xoo:OneExternalIssueWithDetailsPerLine',
   repo: 'external_xoo',
   name: 'One external issue per line',
index b851a8a2369b4ecd111ed66eb04a5ceb62227257..0407fef13fc4cda7997912d62226472762daa1ae 100644 (file)
@@ -30,6 +30,7 @@ import {
   serializeString,
   serializeStringArray
 } from '../../helpers/query';
+import { Dict, RawQuery, RuleInheritance } from '../../types/types';
 
 export interface Query {
   activation: boolean | undefined;
@@ -37,7 +38,7 @@ export interface Query {
   availableSince: Date | undefined;
   compareToProfile: string | undefined;
   cwe: string[];
-  inheritance: T.RuleInheritance | undefined;
+  inheritance: RuleInheritance | undefined;
   languages: string[];
   owaspTop10: string[];
   profile: string | undefined;
@@ -61,10 +62,10 @@ export interface Facet {
 
 export type Facets = { [F in FacetKey]?: Facet };
 
-export type OpenFacets = T.Dict<boolean>;
+export type OpenFacets = Dict<boolean>;
 
 export interface Activation {
-  inherit: T.RuleInheritance;
+  inherit: RuleInheritance;
   severity: string;
 }
 
@@ -74,7 +75,7 @@ export interface Actives {
   };
 }
 
-export function parseQuery(query: T.RawQuery): Query {
+export function parseQuery(query: RawQuery): Query {
   return {
     activation: parseAsOptionalBoolean(query.activation),
     activationSeverities: parseAsArray(query.active_severities, parseAsString),
@@ -98,7 +99,7 @@ export function parseQuery(query: T.RawQuery): Query {
   };
 }
 
-export function serializeQuery(query: Query): T.RawQuery {
+export function serializeQuery(query: Query): RawQuery {
   return cleanQuery({
     activation: serializeOptionalBoolean(query.activation),
     active_severities: serializeStringArray(query.activationSeverities),
@@ -122,7 +123,7 @@ export function serializeQuery(query: Query): T.RawQuery {
   });
 }
 
-export function areQueriesEqual(a: T.RawQuery, b: T.RawQuery) {
+export function areQueriesEqual(a: RawQuery, b: RawQuery) {
   return queriesEqual(parseQuery(a), parseQuery(b));
 }
 
@@ -152,15 +153,15 @@ export function getAppFacet(serverFacet: string): FacetKey {
   return serverFacet === 'active_severities' ? 'activationSeverities' : (serverFacet as FacetKey);
 }
 
-export function getOpen(query: T.RawQuery) {
+export function getOpen(query: RawQuery) {
   return query.open;
 }
 
-export function hasRuleKey(query: T.RawQuery) {
+export function hasRuleKey(query: RawQuery) {
   return Boolean(query.rule_key);
 }
 
-function parseAsInheritance(value?: string): T.RuleInheritance | undefined {
+function parseAsInheritance(value?: string): RuleInheritance | undefined {
   if (value === 'INHERITED' || value === 'NONE' || value === 'OVERRIDES') {
     return value;
   } else {
@@ -168,6 +169,6 @@ function parseAsInheritance(value?: string): T.RuleInheritance | undefined {
   }
 }
 
-function serializeInheritance(value: T.RuleInheritance | undefined): string | undefined {
+function serializeInheritance(value: RuleInheritance | undefined): string | undefined {
   return value;
 }
index 8049584924b62b7b535d1e679b75b4eaeaa90ae9..24bbc0ca79b9e43e68386979048eeff067941e93 100644 (file)
  */
 import { RedirectFunction, RouterState } from 'react-router';
 import { lazyLoadComponent } from '../../components/lazyLoadComponent';
+import { RawQuery } from '../../types/types';
 import { parseQuery, serializeQuery } from './query';
 
-function parseHash(hash: string): T.RawQuery {
-  const query: T.RawQuery = {};
+function parseHash(hash: string): RawQuery {
+  const query: RawQuery = {};
   const parts = hash.split('|');
   parts.forEach(part => {
     const tokens = part.split('=');
index 8b8e75c7701572b3a88abe99f2c43a544e82864e..b113953c327306cf3926b12c2487d6b485b0167d 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { ComponentQualifier } from '../../../types/component';
 import { MetricKey } from '../../../types/metrics';
+import { ComponentMeasure } from '../../../types/types';
 import * as utils from '../utils';
 
 const MEASURES = [
@@ -154,7 +155,7 @@ describe('serializeQuery', () => {
 });
 
 describe('extract measure', () => {
-  const componentBuilder = (qual: ComponentQualifier): T.ComponentMeasure => {
+  const componentBuilder = (qual: ComponentQualifier): ComponentMeasure => {
     return {
       qualifier: qual,
       key: '1',
index 080358d770f1564ec364bc8e15001297d96379d3..b93ce49dd079ff8edb0801ef078e1260e8363c8e 100644 (file)
@@ -47,6 +47,14 @@ import {
 import { fetchBranchStatus } from '../../../store/rootActions';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier, isPortfolioLike } from '../../../types/component';
+import {
+  ComponentMeasure,
+  Dict,
+  Issue,
+  MeasureEnhanced,
+  Metric,
+  Period
+} from '../../../types/types';
 import Sidebar from '../sidebar/Sidebar';
 import '../style.css';
 import {
@@ -69,15 +77,15 @@ import MeasuresEmpty from './MeasuresEmpty';
 
 interface Props extends WithRouterProps {
   branchLike?: BranchLike;
-  component: T.ComponentMeasure;
+  component: ComponentMeasure;
   fetchBranchStatus: (branchLike: BranchLike, projectKey: string) => Promise<void>;
 }
 
 interface State {
-  leakPeriod?: T.Period;
+  leakPeriod?: Period;
   loading: boolean;
-  measures: T.MeasureEnhanced[];
-  metrics: T.Dict<T.Metric>;
+  measures: MeasureEnhanced[];
+  metrics: Dict<Metric>;
 }
 
 export class App extends React.PureComponent<Props, State> {
@@ -167,7 +175,7 @@ export class App extends React.PureComponent<Props, State> {
     );
   }
 
-  getHelmetTitle = (query: Query, displayOverview: boolean, metric?: T.Metric) => {
+  getHelmetTitle = (query: Query, displayOverview: boolean, metric?: Metric) => {
     if (displayOverview && query.metric) {
       return isProjectOverview(query.metric)
         ? translate('component_measures.overview.project_overview.facet')
@@ -195,7 +203,7 @@ export class App extends React.PureComponent<Props, State> {
     return metric;
   };
 
-  handleIssueChange = (_: T.Issue) => {
+  handleIssueChange = (_: Issue) => {
     this.refreshBranchStatus();
   };
 
@@ -228,7 +236,7 @@ export class App extends React.PureComponent<Props, State> {
     }
   };
 
-  renderContent = (displayOverview: boolean, query: Query, metric?: T.Metric) => {
+  renderContent = (displayOverview: boolean, query: Query, metric?: Metric) => {
     const { branchLike, component } = this.props;
     const { leakPeriod } = this.state;
     if (displayOverview) {
index 72e4d1544973376babbe1515d7ef98a2132ac9c0..6f5303558a56ad4bdc8024bc9b249206247071a4 100644 (file)
 import * as React from 'react';
 import Tooltip from '../../../components/controls/Tooltip';
 import { collapsePath, limitComponentName } from '../../../helpers/path';
+import { ComponentMeasure, ComponentMeasureIntern } from '../../../types/types';
 
 interface Props {
   canBrowse: boolean;
-  component: T.ComponentMeasure;
+  component: ComponentMeasure;
   isLast: boolean;
-  handleSelect: (component: T.ComponentMeasureIntern) => void;
+  handleSelect: (component: ComponentMeasureIntern) => void;
 }
 
 export default class Breadcrumb extends React.PureComponent<Props> {
index aa2a001df31e926d4a3e9b050d20fcfca0cf1670..7971ad6e08bb7298e508508b7fbfb62142fdfdce 100644 (file)
@@ -22,19 +22,20 @@ import * as React from 'react';
 import { getBreadcrumbs } from '../../../api/components';
 import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like';
 import { BranchLike } from '../../../types/branch-like';
+import { ComponentMeasure, ComponentMeasureIntern } from '../../../types/types';
 import Breadcrumb from './Breadcrumb';
 
 interface Props {
   backToFirst: boolean;
   branchLike?: BranchLike;
   className?: string;
-  component: T.ComponentMeasure;
-  handleSelect: (component: T.ComponentMeasureIntern) => void;
-  rootComponent: T.ComponentMeasure;
+  component: ComponentMeasure;
+  handleSelect: (component: ComponentMeasureIntern) => void;
+  rootComponent: ComponentMeasure;
 }
 
 interface State {
-  breadcrumbs: T.ComponentMeasure[];
+  breadcrumbs: ComponentMeasure[];
 }
 
 export default class Breadcrumbs extends React.PureComponent<Props, State> {
index 419886e780dc9ef2765ac78f881631783ba03bf2..8537b1734de0aaaa7759fca306e1ad34e7b8291b 100644 (file)
@@ -27,11 +27,12 @@ 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 { ComponentMeasure, Period } from '../../../types/types';
 
 interface Props {
   className?: string;
-  component: T.ComponentMeasure;
-  period: T.Period;
+  component: ComponentMeasure;
+  period: Period;
 }
 
 export class LeakPeriodLegend extends React.PureComponent<Props & WrappedComponentProps> {
index 268241477f972fbdc6a6b147bd9d646e3c8e438d..07b9ccb32a4265e7bb4424893cf2ba1f470c804e 100644 (file)
@@ -35,6 +35,17 @@ import { BranchLike } from '../../../types/branch-like';
 import { isFile, isView } from '../../../types/component';
 import { MeasurePageView } from '../../../types/measures';
 import { MetricKey } from '../../../types/metrics';
+import {
+  ComponentMeasure,
+  ComponentMeasureEnhanced,
+  ComponentMeasureIntern,
+  Dict,
+  Issue,
+  Measure,
+  Metric,
+  Paging,
+  Period
+} from '../../../types/types';
 import { complementary } from '../config/complementary';
 import FilesView from '../drilldown/FilesView';
 import TreeMapView from '../drilldown/TreeMapView';
@@ -46,11 +57,11 @@ import MeasureViewSelect from './MeasureViewSelect';
 
 interface Props {
   branchLike?: BranchLike;
-  leakPeriod?: T.Period;
-  requestedMetric: Pick<T.Metric, 'key' | 'direction'>;
-  metrics: T.Dict<T.Metric>;
-  onIssueChange?: (issue: T.Issue) => void;
-  rootComponent: T.ComponentMeasure;
+  leakPeriod?: Period;
+  requestedMetric: Pick<Metric, 'key' | 'direction'>;
+  metrics: Dict<Metric>;
+  onIssueChange?: (issue: Issue) => void;
+  rootComponent: ComponentMeasure;
   router: InjectedRouter;
   selected?: string;
   updateQuery: (query: Partial<Query>) => void;
@@ -58,14 +69,14 @@ interface Props {
 }
 
 interface State {
-  baseComponent?: T.ComponentMeasure;
-  components: T.ComponentMeasureEnhanced[];
+  baseComponent?: ComponentMeasure;
+  components: ComponentMeasureEnhanced[];
   loadingMoreComponents: boolean;
-  measure?: T.Measure;
-  metric?: T.Metric;
-  paging?: T.Paging;
-  secondaryMeasure?: T.Measure;
-  selectedComponent?: T.ComponentMeasureIntern;
+  measure?: Measure;
+  metric?: Metric;
+  paging?: Paging;
+  secondaryMeasure?: Measure;
+  selectedComponent?: ComponentMeasureIntern;
 }
 
 export default class MeasureContent extends React.PureComponent<Props, State> {
@@ -180,7 +191,7 @@ export default class MeasureContent extends React.PureComponent<Props, State> {
 
   getComponentRequestParams(
     view: MeasurePageView,
-    metric: Pick<T.Metric, 'key' | 'direction'>,
+    metric: Pick<Metric, 'key' | 'direction'>,
     options: Object = {}
   ) {
     const strategy = view === 'list' ? 'leaves' : 'children';
@@ -231,7 +242,7 @@ export default class MeasureContent extends React.PureComponent<Props, State> {
     this.props.updateQuery({ view });
   };
 
-  onOpenComponent = (component: T.ComponentMeasureIntern) => {
+  onOpenComponent = (component: ComponentMeasureIntern) => {
     if (isView(this.props.rootComponent.qualifier)) {
       const comp = this.state.components.find(
         c =>
@@ -253,7 +264,7 @@ export default class MeasureContent extends React.PureComponent<Props, State> {
     }
   };
 
-  onSelectComponent = (component: T.ComponentMeasureIntern) => {
+  onSelectComponent = (component: ComponentMeasureIntern) => {
     this.setState({ selectedComponent: component });
   };
 
@@ -296,7 +307,7 @@ export default class MeasureContent extends React.PureComponent<Props, State> {
           selectedIdx={selectedIdx}
           selectedComponent={
             selectedIdx !== undefined
-              ? (this.state.selectedComponent as T.ComponentMeasureEnhanced)
+              ? (this.state.selectedComponent as ComponentMeasureEnhanced)
               : undefined
           }
           view={view}
index 564017d2dd2437e7a817b5b1fe1f81ea461ba05d..eab63058977c325c026f33968f41fff19d57b5ac 100644 (file)
@@ -28,16 +28,17 @@ import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
 import { isDiffMetric } from '../../../helpers/measures';
 import { getMeasureHistoryUrl } from '../../../helpers/urls';
 import { BranchLike } from '../../../types/branch-like';
+import { ComponentMeasure, Measure as TypeMeasure, Metric, Period } from '../../../types/types';
 import { hasFullMeasures } from '../utils';
 import LeakPeriodLegend from './LeakPeriodLegend';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.ComponentMeasure;
-  leakPeriod?: T.Period;
+  component: ComponentMeasure;
+  leakPeriod?: Period;
   measureValue?: string;
-  metric: T.Metric;
-  secondaryMeasure?: T.Measure;
+  metric: Metric;
+  secondaryMeasure?: TypeMeasure;
 }
 
 export default function MeasureHeader(props: Props) {
index 95842447139c9b036c0cf01daf9461643907fe49..a74013687828b241c7f1acbd68fbbbc1ba5d5507 100644 (file)
@@ -26,6 +26,16 @@ import PageActions from '../../../components/ui/PageActions';
 import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like';
 import { BranchLike } from '../../../types/branch-like';
 import { isFile } from '../../../types/component';
+import {
+  ComponentMeasure,
+  ComponentMeasureEnhanced,
+  ComponentMeasureIntern,
+  Dict,
+  Issue,
+  Metric,
+  Paging,
+  Period
+} from '../../../types/types';
 import BubbleChart from '../drilldown/BubbleChart';
 import { BUBBLES_FETCH_LIMIT, enhanceComponent, getBubbleMetrics, hasFullMeasures } from '../utils';
 import Breadcrumbs from './Breadcrumbs';
@@ -35,20 +45,20 @@ import MeasureContentHeader from './MeasureContentHeader';
 interface Props {
   branchLike?: BranchLike;
   className?: string;
-  component: T.ComponentMeasure;
+  component: ComponentMeasure;
   domain: string;
-  leakPeriod?: T.Period;
+  leakPeriod?: Period;
   loading: boolean;
-  metrics: T.Dict<T.Metric>;
-  onIssueChange?: (issue: T.Issue) => void;
-  rootComponent: T.ComponentMeasure;
-  updateLoading: (param: T.Dict<boolean>) => void;
-  updateSelected: (component: T.ComponentMeasureIntern) => void;
+  metrics: Dict<Metric>;
+  onIssueChange?: (issue: Issue) => void;
+  rootComponent: ComponentMeasure;
+  updateLoading: (param: Dict<boolean>) => void;
+  updateSelected: (component: ComponentMeasureIntern) => void;
 }
 
 interface State {
-  components: T.ComponentMeasureEnhanced[];
-  paging?: T.Paging;
+  components: ComponentMeasureEnhanced[];
+  paging?: Paging;
 }
 
 export default class MeasureOverview extends React.PureComponent<Props, State> {
index 0fb21b2703e953166c15e8ad205b3c424f4fa620..b7411553e05a5671cbbdcfc259e487cd55f75459 100644 (file)
@@ -24,6 +24,14 @@ import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-li
 import { getProjectUrl } from '../../../helpers/urls';
 import { BranchLike } from '../../../types/branch-like';
 import { isView } from '../../../types/component';
+import {
+  ComponentMeasure,
+  ComponentMeasureIntern,
+  Dict,
+  Issue,
+  Metric,
+  Period
+} from '../../../types/types';
 import { Query } from '../utils';
 import MeasureOverview from './MeasureOverview';
 
@@ -31,10 +39,10 @@ interface Props {
   branchLike?: BranchLike;
   className?: string;
   domain: string;
-  leakPeriod?: T.Period;
-  metrics: T.Dict<T.Metric>;
-  onIssueChange?: (issue: T.Issue) => void;
-  rootComponent: T.ComponentMeasure;
+  leakPeriod?: Period;
+  metrics: Dict<Metric>;
+  onIssueChange?: (issue: Issue) => void;
+  rootComponent: ComponentMeasure;
   router: InjectedRouter;
   selected?: string;
   updateQuery: (query: Partial<Query>) => void;
@@ -46,7 +54,7 @@ interface LoadingState {
 }
 
 interface State {
-  component?: T.ComponentMeasure;
+  component?: ComponentMeasure;
   loading: LoadingState;
 }
 
@@ -103,7 +111,7 @@ export default class MeasureOverviewContainer extends React.PureComponent<Props,
     }
   };
 
-  updateSelected = (component: T.ComponentMeasureIntern) => {
+  updateSelected = (component: ComponentMeasureIntern) => {
     if (this.state.component && isView(this.state.component.qualifier)) {
       this.props.router.push(getProjectUrl(component.refKey || component.key, component.branch));
     } else {
index f86e9761b8d78e28aa485e757efd9ed0a1cc369f..91a7de456913704e42666403d971fa48eb01c809 100644 (file)
@@ -24,11 +24,12 @@ import TreeIcon from '../../../components/icons/TreeIcon';
 import TreemapIcon from '../../../components/icons/TreemapIcon';
 import { translate } from '../../../helpers/l10n';
 import { MeasurePageView } from '../../../types/measures';
+import { Metric } from '../../../types/types';
 import { hasList, hasTree, hasTreemap } from '../utils';
 
 interface Props {
   className?: string;
-  metric: T.Metric;
+  metric: Metric;
   handleViewChange: (view: MeasurePageView) => void;
   view: MeasurePageView;
 }
index 2ba3b0220a40ca935d46761af688f9b29665f1f2..9da3eb8d0b13516f48c12f6ee4109fa732eee3b7 100644 (file)
@@ -21,6 +21,7 @@ import { differenceInDays } from 'date-fns';
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { IntlShape } from 'react-intl';
+import { ComponentMeasure, Period } from '../../../../types/types';
 import { LeakPeriodLegend } from '../LeakPeriodLegend';
 
 jest.mock('date-fns', () => {
@@ -40,14 +41,14 @@ const APP = {
   qualifier: 'APP'
 };
 
-const PERIOD: T.Period = {
+const PERIOD: Period = {
   date: '2017-05-16T13:50:02+0200',
   index: 1,
   mode: 'previous_version',
   parameter: '6,4'
 };
 
-const PERIOD_DAYS: T.Period = {
+const PERIOD_DAYS: Period = {
   date: '2017-05-16T13:50:02+0200',
   index: 1,
   mode: 'days',
@@ -68,7 +69,7 @@ it('should render a more precise date', () => {
   expect(getWrapper(PROJECT, PERIOD)).toMatchSnapshot();
 });
 
-function getWrapper(component: T.ComponentMeasure, period: T.Period) {
+function getWrapper(component: ComponentMeasure, period: Period) {
   return shallow(
     <LeakPeriodLegend
       component={component}
index 5327a836960d871e9f1fe404afa083cebf112222..ee9b5d2dd1733d98a3b18ec9a82abad5e97ca0f5 100644 (file)
@@ -20,6 +20,7 @@
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { mockBranch } from '../../../../helpers/mocks/branch-like';
+import { Period } from '../../../../types/types';
 import MeasureHeader from '../MeasureHeader';
 
 const METRIC = {
@@ -50,7 +51,7 @@ const PROPS = {
     index: 1,
     mode: 'previous_version',
     parameter: '6,4'
-  } as T.Period,
+  } as Period,
   measureValue: '3.0',
   metric: METRIC
 };
index ffb3b354597d37deebf78338ab7a798cd088f354..cc028499b2b8cf9d48c082932ddcc4d2ddd4a447 100644 (file)
@@ -1,3 +1,5 @@
+import { Dict } from '../../../types/types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -17,7 +19,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-export const complementary: T.Dict<string[]> = {
+export const complementary: Dict<string[]> = {
   coverage: ['uncovered_lines', 'uncovered_conditions'],
   line_coverage: ['uncovered_lines'],
   branch_coverage: ['uncovered_conditions'],
index bfeb34a62dfca7b391b68e6e56396f7dd8c2a31a..391ef7c9f0b617f92d38fd01d75ad11c7743c086 100644 (file)
@@ -31,6 +31,14 @@ import {
 import { formatMeasure, isDiffMetric } from '../../../helpers/measures';
 import { isDefined } from '../../../helpers/types';
 import { isProject } from '../../../types/component';
+import {
+  ComponentMeasure,
+  ComponentMeasureEnhanced,
+  ComponentMeasureIntern,
+  Dict,
+  Metric,
+  Paging
+} from '../../../types/types';
 import {
   BUBBLES_FETCH_LIMIT,
   getBubbleMetrics,
@@ -42,12 +50,12 @@ import EmptyResult from './EmptyResult';
 const HEIGHT = 500;
 
 interface Props {
-  component: T.ComponentMeasure;
-  components: T.ComponentMeasureEnhanced[];
+  component: ComponentMeasure;
+  components: ComponentMeasureEnhanced[];
   domain: string;
-  metrics: T.Dict<T.Metric>;
-  paging?: T.Paging;
-  updateSelected: (component: T.ComponentMeasureIntern) => void;
+  metrics: Dict<Metric>;
+  paging?: Paging;
+  updateSelected: (component: ComponentMeasureIntern) => void;
 }
 
 interface State {
@@ -59,7 +67,7 @@ export default class BubbleChart extends React.PureComponent<Props, State> {
     ratingFilters: {}
   };
 
-  getMeasureVal = (component: T.ComponentMeasureEnhanced, metric: T.Metric) => {
+  getMeasureVal = (component: ComponentMeasureEnhanced, metric: Metric) => {
     const measure = component.measures.find(measure => measure.metric.key === metric.key);
     if (!measure) {
       return undefined;
@@ -68,9 +76,9 @@ export default class BubbleChart extends React.PureComponent<Props, State> {
   };
 
   getTooltip(
-    component: T.ComponentMeasureEnhanced,
+    component: ComponentMeasureEnhanced,
     values: { x: number; y: number; size: number; colors?: Array<number | undefined> },
-    metrics: { x: T.Metric; y: T.Metric; size: T.Metric; colors?: T.Metric[] }
+    metrics: { x: Metric; y: Metric; size: Metric; colors?: Metric[] }
   ) {
     const inner = [
       [component.name, isProject(component.qualifier) ? component.branch : undefined]
@@ -108,8 +116,7 @@ export default class BubbleChart extends React.PureComponent<Props, State> {
     });
   };
 
-  handleBubbleClick = (component: T.ComponentMeasureEnhanced) =>
-    this.props.updateSelected(component);
+  handleBubbleClick = (component: ComponentMeasureEnhanced) => this.props.updateSelected(component);
 
   getDescription(domain: string) {
     const description = `component_measures.overview.${domain}.description`;
@@ -120,7 +127,7 @@ export default class BubbleChart extends React.PureComponent<Props, State> {
     return translatedDescription;
   }
 
-  renderBubbleChart(metrics: { x: T.Metric; y: T.Metric; size: T.Metric; colors?: T.Metric[] }) {
+  renderBubbleChart(metrics: { x: Metric; y: Metric; size: Metric; colors?: Metric[] }) {
     const { ratingFilters } = this.state;
 
     const items = this.props.components
@@ -164,7 +171,7 @@ export default class BubbleChart extends React.PureComponent<Props, State> {
     }
 
     return (
-      <OriginalBubbleChart<T.ComponentMeasureEnhanced>
+      <OriginalBubbleChart<ComponentMeasureEnhanced>
         formatXTick={formatXTick}
         formatYTick={formatYTick}
         height={HEIGHT}
@@ -177,7 +184,7 @@ export default class BubbleChart extends React.PureComponent<Props, State> {
     );
   }
 
-  renderChartHeader(domain: string, sizeMetric: T.Metric, colorsMetric?: T.Metric[]) {
+  renderChartHeader(domain: string, sizeMetric: Metric, colorsMetric?: Metric[]) {
     const { ratingFilters } = this.state;
     const { paging } = this.props;
 
index 7d0d3d5665b73e21c762def76839df816113ae3f..0368d922b160c2518927e81fad634ffc18c6085e 100644 (file)
@@ -36,12 +36,13 @@ import {
 } from '../../../types/component';
 import { MeasurePageView } from '../../../types/measures';
 import { MetricKey } from '../../../types/metrics';
+import { ComponentMeasure, ComponentMeasureEnhanced, Metric } from '../../../types/types';
 
 export interface ComponentCellProps {
   branchLike?: BranchLike;
-  component: T.ComponentMeasureEnhanced;
-  metric: T.Metric;
-  rootComponent: T.ComponentMeasure;
+  component: ComponentMeasureEnhanced;
+  metric: Metric;
+  rootComponent: ComponentMeasure;
   view: MeasurePageView;
 }
 
index 1209d04cb86e6599d9c087f0e2da803be9dc33d8..250eff12b5acf7a52302bc47eb0d4a1901cd2e91 100644 (file)
@@ -22,17 +22,18 @@ import { getComponentMeasureUniqueKey } from '../../../helpers/component';
 import { getLocalizedMetricName } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
 import { MeasurePageView } from '../../../types/measures';
+import { ComponentMeasure, ComponentMeasureEnhanced, Dict, Metric } from '../../../types/types';
 import { complementary } from '../config/complementary';
 import ComponentsListRow from './ComponentsListRow';
 import EmptyResult from './EmptyResult';
 
 interface Props {
   branchLike?: BranchLike;
-  components: T.ComponentMeasureEnhanced[];
-  metric: T.Metric;
-  metrics: T.Dict<T.Metric>;
-  rootComponent: T.ComponentMeasure;
-  selectedComponent?: T.ComponentMeasureEnhanced;
+  components: ComponentMeasureEnhanced[];
+  metric: Metric;
+  metrics: Dict<Metric>;
+  rootComponent: ComponentMeasure;
+  selectedComponent?: ComponentMeasureEnhanced;
   view: MeasurePageView;
 }
 
index ea86423dc3965d8176ed14197ffdb4eed8b567c6..e2fea247b4e7e818c92f51abdaa141a4839516b4 100644 (file)
@@ -21,16 +21,17 @@ import classNames from 'classnames';
 import * as React from 'react';
 import { BranchLike } from '../../../types/branch-like';
 import { MeasurePageView } from '../../../types/measures';
+import { ComponentMeasure, ComponentMeasureEnhanced, Metric } from '../../../types/types';
 import ComponentCell from './ComponentCell';
 import MeasureCell from './MeasureCell';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.ComponentMeasureEnhanced;
+  component: ComponentMeasureEnhanced;
   isSelected: boolean;
-  otherMetrics: T.Metric[];
-  metric: T.Metric;
-  rootComponent: T.ComponentMeasure;
+  otherMetrics: Metric[];
+  metric: Metric;
+  rootComponent: ComponentMeasure;
   view: MeasurePageView;
 }
 
index 8eb9b7403a82f1fa13956c16ac842db792382f85..fede1808bcf27b7fbbbba5451a48885325d80cf9 100644 (file)
@@ -28,21 +28,28 @@ import { formatMeasure, isDiffMetric, isPeriodBestValue } from '../../../helpers
 import { scrollToElement } from '../../../helpers/scrolling';
 import { BranchLike } from '../../../types/branch-like';
 import { MeasurePageView } from '../../../types/measures';
+import {
+  ComponentMeasure,
+  ComponentMeasureEnhanced,
+  Dict,
+  Metric,
+  Paging
+} from '../../../types/types';
 import ComponentsList from './ComponentsList';
 
 interface Props {
   branchLike?: BranchLike;
-  components: T.ComponentMeasureEnhanced[];
+  components: ComponentMeasureEnhanced[];
   defaultShowBestMeasures: boolean;
   fetchMore: () => void;
-  handleSelect: (component: T.ComponentMeasureEnhanced) => void;
-  handleOpen: (component: T.ComponentMeasureEnhanced) => void;
+  handleSelect: (component: ComponentMeasureEnhanced) => void;
+  handleOpen: (component: ComponentMeasureEnhanced) => void;
   loadingMore: boolean;
-  metric: T.Metric;
-  metrics: T.Dict<T.Metric>;
-  paging?: T.Paging;
-  rootComponent: T.ComponentMeasure;
-  selectedComponent?: T.ComponentMeasureEnhanced;
+  metric: Metric;
+  metrics: Dict<Metric>;
+  paging?: Paging;
+  rootComponent: ComponentMeasure;
+  selectedComponent?: ComponentMeasureEnhanced;
   selectedIdx?: number;
   view: MeasurePageView;
 }
@@ -121,7 +128,7 @@ export default class FilesView extends React.PureComponent<Props, State> {
     this.setState({ showBestMeasures: true });
   };
 
-  hasBestValue = (component: T.ComponentMeasureEnhanced) => {
+  hasBestValue = (component: ComponentMeasureEnhanced) => {
     const { metric } = this.props;
     const focusedMeasure = component.measures.find(measure => measure.metric.key === metric.key);
     if (focusedMeasure && isDiffMetric(metric.key)) {
index 8dfadf8a5e407710e9f7ca88a037e544d3b81c19..5f7e7725f89385f99355f4dec768f550da8f53c6 100644 (file)
 import * as React from 'react';
 import Measure from '../../../components/measure/Measure';
 import { isDiffMetric } from '../../../helpers/measures';
+import { ComponentMeasureEnhanced, MeasureEnhanced, Metric } from '../../../types/types';
 
 interface Props {
-  component: T.ComponentMeasureEnhanced;
-  measure?: T.MeasureEnhanced;
-  metric: T.Metric;
+  component: ComponentMeasureEnhanced;
+  measure?: MeasureEnhanced;
+  metric: Metric;
 }
 
 export default function MeasureCell({ component, measure, metric }: Props) {
index 052ddfb34a4a9b9c1abe59094831627625424aa5..4de48eaef18b6f4f020327307eb982286fb83abd 100644 (file)
@@ -31,13 +31,14 @@ import { formatMeasure, isDiffMetric } from '../../../helpers/measures';
 import { isDefined } from '../../../helpers/types';
 import { BranchLike } from '../../../types/branch-like';
 import { MetricKey } from '../../../types/metrics';
+import { ComponentMeasureEnhanced, ComponentMeasureIntern, Metric } from '../../../types/types';
 import EmptyResult from './EmptyResult';
 
 interface Props {
   branchLike?: BranchLike;
-  components: T.ComponentMeasureEnhanced[];
-  handleSelect: (component: T.ComponentMeasureIntern) => void;
-  metric: T.Metric;
+  components: ComponentMeasureEnhanced[];
+  handleSelect: (component: ComponentMeasureIntern) => void;
+  metric: Metric;
 }
 
 interface State {
@@ -112,7 +113,7 @@ export default class TreeMapView extends React.PureComponent<Props, State> {
       .domain(['ERROR', 'WARN', 'OK', 'NONE'])
       .range(LEVEL_COLORS);
 
-  getPercentColorScale = (metric: T.Metric) => {
+  getPercentColorScale = (metric: Metric) => {
     const color = scaleLinear<string, string>().domain([0, 25, 50, 75, 100]);
     color.range(metric.higherValuesAreBetter ? [...COLORS].reverse() : COLORS);
     return color;
@@ -123,7 +124,7 @@ export default class TreeMapView extends React.PureComponent<Props, State> {
       .domain([1, 2, 3, 4, 5])
       .range(COLORS);
 
-  getColorScale = (metric: T.Metric) => {
+  getColorScale = (metric: Metric) => {
     if (metric.type === 'LEVEL') {
       return this.getLevelColorScale();
     }
@@ -140,10 +141,10 @@ export default class TreeMapView extends React.PureComponent<Props, State> {
     sizeMetric,
     sizeValue
   }: {
-    colorMetric: T.Metric;
+    colorMetric: Metric;
     colorValue?: string;
-    component: T.ComponentMeasureEnhanced;
-    sizeMetric: T.Metric;
+    component: ComponentMeasureEnhanced;
+    sizeMetric: Metric;
     sizeValue: number;
   }) => {
     const formatted =
index ea1fdfb98233499b2538b6a7ec152b3ef9a7def1..6523c491d41604e863af2b7461845b9fe63b18e1 100644 (file)
@@ -30,6 +30,7 @@ import {
   hasMessage,
   translate
 } from '../../../helpers/l10n';
+import { MeasureEnhanced } from '../../../types/types';
 import {
   addMeasureCategories,
   filterMeasures,
@@ -40,7 +41,7 @@ import {
 import FacetMeasureValue from './FacetMeasureValue';
 
 interface Props {
-  domain: { name: string; measures: T.MeasureEnhanced[] };
+  domain: { name: string; measures: MeasureEnhanced[] };
   onChange: (metric: string) => void;
   onToggle: (property: string) => void;
   open: boolean;
@@ -63,11 +64,7 @@ export default class DomainFacet extends React.PureComponent<Props> {
     this.props.onToggle(this.props.domain.name);
   };
 
-  hasFacetSelected = (
-    domain: { name: string },
-    measures: T.MeasureEnhanced[],
-    selected: string
-  ) => {
+  hasFacetSelected = (domain: { name: string }, measures: MeasureEnhanced[], selected: string) => {
     const measureSelected = measures.find(measure => measure.metric.key === selected);
     const overviewSelected = domain.name === selected && this.hasOverview(domain.name);
     return measureSelected || overviewSelected;
@@ -77,7 +74,7 @@ export default class DomainFacet extends React.PureComponent<Props> {
     return this.props.showFullMeasures && hasBubbleChart(domain);
   };
 
-  renderItemFacetStat = (item: T.MeasureEnhanced) => {
+  renderItemFacetStat = (item: MeasureEnhanced) => {
     return hasFacetStat(item.metric.key) ? (
       <FacetMeasureValue displayLeak={this.props.showFullMeasures} measure={item} />
     ) : null;
index edbfc46005ed1607c6a898e57226d13deaf9b99a..b50b5cb298d954b89f9d9701733825d256f23d8a 100644 (file)
@@ -21,10 +21,11 @@ import classNames from 'classnames';
 import * as React from 'react';
 import Measure from '../../../components/measure/Measure';
 import { isDiffMetric } from '../../../helpers/measures';
+import { MeasureEnhanced } from '../../../types/types';
 
 interface Props {
   displayLeak?: boolean;
-  measure: T.MeasureEnhanced;
+  measure: MeasureEnhanced;
 }
 
 export default function FacetMeasureValue({ measure, displayLeak }: Props) {
index f2e9f491c1e29c6ae8b438a08c2d94eafd686ed7..c6654b0a5930fc40000c0aebda81b77858d2c968 100644 (file)
 import * as React from 'react';
 import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
 import { translate } from '../../../helpers/l10n';
+import { Dict, MeasureEnhanced } from '../../../types/types';
 import { groupByDomains, KNOWN_DOMAINS, PROJECT_OVERVEW, Query } from '../utils';
 import DomainFacet from './DomainFacet';
 import ProjectOverviewFacet from './ProjectOverviewFacet';
 
 interface Props {
-  measures: T.MeasureEnhanced[];
+  measures: MeasureEnhanced[];
   selectedMetric: string;
   showFullMeasures: boolean;
   updateQuery: (query: Partial<Query>) => void;
 }
 
 interface State {
-  openFacets: T.Dict<boolean>;
+  openFacets: Dict<boolean>;
 }
 
 export default class Sidebar extends React.PureComponent<Props, State> {
@@ -84,7 +85,7 @@ export default class Sidebar extends React.PureComponent<Props, State> {
   }
 }
 
-function getOpenFacets(openFacets: T.Dict<boolean>, { measures, selectedMetric }: Props) {
+function getOpenFacets(openFacets: Dict<boolean>, { measures, selectedMetric }: Props) {
   const newOpenFacets = { ...openFacets };
   const measure = measures.find(measure => measure.metric.key === selectedMetric);
   if (measure && measure.metric && measure.metric.domain) {
index 806602382b9093637b5da6332625fc333b3d5783..3db8ec9b79a354f066708e41ea94d3ba234700ee 100644 (file)
@@ -27,6 +27,15 @@ import { BranchLike } from '../../types/branch-like';
 import { ComponentQualifier } from '../../types/component';
 import { MeasurePageView } from '../../types/measures';
 import { MetricKey } from '../../types/metrics';
+import {
+  ComponentMeasure,
+  ComponentMeasureEnhanced,
+  Dict,
+  Measure,
+  MeasureEnhanced,
+  Metric,
+  RawQuery
+} from '../../types/types';
 import { bubbles } from './config/bubbles';
 import { domains } from './config/domains';
 
@@ -58,30 +67,30 @@ const BANNED_MEASURES = [
   'new_info_violations'
 ];
 
-export function filterMeasures(measures: T.MeasureEnhanced[]): T.MeasureEnhanced[] {
+export function filterMeasures(measures: MeasureEnhanced[]): MeasureEnhanced[] {
   return measures.filter(measure => !BANNED_MEASURES.includes(measure.metric.key));
 }
 
 export function sortMeasures(
   domainName: string,
-  measures: Array<T.MeasureEnhanced | string>
-): Array<T.MeasureEnhanced | string> {
+  measures: Array<MeasureEnhanced | string>
+): Array<MeasureEnhanced | string> {
   const config = domains[domainName] || {};
   const configOrder = config.order || [];
   return sortBy(measures, [
-    (item: T.MeasureEnhanced | string) => {
+    (item: MeasureEnhanced | string) => {
       if (typeof item === 'string') {
         return configOrder.indexOf(item);
       }
       const idx = configOrder.indexOf(item.metric.key);
       return idx >= 0 ? idx : configOrder.length;
     },
-    (item: T.MeasureEnhanced | string) =>
+    (item: MeasureEnhanced | string) =>
       typeof item === 'string' ? item : getLocalizedMetricName(item.metric)
   ]);
 }
 
-export function addMeasureCategories(domainName: string, measures: T.MeasureEnhanced[]) {
+export function addMeasureCategories(domainName: string, measures: MeasureEnhanced[]) {
   const categories = domains[domainName] && domains[domainName].categories;
   if (categories && categories.length > 0) {
     return [...categories, ...measures];
@@ -90,10 +99,10 @@ export function addMeasureCategories(domainName: string, measures: T.MeasureEnha
 }
 
 export function enhanceComponent(
-  component: T.ComponentMeasure,
-  metric: Pick<T.Metric, 'key'> | undefined,
-  metrics: T.Dict<T.Metric>
-): T.ComponentMeasureEnhanced {
+  component: ComponentMeasure,
+  metric: Pick<Metric, 'key'> | undefined,
+  metrics: Dict<Metric>
+): ComponentMeasureEnhanced {
   if (!component.measures) {
     return { ...component, measures: [] };
   }
@@ -116,10 +125,7 @@ export function isSecurityReviewMetric(metricKey: MetricKey | string): boolean {
   ].includes(metricKey as MetricKey);
 }
 
-export function banQualityGateMeasure({
-  measures = [],
-  qualifier
-}: T.ComponentMeasure): T.Measure[] {
+export function banQualityGateMeasure({ measures = [], qualifier }: ComponentMeasure): Measure[] {
   const bannedMetrics: string[] = [];
   if (ComponentQualifier.Portfolio !== qualifier && ComponentQualifier.SubPortfolio !== qualifier) {
     bannedMetrics.push('alert_status');
@@ -130,14 +136,14 @@ export function banQualityGateMeasure({
   return measures.filter(measure => !bannedMetrics.includes(measure.metric));
 }
 
-export const groupByDomains = memoize((measures: T.MeasureEnhanced[]) => {
+export const groupByDomains = memoize((measures: MeasureEnhanced[]) => {
   const domains = toPairs(groupBy(measures, measure => measure.metric.domain)).map(r => ({
     name: r[0],
     measures: r[1]
   }));
 
   return sortBy(domains, [
-    (domain: { name: string; measures: T.MeasureEnhanced[] }) => {
+    (domain: { name: string; measures: MeasureEnhanced[] }) => {
       const idx = KNOWN_DOMAINS.indexOf(domain.name);
       return idx >= 0 ? idx : KNOWN_DOMAINS.length;
     },
@@ -169,7 +175,7 @@ export function hasFullMeasures(branch?: BranchLike) {
   return !branch || isBranch(branch);
 }
 
-export function getMeasuresPageMetricKeys(metrics: T.Dict<T.Metric>, branch?: BranchLike) {
+export function getMeasuresPageMetricKeys(metrics: Dict<Metric>, branch?: BranchLike) {
   const metricKeys = getDisplayMetrics(Object.values(metrics)).map(metric => metric.key);
 
   if (isPullRequest(branch)) {
@@ -179,7 +185,7 @@ export function getMeasuresPageMetricKeys(metrics: T.Dict<T.Metric>, branch?: Br
   }
 }
 
-export function getBubbleMetrics(domain: string, metrics: T.Dict<T.Metric>) {
+export function getBubbleMetrics(domain: string, metrics: Dict<Metric>) {
   const conf = bubbles[domain];
   return {
     x: metrics[conf.x],
@@ -214,7 +220,7 @@ export interface Query {
 }
 
 export const parseQuery = memoize(
-  (urlQuery: T.RawQuery): Query => {
+  (urlQuery: RawQuery): Query => {
     const metric = parseAsString(urlQuery['metric']) || DEFAULT_METRIC;
     return {
       metric,
index 5df872ec83c574339ee83ba634d25a6580aba303..581979a38a30305ddb0268c31ee76b4e744ad196 100644 (file)
@@ -30,6 +30,7 @@ import {
 } from '../../../api/alm-integrations';
 import { AzureProject, AzureRepository } from '../../../types/alm-integration';
 import { AlmSettingsInstance } from '../../../types/alm-settings';
+import { Dict } from '../../../types/types';
 import AzureCreateProjectRenderer from './AzureProjectCreateRenderer';
 
 interface Props extends Pick<WithRouterProps, 'location' | 'router'> {
@@ -42,12 +43,12 @@ interface Props extends Pick<WithRouterProps, 'location' | 'router'> {
 interface State {
   importing: boolean;
   loading: boolean;
-  loadingRepositories: T.Dict<boolean>;
+  loadingRepositories: Dict<boolean>;
   patIsValid?: boolean;
   projects?: AzureProject[];
-  repositories: T.Dict<AzureRepository[]>;
+  repositories: Dict<AzureRepository[]>;
   searching?: boolean;
-  searchResults?: T.Dict<AzureRepository[]>;
+  searchResults?: Dict<AzureRepository[]>;
   searchQuery?: string;
   selectedRepository?: AzureRepository;
   settings?: AlmSettingsInstance;
index c026d8988a47b0d7a55129dff3d722deb9774a43..f8c09df1c641e2c69dcea1bbd374e8db9a3e3631 100644 (file)
@@ -29,6 +29,7 @@ import { getBaseUrl } from '../../../helpers/system';
 import { getGlobalSettingsUrl } from '../../../helpers/urls';
 import { AzureProject, AzureRepository } from '../../../types/alm-integration';
 import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
+import { Dict } from '../../../types/types';
 import { ALM_INTEGRATION } from '../../settings/components/AdditionalCategoryKeys';
 import AzurePersonalAccessTokenForm from './AzurePersonalAccessTokenForm';
 import AzureProjectsList from './AzureProjectsList';
@@ -39,16 +40,16 @@ export interface AzureProjectCreateRendererProps {
   canAdmin?: boolean;
   importing: boolean;
   loading: boolean;
-  loadingRepositories: T.Dict<boolean>;
+  loadingRepositories: Dict<boolean>;
   onImportRepository: () => void;
   onOpenProject: (key: string) => void;
   onPersonalAccessTokenCreate: (token: string) => void;
   onSearch: (query: string) => void;
   onSelectRepository: (repository: AzureRepository) => void;
   projects?: AzureProject[];
-  repositories: T.Dict<AzureRepository[]>;
+  repositories: Dict<AzureRepository[]>;
   searching?: boolean;
-  searchResults?: T.Dict<AzureRepository[]>;
+  searchResults?: Dict<AzureRepository[]>;
   searchQuery?: string;
   selectedRepository?: AzureRepository;
   settings?: AlmSettingsInstance;
index ffe2f5f01b3f2f9a39d5ef22b2448c625f95cbc2..10922f1e4b186f7f59fa6df42fc1649364390930 100644 (file)
@@ -24,17 +24,18 @@ 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 { Dict } from '../../../types/types';
 import AzureProjectAccordion from './AzureProjectAccordion';
 import { CreateProjectModes } from './types';
 
 export interface AzureProjectsListProps {
   importing: boolean;
-  loadingRepositories: T.Dict<boolean>;
+  loadingRepositories: Dict<boolean>;
   onOpenProject: (key: string) => void;
   onSelectRepository: (repository: AzureRepository) => void;
   projects?: AzureProject[];
-  repositories: T.Dict<AzureRepository[]>;
-  searchResults?: T.Dict<AzureRepository[]>;
+  repositories: Dict<AzureRepository[]>;
+  searchResults?: Dict<AzureRepository[]>;
   searchQuery?: string;
   selectedRepository?: AzureRepository;
 }
index 340008673fd1f11d16e9b92b5102a83d1d00059a..add78a12ba6fac7f00b7a4b0ef09a1274630d55f 100644 (file)
@@ -25,6 +25,7 @@ import {
 } from '../../../api/alm-integrations';
 import { BitbucketCloudRepository } from '../../../types/alm-integration';
 import { AlmSettingsInstance } from '../../../types/alm-settings';
+import { Paging } from '../../../types/types';
 import BitbucketCloudProjectCreateRenderer from './BitbucketCloudProjectCreateRender';
 
 interface Props extends Pick<WithRouterProps, 'location' | 'router'> {
@@ -39,7 +40,7 @@ interface State {
   isLastPage?: boolean;
   loading: boolean;
   loadingMore: boolean;
-  projectsPaging: Omit<T.Paging, 'total'>;
+  projectsPaging: Omit<Paging, 'total'>;
   resetPat: boolean;
   repositories: BitbucketCloudRepository[];
   searching: boolean;
index 506c1ac489aef111511de33bd1e3a674cab3acce..8d44d0dc3558a32ef1a08d47ae8709f4035d8852 100644 (file)
@@ -24,13 +24,14 @@ import ChevronsIcon from '../../../components/icons/ChevronsIcon';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { getBaseUrl } from '../../../helpers/system';
 import { AlmKeys } from '../../../types/alm-settings';
+import { AppState } from '../../../types/types';
 import { CreateProjectModes } from './types';
 
 export interface CreateProjectModeSelectionProps {
   almCounts: {
     [k in AlmKeys]: number;
   };
-  appState: Pick<T.AppState, 'canAdmin'>;
+  appState: Pick<AppState, 'canAdmin'>;
   loadingBindings: boolean;
   onSelectMode: (mode: CreateProjectModes) => void;
   onConfigMode: (mode: AlmKeys) => void;
index de750967d7272799e6e920ac5b471fa5176c1667..c26eb266f13a5d482daeb813f6ccbd4875b60daa 100644 (file)
@@ -27,6 +27,7 @@ import { withAppState } from '../../../components/hoc/withAppState';
 import { translate } from '../../../helpers/l10n';
 import { getProjectUrl } from '../../../helpers/urls';
 import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
+import { AppState, LoggedInUser } from '../../../types/types';
 import AlmBindingDefinitionForm from '../../settings/components/almIntegration/AlmBindingDefinitionForm';
 import AzureProjectCreate from './AzureProjectCreate';
 import BitbucketCloudProjectCreate from './BitbucketCloudProjectCreate';
@@ -39,8 +40,8 @@ import './style.css';
 import { CreateProjectModes } from './types';
 
 interface Props extends Pick<WithRouterProps, 'router' | 'location'> {
-  appState: Pick<T.AppState, 'canAdmin' | 'branchesEnabled'>;
-  currentUser: T.LoggedInUser;
+  appState: Pick<AppState, 'canAdmin' | 'branchesEnabled'>;
+  currentUser: LoggedInUser;
 }
 
 interface State {
index f49167e7ecc3d7d6d598d32f302def1370789578..f48b9bfcdb9599b89d97bf494187d64ea6aab971 100644 (file)
@@ -29,6 +29,7 @@ import {
 import { getHostUrl } from '../../../helpers/urls';
 import { GithubOrganization, GithubRepository } from '../../../types/alm-integration';
 import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
+import { Paging } from '../../../types/types';
 import GitHubProjectCreateRenderer from './GitHubProjectCreateRenderer';
 
 interface Props extends Pick<WithRouterProps, 'location' | 'router'> {
@@ -44,7 +45,7 @@ interface State {
   loadingOrganizations: boolean;
   loadingRepositories: boolean;
   organizations: GithubOrganization[];
-  repositoryPaging: T.Paging;
+  repositoryPaging: Paging;
   repositories: GithubRepository[];
   searchQuery: string;
   selectedOrganization?: GithubOrganization;
index 70113cbccbb96125c312ac194714d1dba268b87d..5b44a19d57c87bef78a0083c30648385718918dd 100644 (file)
@@ -35,6 +35,7 @@ import { getBaseUrl } from '../../../helpers/system';
 import { getProjectUrl } from '../../../helpers/urls';
 import { GithubOrganization, GithubRepository } from '../../../types/alm-integration';
 import { ComponentQualifier } from '../../../types/component';
+import { Paging } from '../../../types/types';
 import CreateProjectPageHeader from './CreateProjectPageHeader';
 
 export interface GitHubProjectCreateRendererProps {
@@ -51,7 +52,7 @@ export interface GitHubProjectCreateRendererProps {
   onSelectRepository: (key: string) => void;
   organizations: GithubOrganization[];
   repositories?: GithubRepository[];
-  repositoryPaging: T.Paging;
+  repositoryPaging: Paging;
   searchQuery: string;
   selectedOrganization?: GithubOrganization;
   selectedRepository?: GithubRepository;
index f84bd1a47f0ddac7b51c27a5d96577c6e57737fd..91702fe82959fa7ebb70f3970d465b2b1f452aea 100644 (file)
@@ -22,6 +22,7 @@ import { WithRouterProps } from 'react-router';
 import { getGitlabProjects, importGitlabProject } from '../../../api/alm-integrations';
 import { GitlabProject } from '../../../types/alm-integration';
 import { AlmSettingsInstance } from '../../../types/alm-settings';
+import { Paging } from '../../../types/types';
 import GitlabProjectCreateRenderer from './GitlabProjectCreateRenderer';
 
 interface Props extends Pick<WithRouterProps, 'location' | 'router'> {
@@ -36,7 +37,7 @@ interface State {
   loading: boolean;
   loadingMore: boolean;
   projects?: GitlabProject[];
-  projectsPaging: T.Paging;
+  projectsPaging: Paging;
   resetPat: boolean;
   searching: boolean;
   searchQuery: string;
index 2b2e761a9d1af9d467e72fc470b44da95cc9968b..309fae339d40f1c4c5df64c3435422af2941f0f3 100644 (file)
@@ -22,6 +22,7 @@ import { translate } from '../../../helpers/l10n';
 import { getBaseUrl } from '../../../helpers/system';
 import { GitlabProject } from '../../../types/alm-integration';
 import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
+import { Paging } from '../../../types/types';
 import CreateProjectPageHeader from './CreateProjectPageHeader';
 import GitlabProjectSelectionForm from './GitlabProjectSelectionForm';
 import PersonalAccessTokenForm from './PersonalAccessTokenForm';
@@ -37,7 +38,7 @@ export interface GitlabProjectCreateRendererProps {
   onPersonalAccessTokenCreated: () => void;
   onSearch: (searchQuery: string) => void;
   projects?: GitlabProject[];
-  projectsPaging: T.Paging;
+  projectsPaging: Paging;
   resetPat: boolean;
   searching: boolean;
   searchQuery: string;
index ed94e6ee0e2710bb8c8dfb8d0476d7cb255f8e40..94b5ef613a0715f5b0d0052a73890a7acb68836c 100644 (file)
@@ -33,6 +33,7 @@ import { translate } from '../../../helpers/l10n';
 import { getProjectUrl } from '../../../helpers/urls';
 import { GitlabProject } from '../../../types/alm-integration';
 import { ComponentQualifier } from '../../../types/component';
+import { Paging } from '../../../types/types';
 import { CreateProjectModes } from './types';
 
 export interface GitlabProjectSelectionFormProps {
@@ -42,7 +43,7 @@ export interface GitlabProjectSelectionFormProps {
   onLoadMore: () => void;
   onSearch: (searchQuery: string) => void;
   projects?: GitlabProject[];
-  projectsPaging: T.Paging;
+  projectsPaging: Paging;
   searching: boolean;
   searchQuery: string;
 }
index 48b136593c82826652e94a5748f050910e306310..5ba0759d146e97967f81b64f244ab703e681b7a6 100644 (file)
@@ -20,6 +20,7 @@
 /* eslint-disable no-console */
 import { filterContent, ParsedContent } from '../../../helpers/markdown';
 import { mockDocumentationMarkdown } from '../../../helpers/testMocks';
+import { Dict } from '../../../types/types';
 
 jest.mock('remark', () => () => ({
   parse: jest.fn().mockReturnValue({})
@@ -92,7 +93,7 @@ it('should correctly handle overrides (replace & add)', () => {
     key: 'tata'
   };
 
-  const overrides: T.Dict<ParsedContent> = {};
+  const overrides: Dict<ParsedContent> = {};
   overrides[foo.url] = { frontmatter: overrideFooDoc, content: overrideFooDoc.content };
   overrides[`analysis/languages/${newDoc.key}`] = { frontmatter: newDoc, content: newDoc.content };
   const pages = getPages(overrides);
@@ -119,7 +120,7 @@ it('should not break the whole doc when one page cannot be parsed', () => {
   console.error = originalConsoleError;
 });
 
-function getPages(overrides: T.Dict<ParsedContent> = {}) {
+function getPages(overrides: Dict<ParsedContent> = {}) {
   // This allows the use of out-of-scope data inside jest.mock
   // Usually, it is impossible as jest.mock'ed module is hoisted on the top of the file
   return jest.requireActual('../pages').default(overrides);
index c7847f7656c0768ff4373edbc27e12a0f090c58c..254518e5e1750addea7d250d0a3d740536b1d563 100644 (file)
@@ -34,6 +34,7 @@ import { ParsedContent, separateFrontMatter } from '../../../helpers/markdown';
 import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages';
 import { isDefined } from '../../../helpers/types';
 import { InstalledPlugin, PluginType } from '../../../types/plugins';
+import { Dict } from '../../../types/types';
 import { getUrlsList } from '../navTreeUtils';
 import getPages from '../pages';
 import '../styles.css';
@@ -121,7 +122,7 @@ export default class App extends React.PureComponent<Props, State> {
       path => regex.test(path) && path !== `/${LANGUAGES_BASE_URL}/overview/`
     );
 
-    const parsedContent: T.Dict<ParsedContent> = {};
+    const parsedContent: Dict<ParsedContent> = {};
 
     pluginsWithDoc.filter(isDefined).forEach(plugin => {
       const parsed = separateFrontMatter(plugin.content);
index ae85ebc33fb0649df544d2f2b2be40c29d59de3b..a799e7d92f02bddc3c1cc6518226a80b003e5dfd 100644 (file)
 import classNames from 'classnames';
 import * as React from 'react';
 import { Link } from 'react-router';
+import { Dict } from '../../../types/types';
 import { cutWords, DocumentationEntry, highlightMarks } from '../utils';
 
 export interface SearchResult {
   exactMatch?: boolean;
-  highlights: T.Dict<[number, number][]>;
+  highlights: Dict<[number, number][]>;
   longestTerm: string;
   page: DocumentationEntry;
   query: string;
index 906ddfba954c6b1f98b0bd1ea9bdf2d7c73800b8..61eae9447f16423f974fcd6270b7428658e908c1 100644 (file)
@@ -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 { DocNavigationItem } from 'Docs/@types/types';
+import { Dict, DocNavigationItem } from 'Docs/@types/types';
 import { sortBy } from 'lodash';
 import lunr, { LunrBuilder, LunrIndex, LunrToken } from 'lunr';
 import * as React from 'react';
@@ -68,7 +68,7 @@ export default class SearchResults extends React.PureComponent<Props> {
           return undefined;
         }
 
-        const highlights: T.Dict<[number, number][]> = {};
+        const highlights: Dict<[number, number][]> = {};
         let longestTerm = '';
         let exactMatch = false;
 
index 47a77d52f742ee3f2fea05b71bc74922811f9e58..be10bbc131284d96f74496d5a3ccac0a4cf5b385 100644 (file)
 import remark from 'remark';
 import visit from 'unist-util-visit';
 import { filterContent, ParsedContent, separateFrontMatter } from '../../helpers/markdown';
+import { Dict } from '../../types/types';
 import Docs from './documentation.directory-loader';
 import { DocumentationEntry, DocumentationEntryScope } from './utils';
 
-export default function getPages(
-  parsedOverrides: T.Dict<ParsedContent> = {}
-): DocumentationEntry[] {
+export default function getPages(parsedOverrides: Dict<ParsedContent> = {}): DocumentationEntry[] {
   // Get entries, merge with overrides if applicable.
   const pages = ((Docs as unknown) as Array<{ content: string; path: string }>).map(file => {
     let parsed = separateFrontMatter(file.content);
index efa8eeb442939b8913d17e7b2f8b60281b758dac..3a164bc7c5af6cd25f0de1a30e55232905d01024 100644 (file)
@@ -25,17 +25,18 @@ import ListFooter from '../../../components/controls/ListFooter';
 import SearchBox from '../../../components/controls/SearchBox';
 import { translate } from '../../../helpers/l10n';
 import { omitNil } from '../../../helpers/request';
+import { Group, Paging } from '../../../types/types';
 import DeleteForm from './DeleteForm';
 import Form from './Form';
 import Header from './Header';
 import List from './List';
 
 interface State {
-  groups?: T.Group[];
-  editedGroup?: T.Group;
-  groupToBeDeleted?: T.Group;
+  groups?: Group[];
+  editedGroup?: Group;
+  groupToBeDeleted?: Group;
   loading: boolean;
-  paging?: T.Paging;
+  paging?: Paging;
   query: string;
 }
 
@@ -124,11 +125,11 @@ export default class App extends React.PureComponent<{}, State> {
     this.setState({ editedGroup: undefined });
   };
 
-  openDeleteForm = (group: T.Group) => {
+  openDeleteForm = (group: Group) => {
     this.setState({ groupToBeDeleted: group });
   };
 
-  openEditForm = (group: T.Group) => {
+  openEditForm = (group: Group) => {
     this.setState({ editedGroup: group });
   };
 
index bae62700da58763b318e90e4f3f5e9ebd04106e6..52f865ec2091ed2e0fd2336164c3ef7a74cff38a 100644 (file)
@@ -22,9 +22,10 @@ import { ResetButtonLink, SubmitButton } from '../../../components/controls/butt
 import SimpleModal from '../../../components/controls/SimpleModal';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { Group } from '../../../types/types';
 
 interface Props {
-  group: T.Group;
+  group: Group;
   onClose: () => void;
   onSubmit: () => Promise<void>;
 }
index 59f29c29d74ec5fdb6272692fcd495290b46514a..76b0bb2094190b48a8ace955c1fc67be72340e5c 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import { ButtonIcon } from '../../../components/controls/buttons';
 import BulletListIcon from '../../../components/icons/BulletListIcon';
 import { translate } from '../../../helpers/l10n';
+import { Group } from '../../../types/types';
 import EditMembersModal from './EditMembersModal';
 
 interface Props {
-  group: T.Group;
+  group: Group;
   onEdit: () => void;
 }
 
index 619ffe94e3423cd1c55c09e5a12e5158a70d3fe3..e508954682ce288f089a10fea8cc7cf6e504c35f 100644 (file)
@@ -27,16 +27,17 @@ import SelectList, {
   SelectListSearchParams
 } from '../../../components/controls/SelectList';
 import { translate } from '../../../helpers/l10n';
+import { Group, UserSelected } from '../../../types/types';
 
 interface Props {
-  group: T.Group;
+  group: Group;
   onClose: () => void;
 }
 
 interface State {
   lastSearchParams?: SelectListSearchParams;
   needToReload: boolean;
-  users: T.UserSelected[];
+  users: UserSelected[];
   usersTotalCount?: number;
   selectedUsers: string[];
 }
index 2efab620f3e74bfd63ba20d2182598d8e67723c7..da5cc8c3f2a43a4f6ef977fb6d329b14dd3479ff 100644 (file)
@@ -24,10 +24,11 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../../helpers/l10n';
+import { Group } from '../../../types/types';
 
 interface Props {
   confirmButtonText: string;
-  group?: T.Group;
+  group?: Group;
   header: string;
   onClose: () => void;
   onSubmit: (data: { description: string; name: string }) => Promise<void>;
index 789811564c10ac1d9f0d5caab2d33ea590d0b4f4..29670491a785d2369846c3236c3011a44be529ea 100644 (file)
 import { sortBy } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { Group } from '../../../types/types';
 import ListItem from './ListItem';
 
 interface Props {
-  groups: T.Group[];
-  onDelete: (group: T.Group) => void;
-  onEdit: (group: T.Group) => void;
+  groups: Group[];
+  onDelete: (group: Group) => void;
+  onEdit: (group: Group) => void;
   onEditMembers: () => void;
   showAnyone: boolean;
 }
index 4e90fd62a6318f64a22057dc82af4cda572ebfdc..ea3a33fe7b371f4af788036b768966a652448e34 100644 (file)
@@ -23,12 +23,13 @@ import ActionsDropdown, {
   ActionsDropdownItem
 } from '../../../components/controls/ActionsDropdown';
 import { translate } from '../../../helpers/l10n';
+import { Group } from '../../../types/types';
 import EditMembers from './EditMembers';
 
 export interface ListItemProps {
-  group: T.Group;
-  onDelete: (group: T.Group) => void;
-  onEdit: (group: T.Group) => void;
+  group: Group;
+  onDelete: (group: Group) => void;
+  onEdit: (group: Group) => void;
   onEditMembers: () => void;
 }
 
index d0565a11fd203827fa941d60375980c589b50705..cc521d5039454baf55ac193e8f9933a15071a0d5 100644 (file)
@@ -25,6 +25,7 @@ import { parseIssueFromResponse } from '../../../helpers/issues';
 import { fetchBranchStatus } from '../../../store/rootActions';
 import { getCurrentUser, Store } from '../../../store/rootReducer';
 import { FetchIssuesPromise } from '../../../types/issues';
+import { RawQuery } from '../../../types/types';
 
 const IssuesAppContainer = lazyLoadComponent(() => import('./IssuesApp'), 'IssuesAppContainer');
 
@@ -33,7 +34,7 @@ const mapStateToProps = (state: Store) => ({
   fetchIssues
 });
 
-const fetchIssues = (query: T.RawQuery) => {
+const fetchIssues = (query: RawQuery) => {
   return searchIssues({
     ...query,
     additionalFields: '_all',
index 3e129863e3eb5eafaf74c3054bb1754644dbde29..99005d400ce1ee5d6a9cbb8b64fd5262dcf8956e 100644 (file)
@@ -37,6 +37,7 @@ 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 { Component, CurrentUser, Dict, Issue, IssueType, Paging } from '../../../types/types';
 import { searchAssignees } from '../utils';
 
 interface AssigneeOption {
@@ -52,9 +53,9 @@ interface TagOption {
 }
 
 interface Props {
-  component: T.Component | undefined;
-  currentUser: T.CurrentUser;
-  fetchIssues: (x: {}) => Promise<{ issues: T.Issue[]; paging: T.Paging }>;
+  component: Component | undefined;
+  currentUser: CurrentUser;
+  fetchIssues: (x: {}) => Promise<{ issues: Issue[]; paging: Paging }>;
   onClose: () => void;
   onDone: () => void;
 }
@@ -72,10 +73,10 @@ interface FormFields {
 
 interface State extends FormFields {
   initialTags: Array<{ label: string; value: string }>;
-  issues: T.Issue[];
+  issues: Issue[];
   // used for initial loading of issues
   loading: boolean;
-  paging?: T.Paging;
+  paging?: Paging;
   // used when submitting a form
   submitting: boolean;
 }
@@ -237,8 +238,8 @@ export default class BulkChangeModal extends React.PureComponent<Props, State> {
     );
   };
 
-  getAvailableTransitions(issues: T.Issue[]) {
-    const transitions: T.Dict<number> = {};
+  getAvailableTransitions(issues: Issue[]) {
+    const transitions: Dict<number> = {};
     issues.forEach(issue => {
       if (issue.transitions) {
         issue.transitions.forEach(t => {
@@ -345,7 +346,7 @@ export default class BulkChangeModal extends React.PureComponent<Props, State> {
       return null;
     }
 
-    const types: T.IssueType[] = ['BUG', 'VULNERABILITY', 'CODE_SMELL'];
+    const types: IssueType[] = ['BUG', 'VULNERABILITY', 'CODE_SMELL'];
     const options = types.map(type => ({ label: translate('issue.type', type), value: type }));
 
     const optionRenderer = (option: { label: string; value: string }) => (
@@ -558,7 +559,7 @@ export default class BulkChangeModal extends React.PureComponent<Props, State> {
 }
 
 function hasAction(action: string) {
-  return (issue: T.Issue) => issue.actions && issue.actions.includes(action);
+  return (issue: Issue) => issue.actions && issue.actions.includes(action);
 }
 
 function promptCreateTag(label: string) {
index c9c8abcd2768334308722080f89c6bfa6f6609b4..1265aa1c6bc4fd01a9e4f46ef867340ef21e204e 100644 (file)
@@ -23,11 +23,12 @@ import QualifierIcon from '../../../components/icons/QualifierIcon';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { collapsePath, limitComponentName } from '../../../helpers/path';
 import { ComponentQualifier, isView } from '../../../types/component';
+import { Component, Issue } from '../../../types/types';
 import { getSelectedLocation } from '../utils';
 
 interface Props {
-  component?: T.Component;
-  issue: T.Issue;
+  component?: Component;
+  issue: Issue;
   selectedFlowIndex?: number;
   selectedLocationIndex?: number;
 }
index 474aacb0a11fc16b6c1854301d99ab1b0fb9ef0e..26583678441c911336071965a73d92211dd08745 100644 (file)
@@ -62,6 +62,15 @@ import {
   ReferencedRule
 } from '../../../types/issues';
 import { SecurityStandard } from '../../../types/security';
+import {
+  Component,
+  CurrentUser,
+  Dict,
+  Issue,
+  Paging,
+  RawQuery,
+  UserBase
+} from '../../../types/types';
 import * as actions from '../actions';
 import ConciseIssuesList from '../conciseIssuesList/ConciseIssuesList';
 import ConciseIssuesListHeader from '../conciseIssuesList/ConciseIssuesListHeader';
@@ -92,10 +101,10 @@ import PageActions from './PageActions';
 
 interface Props {
   branchLike?: BranchLike;
-  component?: T.Component;
-  currentUser: T.CurrentUser;
+  component?: Component;
+  currentUser: CurrentUser;
   fetchBranchStatus: (branchLike: BranchLike, projectKey: string) => void;
-  fetchIssues: (query: T.RawQuery) => Promise<FetchIssuesPromise>;
+  fetchIssues: (query: RawQuery) => Promise<FetchIssuesPromise>;
   location: Location;
   onBranchesChange?: () => void;
   router: Pick<Router, 'push' | 'replace'>;
@@ -107,23 +116,23 @@ export interface State {
   checkAll?: boolean;
   checked: string[];
   effortTotal?: number;
-  facets: T.Dict<Facet>;
-  issues: T.Issue[];
+  facets: Dict<Facet>;
+  issues: Issue[];
   loading: boolean;
-  loadingFacets: T.Dict<boolean>;
+  loadingFacets: Dict<boolean>;
   loadingMore: boolean;
   locationsNavigator: boolean;
   myIssues: boolean;
-  openFacets: T.Dict<boolean>;
-  openIssue?: T.Issue;
+  openFacets: Dict<boolean>;
+  openIssue?: Issue;
   openPopup?: { issue: string; name: string };
-  paging?: T.Paging;
+  paging?: Paging;
   query: Query;
-  referencedComponentsById: T.Dict<ReferencedComponent>;
-  referencedComponentsByKey: T.Dict<ReferencedComponent>;
-  referencedLanguages: T.Dict<ReferencedLanguage>;
-  referencedRules: T.Dict<ReferencedRule>;
-  referencedUsers: T.Dict<T.UserBase>;
+  referencedComponentsById: Dict<ReferencedComponent>;
+  referencedComponentsByKey: Dict<ReferencedComponent>;
+  referencedLanguages: Dict<ReferencedLanguage>;
+  referencedRules: Dict<ReferencedRule>;
+  referencedUsers: Dict<UserBase>;
   selected?: string;
   selectedFlowIndex?: number;
   selectedLocationIndex?: number;
@@ -301,7 +310,7 @@ export default class App extends React.PureComponent<Props, State> {
     return index !== -1 ? index : undefined;
   }
 
-  getOpenIssue = (props: Props, issues: T.Issue[]) => {
+  getOpenIssue = (props: Props, issues: Issue[]) => {
     const open = getOpen(props.location.query);
     return open ? issues.find(issue => issue.key === open) : undefined;
   };
@@ -398,7 +407,7 @@ export default class App extends React.PureComponent<Props, State> {
 
   createdAfterIncludesTime = () => Boolean(this.props.location.query.createdAfter?.includes('T'));
 
-  fetchIssues = (additional: T.RawQuery, requestFacets = false): Promise<FetchIssuesPromise> => {
+  fetchIssues = (additional: RawQuery, requestFacets = false): Promise<FetchIssuesPromise> => {
     const { component } = this.props;
     const { myIssues, openFacets, query } = this.state;
 
@@ -408,7 +417,7 @@ export default class App extends React.PureComponent<Props, State> {
           .join(',')
       : undefined;
 
-    const parameters: T.Dict<string | undefined> = {
+    const parameters: Dict<string | undefined> = {
       ...getBranchLikeQuery(this.props.branchLike),
       componentKeys: component && component.key,
       s: 'FILE_LINE',
@@ -441,7 +450,7 @@ export default class App extends React.PureComponent<Props, State> {
 
     this.setState({ checked: [], loading: true });
     if (openIssueKey !== undefined) {
-      fetchPromise = this.fetchIssuesUntil(1, (pageIssues: T.Issue[], paging: T.Paging) => {
+      fetchPromise = this.fetchIssuesUntil(1, (pageIssues: Issue[], paging: Paging) => {
         if (
           paging.total <= paging.pageIndex * paging.pageSize ||
           paging.pageIndex * paging.pageSize >= MAX_INITAL_FETCH
@@ -497,9 +506,9 @@ export default class App extends React.PureComponent<Props, State> {
 
   fetchIssuesUntil = (
     page: number,
-    done: (pageIssues: T.Issue[], paging: T.Paging) => boolean
+    done: (pageIssues: Issue[], paging: Paging) => boolean
   ): Promise<FetchIssuesPromise> => {
-    const recursiveFetch = (p: number, prevIssues: T.Issue[]): Promise<FetchIssuesPromise> => {
+    const recursiveFetch = (p: number, prevIssues: Issue[]): Promise<FetchIssuesPromise> => {
       return this.fetchIssuesPage(p).then(({ issues: pageIssues, paging, ...other }) => {
         const issues = [...prevIssues, ...pageIssues];
         return done(pageIssues, paging)
@@ -546,9 +555,9 @@ export default class App extends React.PureComponent<Props, State> {
       return Promise.reject(undefined);
     }
 
-    const isSameComponent = (issue: T.Issue) => issue.component === openIssue.component;
+    const isSameComponent = (issue: Issue) => issue.component === openIssue.component;
 
-    const done = (pageIssues: T.Issue[], p: T.Paging) => {
+    const done = (pageIssues: Issue[], p: Paging) => {
       const lastIssue = pageIssues[pageIssues.length - 1];
       if (p.total <= p.pageIndex * p.pageSize) {
         return true;
@@ -623,12 +632,12 @@ export default class App extends React.PureComponent<Props, State> {
   getCheckedIssues = () => {
     const issues = this.state.checked
       .map(checked => this.state.issues.find(issue => issue.key === checked))
-      .filter((issue): issue is T.Issue => issue !== undefined);
+      .filter((issue): issue is Issue => issue !== undefined);
     const paging = { pageIndex: 1, pageSize: issues.length, total: issues.length };
     return Promise.resolve({ issues, paging });
   };
 
-  getButtonLabel = (checked: string[], checkAll = false, paging?: T.Paging) => {
+  getButtonLabel = (checked: string[], checkAll = false, paging?: Paging) => {
     if (checked.length === 0) {
       return translate('bulk_change');
     }
@@ -768,7 +777,7 @@ export default class App extends React.PureComponent<Props, State> {
     }));
   };
 
-  handleIssueChange = (issue: T.Issue) => {
+  handleIssueChange = (issue: Issue) => {
     this.refreshBranchStatus();
     this.setState(state => ({
       issues: state.issues.map(candidate => (candidate.key === issue.key ? issue : candidate)),
@@ -944,7 +953,7 @@ export default class App extends React.PureComponent<Props, State> {
     );
   }
 
-  renderSide(openIssue: T.Issue | undefined) {
+  renderSide(openIssue: Issue | undefined) {
     const { canBrowseAllChildProjects, qualifier = ComponentQualifier.Project } =
       this.props.component || {};
     return (
@@ -1044,8 +1053,8 @@ export default class App extends React.PureComponent<Props, State> {
     paging,
     selectedIndex
   }: {
-    openIssue: T.Issue | undefined;
-    paging: T.Paging | undefined;
+    openIssue: Issue | undefined;
+    paging: Paging | undefined;
     selectedIndex: number | undefined;
   }) {
     return openIssue ? (
index 783876c7ad324136ff1eff27d7298ac521190b02..29866223bda4cb89b394b29750b11f7be51329ab 100644 (file)
  */
 import * as React from 'react';
 import { BranchLike } from '../../../types/branch-like';
+import { Component, Issue } from '../../../types/types';
 import { Query, scrollToIssue } from '../utils';
 import ListItem from './ListItem';
 
 interface Props {
   branchLike: BranchLike | undefined;
   checked: string[];
-  component: T.Component | undefined;
-  issues: T.Issue[];
+  component: Component | undefined;
+  issues: Issue[];
   onFilterChange: (changes: Partial<Query>) => void;
-  onIssueChange: (issue: T.Issue) => void;
+  onIssueChange: (issue: Issue) => void;
   onIssueCheck: ((issueKey: string) => void) | undefined;
   onIssueClick: (issueKey: string) => void;
   onPopupToggle: (issue: string, popupName: string, open?: boolean) => void;
   openPopup: { issue: string; name: string } | undefined;
-  selectedIssue: T.Issue | undefined;
+  selectedIssue: Issue | undefined;
 }
 
 interface State {
index f09aea4e498f1462f26d236d088f727f46076418..caf7b66f24589d995facaa9ae1262b9b1d5f0084 100644 (file)
@@ -21,18 +21,19 @@ import * as React from 'react';
 import SourceViewer from '../../../components/SourceViewer/SourceViewer';
 import { scrollToElement } from '../../../helpers/scrolling';
 import { BranchLike } from '../../../types/branch-like';
+import { Issue } from '../../../types/types';
 import CrossComponentSourceViewer from '../crossComponentSourceViewer/CrossComponentSourceViewer';
 import { getLocations, getSelectedLocation } from '../utils';
 
 interface Props {
   branchLike: BranchLike | undefined;
-  issues: T.Issue[];
-  loadIssues: (component: string, from: number, to: number) => Promise<T.Issue[]>;
+  issues: Issue[];
+  loadIssues: (component: string, from: number, to: number) => Promise<Issue[]>;
   locationsNavigator: boolean;
-  onIssueChange: (issue: T.Issue) => void;
+  onIssueChange: (issue: Issue) => void;
   onIssueSelect: (issueKey: string) => void;
   onLocationSelect: (index: number) => void;
-  openIssue: T.Issue;
+  openIssue: Issue;
   selectedFlowIndex: number | undefined;
   selectedLocationIndex: number | undefined;
 }
index 9900b6f07ea6d4ef9e42c487f36bd67f05ccd058..685f4ac03e666284b0137b033f5ed99a1df04d52 100644 (file)
 import * as React from 'react';
 import Issue from '../../../components/issue/Issue';
 import { BranchLike } from '../../../types/branch-like';
+import { Component, Issue as TypeIssue } from '../../../types/types';
 import { Query } from '../utils';
 import ComponentBreadcrumbs from './ComponentBreadcrumbs';
 
 interface Props {
   branchLike: BranchLike | undefined;
   checked: boolean;
-  component: T.Component | undefined;
-  issue: T.Issue;
-  onChange: (issue: T.Issue) => void;
+  component: Component | undefined;
+  issue: TypeIssue;
+  onChange: (issue: TypeIssue) => void;
   onCheck: ((issueKey: string) => void) | undefined;
   onClick: (issueKey: string) => void;
   onFilterChange: (changes: Partial<Query>) => void;
   onPopupToggle: (issue: string, popupName: string, open?: boolean) => void;
   openPopup: string | undefined;
-  previousIssue: T.Issue | undefined;
+  previousIssue: TypeIssue | undefined;
   selected: boolean;
 }
 
 export default class ListItem extends React.PureComponent<Props> {
-  handleFilter = (property: string, issue: T.Issue) => {
+  handleFilter = (property: string, issue: TypeIssue) => {
     const { onFilterChange } = this.props;
 
     const issuesReset = { issues: [] };
index 9437e70468be3b342dfde0b4ffc0adc6348d749c..579904469c5d5d9cc5a4925dbba3a217f8f1940c 100644 (file)
@@ -22,13 +22,14 @@ import HomePageSelect from '../../../components/controls/HomePageSelect';
 import PageShortcutsTooltip from '../../../components/ui/PageShortcutsTooltip';
 import { translate } from '../../../helpers/l10n';
 import { isSonarCloud } from '../../../helpers/system';
+import { Paging } from '../../../types/types';
 import IssuesCounter from './IssuesCounter';
 import TotalEffort from './TotalEffort';
 
 export interface PageActionsProps {
   canSetHome: boolean;
   effortTotal: number | undefined;
-  paging?: T.Paging;
+  paging?: Paging;
   selectedIndex?: number;
 }
 
index 58c14d823fbf8882facc5808e588284d119799bb..89a73f20aa37cce49d09a00dee638ea3e4a2479d 100644 (file)
@@ -24,6 +24,7 @@ import { SubmitButton } from '../../../../components/controls/buttons';
 import SelectLegacy from '../../../../components/controls/SelectLegacy';
 import { mockIssue } from '../../../../helpers/testMocks';
 import { change, waitAndUpdate } from '../../../../helpers/testUtils';
+import { Issue } from '../../../../types/types';
 import BulkChangeModal, { MAX_PAGE_SIZE } from '../BulkChangeModal';
 
 jest.mock('../../../../api/issues', () => ({
@@ -73,7 +74,7 @@ it('should display form when issues are present', async () => {
 });
 
 it('should display warning when too many issues are passed', async () => {
-  const issues: T.Issue[] = [];
+  const issues: Issue[] = [];
   for (let i = MAX_PAGE_SIZE + 1; i > 0; i--) {
     issues.push(mockIssue());
   }
@@ -85,7 +86,7 @@ it('should display warning when too many issues are passed', async () => {
 });
 
 it('should properly handle the search for assignee', async () => {
-  const issues: T.Issue[] = [];
+  const issues: Issue[] = [];
   for (let i = MAX_PAGE_SIZE + 1; i > 0; i--) {
     issues.push(mockIssue());
   }
@@ -127,7 +128,7 @@ it('should disable the submit button unless some change is configured', async ()
   });
 });
 
-const getWrapper = (issues: T.Issue[]) => {
+const getWrapper = (issues: Issue[]) => {
   return shallow<BulkChangeModal>(
     <BulkChangeModal
       component={undefined}
index 404e5859b828451f73adb7f399721114d9f41040..35971e463b516699d440ac9214fd157a7cff4e5c 100644 (file)
@@ -40,6 +40,7 @@ import {
 } from '../../../../helpers/testMocks';
 import { KEYCODE_MAP, keydown, waitAndUpdate } from '../../../../helpers/testUtils';
 import { ComponentQualifier } from '../../../../types/component';
+import { Issue, Paging } from '../../../../types/types';
 import {
   disableLocationsNavigator,
   enableLocationsNavigator,
@@ -402,7 +403,7 @@ it('should correctly handle filter changes', () => {
 });
 
 it('should fetch issues until defined', async () => {
-  const mockDone = (_: T.Issue[], paging: T.Paging) =>
+  const mockDone = (_: Issue[], paging: Paging) =>
     paging.total <= paging.pageIndex * paging.pageSize;
 
   const wrapper = shallowRender({
@@ -504,7 +505,7 @@ it('should refresh branch status if issues are updated', async () => {
   const instance = wrapper.instance();
   await waitAndUpdate(wrapper);
 
-  const updatedIssue: T.Issue = { ...ISSUES[0], type: 'SECURITY_HOTSPOT' };
+  const updatedIssue: Issue = { ...ISSUES[0], type: 'SECURITY_HOTSPOT' };
   instance.handleIssueChange(updatedIssue);
   expect(wrapper.state().issues).toEqual([updatedIssue, ISSUES[1], ISSUES[2], ISSUES[3]]);
   expect(fetchBranchStatus).toBeCalledWith(branchLike, component.key);
@@ -520,7 +521,7 @@ it('should update the open issue when it is changed', async () => {
 
   wrapper.setState({ openIssue: ISSUES[0] });
 
-  const updatedIssue: T.Issue = { ...ISSUES[0], type: 'SECURITY_HOTSPOT' };
+  const updatedIssue: Issue = { ...ISSUES[0], type: 'SECURITY_HOTSPOT' };
   wrapper.instance().handleIssueChange(updatedIssue);
 
   expect(wrapper.state().openIssue).toBe(updatedIssue);
index 5ac85daa5cbdaf76813f5a1b2b5ae7cbcaf12885..78c07e482680d43a5a4ba952966950834d7f30af 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Issue } from '../../../types/types';
 import ConciseIssueBox from './ConciseIssueBox';
 import ConciseIssueComponent from './ConciseIssueComponent';
 
 interface Props {
-  issue: T.Issue;
+  issue: Issue;
   onFlowSelect: (index: number) => void;
   onLocationSelect: (index: number) => void;
   onSelect: (issueKey: string) => void;
-  previousIssue: T.Issue | undefined;
+  previousIssue: Issue | undefined;
   scroll: (element: Element) => void;
   selected: boolean;
   selectedFlowIndex: number | undefined;
index a63e8a7f1599fd239aeece7be59138b9bdef4582..e9691262f3b82f27456b9a89015d8edd9d592825 100644 (file)
 import classNames from 'classnames';
 import * as React from 'react';
 import TypeHelper from '../../../components/shared/TypeHelper';
+import { Issue } from '../../../types/types';
 import ConciseIssueLocations from './ConciseIssueLocations';
 import ConciseIssueLocationsNavigator from './ConciseIssueLocationsNavigator';
 
 interface Props {
-  issue: T.Issue;
+  issue: Issue;
   onClick: (issueKey: string) => void;
   onFlowSelect: (index: number) => void;
   onLocationSelect: (index: number) => void;
index fe1b4cfad289a4d9714de616a139b2d4bf647ea1..cd6a95ab52e49b7925ea87626d4275ba492d16e1 100644 (file)
  */
 import * as React from 'react';
 import { Button } from '../../../components/controls/buttons';
+import { Issue } from '../../../types/types';
 import ConciseIssueLocationBadge from './ConciseIssueLocationBadge';
 
 interface Props {
-  issue: Pick<T.Issue, 'flows' | 'secondaryLocations'>;
+  issue: Pick<Issue, 'flows' | 'secondaryLocations'>;
   onFlowSelect: (index: number) => void;
   selectedFlowIndex: number | undefined;
 }
index 7d65a6367119479ed438b213c41eedb1c64a18a8..1dc1ef98f20fa099445cace243d2ed7d8a295bfc 100644 (file)
  */
 import { uniq } from 'lodash';
 import * as React from 'react';
+import { Issue } from '../../../types/types';
 import { getLocations } from '../utils';
 import ConciseIssueLocationsNavigatorLocation from './ConciseIssueLocationsNavigatorLocation';
 import CrossFileLocationsNavigator from './CrossFileLocationsNavigator';
 
 interface Props {
-  issue: Pick<T.Issue, 'component' | 'key' | 'flows' | 'secondaryLocations' | 'type'>;
+  issue: Pick<Issue, 'component' | 'key' | 'flows' | 'secondaryLocations' | 'type'>;
   onLocationSelect: (index: number) => void;
   scroll: (element: Element) => void;
   selectedFlowIndex: number | undefined;
index 77058d1e9b488a47d1719ecd096531643cd20b7b..fc05ac04ee5f2fe445c1d59d39ec7aa9cda4abef 100644 (file)
  */
 import * as React from 'react';
 import { scrollToElement } from '../../../helpers/scrolling';
+import { Issue } from '../../../types/types';
 import ConciseIssue from './ConciseIssue';
 
 interface Props {
-  issues: T.Issue[];
+  issues: Issue[];
   onFlowSelect: (index: number) => void;
   onIssueSelect: (issueKey: string) => void;
   onLocationSelect: (index: number) => void;
index 09d1a4db6d7b24c7de14687bad5f3cef57d79245..5b920f4e1b7b2db3f72f77fda42a877b64a9c3b1 100644 (file)
 import * as React from 'react';
 import { translateWithParameters } from '../../../helpers/l10n';
 import { collapsePath } from '../../../helpers/path';
+import { FlowLocation, Issue } from '../../../types/types';
 import ConciseIssueLocationsNavigatorLocation from './ConciseIssueLocationsNavigatorLocation';
 
 interface Props {
-  issue: Pick<T.Issue, 'key' | 'type'>;
-  locations: T.FlowLocation[];
+  issue: Pick<Issue, 'key' | 'type'>;
+  locations: FlowLocation[];
   onLocationSelect: (index: number) => void;
   scroll: (element: Element) => void;
   selectedLocationIndex: number | undefined;
@@ -38,7 +39,7 @@ interface LocationGroup {
   component: string | undefined;
   componentName: string | undefined;
   firstLocationIndex: number;
-  locations: T.FlowLocation[];
+  locations: FlowLocation[];
 }
 
 const MAX_PATH_LENGTH = 15;
@@ -69,10 +70,10 @@ export default class CrossFileLocationsNavigator extends React.PureComponent<Pro
     this.setState({ collapsed: false });
   };
 
-  groupByFile = (locations: T.FlowLocation[]) => {
+  groupByFile = (locations: FlowLocation[]) => {
     const groups: LocationGroup[] = [];
 
-    let currentLocations: T.FlowLocation[] = [];
+    let currentLocations: FlowLocation[] = [];
     let currentComponent: string | undefined;
     let currentComponentName: string | undefined;
     let currentFirstLocationIndex = 0;
index fd259dfa26af7446310e32f3a12270cab6df8843..ffa5c92235ae725ed2d91d5b74c6fbefd2c5cead 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { Issue } from '../../../../types/types';
 import ConciseIssue from '../ConciseIssue';
 
-const issue: T.Issue = {
+const issue: Issue = {
   actions: [],
   component: '',
   componentLongName: 'src/file.js',
index 454f502568215689fe1c5b2a6f785e29f8c2751b..8772152ab7bd6b98acbaf95b0c0359770354e985 100644 (file)
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { mockIssue } from '../../../../helpers/testMocks';
+import { FlowLocation } from '../../../../types/types';
 import ConciseIssueLocationsNavigator from '../ConciseIssueLocationsNavigator';
 
-const location1: T.FlowLocation = {
+const location1: FlowLocation = {
   component: 'foo',
   componentName: 'src/foo.js',
   msg: 'Do not use foo',
   textRange: { startLine: 7, endLine: 7, startOffset: 5, endOffset: 8 }
 };
 
-const location2: T.FlowLocation = {
+const location2: FlowLocation = {
   component: 'foo',
   componentName: 'src/foo.js',
   msg: 'Do not use foo',
   textRange: { startLine: 8, endLine: 8, startOffset: 0, endOffset: 5 }
 };
 
-const location3: T.FlowLocation = {
+const location3: FlowLocation = {
   component: 'bar',
   componentName: 'src/bar.js',
   msg: 'Do not use bar',
index 5627f89713582a70b1b5ef7f77b23c74098e1fa3..f841599316031a03989fd2c4a812dd75d0aad4af 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { Issue } from '../../../../types/types';
 import ConciseIssuesList from '../ConciseIssuesList';
 
 it('should render', () => {
-  const issues = [{ key: 'foo' }, { key: 'bar' }] as T.Issue[];
+  const issues = [{ key: 'foo' }, { key: 'bar' }] as Issue[];
   expect(
     shallow(
       <ConciseIssuesList
index dd7a5f9219919043bc1d746190322b631d021cbb..020732012ee16bcf9d7c49694655f5d0203eba62 100644 (file)
@@ -21,23 +21,24 @@ import { shallow } from 'enzyme';
 import * as React from 'react';
 import { mockFlowLocation } from '../../../../helpers/testMocks';
 import { click } from '../../../../helpers/testUtils';
+import { FlowLocation } from '../../../../types/types';
 import CrossFileLocationsNavigator from '../CrossFileLocationsNavigator';
 
-const location1: T.FlowLocation = {
+const location1: FlowLocation = {
   component: 'foo',
   componentName: 'src/foo.js',
   msg: 'Do not use foo',
   textRange: { startLine: 7, endLine: 7, startOffset: 5, endOffset: 8 }
 };
 
-const location2: T.FlowLocation = {
+const location2: FlowLocation = {
   component: 'foo',
   componentName: 'src/foo.js',
   msg: 'Do not use foo',
   textRange: { startLine: 8, endLine: 8, startOffset: 0, endOffset: 5 }
 };
 
-const location3: T.FlowLocation = {
+const location3: FlowLocation = {
   component: 'bar',
   componentName: 'src/bar.js',
   msg: 'Do not use bar',
index 17cf8de81ceae1f9cc187f1574cfe5f848ad701c..a57ae654bcba7bb96528506bd0b4909b7cc2733e 100644 (file)
@@ -26,6 +26,19 @@ import { locationsByLine } from '../../../components/SourceViewer/helpers/indexi
 import SourceViewerHeaderSlim from '../../../components/SourceViewer/SourceViewerHeaderSlim';
 import { getBranchLikeQuery } from '../../../helpers/branch-like';
 import { BranchLike } from '../../../types/branch-like';
+import {
+  Dict,
+  Duplication,
+  ExpandDirection,
+  FlowLocation,
+  Issue as TypeIssue,
+  IssuesByLine,
+  LinearIssueLocation,
+  Snippet,
+  SnippetGroup,
+  SourceLine,
+  SourceViewerFile
+} from '../../../types/types';
 import SnippetViewer from './SnippetViewer';
 import {
   createSnippets,
@@ -37,34 +50,34 @@ import {
 
 interface Props {
   branchLike: BranchLike | undefined;
-  duplications?: T.Duplication[];
+  duplications?: Duplication[];
   duplicationsByLine?: { [line: number]: number[] };
   highlightedLocationMessage: { index: number; text: string | undefined } | undefined;
   isLastOccurenceOfPrimaryComponent: boolean;
-  issue: T.Issue;
+  issue: TypeIssue;
   issuePopup?: { issue: string; name: string };
-  issuesByLine: T.IssuesByLine;
+  issuesByLine: IssuesByLine;
   lastSnippetGroup: boolean;
-  loadDuplications: (component: string, line: T.SourceLine) => void;
-  locations: T.FlowLocation[];
-  onIssueChange: (issue: T.Issue) => void;
+  loadDuplications: (component: string, line: SourceLine) => void;
+  locations: FlowLocation[];
+  onIssueChange: (issue: TypeIssue) => void;
   onIssuePopupToggle: (issue: string, popupName: string, open?: boolean) => void;
   onLocationSelect: (index: number) => void;
   renderDuplicationPopup: (
-    component: T.SourceViewerFile,
+    component: SourceViewerFile,
     index: number,
     line: number
   ) => React.ReactNode;
   scroll?: (element: HTMLElement, offset: number) => void;
-  snippetGroup: T.SnippetGroup;
+  snippetGroup: SnippetGroup;
 }
 
 interface State {
-  additionalLines: { [line: number]: T.SourceLine };
+  additionalLines: { [line: number]: SourceLine };
   highlightedSymbols: string[];
   loading: boolean;
-  openIssuesByLine: T.Dict<boolean>;
-  snippets: T.Snippet[];
+  openIssuesByLine: Dict<boolean>;
+  snippets: Snippet[];
 }
 
 export default class ComponentSourceSnippetGroupViewer extends React.PureComponent<Props, State> {
@@ -163,7 +176,7 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
     }
   }
 
-  expandBlock = (snippetIndex: number, direction: T.ExpandDirection): Promise<void> => {
+  expandBlock = (snippetIndex: number, direction: ExpandDirection): Promise<void> => {
     const { branchLike, snippetGroup } = this.props;
     const { key } = snippetGroup.component;
     const { snippets } = this.state;
@@ -189,7 +202,7 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
       ...getBranchLikeQuery(branchLike)
     })
       .then(lines =>
-        lines.reduce((lineMap: T.Dict<T.SourceLine>, line) => {
+        lines.reduce((lineMap: Dict<SourceLine>, line) => {
           line.coverageStatus = getCoverageStatus(line);
           lineMap[line.line] = line;
           return lineMap;
@@ -200,8 +213,8 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
 
   animateBlockExpansion(
     snippetIndex: number,
-    direction: T.ExpandDirection,
-    newLinesMapped: T.Dict<T.SourceLine>
+    direction: ExpandDirection,
+    newLinesMapped: Dict<SourceLine>
   ): Promise<void> {
     if (this.mounted) {
       const { snippets } = this.state;
@@ -273,13 +286,13 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
     );
   };
 
-  handleOpenIssues = (line: T.SourceLine) => {
+  handleOpenIssues = (line: SourceLine) => {
     this.setState(state => ({
       openIssuesByLine: { ...state.openIssuesByLine, [line.line]: true }
     }));
   };
 
-  handleCloseIssues = (line: T.SourceLine) => {
+  handleCloseIssues = (line: SourceLine) => {
     this.setState(state => ({
       openIssuesByLine: { ...state.openIssuesByLine, [line.line]: false }
     }));
@@ -294,7 +307,7 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
     });
   };
 
-  loadDuplications = (line: T.SourceLine) => {
+  loadDuplications = (line: SourceLine) => {
     this.props.loadDuplications(this.props.snippetGroup.component.key, line);
   };
 
@@ -310,10 +323,10 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
     snippet
   }: {
     index: number;
-    issuesByLine: T.IssuesByLine;
+    issuesByLine: IssuesByLine;
     lastSnippetOfLastGroup: boolean;
-    locationsByLine: { [line: number]: T.LinearIssueLocation[] };
-    snippet: T.SourceLine[];
+    locationsByLine: { [line: number]: LinearIssueLocation[] };
+    snippet: SourceLine[];
   }) {
     return (
       <SnippetViewer
index 4b23e381d76d9813fe93e7194b669f3c14a8f7f4..47da6b2d90afce416c18c413f7ae8c7e98059b6e 100644 (file)
@@ -39,16 +39,25 @@ import { WorkspaceContext } from '../../../components/workspace/context';
 import { getBranchLikeQuery } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import {
+  Dict,
+  DuplicatedFile,
+  Duplication,
+  FlowLocation,
+  Issue,
+  SnippetsByComponent,
+  SourceViewerFile
+} from '../../../types/types';
 import ComponentSourceSnippetGroupViewer from './ComponentSourceSnippetGroupViewer';
 import { groupLocationsByComponent } from './utils';
 
 interface Props {
   branchLike: BranchLike | undefined;
   highlightedLocationMessage?: { index: number; text: string | undefined };
-  issue: T.Issue;
-  issues: T.Issue[];
-  locations: T.FlowLocation[];
-  onIssueChange: (issue: T.Issue) => void;
+  issue: Issue;
+  issues: Issue[];
+  locations: FlowLocation[];
+  onIssueChange: (issue: Issue) => void;
   onLoaded?: () => void;
   onLocationSelect: (index: number) => void;
   scroll?: (element: HTMLElement) => void;
@@ -56,9 +65,9 @@ interface Props {
 }
 
 interface State {
-  components: T.Dict<T.SnippetsByComponent>;
-  duplicatedFiles?: T.Dict<T.DuplicatedFile>;
-  duplications?: T.Duplication[];
+  components: Dict<SnippetsByComponent>;
+  duplicatedFiles?: Dict<DuplicatedFile>;
+  duplications?: Duplication[];
   duplicationsByLine: { [line: number]: number[] };
   issuePopup?: { issue: string; name: string };
   loading: boolean;
@@ -146,7 +155,7 @@ export default class CrossComponentSourceViewerWrapper extends React.PureCompone
     });
   };
 
-  renderDuplicationPopup = (component: T.SourceViewerFile, index: number, line: number) => {
+  renderDuplicationPopup = (component: SourceViewerFile, index: number, line: number) => {
     const { duplicatedFiles, duplications } = this.state;
 
     if (!component || !duplicatedFiles) {
index 2d14573f53656e611f0df941927d5c435f878f25..84524731d5791d38444b54bdd8a34a89d7683470 100644 (file)
@@ -31,37 +31,48 @@ import {
 import { translate } from '../../../helpers/l10n';
 import { scrollHorizontally } from '../../../helpers/scrolling';
 import { BranchLike } from '../../../types/branch-like';
+import {
+  Dict,
+  Duplication,
+  ExpandDirection,
+  FlowLocation,
+  Issue,
+  IssuesByLine,
+  LinearIssueLocation,
+  SourceLine,
+  SourceViewerFile
+} from '../../../types/types';
 import './SnippetViewer.css';
 import { inSnippet, LINES_BELOW_ISSUE } from './utils';
 
 interface Props {
   branchLike: BranchLike | undefined;
-  component: T.SourceViewerFile;
+  component: SourceViewerFile;
   displayLineNumberOptions?: boolean;
   displaySCM?: boolean;
-  duplications?: T.Duplication[];
+  duplications?: Duplication[];
   duplicationsByLine?: { [line: number]: number[] };
-  expandBlock: (snippetIndex: number, direction: T.ExpandDirection) => Promise<void>;
-  handleCloseIssues: (line: T.SourceLine) => void;
-  handleOpenIssues: (line: T.SourceLine) => void;
+  expandBlock: (snippetIndex: number, direction: ExpandDirection) => Promise<void>;
+  handleCloseIssues: (line: SourceLine) => void;
+  handleOpenIssues: (line: SourceLine) => void;
   handleSymbolClick: (symbols: string[]) => void;
   highlightedLocationMessage: { index: number; text: string | undefined } | undefined;
   highlightedSymbols: string[];
   index: number;
-  issue: Pick<T.Issue, 'key' | 'textRange' | 'line'>;
+  issue: Pick<Issue, 'key' | 'textRange' | 'line'>;
   issuePopup?: { issue: string; name: string };
-  issuesByLine: T.IssuesByLine;
+  issuesByLine: IssuesByLine;
   lastSnippetOfLastGroup: boolean;
-  loadDuplications?: (line: T.SourceLine) => void;
-  locations: T.FlowLocation[];
-  locationsByLine: { [line: number]: T.LinearIssueLocation[] };
-  onIssueChange: (issue: T.Issue) => void;
+  loadDuplications?: (line: SourceLine) => void;
+  locations: FlowLocation[];
+  locationsByLine: { [line: number]: LinearIssueLocation[] };
+  onIssueChange: (issue: Issue) => void;
   onIssuePopupToggle: (issue: string, popupName: string, open?: boolean) => void;
   onLocationSelect: (index: number) => void;
-  openIssuesByLine: T.Dict<boolean>;
+  openIssuesByLine: Dict<boolean>;
   renderDuplicationPopup: (index: number, line: number) => React.ReactNode;
   scroll?: (element: HTMLElement, offset?: number) => void;
-  snippet: T.SourceLine[];
+  snippet: SourceLine[];
 }
 
 export default class SnippetViewer extends React.PureComponent<Props> {
@@ -101,7 +112,7 @@ export default class SnippetViewer extends React.PureComponent<Props> {
     }
   };
 
-  expandBlock = (direction: T.ExpandDirection) => () =>
+  expandBlock = (direction: ExpandDirection) => () =>
     this.props.expandBlock(this.props.index, direction).then(() => {
       if (direction === 'down') {
         this.scrollToLastExpandedRow();
@@ -122,10 +133,10 @@ export default class SnippetViewer extends React.PureComponent<Props> {
     displayDuplications: boolean;
     displaySCM?: boolean;
     index: number;
-    issuesForLine: T.Issue[];
-    issueLocations: T.LinearIssueLocation[];
-    line: T.SourceLine;
-    snippet: T.SourceLine[];
+    issuesForLine: Issue[];
+    issueLocations: LinearIssueLocation[];
+    line: SourceLine;
+    snippet: SourceLine[];
     symbols: string[];
     verticalBuffer: number;
   }) {
index 899005fdf8d928b0bc6dc18d16c9f0b8aa2992bd..2bcbde079671173c1b92e364a7f4a9922a97f578 100644 (file)
@@ -31,6 +31,7 @@ import {
   mockSourceViewerFile
 } from '../../../../helpers/testMocks';
 import { waitAndUpdate } from '../../../../helpers/testUtils';
+import { SnippetGroup } from '../../../../types/types';
 import ComponentSourceSnippetGroupViewer from '../ComponentSourceSnippetGroupViewer';
 import SnippetViewer from '../SnippetViewer';
 
@@ -53,7 +54,7 @@ it('should render correctly with secondary locations', () => {
     textRange: { startLine: 7, endLine: 7, startOffset: 5, endOffset: 10 }
   });
 
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     locations: [
       mockFlowLocation({
         component: issue.component,
@@ -84,7 +85,7 @@ it('should render correctly with flows', () => {
     textRange: { startLine: 7, endLine: 7, startOffset: 5, endOffset: 10 }
   });
 
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     locations: [
       mockFlowLocation({
         component: issue.component,
@@ -155,7 +156,7 @@ it('should expand block', async () => {
   const issue = mockIssue(true, {
     textRange: { startLine: 74, endLine: 74, startOffset: 5, endOffset: 10 }
   });
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     locations: [
       mockFlowLocation({
         component: 'a',
@@ -184,7 +185,7 @@ it('should expand full component', async () => {
   (getSources as jest.Mock).mockResolvedValueOnce(
     Object.values(mockSnippetsByComponent('a', times(14)).sources)
   );
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     locations: [
       mockFlowLocation({
         component: 'a',
@@ -214,7 +215,7 @@ it('should get the right branch when expanding', async () => {
       mockSnippetsByComponent('a', [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]).sources
     )
   );
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     locations: [mockFlowLocation()],
     ...mockSnippetsByComponent('a', [1, 2, 3, 4, 5, 6, 7])
   };
@@ -250,7 +251,7 @@ it('should handle symbol highlighting', () => {
 });
 
 it('should correctly handle lines actions', () => {
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     locations: [
       mockFlowLocation({
         component: 'a',
@@ -291,7 +292,7 @@ it('should correctly handle lines actions', () => {
 });
 
 describe('getNodes', () => {
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     component: mockSourceViewerFile(),
     locations: [],
     sources: []
@@ -346,7 +347,7 @@ describe('getNodes', () => {
 describe('getHeight', () => {
   jest.useFakeTimers();
 
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     component: mockSourceViewerFile(),
     locations: [],
     sources: []
@@ -397,7 +398,7 @@ describe('getHeight', () => {
 });
 
 function shallowRender(props: Partial<ComponentSourceSnippetGroupViewer['props']> = {}) {
-  const snippetGroup: T.SnippetGroup = {
+  const snippetGroup: SnippetGroup = {
     component: mockSourceViewerFile(),
     locations: [],
     sources: []
index 65c15dc49f967fab279d4122af2bd8035c181e21..48ce2f36565c6014700d0adcfb33ee82a4119b8f 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import {
+  ExpandDirection,
+  FlowLocation,
+  Issue,
+  LineMap,
+  Snippet,
+  SnippetGroup,
+  SnippetsByComponent,
+  SourceLine
+} from '../../../types/types';
+
 const LINES_ABOVE = 5;
 const LINES_BELOW = 5;
 export const MERGE_DISTANCE = 11; // Merge if snippets are eleven lines away (separated by 10 lines) or fewer
 export const LINES_BELOW_ISSUE = 9;
 export const EXPAND_BY_LINES = 50;
 
-function unknownComponent(key: string): T.SnippetsByComponent {
+function unknownComponent(key: string): SnippetsByComponent {
   return {
     component: {
       key,
@@ -42,7 +53,7 @@ function collision([startA, endA]: number[], [startB, endB]: number[]) {
   return !(startA > endB + MERGE_DISTANCE || endA < startB - MERGE_DISTANCE);
 }
 
-export function getPrimaryLocation(issue: T.Issue): T.FlowLocation {
+export function getPrimaryLocation(issue: Issue): FlowLocation {
   return {
     component: issue.component,
     textRange: issue.textRange || {
@@ -54,7 +65,7 @@ export function getPrimaryLocation(issue: T.Issue): T.FlowLocation {
   };
 }
 
-function addLinesBellow(params: { issue: T.Issue; locationEnd: number }) {
+function addLinesBellow(params: { issue: Issue; locationEnd: number }) {
   const { issue, locationEnd } = params;
   const issueEndLine = (issue.textRange && issue.textRange.endLine) || 0;
 
@@ -67,9 +78,9 @@ function addLinesBellow(params: { issue: T.Issue; locationEnd: number }) {
 
 export function createSnippets(params: {
   component: string;
-  issue: T.Issue;
-  locations: T.FlowLocation[];
-}): T.Snippet[] {
+  issue: Issue;
+  locations: FlowLocation[];
+}): Snippet[] {
   const { component, issue, locations } = params;
 
   const hasSecondaryLocations = issue.secondaryLocations.length > 0;
@@ -79,7 +90,7 @@ export function createSnippets(params: {
   // For each location: compute its range, and then compare with other ranges
   // to merge snippets that collide.
   const ranges = (addIssueLocation ? [getPrimaryLocation(issue), ...locations] : locations).reduce(
-    (snippets: T.Snippet[], loc, index) => {
+    (snippets: Snippet[], loc, index) => {
       const startIndex = Math.max(1, loc.textRange.startLine - LINES_ABOVE);
       const endIndex = addLinesBellow({ issue, locationEnd: loc.textRange.endLine });
 
@@ -122,7 +133,7 @@ export function createSnippets(params: {
   return hasSecondaryLocations ? ranges.sort((a, b) => a.start - b.start) : ranges;
 }
 
-export function linesForSnippets(snippets: T.Snippet[], componentLines: T.LineMap) {
+export function linesForSnippets(snippets: Snippet[], componentLines: LineMap) {
   return snippets
     .map(snippet => {
       const lines = [];
@@ -137,13 +148,13 @@ export function linesForSnippets(snippets: T.Snippet[], componentLines: T.LineMa
 }
 
 export function groupLocationsByComponent(
-  issue: T.Issue,
-  locations: T.FlowLocation[],
-  components: { [key: string]: T.SnippetsByComponent }
+  issue: Issue,
+  locations: FlowLocation[],
+  components: { [key: string]: SnippetsByComponent }
 ) {
   let currentComponent = '';
-  let currentGroup: T.SnippetGroup;
-  const groups: T.SnippetGroup[] = [];
+  let currentGroup: SnippetGroup;
+  const groups: SnippetGroup[] = [];
 
   const addGroup = (componentKey: string) => {
     currentGroup = {
@@ -177,9 +188,9 @@ export function expandSnippet({
   snippetIndex,
   snippets
 }: {
-  direction: T.ExpandDirection;
+  direction: ExpandDirection;
   snippetIndex: number;
-  snippets: T.Snippet[];
+  snippets: Snippet[];
 }) {
   const snippetToExpand = snippets.find(s => s.index === snippetIndex);
   if (!snippetToExpand) {
@@ -206,6 +217,6 @@ export function expandSnippet({
   });
 }
 
-export function inSnippet(line: number, snippet: T.SourceLine[]) {
+export function inSnippet(line: number, snippet: SourceLine[]) {
   return line >= snippet[0].line && line <= snippet[snippet.length - 1].line;
 }
index 35cc0eebc6b4fc392bb9fea15175148358953855..4f424d6fd74f31a387493ba82bc5d1943909923e 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { Location } from '../../helpers/urls';
+import { RawQuery } from '../../types/types';
 import { areMyIssuesSelected, parseQuery, serializeQuery } from './utils';
 
 function parseHash(hash: string) {
-  const query: T.RawQuery = {};
+  const query: RawQuery = {};
   const parts = hash.split('|');
   parts.forEach(part => {
     const tokens = part.split('=');
index 20154382029d0711d7a22484fc9b7f827cdcd6e1..e8f2ac769d68943e57438c913daeff47338efba7 100644 (file)
@@ -25,6 +25,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { highlightTerm } from '../../../helpers/search';
 import { isUserActive } from '../../../helpers/users';
 import { Facet } from '../../../types/issues';
+import { Dict, UserBase } from '../../../types/types';
 import { Query, searchAssignees } from '../utils';
 
 interface Props {
@@ -36,8 +37,8 @@ interface Props {
   onToggle: (property: string) => void;
   open: boolean;
   query: Query;
-  stats: T.Dict<number> | undefined;
-  referencedUsers: T.Dict<T.UserBase>;
+  stats: Dict<number> | undefined;
+  referencedUsers: Dict<UserBase>;
 }
 
 export default class AssigneeFacet extends React.PureComponent<Props> {
@@ -79,7 +80,7 @@ export default class AssigneeFacet extends React.PureComponent<Props> {
     }
   };
 
-  loadSearchResultCount = (assignees: T.UserBase[]) => {
+  loadSearchResultCount = (assignees: UserBase[]) => {
     return this.props.loadSearchResultCount('assignees', {
       assigned: undefined,
       assignees: assignees.map(assignee => assignee.login)
@@ -118,7 +119,7 @@ export default class AssigneeFacet extends React.PureComponent<Props> {
     );
   };
 
-  renderSearchResult = (result: T.UserBase, query: string) => {
+  renderSearchResult = (result: UserBase, query: string) => {
     const displayName = isUserActive(result)
       ? result.name
       : translateWithParameters('user.x_deleted', result.login);
@@ -142,7 +143,7 @@ export default class AssigneeFacet extends React.PureComponent<Props> {
     }
 
     return (
-      <ListStyleFacet<T.UserBase>
+      <ListStyleFacet<UserBase>
         facetHeader={translate('issues.facet.assignees')}
         fetching={this.props.fetching}
         getFacetItemText={this.getAssigneeName}
index 2dd7db0f76086989f546c3255914869723ffebc6..39488507762a10220c78a7659d550c85e9c3fbcd 100644 (file)
@@ -24,17 +24,18 @@ import ListStyleFacet from '../../../components/facet/ListStyleFacet';
 import { translate } from '../../../helpers/l10n';
 import { highlightTerm } from '../../../helpers/search';
 import { Facet } from '../../../types/issues';
+import { Component, Dict } from '../../../types/types';
 import { Query } from '../utils';
 
 interface Props {
-  component: T.Component | undefined;
+  component: Component | undefined;
   fetching: boolean;
   loadSearchResultCount: (property: string, changes: Partial<Query>) => Promise<Facet>;
   onChange: (changes: Partial<Query>) => void;
   onToggle: (property: string) => void;
   open: boolean;
   query: Query;
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
   author: string[];
 }
 
index a69c5b1c7f17ab530a7281d85fa25f283ccc87ca..0993c05084cf5711a0eab1b08e8781294a40f33f 100644 (file)
@@ -35,10 +35,11 @@ import { parseDate } from '../../../helpers/dates';
 import { translate } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
 import { isPortfolioLike } from '../../../types/component';
+import { Component, Dict } from '../../../types/types';
 import { Query } from '../utils';
 
 interface Props {
-  component: T.Component | undefined;
+  component: Component | undefined;
   createdAfter: Date | undefined;
   createdAfterIncludesTime: boolean;
   createdAt: string;
@@ -49,7 +50,7 @@ interface Props {
   onToggle: (property: string) => void;
   open: boolean;
   sinceLeakPeriod: boolean;
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
 }
 
 export class CreationDateFacet extends React.PureComponent<Props & WrappedComponentProps> {
index a898a622af5e154079f4a0f2dfd59114d2573276..cc13835d859d7fb585fd94928298d342d5ff3917 100644 (file)
@@ -25,6 +25,7 @@ import { translate } from '../../../helpers/l10n';
 import { highlightTerm } from '../../../helpers/search';
 import { getLanguages, Store } from '../../../store/rootReducer';
 import { Facet, ReferencedLanguage } from '../../../types/issues';
+import { Dict } from '../../../types/types';
 import { Query } from '../utils';
 
 interface InstalledLanguage {
@@ -41,8 +42,8 @@ interface Props {
   onToggle: (property: string) => void;
   open: boolean;
   query: Query;
-  referencedLanguages: T.Dict<ReferencedLanguage>;
-  stats: T.Dict<number> | undefined;
+  referencedLanguages: Dict<ReferencedLanguage>;
+  stats: Dict<number> | undefined;
 }
 
 class LanguageFacet extends React.PureComponent<Props> {
index 4738c61842d6adf95a3f10b22deeffa43160512f..465b29ba095951787d2a41d7c6a9a2dca6d3ea30 100644 (file)
@@ -26,10 +26,11 @@ import { translate } from '../../../helpers/l10n';
 import { highlightTerm } from '../../../helpers/search';
 import { ComponentQualifier } from '../../../types/component';
 import { Facet, ReferencedComponent } from '../../../types/issues';
+import { Component, Dict, Paging } from '../../../types/types';
 import { Query } from '../utils';
 
 interface Props {
-  component: T.Component | undefined;
+  component: Component | undefined;
   loadSearchResultCount: (property: string, changes: Partial<Query>) => Promise<Facet>;
   fetching: boolean;
   onChange: (changes: Partial<Query>) => void;
@@ -37,8 +38,8 @@ interface Props {
   open: boolean;
   projects: string[];
   query: Query;
-  referencedComponents: T.Dict<ReferencedComponent>;
-  stats: T.Dict<number> | undefined;
+  referencedComponents: Dict<ReferencedComponent>;
+  stats: Dict<number> | undefined;
 }
 
 interface SearchedProject {
@@ -50,7 +51,7 @@ export default class ProjectFacet extends React.PureComponent<Props> {
   handleSearch = (
     query: string,
     page = 1
-  ): Promise<{ results: SearchedProject[]; paging: T.Paging }> => {
+  ): Promise<{ results: SearchedProject[]; paging: Paging }> => {
     const { component } = this.props;
     if (
       component &&
index 3d4714916865c251db27b57adee032f1f9d3b215..d13db6d05daef8d5f8364cdbdd1aa59a831d30b0 100644 (file)
@@ -25,6 +25,7 @@ import FacetItem from '../../../components/facet/FacetItem';
 import FacetItemsList from '../../../components/facet/FacetItemsList';
 import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint';
 import { translate } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 import { formatFacetStat, Query } from '../utils';
 
 interface Props {
@@ -34,7 +35,7 @@ interface Props {
   open: boolean;
   resolved: boolean;
   resolutions: string[];
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
 }
 
 const RESOLUTIONS = ['', 'FALSE-POSITIVE', 'FIXED', 'REMOVED', 'WONTFIX'];
index 61d48932cfafae9428f2b6d97cb6379f5ffd5fdc..1c2075778a38442cf97281db67e07c66906f26bd 100644 (file)
@@ -23,6 +23,7 @@ import { searchRules } from '../../../api/rules';
 import ListStyleFacet from '../../../components/facet/ListStyleFacet';
 import { translate } from '../../../helpers/l10n';
 import { Facet, ReferencedRule } from '../../../types/issues';
+import { Dict, Rule } from '../../../types/types';
 import { Query } from '../utils';
 
 interface Props {
@@ -33,9 +34,9 @@ interface Props {
   onToggle: (property: string) => void;
   open: boolean;
   query: Query;
-  referencedRules: T.Dict<ReferencedRule>;
+  referencedRules: Dict<ReferencedRule>;
   rules: string[];
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
 }
 
 export default class RuleFacet extends React.PureComponent<Props> {
@@ -55,7 +56,7 @@ export default class RuleFacet extends React.PureComponent<Props> {
     }));
   };
 
-  loadSearchResultCount = (rules: T.Rule[]) => {
+  loadSearchResultCount = (rules: Rule[]) => {
     return this.props.loadSearchResultCount('rules', { rules: rules.map(rule => rule.key) });
   };
 
@@ -70,13 +71,13 @@ export default class RuleFacet extends React.PureComponent<Props> {
     return langName ? `(${langName}) ${name}` : name;
   };
 
-  renderSearchResult = (rule: T.Rule) => {
+  renderSearchResult = (rule: Rule) => {
     return this.formatRuleName(rule.name, rule.langName);
   };
 
   render() {
     return (
-      <ListStyleFacet<T.Rule>
+      <ListStyleFacet<Rule>
         facetHeader={translate('issues.facet.rules')}
         fetching={this.props.fetching}
         getFacetItemText={this.getRuleName}
index 44d3e34dc857222a6a9000da8b677ffc0c1a5589..f7fce70301125eff6d26fcd6d83eb0e1f128c106 100644 (file)
@@ -27,6 +27,7 @@ import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHi
 import QualifierIcon from '../../../components/icons/QualifierIcon';
 import { SOURCE_SCOPES } from '../../../helpers/constants';
 import { translate } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 import { formatFacetStat, Query } from '../utils';
 
 export interface ScopeFacetProps {
@@ -35,7 +36,7 @@ export interface ScopeFacetProps {
   onToggle: (property: string) => void;
   open: boolean;
   scopes: string[];
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
 }
 
 export default function ScopeFacet(props: ScopeFacetProps) {
index e607e0bf9b9b3df58754da1ba8ebefb1ec5faf9a..10e4ae10beac28f19706740ec1545dcbe37329d3 100644 (file)
@@ -26,6 +26,7 @@ import FacetItemsList from '../../../components/facet/FacetItemsList';
 import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint';
 import SeverityHelper from '../../../components/shared/SeverityHelper';
 import { translate } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 import { formatFacetStat, Query } from '../utils';
 
 interface Props {
@@ -34,7 +35,7 @@ interface Props {
   onToggle: (property: string) => void;
   open: boolean;
   severities: string[];
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
 }
 
 const SEVERITIES = ['BLOCKER', 'MINOR', 'CRITICAL', 'INFO', 'MAJOR'];
index 67666f9bc7781fb4454734567c1630b7e694745a..e86a72ec3b43dcfb91b14ca7404613659eff591a 100644 (file)
@@ -19,9 +19,9 @@
  */
 import * as React from 'react';
 import { connect } from 'react-redux';
+import { isBranch, isPullRequest } from '../../../helpers/branch-like';
 import { getGlobalSettingValue, Store } from '../../../store/rootReducer';
 import { BranchLike } from '../../../types/branch-like';
-import { isBranch, isPullRequest } from '../../../helpers/branch-like';
 import { ComponentQualifier, isApplication, isPortfolioLike } from '../../../types/component';
 import {
   Facet,
@@ -29,6 +29,7 @@ import {
   ReferencedLanguage,
   ReferencedRule
 } from '../../../types/issues';
+import { Component, Dict, UserBase } from '../../../types/types';
 import { Query } from '../utils';
 import AssigneeFacet from './AssigneeFacet';
 import AuthorFacet from './AuthorFacet';
@@ -48,21 +49,21 @@ import TypeFacet from './TypeFacet';
 
 export interface Props {
   branchLike?: BranchLike;
-  component: T.Component | undefined;
+  component: Component | undefined;
   createdAfterIncludesTime: boolean;
-  facets: T.Dict<Facet | undefined>;
+  facets: Dict<Facet | undefined>;
   loadSearchResultCount: (property: string, changes: Partial<Query>) => Promise<Facet>;
-  loadingFacets: T.Dict<boolean>;
+  loadingFacets: Dict<boolean>;
   myIssues: boolean;
   onFacetToggle: (property: string) => void;
   onFilterChange: (changes: Partial<Query>) => void;
-  openFacets: T.Dict<boolean>;
+  openFacets: Dict<boolean>;
   query: Query;
-  referencedComponentsById: T.Dict<ReferencedComponent>;
-  referencedComponentsByKey: T.Dict<ReferencedComponent>;
-  referencedLanguages: T.Dict<ReferencedLanguage>;
-  referencedRules: T.Dict<ReferencedRule>;
-  referencedUsers: T.Dict<T.UserBase>;
+  referencedComponentsById: Dict<ReferencedComponent>;
+  referencedComponentsByKey: Dict<ReferencedComponent>;
+  referencedLanguages: Dict<ReferencedLanguage>;
+  referencedRules: Dict<ReferencedRule>;
+  referencedUsers: Dict<UserBase>;
   disableDeveloperAggregatedInfo: boolean;
 }
 
index ae087df51beee6c166beeca254c06a179d4461ff..06e7f05b4bac10e5fa6206d0674b480a4be925ef 100644 (file)
@@ -36,12 +36,13 @@ import {
 } from '../../../helpers/security-standard';
 import { Facet } from '../../../types/issues';
 import { SecurityStandard, Standards, StandardType } from '../../../types/security';
+import { Dict } from '../../../types/types';
 import { formatFacetStat, Query, STANDARDS } from '../utils';
 
 interface Props {
   cwe: string[];
   cweOpen: boolean;
-  cweStats: T.Dict<number> | undefined;
+  cweStats: Dict<number> | undefined;
   fetchingCwe: boolean;
   fetchingOwaspTop10: boolean;
   fetchingSansTop25: boolean;
@@ -52,14 +53,14 @@ interface Props {
   open: boolean;
   owaspTop10: string[];
   owaspTop10Open: boolean;
-  owaspTop10Stats: T.Dict<number> | undefined;
+  owaspTop10Stats: Dict<number> | undefined;
   query: Partial<Query>;
   sansTop25: string[];
   sansTop25Open: boolean;
-  sansTop25Stats: T.Dict<number> | undefined;
+  sansTop25Stats: Dict<number> | undefined;
   sonarsourceSecurity: string[];
   sonarsourceSecurityOpen: boolean;
-  sonarsourceSecurityStats: T.Dict<number> | undefined;
+  sonarsourceSecurityStats: Dict<number> | undefined;
 }
 
 interface State {
index ebf1fa97c75d3c0a1086959d15a05c34258342cb..01a22bf23a5b3aab49b78abd971e251d765d244d 100644 (file)
@@ -26,6 +26,7 @@ import FacetItemsList from '../../../components/facet/FacetItemsList';
 import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint';
 import StatusHelper from '../../../components/shared/StatusHelper';
 import { translate } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 import { formatFacetStat, Query } from '../utils';
 
 interface Props {
@@ -33,7 +34,7 @@ interface Props {
   onChange: (changes: Partial<Query>) => void;
   onToggle: (property: string) => void;
   open: boolean;
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
   statuses: string[];
 }
 
index 6c8f4af269c0425116204404ed2bef6764d060b1..573b961b8613447e8b83ebba80870a4485721d27 100644 (file)
@@ -26,10 +26,11 @@ import TagsIcon from '../../../components/icons/TagsIcon';
 import { translate } from '../../../helpers/l10n';
 import { highlightTerm } from '../../../helpers/search';
 import { Facet } from '../../../types/issues';
+import { Component, Dict } from '../../../types/types';
 import { Query } from '../utils';
 
 interface Props {
-  component: T.Component | undefined;
+  component: Component | undefined;
   branch?: string;
   fetching: boolean;
   loadSearchResultCount: (property: string, changes: Partial<Query>) => Promise<Facet>;
@@ -37,7 +38,7 @@ interface Props {
   onToggle: (property: string) => void;
   open: boolean;
   query: Query;
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
   tags: string[];
 }
 
index 057d954e2de50d831f1402b695746870f34f62db..80c6e518c7a83f464886bb31b7cfb11c415b3508 100644 (file)
@@ -27,6 +27,7 @@ import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHi
 import IssueTypeIcon from '../../../components/icons/IssueTypeIcon';
 import { ISSUE_TYPES } from '../../../helpers/constants';
 import { translate } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 import { formatFacetStat, Query } from '../utils';
 
 interface Props {
@@ -34,7 +35,7 @@ interface Props {
   onChange: (changes: Partial<Query>) => void;
   onToggle: (property: string) => void;
   open: boolean;
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
   types: string[];
 }
 
index e8d4f8baf0f8c6c2b2d232f9aff5c851c1c8a594..4b5c9f9713b58aa621cbf90a9361b94891ef7a82 100644 (file)
@@ -36,6 +36,7 @@ import { get, save } from '../../helpers/storage';
 import { isDefined } from '../../helpers/types';
 import { Facet, RawFacet } from '../../types/issues';
 import { SecurityStandard, StandardType } from '../../types/security';
+import { Dict, Issue, Paging, RawQuery, UserBase } from '../../types/types';
 
 export interface Query {
   assigned: boolean;
@@ -78,7 +79,7 @@ export const STANDARD_TYPES: StandardType[] = [
 const parseAsSort = (sort: string) => (sort === 'CREATION_DATE' ? 'CREATION_DATE' : '');
 const ISSUES_DEFAULT = 'sonarqube.issues.default';
 
-export function parseQuery(query: T.RawQuery): Query {
+export function parseQuery(query: RawQuery): Query {
   return {
     assigned: parseAsBoolean(query.assigned),
     assignees: parseAsArray(query.assignees, parseAsString),
@@ -109,13 +110,13 @@ export function parseQuery(query: T.RawQuery): Query {
   };
 }
 
-export function getOpen(query: T.RawQuery): string | undefined {
+export function getOpen(query: RawQuery): string | undefined {
   return query.open;
 }
 
-export const areMyIssuesSelected = (query: T.RawQuery) => query.myIssues === 'true';
+export const areMyIssuesSelected = (query: RawQuery) => query.myIssues === 'true';
 
-export function serializeQuery(query: Query): T.RawQuery {
+export function serializeQuery(query: Query): RawQuery {
   const filter = {
     assigned: query.assigned ? undefined : 'false',
     assignees: serializeStringArray(query.assignees),
@@ -148,15 +149,15 @@ export function serializeQuery(query: Query): T.RawQuery {
   return cleanQuery(filter);
 }
 
-export const areQueriesEqual = (a: T.RawQuery, b: T.RawQuery) =>
+export const areQueriesEqual = (a: RawQuery, b: RawQuery) =>
   queriesEqual(parseQuery(a), parseQuery(b));
 
-export function parseFacets(facets: RawFacet[]): T.Dict<Facet> {
+export function parseFacets(facets: RawFacet[]): Dict<Facet> {
   if (!facets) {
     return {};
   }
 
-  const result: T.Dict<Facet> = {};
+  const result: Dict<Facet> = {};
   facets.forEach(facet => {
     const values: Facet = {};
     facet.values.forEach(value => {
@@ -174,7 +175,7 @@ export function formatFacetStat(stat: number | undefined) {
 export const searchAssignees = (
   query: string,
   page = 1
-): Promise<{ paging: T.Paging; results: T.UserBase[] }> => {
+): Promise<{ paging: Paging; results: UserBase[] }> => {
   return searchUsers({ p: page, q: query }).then(({ paging, users }) => ({
     paging,
     results: users
@@ -192,7 +193,7 @@ export const saveMyIssues = (myIssues: boolean) =>
   save(ISSUES_DEFAULT, myIssues ? LOCALSTORAGE_MY : LOCALSTORAGE_ALL);
 
 export function getLocations(
-  { flows, secondaryLocations }: Pick<T.Issue, 'flows' | 'secondaryLocations'>,
+  { flows, secondaryLocations }: Pick<Issue, 'flows' | 'secondaryLocations'>,
   selectedFlowIndex: number | undefined
 ) {
   if (selectedFlowIndex !== undefined) {
@@ -203,7 +204,7 @@ export function getLocations(
 }
 
 export function getSelectedLocation(
-  issue: Pick<T.Issue, 'flows' | 'secondaryLocations'>,
+  issue: Pick<Issue, 'flows' | 'secondaryLocations'>,
   selectedFlowIndex: number | undefined,
   selectedLocationIndex: number | undefined
 ) {
@@ -220,7 +221,7 @@ export function getSelectedLocation(
 }
 
 export function allLocationsEmpty(
-  issue: Pick<T.Issue, 'flows' | 'secondaryLocations'>,
+  issue: Pick<Issue, 'flows' | 'secondaryLocations'>,
   selectedFlowIndex: number | undefined
 ) {
   return getLocations(issue, selectedFlowIndex).every(location => !location.msg);
@@ -234,7 +235,7 @@ export function scrollToIssue(issue: string, smooth = true) {
 }
 
 export function shouldOpenStandardsFacet(
-  openFacets: T.Dict<boolean>,
+  openFacets: Dict<boolean>,
   query: Partial<Query>
 ): boolean {
   return (
@@ -245,7 +246,7 @@ export function shouldOpenStandardsFacet(
 }
 
 export function shouldOpenStandardsChildFacet(
-  openFacets: T.Dict<boolean>,
+  openFacets: Dict<boolean>,
   query: Partial<Query>,
   standardType: SecurityStandard
 ): boolean {
@@ -258,7 +259,7 @@ export function shouldOpenStandardsChildFacet(
 }
 
 export function shouldOpenSonarSourceSecurityFacet(
-  openFacets: T.Dict<boolean>,
+  openFacets: Dict<boolean>,
   query: Partial<Query>
 ): boolean {
   // Open it by default if the parent is open, and no other standard is open.
@@ -272,7 +273,7 @@ function isFilteredBySecurityIssueTypes(query: Partial<Query>): boolean {
   return query.types !== undefined && query.types.includes('VULNERABILITY');
 }
 
-function isOneStandardChildFacetOpen(openFacets: T.Dict<boolean>, query: Partial<Query>): boolean {
+function isOneStandardChildFacetOpen(openFacets: Dict<boolean>, query: Partial<Query>): boolean {
   return STANDARD_TYPES.some(standardType =>
     shouldOpenStandardsChildFacet(openFacets, query, standardType)
   );
index e49721d363f269dc756921cf1f80f5d18303e27e..43a2c17787fdef6052560c03cd371ab765298159 100644 (file)
@@ -22,10 +22,11 @@ import { connect } from 'react-redux';
 import AdminContext from '../../app/components/AdminContext';
 import { getAppState, getGlobalSettingValue, Store } from '../../store/rootReducer';
 import { EditionKey } from '../../types/editions';
+import { RawQuery } from '../../types/types';
 import App from './App';
 
 interface OwnProps {
-  location: { pathname: string; query: T.RawQuery };
+  location: { pathname: string; query: RawQuery };
 }
 
 interface StateToProps {
index d6a752783166d33ed7b2b7fd4e11acb903bb1b40..8c4a0eca1b46a2f6b443c71ea4dda7eabfee03a7 100644 (file)
@@ -20,6 +20,7 @@
 import { memoize } from 'lodash';
 import { cleanQuery, parseAsString, serializeString } from '../../helpers/query';
 import { Plugin } from '../../types/plugins';
+import { RawQuery } from '../../types/types';
 
 export interface Query {
   filter: string;
@@ -45,14 +46,14 @@ export function filterPlugins(plugins: Plugin[], search?: string): Plugin[] {
 
 export const DEFAULT_FILTER = 'all';
 export const parseQuery = memoize(
-  (urlQuery: T.RawQuery): Query => ({
+  (urlQuery: RawQuery): Query => ({
     filter: parseAsString(urlQuery['filter']) || DEFAULT_FILTER,
     search: parseAsString(urlQuery['search'])
   })
 );
 
 export const serializeQuery = memoize(
-  (query: Query): T.RawQuery =>
+  (query: Query): RawQuery =>
     cleanQuery({
       filter: query.filter === DEFAULT_FILTER ? undefined : serializeString(query.filter),
       search: query.search ? serializeString(query.search) : undefined
index 163d39c564e25861632168eb5bd74e2b195439ad..aa70f143472950d457cd0879e13bae08ceae73d8 100644 (file)
@@ -32,17 +32,18 @@ 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 as AnalysisType, Component, Metric } from '../../../types/types';
 import Analysis from './Analysis';
 
 export interface ActivityPanelProps {
-  analyses?: T.Analysis[];
+  analyses?: AnalysisType[];
   branchLike?: BranchLike;
-  component: Pick<T.Component, 'key' | 'qualifier'>;
+  component: Pick<Component, 'key' | 'qualifier'>;
   graph?: GraphType;
   leakPeriodDate?: Date;
   loading?: boolean;
   measuresHistory: MeasureHistory[];
-  metrics: T.Metric[];
+  metrics: Metric[];
   onGraphChange: (graph: GraphType) => void;
 }
 
index 80a7a6274b7bf031cc7d9f300ce86742f5bc1239..4daeefa495f96d6eba1e15a9be86ff4f25f76b60 100644 (file)
@@ -22,10 +22,11 @@ import * as React from 'react';
 import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
 import { translate } from '../../../helpers/l10n';
 import { ComponentQualifier } from '../../../types/component';
+import { Analysis as TypeAnalysis } from '../../../types/types';
 import Event from './Event';
 
 export interface AnalysisProps {
-  analysis: T.Analysis;
+  analysis: TypeAnalysis;
   qualifier: string;
 }
 
index 9ab00c04736a3c40c82347d9221b37acf8b5d1c3..ecf8a51dcb5c28622fdd8336c821e3457d41c504 100644 (file)
@@ -49,6 +49,7 @@ import { ComponentQualifier } from '../../../types/component';
 import { MetricKey } from '../../../types/metrics';
 import { GraphType, MeasureHistory } from '../../../types/project-activity';
 import { QualityGateStatus, QualityGateStatusCondition } from '../../../types/quality-gates';
+import { Analysis, Component, MeasureEnhanced, Metric, Period } from '../../../types/types';
 import '../styles.css';
 import { HISTORY_METRICS_LIST, METRICS } from '../utils';
 import BranchOverviewRenderer from './BranchOverviewRenderer';
@@ -56,21 +57,21 @@ import BranchOverviewRenderer from './BranchOverviewRenderer';
 interface Props {
   branch?: Branch;
   branchesEnabled?: boolean;
-  component: T.Component;
+  component: Component;
   projectBinding?: ProjectAlmBindingResponse;
 }
 
 interface State {
-  analyses?: T.Analysis[];
+  analyses?: Analysis[];
   appLeak?: ApplicationPeriod;
   detectedCIOnLastAnalysis?: boolean;
   graph: GraphType;
   loadingHistory?: boolean;
   loadingStatus?: boolean;
-  measures?: T.MeasureEnhanced[];
+  measures?: MeasureEnhanced[];
   measuresHistory?: MeasureHistory[];
-  metrics?: T.Metric[];
-  period?: T.Period;
+  metrics?: Metric[];
+  period?: Period;
   qgStatuses?: QualityGateStatus[];
 }
 
@@ -348,10 +349,7 @@ export default class BranchOverview extends React.PureComponent<Props, State> {
     );
   };
 
-  getFailedConditions = (
-    conditions: QualityGateStatusCondition[],
-    measures: T.MeasureEnhanced[]
-  ) => {
+  getFailedConditions = (conditions: QualityGateStatusCondition[], measures: MeasureEnhanced[]) => {
     return (
       conditions
         .filter(c => c.level !== 'OK')
index d537f7d5d7af1c714ee39313dc7d6618c46b7504..c3be7dbff7e8917aab0d1b30459fce6a509171c1 100644 (file)
@@ -26,6 +26,7 @@ import { Branch } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
 import { GraphType, MeasureHistory } from '../../../types/project-activity';
 import { QualityGateStatus } from '../../../types/quality-gates';
+import { Analysis, Component, MeasureEnhanced, Metric, Period } from '../../../types/types';
 import ActivityPanel from './ActivityPanel';
 import FirstAnalysisNextStepsNotif from './FirstAnalysisNextStepsNotif';
 import { MeasuresPanel } from './MeasuresPanel';
@@ -33,20 +34,20 @@ import NoCodeWarning from './NoCodeWarning';
 import QualityGatePanel from './QualityGatePanel';
 
 export interface BranchOverviewRendererProps {
-  analyses?: T.Analysis[];
+  analyses?: Analysis[];
   appLeak?: ApplicationPeriod;
   branch?: Branch;
   branchesEnabled?: boolean;
-  component: T.Component;
+  component: Component;
   detectedCIOnLastAnalysis?: boolean;
   graph?: GraphType;
   loadingHistory?: boolean;
   loadingStatus?: boolean;
-  measures?: T.MeasureEnhanced[];
+  measures?: MeasureEnhanced[];
   measuresHistory?: MeasureHistory[];
-  metrics?: T.Metric[];
+  metrics?: Metric[];
   onGraphChange: (graph: GraphType) => void;
-  period?: T.Period;
+  period?: Period;
   projectBinding?: ProjectAlmBindingResponse;
   projectIsEmpty?: boolean;
   qgStatuses?: QualityGateStatus[];
index abf286bd08fde0a7ca05fcc24cf9a0ca5ddbcd44..5a8c51c3a321898bebdfa5649309d748ecc7f0f3 100644 (file)
@@ -24,11 +24,12 @@ import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
 import { findMeasure, formatMeasure, localizeMetric } from '../../../helpers/measures';
 import { BranchLike } from '../../../types/branch-like';
 import { MetricKey } from '../../../types/metrics';
+import { Component, MeasureEnhanced } from '../../../types/types';
 
 export interface DebtValueProps {
   branchLike?: BranchLike;
-  component: T.Component;
-  measures: T.MeasureEnhanced[];
+  component: Component;
+  measures: MeasureEnhanced[];
   useDiffMetric?: boolean;
 }
 
index c30a0ca7f04903c6f201c15bab68c208268740a1..3a6d201badad7e4486c2960e571d6f18ccf28f78 100644 (file)
@@ -23,11 +23,12 @@ import { getLocalizedMetricName } from '../../../helpers/l10n';
 import { findMeasure, formatMeasure } from '../../../helpers/measures';
 import { BranchLike } from '../../../types/branch-like';
 import { MetricKey } from '../../../types/metrics';
+import { Component, MeasureEnhanced } from '../../../types/types';
 
 export interface DrilldownMeasureValueProps {
   branchLike?: BranchLike;
-  component: T.Component;
-  measures: T.MeasureEnhanced[];
+  component: Component;
+  measures: MeasureEnhanced[];
   metric: MetricKey;
 }
 
index ce8440b6d3e37d5e955ad9ce952d27eba8934d68..a33b217d70c610b8e37beb11c102d1f436ef77f5 100644 (file)
@@ -21,11 +21,12 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import Level from '../../../components/ui/Level';
 import { translate } from '../../../helpers/l10n';
+import { AnalysisEvent } from '../../../types/types';
 import { isDefinitionChangeEvent } from '../../projectActivity/components/DefinitionChangeEventInner';
 import { isRichQualityGateEvent } from '../../projectActivity/components/RichQualityGateEventInner';
 
 interface Props {
-  event: T.AnalysisEvent;
+  event: AnalysisEvent;
 }
 
 export function Event({ event }: Props) {
index 704d09759bbf351714a6818c640823b4d998e5fc..5338da91e84d7f0cd544385bcc0e8bf7237d5a75 100644 (file)
@@ -26,12 +26,13 @@ import { translate } from '../../../helpers/l10n';
 import { isLoggedIn } from '../../../helpers/users';
 import { ProjectAlmBindingResponse } from '../../../types/alm-settings';
 import { ComponentQualifier } from '../../../types/component';
+import { Component, CurrentUser } from '../../../types/types';
 import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../settings/components/AdditionalCategoryKeys';
 
 export interface FirstAnalysisNextStepsNotifProps {
   branchesEnabled?: boolean;
-  component: T.Component;
-  currentUser: T.CurrentUser;
+  component: Component;
+  currentUser: CurrentUser;
   detectedCIOnLastAnalysis?: boolean;
   projectBinding?: ProjectAlmBindingResponse;
 }
index 53e675c3f67254bfd22cc46884581d2762b0eb7a..49b89c3783d6ef553d8a7e6c04392c41c5fb7721 100644 (file)
 import * as React from 'react';
 import { isApplicationPeriod } from '../../../helpers/periods';
 import { ApplicationPeriod } from '../../../types/application';
+import { Period } from '../../../types/types';
 import ApplicationLeakPeriodInfo from './ApplicationLeakPeriodInfo';
 import ProjectLeakPeriodInfo from './ProjectLeakPeriodInfo';
 
 export interface LeakPeriodInfoProps {
-  leakPeriod: T.Period | ApplicationPeriod;
+  leakPeriod: Period | ApplicationPeriod;
 }
 
 export function LeakPeriodInfo({ leakPeriod }: LeakPeriodInfoProps) {
index 4edc3cba36bc25a678590887cc5906a450def277..dcc39f05b8b337f11beb669999adc622af1f11d7 100644 (file)
@@ -29,6 +29,7 @@ import { Branch } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
 import { IssueType } from '../../../types/issues';
 import { MetricKey } from '../../../types/metrics';
+import { Component, MeasureEnhanced, Period } from '../../../types/types';
 import MeasurementLabel from '../components/MeasurementLabel';
 import { MeasurementType } from '../utils';
 import { DrilldownMeasureValue } from './DrilldownMeasureValue';
@@ -39,10 +40,10 @@ import MeasuresPanelNoNewCode from './MeasuresPanelNoNewCode';
 export interface MeasuresPanelProps {
   appLeak?: ApplicationPeriod;
   branch?: Branch;
-  component: T.Component;
+  component: Component;
   loading?: boolean;
-  measures?: T.MeasureEnhanced[];
-  period?: T.Period;
+  measures?: MeasureEnhanced[];
+  period?: Period;
 }
 
 export enum MeasuresPanelTabs {
index a4abcbd51a20d4d0f2ac04a6f8e4072b7d6f20fa..3f33feb13700a1caeed745b369eebcab167bb88c 100644 (file)
@@ -22,6 +22,7 @@ import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
 import { IssueType } from '../../../types/issues';
+import { Component, MeasureEnhanced } from '../../../types/types';
 import IssueLabel from '../components/IssueLabel';
 import IssueRating from '../components/IssueRating';
 import DebtValue from './DebtValue';
@@ -29,9 +30,9 @@ import SecurityHotspotsReviewed from './SecurityHotspotsReviewed';
 
 export interface MeasuresPanelIssueMeasureRowProps {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   isNewCodeTab: boolean;
-  measures: T.MeasureEnhanced[];
+  measures: MeasureEnhanced[];
   type: IssueType;
 }
 
index a6eaf3cf9417a04bc3c5245e35deb1507c0cb1a3..57532e33143d7a89cde26109fb14135c07fa6292 100644 (file)
@@ -25,11 +25,12 @@ import { translate } from '../../../helpers/l10n';
 import { getBaseUrl } from '../../../helpers/system';
 import { Branch } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
+import { Component, Period } from '../../../types/types';
 
 export interface MeasuresPanelNoNewCodeProps {
   branch?: Branch;
-  component: T.Component;
-  period?: T.Period;
+  component: Component;
+  period?: Period;
 }
 
 export default function MeasuresPanelNoNewCode(props: MeasuresPanelNoNewCodeProps) {
index 3c03e6fe6c5f98796ace7bc17e71e4d91755b981..bdf4542e5c55a80796a3216e5812f43ff8aa7dbd 100644 (file)
@@ -24,11 +24,12 @@ import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
 import { MetricKey } from '../../../types/metrics';
+import { Component, MeasureEnhanced } from '../../../types/types';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.Component;
-  measures?: T.MeasureEnhanced[];
+  component: Component;
+  measures?: MeasureEnhanced[];
 }
 
 export function NoCodeWarning({ branchLike, component, measures }: Props) {
index 1996f07ae95c0781d3c9b5919a7a34675fa96ffb..3e7a6defbd69e764d618c7e9459ac19e287095d2 100644 (file)
@@ -24,9 +24,10 @@ import DateFromNow from '../../../components/intl/DateFromNow';
 import { formatterOption } from '../../../components/intl/DateTimeFormatter';
 import { translateWithParameters } from '../../../helpers/l10n';
 import { getPeriodDate, getPeriodLabel } from '../../../helpers/periods';
+import { Period } from '../../../types/types';
 
 export interface ProjectLeakPeriodInfoProps extends WrappedComponentProps {
-  leakPeriod: T.Period;
+  leakPeriod: Period;
 }
 
 export function ProjectLeakPeriodInfo(props: ProjectLeakPeriodInfoProps) {
index 2954827ba40ca9347ebff84a9461b8362c056b52..128d3b0b0fa8799b65c2ac143d3522760a0a191d 100644 (file)
@@ -25,11 +25,12 @@ 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 { Component } from '../../../types/types';
 import SonarLintPromotion from '../components/SonarLintPromotion';
 import QualityGatePanelSection from './QualityGatePanelSection';
 
 export interface QualityGatePanelProps {
-  component: Pick<T.Component, 'key' | 'qualifier'>;
+  component: Pick<Component, 'key' | 'qualifier'>;
   loading?: boolean;
   qgStatuses?: QualityGateStatus[];
 }
index 3470d6794232bbb1ac92b66a48ecc12f37b64738..fe441a3bbda3927fda0e6315b167f706a329f89e 100644 (file)
@@ -23,11 +23,12 @@ import { isDiffMetric } from '../../../helpers/measures';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
 import { QualityGateStatus } from '../../../types/quality-gates';
+import { Component } from '../../../types/types';
 import QualityGateConditions from '../components/QualityGateConditions';
 
 export interface QualityGatePanelSectionProps {
   branchLike?: BranchLike;
-  component: Pick<T.Component, 'key' | 'qualifier'>;
+  component: Pick<Component, 'key' | 'qualifier'>;
   qgStatus: QualityGateStatus;
 }
 
index 01840022a22f3f7fb78434bd449b5e7760301fa5..63ed0c15e5a76cf58044d86630b445ad0357b27d 100644 (file)
@@ -23,9 +23,10 @@ import CoverageRating from '../../../components/ui/CoverageRating';
 import { translate } from '../../../helpers/l10n';
 import { findMeasure, formatMeasure } from '../../../helpers/measures';
 import { MetricKey } from '../../../types/metrics';
+import { MeasureEnhanced } from '../../../types/types';
 
 export interface SecurityHotspotsReviewedProps {
-  measures: T.MeasureEnhanced[];
+  measures: MeasureEnhanced[];
   useDiffMetric?: boolean;
 }
 
index 08ef85049ddd86c5707b1b1d8e5313ed49e6c209..bdb0f097d2ff8611f3a9f5b6faf2a62f2242864f 100644 (file)
@@ -37,6 +37,7 @@ import { waitAndUpdate } from '../../../../helpers/testUtils';
 import { ComponentQualifier } from '../../../../types/component';
 import { MetricKey } from '../../../../types/metrics';
 import { GraphType } from '../../../../types/project-activity';
+import { Measure, Metric } from '../../../../types/types';
 import BranchOverview, { BRANCH_OVERVIEW_ACTIVITY_GRAPH, NO_CI_DETECTED } from '../BranchOverview';
 import BranchOverviewRenderer from '../BranchOverviewRenderer';
 
@@ -49,8 +50,8 @@ jest.mock('../../../../api/measures', () => {
   const { mockMeasure, mockMetric } = jest.requireActual('../../../../helpers/testMocks');
   return {
     getMeasuresWithPeriodAndMetrics: jest.fn((_, metricKeys: string[]) => {
-      const metrics: T.Metric[] = [];
-      const measures: T.Measure[] = [];
+      const metrics: Metric[] = [];
+      const measures: Measure[] = [];
       metricKeys.forEach(key => {
         if (key === 'unknown_metric') {
           return;
index 4a67a46209e765e12c169b8badca2af3f41abec4..10d651996e718cf1efa5c01cc26c92079b0d6690 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { AnalysisEvent } from '../../../../types/types';
 import { Event } from '../Event';
 
 it('should render an event correctly', () => {
@@ -34,7 +35,7 @@ it('should render a version correctly', () => {
 });
 
 it('should render rich quality gate event', () => {
-  const event: T.AnalysisEvent = {
+  const event: AnalysisEvent = {
     category: 'QUALITY_GATE',
     key: 'foo1234',
     name: '',
index efe108afacdb234ba5314440988a4596ff1fc1fd..4f6b86d484c5a389a310e76ffdd58da5eaf4580a 100644 (file)
@@ -22,6 +22,7 @@ import { shallow } from 'enzyme';
 import * as React from 'react';
 import { IntlShape } from 'react-intl';
 import { mockPeriod } from '../../../../helpers/testMocks';
+import { Period } from '../../../../types/types';
 import { ProjectLeakPeriodInfo } from '../ProjectLeakPeriodInfo';
 
 jest.mock('date-fns', () => {
@@ -61,7 +62,7 @@ it('should render a more precise date', () => {
   ).toMatchSnapshot();
 });
 
-function shallowRender(period: Partial<T.Period> = {}) {
+function shallowRender(period: Partial<Period> = {}) {
   return shallow(
     <ProjectLeakPeriodInfo
       intl={
index e16b7599eb38f943350d0a7fc33211dee95f36c5..d95d2cfff8c51ef01371e773f2f56f9314ef3d90 100644 (file)
@@ -26,16 +26,17 @@ import { isPullRequest } from '../../../helpers/branch-like';
 import { ProjectAlmBindingResponse } from '../../../types/alm-settings';
 import { BranchLike } from '../../../types/branch-like';
 import { isPortfolioLike } from '../../../types/component';
+import { AppState, Component } from '../../../types/types';
 import BranchOverview from '../branches/BranchOverview';
 
 const EmptyOverview = lazyLoadComponent(() => import('./EmptyOverview'));
 const PullRequestOverview = lazyLoadComponent(() => import('../pullRequests/PullRequestOverview'));
 
 interface Props {
-  appState: Pick<T.AppState, 'branchesEnabled'>;
+  appState: Pick<AppState, 'branchesEnabled'>;
   branchLike?: BranchLike;
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   isInProgress?: boolean;
   isPending?: boolean;
   projectBinding?: ProjectAlmBindingResponse;
index 0008d78886f6ed5216516394e390b72528b71729..ac6038393d8079aff4e47741f0f731900de9831e 100644 (file)
@@ -29,12 +29,13 @@ import { getCurrentUser, Store } from '../../../store/rootReducer';
 import { ProjectAlmBindingResponse } from '../../../types/alm-settings';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
+import { Component, CurrentUser } from '../../../types/types';
 
 export interface EmptyOverviewProps {
   branchLike?: BranchLike;
   branchLikes: BranchLike[];
-  component: T.Component;
-  currentUser: T.CurrentUser;
+  component: Component;
+  currentUser: CurrentUser;
   hasAnalyses?: boolean;
   projectBinding?: ProjectAlmBindingResponse;
 }
index 8a9db10118be9469721bb0a5559393257fa9b7ee..b0a2068eaa9d16c9a36bc7f1f1c1eae636f99c00 100644 (file)
@@ -27,13 +27,14 @@ import { findMeasure, formatMeasure, localizeMetric } from '../../../helpers/mea
 import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl } from '../../../helpers/urls';
 import { BranchLike } from '../../../types/branch-like';
 import { IssueType } from '../../../types/issues';
+import { Component, MeasureEnhanced } from '../../../types/types';
 import { getIssueIconClass, getIssueMetricKey } from '../utils';
 
 export interface IssueLabelProps {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   helpTooltip?: string;
-  measures: T.MeasureEnhanced[];
+  measures: MeasureEnhanced[];
   type: IssueType;
   useDiffMetric?: boolean;
 }
index ec85ad822eeb4f9a67805f822831ed4bfeea37df..d3238fcbaf81cdbce2f3ffee433c0afbad99d919 100644 (file)
@@ -25,12 +25,13 @@ import Rating from '../../../components/ui/Rating';
 import { findMeasure } from '../../../helpers/measures';
 import { BranchLike } from '../../../types/branch-like';
 import { IssueType } from '../../../types/issues';
+import { Component, MeasureEnhanced } from '../../../types/types';
 import { getIssueRatingMetricKey, getIssueRatingName } from '../utils';
 
 export interface IssueRatingProps {
   branchLike?: BranchLike;
-  component: T.Component;
-  measures: T.MeasureEnhanced[];
+  component: Component;
+  measures: MeasureEnhanced[];
   type: IssueType;
   useDiffMetric?: boolean;
 }
index c07984784aa3b29f27f1b405efbe0850b3901466..57759228ef1f98f615107ed8825c50d4f46ebf57 100644 (file)
@@ -26,12 +26,13 @@ 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 { Dict, Period } from '../../../types/types';
 
 interface Props {
-  period: T.Period;
+  period: Period;
 }
 
-const MODE_INCLUDES_TIME: T.Dict<boolean> = {
+const MODE_INCLUDES_TIME: Dict<boolean> = {
   manual_baseline: true,
   SPECIFIC_ANALYSIS: true
 };
index 5e968b8b8939f86cc3755b468b7fa0f31ce7ac49..3ac5219934a91dbbf8d15ff83c948e23d6ce9759 100644 (file)
@@ -24,6 +24,7 @@ import DrilldownLink from '../../../components/shared/DrilldownLink';
 import { translate } from '../../../helpers/l10n';
 import { findMeasure, formatMeasure } from '../../../helpers/measures';
 import { BranchLike } from '../../../types/branch-like';
+import { Component, MeasureEnhanced } from '../../../types/types';
 import {
   getMeasurementIconClass,
   getMeasurementLabelKeys,
@@ -35,8 +36,8 @@ import {
 interface Props {
   branchLike?: BranchLike;
   centered?: boolean;
-  component: T.Component;
-  measures: T.MeasureEnhanced[];
+  component: Component;
+  measures: MeasureEnhanced[];
   type: MeasurementType;
   useDiffMetric?: boolean;
 }
index a3a191f3ac40fbf83e3625304d2aa1cfdbf778d7..cecbbdac1f9929d6269acd2d9698e18535100bee 100644 (file)
@@ -35,16 +35,17 @@ import { BranchLike } from '../../../types/branch-like';
 import { IssueType } from '../../../types/issues';
 import { MetricKey } from '../../../types/metrics';
 import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates';
+import { Component, Dict } from '../../../types/types';
 
 interface Props {
   branchLike?: BranchLike;
-  component: Pick<T.Component, 'key'>;
+  component: Pick<Component, 'key'>;
   condition: QualityGateStatusConditionEnhanced;
 }
 
 export default class QualityGateCondition extends React.PureComponent<Props> {
-  getIssuesUrl = (sinceLeakPeriod: boolean, customQuery: T.Dict<string>) => {
-    const query: T.Dict<string | undefined> = {
+  getIssuesUrl = (sinceLeakPeriod: boolean, customQuery: Dict<string>) => {
+    const query: Dict<string | undefined> = {
       resolved: 'false',
       ...getBranchLikeQuery(this.props.branchLike),
       ...customQuery
@@ -56,7 +57,7 @@ export default class QualityGateCondition extends React.PureComponent<Props> {
   };
 
   getUrlForSecurityHotspot(sinceLeakPeriod: boolean) {
-    const query: T.Dict<string | undefined> = {
+    const query: Dict<string | undefined> = {
       ...getBranchLikeQuery(this.props.branchLike)
     };
     if (sinceLeakPeriod) {
@@ -96,7 +97,7 @@ export default class QualityGateCondition extends React.PureComponent<Props> {
 
     const metricKey = condition.measure.metric.key;
 
-    const METRICS_TO_URL_MAPPING: T.Dict<() => Location> = {
+    const METRICS_TO_URL_MAPPING: Dict<() => Location> = {
       [MetricKey.reliability_rating]: () =>
         this.getUrlForBugsOrVulnerabilities(IssueType.Bug, false),
       [MetricKey.new_reliability_rating]: () =>
index 77e6323bb875b0a344c9a6cbd2fb8b0b38e8ddcf..5cd2452c8631022edc73a3816c1b612c028a6a58 100644 (file)
@@ -24,13 +24,14 @@ import ChevronDownIcon from '../../../components/icons/ChevronDownIcon';
 import { translateWithParameters } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
 import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates';
+import { Component } from '../../../types/types';
 import QualityGateCondition from './QualityGateCondition';
 
 const LEVEL_ORDER = ['ERROR', 'WARN'];
 
 export interface QualityGateConditionsProps {
   branchLike?: BranchLike;
-  component: Pick<T.Component, 'key'>;
+  component: Pick<Component, 'key'>;
   collapsible?: boolean;
   failedConditions: QualityGateStatusConditionEnhanced[];
 }
index 32a6ce2a6278d6a1e91471b890a06fcf18465d87..7796778e69084b75e11369fdeac5ea6bf71932de 100644 (file)
@@ -24,9 +24,10 @@ import SonarLintIcon from '../../../components/icons/SonarLintIcon';
 import { translate } from '../../../helpers/l10n';
 import { MetricKey } from '../../../types/metrics';
 import { QualityGateStatusCondition } from '../../../types/quality-gates';
+import { CurrentUser } from '../../../types/types';
 
 export interface SonarLintPromotionProps {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   qgConditions?: QualityGateStatusCondition[];
 }
 
index 76929c951e99ac1de1a0d72d089705816b1a8e0f..44a2e8eac02e0ad31330d82e16e20661a1156bc4 100644 (file)
@@ -21,6 +21,7 @@ import { differenceInDays } from 'date-fns';
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { IntlShape } from 'react-intl';
+import { Period } from '../../../../types/types';
 import { LeakPeriodLegend } from '../LeakPeriodLegend';
 
 jest.mock('date-fns', () => {
@@ -60,7 +61,7 @@ it('should render a more precise date', () => {
   ).toMatchSnapshot();
 });
 
-function getWrapper(period: Partial<T.Period> = {}) {
+function getWrapper(period: Partial<Period> = {}) {
   return shallow(
     <LeakPeriodLegend
       intl={
index 333f4947b1e9abd81f0b9ed2245f0fa8ce24e2ff..437a04995322053fa90837fe0ce0e40ad5a452b8 100644 (file)
@@ -21,11 +21,12 @@ import classNames from 'classnames';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { findMeasure, formatMeasure } from '../../../helpers/measures';
+import { MeasureEnhanced } from '../../../types/types';
 import { getMeasurementAfterMergeMetricKey, MeasurementType } from '../utils';
 
 export interface AfterMergeEstimateProps {
   className?: string;
-  measures: T.MeasureEnhanced[];
+  measures: MeasureEnhanced[];
   type: MeasurementType;
 }
 
index 307c163b89394ec2d4a622fbfc4075d2a7b29980..e9cc50fa1b145afbb361541977a976ae66f2e668 100644 (file)
@@ -26,10 +26,11 @@ import HelpTooltip from '../../../components/controls/HelpTooltip';
 import HelpIcon from '../../../components/icons/HelpIcon';
 import { translate } from '../../../helpers/l10n';
 import { getQualityGatesUrl, getQualityGateUrl } from '../../../helpers/urls';
+import { Component, Status } from '../../../types/types';
 
 interface Props {
-  component: T.Component;
-  level?: T.Status;
+  component: Component;
+  level?: Status;
 }
 
 export function LargeQualityGateBadge({ component, level }: Props) {
index d6a0cdcb7efbc9bf5fbb1dad11f0a1c55e1322c4..270f52aea34999abb26162e8a34ab30acd257828 100644 (file)
@@ -33,6 +33,7 @@ import { getBranchStatusByBranchLike, Store } from '../../../store/rootReducer';
 import { BranchLike, PullRequest } from '../../../types/branch-like';
 import { IssueType } from '../../../types/issues';
 import { QualityGateStatusCondition } from '../../../types/quality-gates';
+import { Component, MeasureEnhanced, Status } from '../../../types/types';
 import IssueLabel from '../components/IssueLabel';
 import IssueRating from '../components/IssueRating';
 import MeasurementLabel from '../components/MeasurementLabel';
@@ -46,7 +47,7 @@ import LargeQualityGateBadge from './LargeQualityGateBadge';
 interface StateProps {
   conditions?: QualityGateStatusCondition[];
   ignoredConditions?: boolean;
-  status?: T.Status;
+  status?: Status;
 }
 
 interface DispatchProps {
@@ -55,14 +56,14 @@ interface DispatchProps {
 
 interface OwnProps {
   branchLike: PullRequest;
-  component: T.Component;
+  component: Component;
 }
 
 type Props = StateProps & DispatchProps & OwnProps;
 
 interface State {
   loading: boolean;
-  measures: T.MeasureEnhanced[];
+  measures: MeasureEnhanced[];
 }
 
 export class PullRequestOverview extends React.PureComponent<Props, State> {
index 4a2c0629eb5440b8fcb5d4851839b629a9c5380a..c6ed95e59932d1c6068471903e2398aa3a9ce50f 100644 (file)
@@ -28,13 +28,14 @@ import ActionsDropdown, { ActionsDropdownItem } from '../../../components/contro
 import { Router, withRouter } from '../../../components/hoc/withRouter';
 import QualifierIcon from '../../../components/icons/QualifierIcon';
 import { translate } from '../../../helpers/l10n';
+import { PermissionTemplate } from '../../../types/types';
 import { PERMISSION_TEMPLATES_PATH } from '../utils';
 import DeleteForm from './DeleteForm';
 import Form from './Form';
 
 interface Props {
   fromDetails?: boolean;
-  permissionTemplate: T.PermissionTemplate;
+  permissionTemplate: PermissionTemplate;
   refresh: () => void;
   router: Pick<Router, 'replace'>;
   topQualifiers: string[];
index 1502c6210642723e3d685da5f89ec47e40bffa0a..bd212fcf492eb1c7fe44795731c1b8467defc1d7 100644 (file)
@@ -25,6 +25,7 @@ import { getPermissionTemplates } from '../../../api/permissions';
 import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
 import { translate } from '../../../helpers/l10n';
 import { getAppState, Store } from '../../../store/rootReducer';
+import { Permission, PermissionTemplate } from '../../../types/types';
 import '../../permissions/styles.css';
 import { mergeDefaultsToTemplates, mergePermissionsToTemplates, sortPermissions } from '../utils';
 import Home from './Home';
@@ -37,8 +38,8 @@ interface Props {
 
 interface State {
   ready: boolean;
-  permissions: T.Permission[];
-  permissionTemplates: T.PermissionTemplate[];
+  permissions: Permission[];
+  permissionTemplates: PermissionTemplate[];
 }
 
 export class App extends React.PureComponent<Props, State> {
index 6989f2ac20d7bd514ec42e3660e52fb940c965af..4281bf6640be583635b8f0c37ddb5a85eebff666 100644 (file)
 import { sortBy } from 'lodash';
 import * as React from 'react';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { PermissionTemplate } from '../../../types/types';
 
 interface Props {
-  template: T.PermissionTemplate;
+  template: PermissionTemplate;
 }
 
 export default function Defaults({ template }: Props) {
index e7ccb5188684ff77d6c3bd690ee15e5bc4b3e33f..f4bd8ef09678fc2e4150fdc5513cfb6cf0bac253 100644 (file)
@@ -22,11 +22,12 @@ import { ResetButtonLink, SubmitButton } from '../../../components/controls/butt
 import SimpleModal from '../../../components/controls/SimpleModal';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { PermissionTemplate } from '../../../types/types';
 
 interface Props {
   onClose: () => void;
   onSubmit: () => Promise<void>;
-  permissionTemplate: T.PermissionTemplate;
+  permissionTemplate: PermissionTemplate;
 }
 
 export default function DeleteForm({ onClose, onSubmit, permissionTemplate: t }: Props) {
index 398a06773bb876d0ca58af499c2d65498bc2767d..a5bbfd3d39eb4ff610e34bd656d8f046d516464a 100644 (file)
 import * as React from 'react';
 import { Helmet } from 'react-helmet-async';
 import { translate } from '../../../helpers/l10n';
+import { Permission, PermissionTemplate } from '../../../types/types';
 import Header from './Header';
 import List from './List';
 
 interface Props {
-  permissionTemplates: T.PermissionTemplate[];
-  permissions: T.Permission[];
+  permissionTemplates: PermissionTemplate[];
+  permissions: Permission[];
   ready: boolean;
   refresh: () => Promise<void>;
   topQualifiers: string[];
index 526d8802e81b0b7361095bbbb48b7b627b39b66e..b208770810f0558d2b4c1a145b25f1db24066452 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Permission, PermissionTemplate } from '../../../types/types';
 import ListHeader from './ListHeader';
 import ListItem from './ListItem';
 
 interface Props {
-  permissionTemplates: T.PermissionTemplate[];
-  permissions: T.Permission[];
+  permissionTemplates: PermissionTemplate[];
+  permissions: Permission[];
   refresh: () => Promise<void>;
   topQualifiers: string[];
 }
index 3ce076cdb3e405345aeab26d6f09b97949fd7994..e633c1a23e9d5f17495cec997b3ed50a90868db3 100644 (file)
@@ -22,13 +22,14 @@ import InstanceMessage from '../../../components/common/InstanceMessage';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { Alert } from '../../../components/ui/Alert';
 import { translate } from '../../../helpers/l10n';
+import { Permission } from '../../../types/types';
 
 interface Props {
-  permissions: T.Permission[];
+  permissions: Permission[];
 }
 
 export default class ListHeader extends React.PureComponent<Props> {
-  renderTooltip(permission: T.Permission) {
+  renderTooltip(permission: Permission) {
     return permission.key === 'user' || permission.key === 'codeviewer' ? (
       <div>
         <InstanceMessage message={translate('projects_role', permission.key, 'desc')} />
index 7c4383463fa6a2c2c42102556f0b4ba3f0d363a3..a88771782a1409a29fb3ab4611967ea911a6cbb7 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { PermissionTemplate } from '../../../types/types';
 import ActionsCell from './ActionsCell';
 import NameCell from './NameCell';
 import PermissionCell from './PermissionCell';
 
 interface Props {
   refresh: () => Promise<void>;
-  template: T.PermissionTemplate;
+  template: PermissionTemplate;
   topQualifiers: string[];
 }
 
index d1c527702552bb316a4410c5e5fdb1806a4485c3..1da9847cc473c414db3ee01e5c116ff5d46c74cf 100644 (file)
  */
 import * as React from 'react';
 import { Link } from 'react-router';
+import { PermissionTemplate } from '../../../types/types';
 import { PERMISSION_TEMPLATES_PATH } from '../utils';
 import Defaults from './Defaults';
 
 interface Props {
-  template: T.PermissionTemplate;
+  template: PermissionTemplate;
 }
 
 export default function NameCell({ template }: Props) {
index a865e5083776747bf80b5424b40524d4afec5701..0545051858466c28f9d77515c78d1fec3e94efdf 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { Helmet } from 'react-helmet-async';
 import * as api from '../../../api/permissions';
 import { translate } from '../../../helpers/l10n';
+import { PermissionGroup, PermissionTemplate, PermissionUser } from '../../../types/types';
 import HoldersList from '../../permissions/shared/components/HoldersList';
 import SearchForm from '../../permissions/shared/components/SearchForm';
 import {
@@ -32,17 +33,17 @@ import TemplateHeader from './TemplateHeader';
 
 interface Props {
   refresh: () => void;
-  template: T.PermissionTemplate;
+  template: PermissionTemplate;
   topQualifiers: string[];
 }
 
 interface State {
   filter: string;
-  groups: T.PermissionGroup[];
+  groups: PermissionGroup[];
   loading: boolean;
   query: string;
   selectedPermission?: string;
-  users: T.PermissionUser[];
+  users: PermissionUser[];
 }
 
 export default class Template extends React.PureComponent<Props, State> {
@@ -95,7 +96,7 @@ export default class Template extends React.PureComponent<Props, State> {
     });
   };
 
-  handleToggleUser = (user: T.PermissionUser, permission: string) => {
+  handleToggleUser = (user: PermissionUser, permission: string) => {
     if (user.login === '<creator>') {
       return this.handleToggleProjectCreator(user, permission);
     }
@@ -113,7 +114,7 @@ export default class Template extends React.PureComponent<Props, State> {
     return request.then(() => this.requestHolders()).then(this.props.refresh);
   };
 
-  handleToggleProjectCreator = (user: T.PermissionUser, permission: string) => {
+  handleToggleProjectCreator = (user: PermissionUser, permission: string) => {
     const { template } = this.props;
     const hasPermission = user.permissions.includes(permission);
     const request = hasPermission
@@ -122,7 +123,7 @@ export default class Template extends React.PureComponent<Props, State> {
     return request.then(() => this.requestHolders()).then(this.props.refresh);
   };
 
-  handleToggleGroup = (group: T.PermissionGroup, permission: string) => {
+  handleToggleGroup = (group: PermissionGroup, permission: string) => {
     const { template } = this.props;
     const hasPermission = group.permissions.includes(permission);
     const data = {
index 564c118fd24a6c962bbb40c2d7dca44c81f62c74..478cc307dd16d68eed01a8c958c540c426551754 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { PermissionTemplate } from '../../../types/types';
 import Defaults from './Defaults';
 
 interface Props {
-  template: T.PermissionTemplate;
+  template: PermissionTemplate;
 }
 
 export default function TemplateDetails({ template }: Props) {
index c0cb3b92d3db0529ca5da2cfa01b05c52ea9aa8d..446d07f9644bc2bacb58035cb2f597c8f0730d01 100644 (file)
 import * as React from 'react';
 import { Link } from 'react-router';
 import { translate } from '../../../helpers/l10n';
+import { PermissionTemplate } from '../../../types/types';
 import { PERMISSION_TEMPLATES_PATH } from '../utils';
 import ActionsCell from './ActionsCell';
 
 interface Props {
   loading: boolean;
   refresh: () => void;
-  template: T.PermissionTemplate;
+  template: PermissionTemplate;
   topQualifiers: string[];
 }
 
index 988f38e143c978f226c2ee100e32f845345d67a9..4e5ac54953447868d4a147fc44231241b81edd96 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { PermissionTemplate } from '../../../../types/types';
 import Defaults from '../Defaults';
 
-const SAMPLE: T.PermissionTemplate = {
+const SAMPLE: PermissionTemplate = {
   createdAt: '2018-01-01',
   defaultFor: [],
   id: 'id',
index 159470adc439ccd97bf58e06ba0d869bd73208c4..0225794fa86305dc0a934e0a7f5e2b294e652227 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { sortBy } from 'lodash';
+import { Permission, PermissionTemplate } from '../../types/types';
 
 export const PERMISSIONS_ORDER = [
   'user',
@@ -30,14 +31,14 @@ export const PERMISSIONS_ORDER = [
 
 export const PERMISSION_TEMPLATES_PATH = '/permission_templates';
 
-export function sortPermissions(permissions: T.Permission[]) {
+export function sortPermissions(permissions: Permission[]) {
   return sortBy(permissions, p => PERMISSIONS_ORDER.indexOf(p.key));
 }
 
 export function mergePermissionsToTemplates(
-  permissionTemplates: T.PermissionTemplate[],
-  basePermissions: T.Permission[]
-): T.PermissionTemplate[] {
+  permissionTemplates: PermissionTemplate[],
+  basePermissions: Permission[]
+): PermissionTemplate[] {
   return permissionTemplates.map(permissionTemplate => {
     // it's important to keep the order of the permission template's permissions
     // the same as the order of base permissions
@@ -53,9 +54,9 @@ export function mergePermissionsToTemplates(
 }
 
 export function mergeDefaultsToTemplates(
-  permissionTemplates: T.PermissionTemplate[],
+  permissionTemplates: PermissionTemplate[],
   defaultTemplates: Array<{ templateId: string; qualifier: string }> = []
-): T.PermissionTemplate[] {
+): PermissionTemplate[] {
   return permissionTemplates.map(permissionTemplate => {
     const defaultFor: string[] = [];
 
index fa35299f732fcd0d834103331ec8cf8132b207c1..68a985e89e0c1fea74a2a3bf3b3678ed6e402e0f 100644 (file)
@@ -22,6 +22,7 @@ import { connect } from 'react-redux';
 import ListFooter from '../../../../components/controls/ListFooter';
 import { getAppState, Store } from '../../../../store/rootReducer';
 import { ComponentQualifier } from '../../../../types/component';
+import { AppState, Paging, PermissionGroup, PermissionUser } from '../../../../types/types';
 import HoldersList from '../../shared/components/HoldersList';
 import SearchForm from '../../shared/components/SearchForm';
 import {
@@ -31,15 +32,15 @@ import {
 } from '../../utils';
 
 interface StateProps {
-  appState: Pick<T.AppState, 'qualifiers'>;
+  appState: Pick<AppState, 'qualifiers'>;
 }
 
 interface OwnProps {
   filter: string;
   grantPermissionToGroup: (groupName: string, permission: string) => Promise<void>;
   grantPermissionToUser: (login: string, permission: string) => Promise<void>;
-  groups: T.PermissionGroup[];
-  groupsPaging?: T.Paging;
+  groups: PermissionGroup[];
+  groupsPaging?: Paging;
   loadHolders: () => void;
   loading?: boolean;
   onLoadMore: () => void;
@@ -48,14 +49,14 @@ interface OwnProps {
   query: string;
   revokePermissionFromGroup: (groupName: string, permission: string) => Promise<void>;
   revokePermissionFromUser: (login: string, permission: string) => Promise<void>;
-  users: T.PermissionUser[];
-  usersPaging?: T.Paging;
+  users: PermissionUser[];
+  usersPaging?: Paging;
 }
 
 type Props = StateProps & OwnProps;
 
 export class AllHoldersList extends React.PureComponent<Props> {
-  handleToggleUser = (user: T.PermissionUser, permission: string) => {
+  handleToggleUser = (user: PermissionUser, permission: string) => {
     const hasPermission = user.permissions.includes(permission);
     if (hasPermission) {
       return this.props.revokePermissionFromUser(user.login, permission);
@@ -64,7 +65,7 @@ export class AllHoldersList extends React.PureComponent<Props> {
     }
   };
 
-  handleToggleGroup = (group: T.PermissionGroup, permission: string) => {
+  handleToggleGroup = (group: PermissionGroup, permission: string) => {
     const hasPermission = group.permissions.includes(permission);
 
     if (hasPermission) {
index d500c870b983414ff3a46aed12e5a8025d420a2e..e51350c35833523fc70b4c8a92ec7253c95f7106 100644 (file)
@@ -23,18 +23,19 @@ import { Helmet } from 'react-helmet-async';
 import * as api from '../../../../api/permissions';
 import Suggestions from '../../../../app/components/embed-docs-modal/Suggestions';
 import { translate } from '../../../../helpers/l10n';
+import { Paging, PermissionGroup, PermissionUser } from '../../../../types/types';
 import '../../styles.css';
 import AllHoldersList from './AllHoldersList';
 import PageHeader from './PageHeader';
 
 interface State {
   filter: 'all' | 'groups' | 'users';
-  groups: T.PermissionGroup[];
-  groupsPaging?: T.Paging;
+  groups: PermissionGroup[];
+  groupsPaging?: Paging;
   loading: boolean;
   query: string;
-  users: T.PermissionUser[];
-  usersPaging?: T.Paging;
+  users: PermissionUser[];
+  usersPaging?: Paging;
 }
 
 export default class App extends React.PureComponent<{}, State> {
@@ -63,7 +64,7 @@ export default class App extends React.PureComponent<{}, State> {
   loadUsersAndGroups = (userPage?: number, groupsPage?: number) => {
     const { filter, query } = this.state;
 
-    const getUsers: Promise<{ paging?: T.Paging; users: T.PermissionUser[] }> =
+    const getUsers: Promise<{ paging?: Paging; users: PermissionUser[] }> =
       filter !== 'groups'
         ? api.getGlobalPermissionsUsers({
             q: query || undefined,
@@ -71,7 +72,7 @@ export default class App extends React.PureComponent<{}, State> {
           })
         : Promise.resolve({ paging: undefined, users: [] });
 
-    const getGroups: Promise<{ paging?: T.Paging; groups: T.PermissionGroup[] }> =
+    const getGroups: Promise<{ paging?: Paging; groups: PermissionGroup[] }> =
       filter !== 'users'
         ? api.getGlobalPermissionsGroups({
             q: query || undefined,
@@ -124,7 +125,7 @@ export default class App extends React.PureComponent<{}, State> {
     this.setState({ query }, this.loadHolders);
   };
 
-  addPermissionToGroup = (groups: T.PermissionGroup[], group: string, permission: string) => {
+  addPermissionToGroup = (groups: PermissionGroup[], group: string, permission: string) => {
     return groups.map(candidate =>
       candidate.name === group
         ? { ...candidate, permissions: [...candidate.permissions, permission] }
@@ -132,7 +133,7 @@ export default class App extends React.PureComponent<{}, State> {
     );
   };
 
-  addPermissionToUser = (users: T.PermissionUser[], user: string, permission: string) => {
+  addPermissionToUser = (users: PermissionUser[], user: string, permission: string) => {
     return users.map(candidate =>
       candidate.login === user
         ? { ...candidate, permissions: [...candidate.permissions, permission] }
@@ -140,7 +141,7 @@ export default class App extends React.PureComponent<{}, State> {
     );
   };
 
-  removePermissionFromGroup = (groups: T.PermissionGroup[], group: string, permission: string) => {
+  removePermissionFromGroup = (groups: PermissionGroup[], group: string, permission: string) => {
     return groups.map(candidate =>
       candidate.name === group
         ? { ...candidate, permissions: without(candidate.permissions, permission) }
@@ -148,7 +149,7 @@ export default class App extends React.PureComponent<{}, State> {
     );
   };
 
-  removePermissionFromUser = (users: T.PermissionUser[], user: string, permission: string) => {
+  removePermissionFromUser = (users: PermissionUser[], user: string, permission: string) => {
     return users.map(candidate =>
       candidate.login === user
         ? { ...candidate, permissions: without(candidate.permissions, permission) }
index f082f4702be6d9db2c20fe28cc11572a7dfb3b5a..744b9945156902472b5397857ca219b937623ddd 100644 (file)
 import { without } from 'lodash';
 import * as React from 'react';
 import ListFooter from '../../../../components/controls/ListFooter';
+import {
+  Component,
+  Paging,
+  PermissionGroup,
+  PermissionUser,
+  Visibility
+} from '../../../../types/types';
 import HoldersList from '../../shared/components/HoldersList';
 import SearchForm from '../../shared/components/SearchForm';
 import { convertToPermissionDefinitions, PERMISSIONS_ORDER_BY_QUALIFIER } from '../../utils';
 
 interface Props {
-  component: T.Component;
+  component: Component;
   filter: string;
   grantPermissionToGroup: (group: string, permission: string) => Promise<void>;
   grantPermissionToUser: (user: string, permission: string) => Promise<void>;
-  groups: T.PermissionGroup[];
-  groupsPaging?: T.Paging;
+  groups: PermissionGroup[];
+  groupsPaging?: Paging;
   onLoadMore: () => void;
   onFilterChange: (filter: string) => void;
   onPermissionSelect: (permissions?: string) => void;
@@ -39,13 +46,13 @@ interface Props {
   revokePermissionFromGroup: (group: string, permission: string) => Promise<void>;
   revokePermissionFromUser: (user: string, permission: string) => Promise<void>;
   selectedPermission?: string;
-  users: T.PermissionUser[];
-  usersPaging?: T.Paging;
-  visibility?: T.Visibility;
+  users: PermissionUser[];
+  usersPaging?: Paging;
+  visibility?: Visibility;
 }
 
 export default class AllHoldersList extends React.PureComponent<Props> {
-  handleToggleUser = (user: T.PermissionUser, permission: string) => {
+  handleToggleUser = (user: PermissionUser, permission: string) => {
     const hasPermission = user.permissions.includes(permission);
 
     if (hasPermission) {
@@ -55,7 +62,7 @@ export default class AllHoldersList extends React.PureComponent<Props> {
     }
   };
 
-  handleToggleGroup = (group: T.PermissionGroup, permission: string) => {
+  handleToggleGroup = (group: PermissionGroup, permission: string) => {
     const hasPermission = group.permissions.includes(permission);
 
     if (hasPermission) {
index 9b3fa2b5df47596f02a27b1204d48ed51501be0a..5a318e7dbb8944d780990cb123398b1a746804ac 100644 (file)
@@ -23,26 +23,27 @@ import { Helmet } from 'react-helmet-async';
 import * as api from '../../../../api/permissions';
 import VisibilitySelector from '../../../../components/common/VisibilitySelector';
 import { translate } from '../../../../helpers/l10n';
+import { Component, Paging, PermissionGroup, PermissionUser } from '../../../../types/types';
 import '../../styles.css';
 import AllHoldersList from './AllHoldersList';
 import PageHeader from './PageHeader';
 import PublicProjectDisclaimer from './PublicProjectDisclaimer';
 
 interface Props {
-  component: T.Component;
-  onComponentChange: (changes: Partial<T.Component>) => void;
+  component: Component;
+  onComponentChange: (changes: Partial<Component>) => void;
 }
 
 interface State {
   disclaimer: boolean;
   filter: string;
-  groups: T.PermissionGroup[];
-  groupsPaging?: T.Paging;
+  groups: PermissionGroup[];
+  groupsPaging?: Paging;
   loading: boolean;
   query: string;
   selectedPermission?: string;
-  users: T.PermissionUser[];
-  usersPaging?: T.Paging;
+  users: PermissionUser[];
+  usersPaging?: Paging;
 }
 
 export default class App extends React.PureComponent<Props, State> {
@@ -79,7 +80,7 @@ export default class App extends React.PureComponent<Props, State> {
     const { component } = this.props;
     const { filter, query, selectedPermission } = this.state;
 
-    const getUsers: Promise<{ paging?: T.Paging; users: T.PermissionUser[] }> =
+    const getUsers: Promise<{ paging?: Paging; users: PermissionUser[] }> =
       filter !== 'groups'
         ? api.getPermissionsUsersForComponent({
             projectKey: component.key,
@@ -89,7 +90,7 @@ export default class App extends React.PureComponent<Props, State> {
           })
         : Promise.resolve({ paging: undefined, users: [] });
 
-    const getGroups: Promise<{ paging?: T.Paging; groups: T.PermissionGroup[] }> =
+    const getGroups: Promise<{ paging?: Paging; groups: PermissionGroup[] }> =
       filter !== 'users'
         ? api.getPermissionsGroupsForComponent({
             projectKey: component.key,
index 15df2627efde65c243ee57cc3dfaa67836cc89dd..fb40ec73f7ee04517f906f7042bae2cb69313285 100644 (file)
@@ -27,6 +27,7 @@ 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 { PermissionTemplate } from '../../../../types/types';
 
 interface Props {
   onApply?: () => void;
@@ -38,7 +39,7 @@ interface State {
   done: boolean;
   loading: boolean;
   permissionTemplate?: string;
-  permissionTemplates?: T.PermissionTemplate[];
+  permissionTemplates?: PermissionTemplate[];
 }
 
 export default class ApplyTemplate extends React.PureComponent<Props, State> {
index 242eebafe26149e6d3a0caaef0e5b3f8514e0130..1adc92fb2fcd0a1fc7853e129f415d7551c4c60d 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import { Button } from '../../../../components/controls/buttons';
 import { translate } from '../../../../helpers/l10n';
 import { isApplication, isPortfolioLike } from '../../../../types/component';
+import { Component } from '../../../../types/types';
 import ApplyTemplate from './ApplyTemplate';
 
 interface Props {
-  component: T.Component;
+  component: Component;
   loadHolders: () => void;
   loading: boolean;
 }
index 98c527002476da5f6fbf04bba29b17a3f519d220..8a93bf269eabe1bef7b92aa686324f4f8c862b94 100644 (file)
 import { without } from 'lodash';
 import * as React from 'react';
 import GroupIcon from '../../../../components/icons/GroupIcon';
+import { PermissionDefinitions, PermissionGroup } from '../../../../types/types';
 import { isPermissionDefinitionGroup } from '../../utils';
 import PermissionCell from './PermissionCell';
 
 interface Props {
-  group: T.PermissionGroup;
-  onToggle: (group: T.PermissionGroup, permission: string) => Promise<void>;
-  permissions: T.PermissionDefinitions;
+  group: PermissionGroup;
+  onToggle: (group: PermissionGroup, permission: string) => Promise<void>;
+  permissions: PermissionDefinitions;
   selectedPermission?: string;
 }
 
index bcce4e0b0b72e2224e4e37b79d89147e6ca0b7a8..b4ce6650e9a9f1ddde3d78b9d5e2c48da2d28343 100644 (file)
 import { partition, sortBy } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../../helpers/l10n';
+import {
+  Dict,
+  PermissionDefinitions,
+  PermissionGroup,
+  PermissionUser
+} from '../../../../types/types';
 import { isPermissionDefinitionGroup } from '../../utils';
 import GroupHolder from './GroupHolder';
 import PermissionHeader from './PermissionHeader';
@@ -27,20 +33,20 @@ import UserHolder from './UserHolder';
 
 interface Props {
   filter?: string;
-  groups: T.PermissionGroup[];
+  groups: PermissionGroup[];
   loading?: boolean;
   onSelectPermission?: (permission: string) => void;
-  onToggleGroup: (group: T.PermissionGroup, permission: string) => Promise<void>;
-  onToggleUser: (user: T.PermissionUser, permission: string) => Promise<void>;
-  permissions: T.PermissionDefinitions;
+  onToggleGroup: (group: PermissionGroup, permission: string) => Promise<void>;
+  onToggleUser: (user: PermissionUser, permission: string) => Promise<void>;
+  permissions: PermissionDefinitions;
   query?: string;
   selectedPermission?: string;
   showPublicProjectsWarning?: boolean;
-  users: T.PermissionUser[];
+  users: PermissionUser[];
 }
 
 interface State {
-  initialPermissionsCount: T.Dict<number>;
+  initialPermissionsCount: Dict<number>;
 }
 export default class HoldersList extends React.PureComponent<Props, State> {
   state: State = { initialPermissionsCount: {} };
@@ -50,11 +56,11 @@ export default class HoldersList extends React.PureComponent<Props, State> {
     }
   }
 
-  isPermissionUser(item: T.PermissionGroup | T.PermissionUser): item is T.PermissionUser {
-    return (item as T.PermissionUser).login !== undefined;
+  isPermissionUser(item: PermissionGroup | PermissionUser): item is PermissionUser {
+    return (item as PermissionUser).login !== undefined;
   }
 
-  handleGroupToggle = (group: T.PermissionGroup, permission: string) => {
+  handleGroupToggle = (group: PermissionGroup, permission: string) => {
     const key = group.id || group.name;
     if (this.state.initialPermissionsCount[key] === undefined) {
       this.setState(state => ({
@@ -67,7 +73,7 @@ export default class HoldersList extends React.PureComponent<Props, State> {
     return this.props.onToggleGroup(group, permission);
   };
 
-  handleUserToggle = (user: T.PermissionUser, permission: string) => {
+  handleUserToggle = (user: PermissionUser, permission: string) => {
     if (this.state.initialPermissionsCount[user.login] === undefined) {
       this.setState(state => ({
         initialPermissionsCount: {
@@ -79,7 +85,7 @@ export default class HoldersList extends React.PureComponent<Props, State> {
     return this.props.onToggleUser(user, permission);
   };
 
-  getItemInitialPermissionsCount = (item: T.PermissionGroup | T.PermissionUser) => {
+  getItemInitialPermissionsCount = (item: PermissionGroup | PermissionUser) => {
     const key = this.isPermissionUser(item) ? item.login : item.id || item.name;
     return this.state.initialPermissionsCount[key] !== undefined
       ? this.state.initialPermissionsCount[key]
@@ -95,7 +101,7 @@ export default class HoldersList extends React.PureComponent<Props, State> {
     );
   }
 
-  renderItem(item: T.PermissionUser | T.PermissionGroup, permissions: T.PermissionDefinitions) {
+  renderItem(item: PermissionUser | PermissionGroup, permissions: PermissionDefinitions) {
     return this.isPermissionUser(item) ? (
       <UserHolder
         key={`user-${item.login}`}
index 66d667f147b2a2002b67a12245aecd4dfc8fb2a2..2a240cfa0c8413f5105e27d528aee3be5356bcb6 100644 (file)
 import classNames from 'classnames';
 import * as React from 'react';
 import Checkbox from '../../../../components/controls/Checkbox';
+import {
+  PermissionDefinition,
+  PermissionDefinitionGroup,
+  PermissionGroup,
+  PermissionUser
+} from '../../../../types/types';
 import { isPermissionDefinitionGroup } from '../../utils';
 
 interface Props {
   loading: string[];
   onCheck: (checked: boolean, permission?: string) => void;
-  permission: T.PermissionDefinition | T.PermissionDefinitionGroup;
-  permissionItem: T.PermissionGroup | T.PermissionUser;
+  permission: PermissionDefinition | PermissionDefinitionGroup;
+  permissionItem: PermissionGroup | PermissionUser;
   selectedPermission?: string;
 }
 
index e0012f41af1ce1a880ef4b707679cf6078079b9f..ed44cf2d870d337c368c67ac835f268e3db8b7b1 100644 (file)
@@ -24,11 +24,12 @@ 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 { PermissionDefinition, PermissionDefinitionGroup } from '../../../../types/types';
 import { isPermissionDefinitionGroup } from '../../utils';
 
 interface Props {
   onSelectPermission?: (permission: string) => void;
-  permission: T.PermissionDefinition | T.PermissionDefinitionGroup;
+  permission: PermissionDefinition | PermissionDefinitionGroup;
   selectedPermission?: string;
   showPublicProjectsWarning?: boolean;
 }
index 8f767da002fefbff55cbbd735a06ce6c8f18086d..6345c4af12c8bfd858547f326af1f411d8b36195 100644 (file)
@@ -21,14 +21,15 @@ import { without } from 'lodash';
 import * as React from 'react';
 import Avatar from '../../../../components/ui/Avatar';
 import { translate } from '../../../../helpers/l10n';
+import { PermissionDefinitions, PermissionUser } from '../../../../types/types';
 import { isPermissionDefinitionGroup } from '../../utils';
 import PermissionCell from './PermissionCell';
 
 interface Props {
-  onToggle: (user: T.PermissionUser, permission: string) => Promise<void>;
-  permissions: T.PermissionDefinitions;
+  onToggle: (user: PermissionUser, permission: string) => Promise<void>;
+  permissions: PermissionDefinitions;
   selectedPermission?: string;
-  user: T.PermissionUser;
+  user: PermissionUser;
 }
 
 interface State {
index 1fd5ab17dd4db81f22da3732c97b698cbd9110b4..ba61c427d986a6226353243fc370da7e51563c3b 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { hasMessage, translate } from '../../helpers/l10n';
 import { isSonarCloud } from '../../helpers/system';
+import { Dict, PermissionDefinition, PermissionDefinitionGroup } from '../../types/types';
 
 export const PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE = [
   'user',
@@ -40,7 +41,7 @@ export const PERMISSIONS_ORDER_FOR_VIEW = ['user', 'admin'];
 
 export const PERMISSIONS_ORDER_FOR_DEV = ['user', 'admin'];
 
-export const PERMISSIONS_ORDER_BY_QUALIFIER: T.Dict<string[]> = {
+export const PERMISSIONS_ORDER_BY_QUALIFIER: Dict<string[]> = {
   TRK: PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE,
   VW: PERMISSIONS_ORDER_FOR_VIEW,
   SVW: PERMISSIONS_ORDER_FOR_VIEW,
@@ -91,7 +92,7 @@ export function filterPermissions(
 export function convertToPermissionDefinitions(
   permissions: Array<string | { category: string; permissions: string[] }>,
   l10nPrefix: string
-): Array<T.PermissionDefinition | T.PermissionDefinitionGroup> {
+): Array<PermissionDefinition | PermissionDefinitionGroup> {
   return permissions.map(permission => {
     if (typeof permission === 'object') {
       return {
@@ -106,7 +107,7 @@ export function convertToPermissionDefinitions(
 }
 
 export function isPermissionDefinitionGroup(
-  permission?: T.PermissionDefinition | T.PermissionDefinitionGroup
-): permission is T.PermissionDefinitionGroup {
-  return Boolean(permission && (permission as T.PermissionDefinitionGroup).category);
+  permission?: PermissionDefinition | PermissionDefinitionGroup
+): permission is PermissionDefinitionGroup {
+  return Boolean(permission && (permission as PermissionDefinitionGroup).category);
 }
index d2d9545775325c1588f44f96d0d826fd56dd6555..eba87d060f0dbc4eea6756514466458a66fe4018 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import { AnalysisEvent } from '../../types/types';
 import { State } from './components/ProjectActivityAppContainer';
 
-export function addCustomEvent(analysis: string, event: T.AnalysisEvent) {
+export function addCustomEvent(analysis: string, event: AnalysisEvent) {
   return (state: State) => ({
     analyses: state.analyses.map(item => {
       if (item.key !== analysis) {
@@ -41,7 +42,7 @@ export function deleteEvent(analysis: string, event: string) {
   });
 }
 
-export function changeEvent(analysis: string, event: T.AnalysisEvent) {
+export function changeEvent(analysis: string, event: AnalysisEvent) {
   return (state: State) => ({
     analyses: state.analyses.map(item => {
       if (item.key !== analysis) {
index 32b6759c9cb5c77db24763a5d13c0b52845e1c43..71384fdb2d98f1adc85b4314438729c8fba2e16f 100644 (file)
@@ -28,11 +28,12 @@ import { translate } from '../../../helpers/l10n';
 import { limitComponentName } from '../../../helpers/path';
 import { getProjectUrl } from '../../../helpers/urls';
 import { BranchLike } from '../../../types/branch-like';
+import { AnalysisEvent } from '../../../types/types';
 
-export type DefinitionChangeEvent = T.AnalysisEvent &
-  Required<Pick<T.AnalysisEvent, 'definitionChange'>>;
+export type DefinitionChangeEvent = AnalysisEvent &
+  Required<Pick<AnalysisEvent, 'definitionChange'>>;
 
-export function isDefinitionChangeEvent(event: T.AnalysisEvent): event is DefinitionChangeEvent {
+export function isDefinitionChangeEvent(event: AnalysisEvent): event is DefinitionChangeEvent {
   return event.category === 'DEFINITION_CHANGE' && event.definitionChange !== undefined;
 }
 
index a90c8bd379cccdfa26f301fbb21310bd6389ef89..658e9d9cf451d0a10c79109cdfe54412d501b444 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import { DeleteButton, EditButton } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
+import { AnalysisEvent } from '../../../types/types';
 import EventInner from './EventInner';
 import ChangeEventForm from './forms/ChangeEventForm';
 import RemoveEventForm from './forms/RemoveEventForm';
@@ -27,7 +28,7 @@ import RemoveEventForm from './forms/RemoveEventForm';
 export interface EventProps {
   analysisKey: string;
   canAdmin?: boolean;
-  event: T.AnalysisEvent;
+  event: AnalysisEvent;
   isFirst?: boolean;
   onChange?: (event: string, name: string) => Promise<void>;
   onDelete?: (analysisKey: string, event: string) => Promise<void>;
index 1180aa9d6c3a34333af4d08bbf9b3eadd04d574f..6502ec138b0a909bfa15b3b30d2bcb921634a252 100644 (file)
@@ -21,11 +21,12 @@ import * as React from 'react';
 import { ComponentContext } from '../../../app/components/ComponentContext';
 import Tooltip from '../../../components/controls/Tooltip';
 import { translate } from '../../../helpers/l10n';
+import { AnalysisEvent } from '../../../types/types';
 import { DefinitionChangeEventInner, isDefinitionChangeEvent } from './DefinitionChangeEventInner';
 import { isRichQualityGateEvent, RichQualityGateEventInner } from './RichQualityGateEventInner';
 
 export interface EventInnerProps {
-  event: T.AnalysisEvent;
+  event: AnalysisEvent;
   readonly?: boolean;
 }
 
index 5839141e24b56956be519e539db8a34f08b2d047..37968a03603fae1577f4dd57de0be744fa0f769e 100644 (file)
  */
 import { sortBy } from 'lodash';
 import * as React from 'react';
+import { AnalysisEvent } from '../../../types/types';
 import Event from './Event';
 
 export interface EventsProps {
   analysisKey: string;
   canAdmin?: boolean;
-  events: T.AnalysisEvent[];
+  events: AnalysisEvent[];
   isFirst?: boolean;
   onChange?: (event: string, name: string) => Promise<void>;
   onDelete?: (analysis: string, event: string) => Promise<void>;
index 7354797aef624d385b3da2fd3e82c3cef3cde5b4..e82919c15d084e61df316a380dbc62e73a7b3b7b 100644 (file)
@@ -26,13 +26,14 @@ import DateFormatter from '../../../components/intl/DateFormatter';
 import { toShortNotSoISOString } from '../../../helpers/dates';
 import { translate } from '../../../helpers/l10n';
 import { ComponentQualifier } from '../../../types/component';
+import { ParsedAnalysis } from '../../../types/types';
 import { activityQueryChanged, getAnalysesByVersionByDay, Query } from '../utils';
 import ProjectActivityAnalysis from './ProjectActivityAnalysis';
 
 interface Props {
   addCustomEvent: (analysis: string, name: string, category?: string) => Promise<void>;
   addVersion: (analysis: string, version: string) => Promise<void>;
-  analyses: T.ParsedAnalysis[];
+  analyses: ParsedAnalysis[];
   analysesLoading: boolean;
   canAdmin?: boolean;
   canDeleteAnalyses?: boolean;
@@ -127,11 +128,11 @@ export default class ProjectActivityAnalysesList extends React.PureComponent<Pro
     this.props.updateQuery({ selectedDate: date });
   };
 
-  shouldRenderBaselineMarker(analysis: T.ParsedAnalysis): boolean {
+  shouldRenderBaselineMarker(analysis: ParsedAnalysis): boolean {
     return Boolean(this.props.leakPeriodDate && isEqual(this.props.leakPeriodDate, analysis.date));
   }
 
-  renderAnalysis(analysis: T.ParsedAnalysis) {
+  renderAnalysis(analysis: ParsedAnalysis) {
     const firstAnalysisKey = this.props.analyses[0].key;
 
     const selectedDate = this.props.query.selectedDate
index 9c8b6df8e114ad3e1ce9d9c54f8169cb76f8c4c2..5d6a5f36c9d400cd375197d80bc8e34cb0860c43 100644 (file)
@@ -30,6 +30,7 @@ import { PopupPlacement } from '../../../components/ui/popups';
 import { parseDate } from '../../../helpers/dates';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { scrollToElement } from '../../../helpers/scrolling';
+import { ParsedAnalysis } from '../../../types/types';
 import Events from './Events';
 import AddEventForm from './forms/AddEventForm';
 import RemoveAnalysisForm from './forms/RemoveAnalysisForm';
@@ -37,7 +38,7 @@ import RemoveAnalysisForm from './forms/RemoveAnalysisForm';
 export interface ProjectActivityAnalysisProps {
   addCustomEvent: (analysis: string, name: string, category?: string) => Promise<void>;
   addVersion: (analysis: string, version: string) => Promise<void>;
-  analysis: T.ParsedAnalysis;
+  analysis: ParsedAnalysis;
   canAdmin?: boolean;
   canDeleteAnalyses?: boolean;
   canCreateVersion: boolean;
index b119bcbd6c6c26ccac852e4fb438822a90cc31cd..5d7695f87bbf8a0bef91d4b86fe7286b1b6a8ac2 100644 (file)
@@ -24,6 +24,7 @@ import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
 import { parseDate } from '../../../helpers/dates';
 import { translate } from '../../../helpers/l10n';
 import { MeasureHistory } from '../../../types/project-activity';
+import { Component, Metric, ParsedAnalysis } from '../../../types/types';
 import { Query } from '../utils';
 import './projectActivity.css';
 import ProjectActivityAnalysesList from './ProjectActivityAnalysesList';
@@ -33,15 +34,15 @@ import ProjectActivityPageHeader from './ProjectActivityPageHeader';
 interface Props {
   addCustomEvent: (analysis: string, name: string, category?: string) => Promise<void>;
   addVersion: (analysis: string, version: string) => Promise<void>;
-  analyses: T.ParsedAnalysis[];
+  analyses: ParsedAnalysis[];
   analysesLoading: boolean;
   changeEvent: (event: string, name: string) => Promise<void>;
   deleteAnalysis: (analysis: string) => Promise<void>;
   deleteEvent: (analysis: string, event: string) => Promise<void>;
   graphLoading: boolean;
   initializing: boolean;
-  project: Pick<T.Component, 'configuration' | 'key' | 'leakPeriodDate' | 'qualifier'>;
-  metrics: T.Metric[];
+  project: Pick<Component, 'configuration' | 'key' | 'leakPeriodDate' | 'qualifier'>;
+  metrics: Metric[];
   measuresHistory: MeasureHistory[];
   query: Query;
   updateQuery: (changes: Partial<Query>) => void;
index ce321125b04ea6f38faf573fa4b5a7d5a1f5cba4..7f033af879c8abd6a4c09e8a66367f9702971831 100644 (file)
@@ -34,6 +34,7 @@ import { parseDate } from '../../../helpers/dates';
 import { BranchLike } from '../../../types/branch-like';
 import { MetricKey } from '../../../types/metrics';
 import { GraphType, MeasureHistory } from '../../../types/project-activity';
+import { Component, Metric, Paging, ParsedAnalysis, RawQuery } from '../../../types/types';
 import * as actions from '../actions';
 import {
   customMetricsChanged,
@@ -46,17 +47,17 @@ import ProjectActivityApp from './ProjectActivityApp';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   location: Location;
   router: Pick<InjectedRouter, 'push' | 'replace'>;
 }
 
 export interface State {
-  analyses: T.ParsedAnalysis[];
+  analyses: ParsedAnalysis[];
   analysesLoading: boolean;
   graphLoading: boolean;
   initialized: boolean;
-  metrics: T.Metric[];
+  metrics: Metric[];
   measuresHistory: MeasureHistory[];
   query: Query;
 }
@@ -160,7 +161,7 @@ export default class ProjectActivityAppContainer extends React.PureComponent<Pro
     });
   };
 
-  fetchActivity = (project: string, p: number, ps: number, additional?: T.RawQuery) => {
+  fetchActivity = (project: string, p: number, ps: number, additional?: RawQuery) => {
     const parameters = { project, p, ps, ...getBranchLikeQuery(this.props.branchLike) };
     return api
       .getProjectActivity({ ...additional, ...parameters })
@@ -168,7 +169,7 @@ export default class ProjectActivityAppContainer extends React.PureComponent<Pro
         analyses: analyses.map(analysis => ({
           ...analysis,
           date: parseDate(analysis.date)
-        })) as T.ParsedAnalysis[],
+        })) as ParsedAnalysis[],
         paging
       }));
   };
@@ -213,8 +214,8 @@ export default class ProjectActivityAppContainer extends React.PureComponent<Pro
 
   loadAllActivities = (
     project: string,
-    prevResult?: { analyses: T.ParsedAnalysis[]; paging: T.Paging }
-  ): Promise<{ analyses: T.ParsedAnalysis[]; paging: T.Paging }> => {
+    prevResult?: { analyses: ParsedAnalysis[]; paging: Paging }
+  ): Promise<{ analyses: ParsedAnalysis[]; paging: Paging }> => {
     if (
       prevResult &&
       prevResult.paging.pageIndex * prevResult.paging.pageSize >= prevResult.paging.total
@@ -233,7 +234,7 @@ export default class ProjectActivityAppContainer extends React.PureComponent<Pro
     });
   };
 
-  getTopLevelComponent = (component: T.Component) => {
+  getTopLevelComponent = (component: Component) => {
     let current = component.breadcrumbs.length - 1;
     while (
       current > 0 &&
@@ -244,13 +245,13 @@ export default class ProjectActivityAppContainer extends React.PureComponent<Pro
     return component.breadcrumbs[current].key;
   };
 
-  filterMetrics({ qualifier }: T.Component, metrics: T.Metric[]) {
+  filterMetrics({ qualifier }: Component, metrics: Metric[]) {
     return ['VW', 'SVW'].includes(qualifier)
       ? metrics.filter(metric => metric.key !== MetricKey.security_hotspots_reviewed)
       : metrics.filter(metric => metric.key !== MetricKey.security_review_rating);
   }
 
-  firstLoadData(query: Query, component: T.Component) {
+  firstLoadData(query: Query, component: Component) {
     const graphMetrics = getHistoryMetrics(query.graph || DEFAULT_GRAPH, query.customMetrics);
     const topLevelComponent = this.getTopLevelComponent(component);
     Promise.all([
index aec1139cf01c41ae8135f376030fbd0d0865e911..7aeb04fe0a90cf5a6b88ad33562a3a554f762ff9 100644 (file)
@@ -32,15 +32,16 @@ import {
   splitSeriesInGraphs
 } from '../../../components/activity-graph/utils';
 import { GraphType, MeasureHistory, Point, Serie } from '../../../types/project-activity';
+import { Metric, ParsedAnalysis } from '../../../types/types';
 import { datesQueryChanged, historyQueryChanged, Query } from '../utils';
 import { PROJECT_ACTIVITY_GRAPH } from './ProjectActivityAppContainer';
 
 interface Props {
-  analyses: T.ParsedAnalysis[];
+  analyses: ParsedAnalysis[];
   leakPeriodDate?: Date;
   loading: boolean;
   measuresHistory: MeasureHistory[];
-  metrics: T.Metric[];
+  metrics: Metric[];
   project: string;
   query: Query;
   updateQuery: (changes: Partial<Query>) => void;
index 0bccf88b7192877b60edebc7574b33fa77da4b57..85bbdc6e657599d8a079eadf22c865804b08ccc8 100644 (file)
  */
 import * as React from 'react';
 import ListFooter from '../../../components/controls/ListFooter';
+import { Paging } from '../../../types/types';
 
 interface Props {
   analyses: unknown[];
   fetchMoreActivity: () => void;
-  paging?: T.Paging;
+  paging?: Paging;
 }
 
 export default function ProjectActivityPageFooter({ analyses, fetchMoreActivity, paging }: Props) {
index fe17c39eb297679f04df24b45bbb055722e00094..1cc93b7e0f7f15e72b6d52e439099af950818585 100644 (file)
@@ -21,6 +21,7 @@ import classNames from 'classnames';
 import * as React from 'react';
 import SelectLegacy from '../../../components/controls/SelectLegacy';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 import { APPLICATION_EVENT_TYPES, EVENT_TYPES, Query } from '../utils';
 import ProjectActivityDateInput from './ProjectActivityDateInput';
 import ProjectActivityEventSelectOption from './ProjectActivityEventSelectOption';
@@ -28,7 +29,7 @@ import ProjectActivityEventSelectOption from './ProjectActivityEventSelectOption
 interface Props {
   category?: string;
   from?: Date;
-  project: Pick<T.Component, 'qualifier'>;
+  project: Pick<Component, 'qualifier'>;
   to?: Date;
   updateQuery: (changes: Partial<Query>) => void;
 }
index 253dfc700f11675e4670f5d710c13796914f48cb..1991885adce6f73b664310e528cba2ae9b055b4e 100644 (file)
@@ -25,10 +25,11 @@ import DropdownIcon from '../../../components/icons/DropdownIcon';
 import Level from '../../../components/ui/Level';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { getProjectUrl } from '../../../helpers/urls';
+import { AnalysisEvent } from '../../../types/types';
 
-export type RichQualityGateEvent = T.AnalysisEvent & Required<Pick<T.AnalysisEvent, 'qualityGate'>>;
+export type RichQualityGateEvent = AnalysisEvent & Required<Pick<AnalysisEvent, 'qualityGate'>>;
 
-export function isRichQualityGateEvent(event: T.AnalysisEvent): event is RichQualityGateEvent {
+export function isRichQualityGateEvent(event: AnalysisEvent): event is RichQualityGateEvent {
   return event.category === 'QUALITY_GATE' && event.qualityGate !== undefined;
 }
 
index 715b9c53e487790d66f872142b53a1f05856ca6c..0d33785909e6b37070fed652cfa8392cabc294bb 100644 (file)
 import * as React from 'react';
 import ConfirmModal from '../../../../components/controls/ConfirmModal';
 import { translate } from '../../../../helpers/l10n';
+import { ParsedAnalysis } from '../../../../types/types';
 
 interface Props {
   addEvent: (analysis: string, name: string, category?: string) => Promise<void>;
   addEventButtonText: string;
-  analysis: T.ParsedAnalysis;
+  analysis: ParsedAnalysis;
   onClose: () => void;
 }
 
index e21cb74372d14ec26be3040c1dd1ec243995b7d4..adfcca6e0193b1d2007ebb93bcea83e744563e62 100644 (file)
 import * as React from 'react';
 import ConfirmModal from '../../../../components/controls/ConfirmModal';
 import { translate } from '../../../../helpers/l10n';
+import { AnalysisEvent } from '../../../../types/types';
 
 interface Props {
   changeEvent: (event: string, name: string) => Promise<void>;
-  event: T.AnalysisEvent;
+  event: AnalysisEvent;
   header: string;
   onClose: () => void;
 }
index ddb2a25ba8b84bb317c21b300c290e4865fe844a..4cbfa8ec1574a23f05b792abb153f0649f44ea02 100644 (file)
 import * as React from 'react';
 import ConfirmModal from '../../../../components/controls/ConfirmModal';
 import { translate } from '../../../../helpers/l10n';
+import { ParsedAnalysis } from '../../../../types/types';
 
 interface Props {
-  analysis: T.ParsedAnalysis;
+  analysis: ParsedAnalysis;
   deleteAnalysis: (analysis: string) => Promise<void>;
   onClose: () => void;
 }
index 3934f697e271b04e089a5c2617301fd1a245bfcf..69ede5e897de044dbfb7b2c7a220d10b3f37bc08 100644 (file)
 import * as React from 'react';
 import ConfirmModal from '../../../../components/controls/ConfirmModal';
 import { translate } from '../../../../helpers/l10n';
+import { AnalysisEvent } from '../../../../types/types';
 
 export interface RemoveEventFormProps {
   analysisKey: string;
-  event: T.AnalysisEvent;
+  event: AnalysisEvent;
   header: string;
   removeEventQuestion: string;
   onClose: () => void;
index 86dae218145a12f0ee16961b9a0df043d97f6ea5..e8fceb3327e4d6f878dc6913e6f5a5813dcaab38 100644 (file)
@@ -31,6 +31,7 @@ import {
   serializeStringArray
 } from '../../helpers/query';
 import { GraphType } from '../../types/project-activity';
+import { Dict, ParsedAnalysis, RawQuery } from '../../types/types';
 
 export interface Query {
   category: string;
@@ -66,13 +67,13 @@ export function selectedDateQueryChanged(prevQuery: Query, nextQuery: Query) {
 }
 
 interface AnalysesByDay {
-  byDay: T.Dict<T.ParsedAnalysis[]>;
+  byDay: Dict<ParsedAnalysis[]>;
   version: string | null;
   key: string | null;
 }
 
 export function getAnalysesByVersionByDay(
-  analyses: T.ParsedAnalysis[],
+  analyses: ParsedAnalysis[],
   query: Pick<Query, 'category' | 'from' | 'to'>
 ) {
   return analyses.reduce<AnalysesByDay[]>((acc, analysis) => {
@@ -115,7 +116,7 @@ export function getAnalysesByVersionByDay(
   }, []);
 }
 
-export function parseQuery(urlQuery: T.RawQuery): Query {
+export function parseQuery(urlQuery: RawQuery): Query {
   return {
     category: parseAsString(urlQuery['category']),
     customMetrics: parseAsArray(urlQuery['custom_metrics'], parseAsString),
@@ -127,7 +128,7 @@ export function parseQuery(urlQuery: T.RawQuery): Query {
   };
 }
 
-export function serializeQuery(query: Query): T.RawQuery {
+export function serializeQuery(query: Query): RawQuery {
   return cleanQuery({
     category: serializeString(query.category),
     from: serializeDate(query.from),
@@ -136,7 +137,7 @@ export function serializeQuery(query: Query): T.RawQuery {
   });
 }
 
-export function serializeUrlQuery(query: Query): T.RawQuery {
+export function serializeUrlQuery(query: Query): RawQuery {
   return cleanQuery({
     category: serializeString(query.category),
     custom_metrics: serializeStringArray(query.customMetrics),
index 3a751aecc1f375ed705f4e72e8f80dbb4218eaf4..4f957e4b68615ecf7e2ea3707267f2a791a90c03 100644 (file)
@@ -27,6 +27,12 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { isBranch, sortBranches } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import { Branch, BranchLike } from '../../../types/branch-like';
+import {
+  Component,
+  NewCodePeriod,
+  NewCodePeriodSettingType,
+  ParsedAnalysis
+} from '../../../types/types';
 import '../styles.css';
 import { getSettingValue } from '../utils';
 import AppHeader from './AppHeader';
@@ -38,27 +44,27 @@ interface Props {
   branchLikes: BranchLike[];
   branchesEnabled?: boolean;
   canAdmin?: boolean;
-  component: T.Component;
+  component: Component;
 }
 
 interface State {
   analysis?: string;
   branchList: Branch[];
-  currentSetting?: T.NewCodePeriodSettingType;
+  currentSetting?: NewCodePeriodSettingType;
   currentSettingValue?: string;
   days: string;
-  generalSetting?: T.NewCodePeriod;
+  generalSetting?: NewCodePeriod;
   loading: boolean;
   overrideGeneralSetting?: boolean;
   referenceBranch?: string;
   saving: boolean;
-  selected?: T.NewCodePeriodSettingType;
+  selected?: NewCodePeriodSettingType;
   success?: boolean;
 }
 
 const DEFAULT_NUMBER_OF_DAYS = '30';
 
-const DEFAULT_GENERAL_SETTING: { type: T.NewCodePeriodSettingType } = {
+const DEFAULT_GENERAL_SETTING: { type: NewCodePeriodSettingType } = {
   type: 'PREVIOUS_VERSION'
 };
 
@@ -91,9 +97,9 @@ export default class App extends React.PureComponent<Props, State> {
   }
 
   getUpdatedState(params: {
-    currentSetting?: T.NewCodePeriodSettingType;
+    currentSetting?: NewCodePeriodSettingType;
     currentSettingValue?: string;
-    generalSetting: T.NewCodePeriod;
+    generalSetting: NewCodePeriod;
   }) {
     const { currentSetting, currentSettingValue, generalSetting } = params;
     const { referenceBranch } = this.state;
@@ -173,7 +179,7 @@ export default class App extends React.PureComponent<Props, State> {
     );
   };
 
-  handleSelectAnalysis = (analysis: T.ParsedAnalysis) => this.setState({ analysis: analysis.key });
+  handleSelectAnalysis = (analysis: ParsedAnalysis) => this.setState({ analysis: analysis.key });
 
   handleSelectDays = (days: string) => this.setState({ days });
 
@@ -187,7 +193,7 @@ export default class App extends React.PureComponent<Props, State> {
         this.getUpdatedState({ generalSetting, currentSetting, currentSettingValue })
     );
 
-  handleSelectSetting = (selected?: T.NewCodePeriodSettingType) => this.setState({ selected });
+  handleSelectSetting = (selected?: NewCodePeriodSettingType) => this.setState({ selected });
 
   handleToggleSpecificSetting = (overrideGeneralSetting: boolean) =>
     this.setState({ overrideGeneralSetting });
index 0dd4a639f45d10308b7417f5203ce75a2a237cee..cba5518a9f4980ac6190a4c5377902fdb66877fc 100644 (file)
 import * as React from 'react';
 import RadioCard from '../../../components/controls/RadioCard';
 import { translate } from '../../../helpers/l10n';
+import { NewCodePeriodSettingType } from '../../../types/types';
 
 export interface Props {
   disabled?: boolean;
-  onSelect: (selection: T.NewCodePeriodSettingType) => void;
+  onSelect: (selection: NewCodePeriodSettingType) => void;
   selected: boolean;
 }
 
index a0f88c0fc16aa09b36b3b16d26bb5c401a95116b..d555d6338e80154819eaebde9dcdafb64f7fe456 100644 (file)
@@ -22,6 +22,7 @@ import RadioCard from '../../../components/controls/RadioCard';
 import ValidationInput from '../../../components/controls/ValidationInput';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../../helpers/l10n';
+import { NewCodePeriodSettingType } from '../../../types/types';
 
 export interface Props {
   className?: string;
@@ -30,7 +31,7 @@ export interface Props {
   isChanged: boolean;
   isValid: boolean;
   onChangeDays: (value: string) => void;
-  onSelect: (selection: T.NewCodePeriodSettingType) => void;
+  onSelect: (selection: NewCodePeriodSettingType) => void;
   selected: boolean;
 }
 
index 9a24385d5ee4f904544650e03e1233f6af11bcf7..2b1ee54ad8d131ddaa61a81d173b8604799d71a5 100644 (file)
 import * as React from 'react';
 import RadioCard from '../../../components/controls/RadioCard';
 import { translate } from '../../../helpers/l10n';
+import { NewCodePeriodSettingType } from '../../../types/types';
 
 export interface Props {
   disabled?: boolean;
   isDefault?: boolean;
-  onSelect: (selection: T.NewCodePeriodSettingType) => void;
+  onSelect: (selection: NewCodePeriodSettingType) => void;
   selected: boolean;
 }
 
index 9e932cd49966b66501c3f3dbba35692ab52f59c5..e31c3caf12d22df0d3ed3c0442b5b3f9cb3e19d7 100644 (file)
@@ -25,6 +25,7 @@ import AlertErrorIcon from '../../../components/icons/AlertErrorIcon';
 import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { NewCodePeriodSettingType } from '../../../types/types';
 
 export interface BaselineSettingReferenceBranchProps {
   branchList: BranchOption[];
@@ -32,7 +33,7 @@ export interface BaselineSettingReferenceBranchProps {
   configuredBranchName?: string;
   disabled?: boolean;
   onChangeReferenceBranch: (value: string) => void;
-  onSelect: (selection: T.NewCodePeriodSettingType) => void;
+  onSelect: (selection: NewCodePeriodSettingType) => void;
   referenceBranch: string;
   selected: boolean;
   settingLevel: 'project' | 'branch';
index dcf12cd846b6d919d463dc1ffc2500c2b080a744..8ae05b89402275ce390d6625c1d72540d92271db 100644 (file)
@@ -23,17 +23,18 @@ import * as React from 'react';
 import { getProjectActivity } from '../../../api/projectActivity';
 import { parseDate, toShortNotSoISOString } from '../../../helpers/dates';
 import { scrollToElement } from '../../../helpers/scrolling';
+import { Analysis, Dict, ParsedAnalysis } from '../../../types/types';
 import BranchAnalysisListRenderer from './BranchAnalysisListRenderer';
 
 interface Props {
   analysis: string;
   branch: string;
   component: string;
-  onSelectAnalysis: (analysis: T.ParsedAnalysis) => void;
+  onSelectAnalysis: (analysis: ParsedAnalysis) => void;
 }
 
 interface State {
-  analyses: T.ParsedAnalysis[];
+  analyses: ParsedAnalysis[];
   loading: boolean;
   range: number;
   scroll: number;
@@ -43,7 +44,7 @@ const STICKY_BADGE_SCROLL_OFFSET = 10;
 
 export default class BranchAnalysisList extends React.PureComponent<Props, State> {
   mounted = false;
-  badges: T.Dict<HTMLDivElement> = {};
+  badges: Dict<HTMLDivElement> = {};
   scrollableNode?: HTMLDivElement;
   state: State = {
     analyses: [],
@@ -82,7 +83,7 @@ export default class BranchAnalysisList extends React.PureComponent<Props, State
       branch,
       project: component,
       from: range ? toShortNotSoISOString(subDays(new Date(), range)) : undefined
-    }).then((result: { analyses: T.Analysis[] }) => {
+    }).then((result: { analyses: Analysis[] }) => {
       // If the selected analysis wasn't found in the default 30 days range, redo the search
       if (initial && analysis && !result.analyses.find(a => a.key === analysis)) {
         this.handleRangeChange({ value: 0 });
@@ -94,7 +95,7 @@ export default class BranchAnalysisList extends React.PureComponent<Props, State
           analyses: result.analyses.map(analysis => ({
             ...analysis,
             date: parseDate(analysis.date)
-          })) as T.ParsedAnalysis[],
+          })) as ParsedAnalysis[],
           loading: false
         },
         () => {
index 7ebb4cf9fc820e0594cb2a4da09d17a3dd5f27ed..c81b95fa6be91dee563883c95a0deb6db2be8be2 100644 (file)
@@ -27,15 +27,16 @@ import TimeFormatter from '../../../components/intl/TimeFormatter';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { parseDate, toShortNotSoISOString } from '../../../helpers/dates';
 import { translate } from '../../../helpers/l10n';
+import { ParsedAnalysis } from '../../../types/types';
 import Events from '../../projectActivity/components/Events';
 import { getAnalysesByVersionByDay } from '../../projectActivity/utils';
 
 export interface BranchAnalysisListRendererProps {
-  analyses: T.ParsedAnalysis[];
+  analyses: ParsedAnalysis[];
   handleRangeChange: ({ value }: { value: number }) => void;
   handleScroll: (e: React.SyntheticEvent<HTMLDivElement>) => void;
   loading: boolean;
-  onSelectAnalysis: (analysis: T.ParsedAnalysis) => void;
+  onSelectAnalysis: (analysis: ParsedAnalysis) => void;
   range: number;
   registerBadgeNode: (version: string) => (el: HTMLDivElement) => void;
   registerScrollableNode: (el: HTMLDivElement) => void;
@@ -44,9 +45,9 @@ export interface BranchAnalysisListRendererProps {
 }
 
 function renderAnalysis(args: {
-  analysis: T.ParsedAnalysis;
+  analysis: ParsedAnalysis;
   isFirst: boolean;
-  onSelectAnalysis: (analysis: T.ParsedAnalysis) => void;
+  onSelectAnalysis: (analysis: ParsedAnalysis) => void;
   selectedAnalysisKey: string;
 }) {
   const { analysis, isFirst, onSelectAnalysis, selectedAnalysisKey } = args;
index 2fb28321fe15433637a4ac9cf04db33925452883..37629eeb5c38bc41fdd18858bef0e82bb4735b80 100644 (file)
@@ -25,6 +25,7 @@ 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 { NewCodePeriod, NewCodePeriodSettingType, ParsedAnalysis } from '../../../types/types';
 import { getSettingValue, validateSetting } from '../utils';
 import BaselineSettingAnalysis from './BaselineSettingAnalysis';
 import BaselineSettingDays from './BaselineSettingDays';
@@ -36,7 +37,7 @@ interface Props {
   branch: BranchWithNewCodePeriod;
   branchList: Branch[];
   component: string;
-  onClose: (branch?: string, newSetting?: T.NewCodePeriod) => void;
+  onClose: (branch?: string, newSetting?: NewCodePeriod) => void;
 }
 
 interface State {
@@ -45,7 +46,7 @@ interface State {
   days: string;
   referenceBranch: string;
   saving: boolean;
-  selected?: T.NewCodePeriodSettingType;
+  selected?: NewCodePeriodSettingType;
 }
 
 export default class BranchBaselineSettingModal extends React.PureComponent<Props, State> {
@@ -74,7 +75,7 @@ export default class BranchBaselineSettingModal extends React.PureComponent<Prop
     this.mounted = false;
   }
 
-  getValueFromProps(type: T.NewCodePeriodSettingType) {
+  getValueFromProps(type: NewCodePeriodSettingType) {
     return this.props.branch.newCodePeriod && this.props.branch.newCodePeriod.type === type
       ? this.props.branch.newCodePeriod.value
       : null;
@@ -123,14 +124,14 @@ export default class BranchBaselineSettingModal extends React.PureComponent<Prop
 
   requestClose = () => this.props.onClose();
 
-  handleSelectAnalysis = (analysis: T.ParsedAnalysis) =>
+  handleSelectAnalysis = (analysis: ParsedAnalysis) =>
     this.setState({ analysis: analysis.key, analysisDate: analysis.date });
 
   handleSelectDays = (days: string) => this.setState({ days });
 
   handleSelectReferenceBranch = (referenceBranch: string) => this.setState({ referenceBranch });
 
-  handleSelectSetting = (selected: T.NewCodePeriodSettingType) => this.setState({ selected });
+  handleSelectSetting = (selected: NewCodePeriodSettingType) => this.setState({ selected });
 
   render() {
     const { branch, branchList } = this.props;
index f91052b65179f5c135b739587bc43300294d9d89..201152ddd3887ce94f0d22a1f90ba66f07001603 100644 (file)
@@ -23,13 +23,14 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { isBranch, sortBranches } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import { Branch, BranchLike, BranchWithNewCodePeriod } from '../../../types/branch-like';
+import { Component, NewCodePeriod } from '../../../types/types';
 import BranchBaselineSettingModal from './BranchBaselineSettingModal';
 import BranchListRow from './BranchListRow';
 
 interface Props {
   branchList: Branch[];
-  component: T.Component;
-  inheritedSetting: T.NewCodePeriod;
+  component: Component;
+  inheritedSetting: NewCodePeriod;
 }
 
 interface State {
@@ -88,7 +89,7 @@ export default class BranchList extends React.PureComponent<Props, State> {
     );
   }
 
-  updateBranchNewCodePeriod = (branch: string, newSetting: T.NewCodePeriod | undefined) => {
+  updateBranchNewCodePeriod = (branch: string, newSetting: NewCodePeriod | undefined) => {
     const { branches } = this.state;
 
     const updated = branches.find(b => b.name === branch);
@@ -102,7 +103,7 @@ export default class BranchList extends React.PureComponent<Props, State> {
     this.setState({ editedBranch: branch });
   };
 
-  closeEditModal = (branch?: string, newSetting?: T.NewCodePeriod) => {
+  closeEditModal = (branch?: string, newSetting?: NewCodePeriod) => {
     if (branch) {
       this.setState({
         branches: this.updateBranchNewCodePeriod(branch, newSetting),
index 0b45d2f1c483b0380be481540c43edaf7278c205..0cb9e14f733e08a0074ea2949c72705c41182863 100644 (file)
@@ -25,16 +25,17 @@ import WarningIcon from '../../../components/icons/WarningIcon';
 import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { BranchWithNewCodePeriod } from '../../../types/branch-like';
+import { NewCodePeriod } from '../../../types/types';
 
 export interface BranchListRowProps {
   branch: BranchWithNewCodePeriod;
   existingBranches: Array<string>;
-  inheritedSetting: T.NewCodePeriod;
+  inheritedSetting: NewCodePeriod;
   onOpenEditModal: (branch: BranchWithNewCodePeriod) => void;
   onResetToDefault: (branchName: string) => void;
 }
 
-function renderNewCodePeriodSetting(newCodePeriod: T.NewCodePeriod) {
+function renderNewCodePeriodSetting(newCodePeriod: NewCodePeriod) {
   switch (newCodePeriod.type) {
     case 'SPECIFIC_ANALYSIS':
       return (
@@ -60,7 +61,7 @@ function renderNewCodePeriodSetting(newCodePeriod: T.NewCodePeriod) {
 
 function branchInheritsItselfAsReference(
   branch: BranchWithNewCodePeriod,
-  inheritedSetting: T.NewCodePeriod
+  inheritedSetting: NewCodePeriod
 ) {
   return (
     !branch.newCodePeriod &&
index c001b46f4c1ccce2c8aaed7e5eec88cc3a4e85db..fdf84f077fa9655d51f9be1acef388d73f396003 100644 (file)
@@ -25,6 +25,7 @@ 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 { NewCodePeriod, NewCodePeriodSettingType, ParsedAnalysis } from '../../../types/types';
 import { validateSetting } from '../utils';
 import BaselineSettingAnalysis from './BaselineSettingAnalysis';
 import BaselineSettingDays from './BaselineSettingDays';
@@ -38,24 +39,24 @@ export interface ProjectBaselineSelectorProps {
   branchList: Branch[];
   branchesEnabled?: boolean;
   component: string;
-  currentSetting?: T.NewCodePeriodSettingType;
+  currentSetting?: NewCodePeriodSettingType;
   currentSettingValue?: string;
   days: string;
-  generalSetting: T.NewCodePeriod;
+  generalSetting: NewCodePeriod;
   onCancel: () => void;
-  onSelectAnalysis: (analysis: T.ParsedAnalysis) => void;
+  onSelectAnalysis: (analysis: ParsedAnalysis) => void;
   onSelectDays: (value: string) => void;
   onSelectReferenceBranch: (value: string) => void;
-  onSelectSetting: (value?: T.NewCodePeriodSettingType) => void;
+  onSelectSetting: (value?: NewCodePeriodSettingType) => void;
   onSubmit: (e: React.SyntheticEvent<HTMLFormElement>) => void;
   onToggleSpecificSetting: (selection: boolean) => void;
   referenceBranch?: string;
   saving: boolean;
-  selected?: T.NewCodePeriodSettingType;
+  selected?: NewCodePeriodSettingType;
   overrideGeneralSetting: boolean;
 }
 
-function renderGeneralSetting(generalSetting: T.NewCodePeriod) {
+function renderGeneralSetting(generalSetting: NewCodePeriod) {
   let setting: string;
   let description: string;
   if (generalSetting.type === 'NUMBER_OF_DAYS') {
index 3828c93cf5c4e4dfa8ebb5c0d44819899814594d..358d7dae26927d1522b92b166f1ed3de9eccd963 100644 (file)
@@ -1,3 +1,5 @@
+import { NewCodePeriodSettingType } from '../../types/types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -32,7 +34,7 @@ export function getSettingValue({
   analysis?: string;
   days?: string;
   referenceBranch?: string;
-  type?: T.NewCodePeriodSettingType;
+  type?: NewCodePeriodSettingType;
 }) {
   switch (type) {
     case 'NUMBER_OF_DAYS':
@@ -48,12 +50,12 @@ export function getSettingValue({
 
 export function validateSetting(state: {
   analysis?: string;
-  currentSetting?: T.NewCodePeriodSettingType;
+  currentSetting?: NewCodePeriodSettingType;
   currentSettingValue?: string;
   days: string;
   overrideGeneralSetting?: boolean;
   referenceBranch?: string;
-  selected?: T.NewCodePeriodSettingType;
+  selected?: NewCodePeriodSettingType;
 }) {
   const {
     analysis = '',
index 072a6c557eeb67c6272a85dd5b3adc0a6d90a49b..b714be8959335c2a4bb05ee9e0ba7d68c8531d20 100644 (file)
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 import BranchLikeTabs from './BranchLikeTabs';
 import LifetimeInformation from './LifetimeInformation';
 
 export interface AppProps {
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   onBranchesChange: () => void;
 }
 
index ba2402fc3807b0791a9e1241f9e9de23f5510f12..b0d958fb32f3d296156f7bdc88246d7e7dcdb661 100644 (file)
@@ -30,11 +30,12 @@ import {
 } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 import BranchPurgeSetting from './BranchPurgeSetting';
 
 export interface BranchLikeRowProps {
   branchLike: BranchLike;
-  component: T.Component;
+  component: Component;
   displayPurgeSetting?: boolean;
   onDelete: () => void;
   onRename: () => void;
index 746a7edec539c9fed0e8c48bed227324d54ce134..1eedf68433464d5ab9ae71b0111e4b98ea7edec9 100644 (file)
@@ -22,11 +22,12 @@ import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { getBranchLikeKey } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 import BranchLikeRow from './BranchLikeRow';
 
 export interface BranchLikeTableProps {
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   displayPurgeSetting?: boolean;
   onDelete: (branchLike: BranchLike) => void;
   onRename: (branchLike: BranchLike) => void;
index d4707949acb653ff01bb2769d43b501324e487e8..ee70a0185c563069ac327e9abe1696662d61ec64 100644 (file)
@@ -30,13 +30,14 @@ import {
 } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 import BranchLikeTable from './BranchLikeTable';
 import DeleteBranchModal from './DeleteBranchModal';
 import RenameBranchModal from './RenameBranchModal';
 
 interface Props {
   branchLikes: BranchLike[];
-  component: T.Component;
+  component: Component;
   onBranchesChange: () => void;
 }
 
index ea204c09cd586edf8cc8e3d187c595946bda6822..63d510fe7b01dbf4e60fa92779eea08e15054458 100644 (file)
@@ -25,10 +25,11 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { isMainBranch } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import { Branch } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 
 interface Props {
   branch: Branch;
-  component: T.Component;
+  component: Component;
 }
 
 interface State {
index 79180d0edce21bdcd9346626f54898735e1d6add..403befd3e7f28564e1774e1850dc07ea07b0c349 100644 (file)
@@ -24,10 +24,11 @@ import Modal from '../../../components/controls/Modal';
 import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branch-like';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 
 interface Props {
   branchLike: BranchLike;
-  component: T.Component;
+  component: Component;
   onClose: () => void;
   onDelete: () => void;
 }
index 5b0403f627ff9caf7bf49b42cb1a1a8c8aaea963..31059f77e7a679be3c1685171997f739816df728 100644 (file)
@@ -25,10 +25,11 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../../helpers/l10n';
 import { MainBranch } from '../../../types/branch-like';
+import { Component } from '../../../types/types';
 
 interface Props {
   branch: MainBranch;
-  component: T.Component;
+  component: Component;
   onClose: () => void;
   onRename: () => void;
 }
index 9fd50d11b0302112c0ae5ab59cbfd8477c452926..fecc91be0c1e125a62a1945f9b98140597360cb6 100644 (file)
 import * as React from 'react';
 import { Helmet } from 'react-helmet-async';
 import { translate } from '../../helpers/l10n';
+import { Component } from '../../types/types';
 import Form from './Form';
 import Header from './Header';
 
 interface Props {
-  component: Pick<T.Component, 'key' | 'name' | 'qualifier'>;
+  component: Pick<Component, 'key' | 'name' | 'qualifier'>;
 }
 
 export default function App(props: Props) {
index 8c97d9d87e348e9c68d6a10a1c1735a0ab707110..2a3680c7a18c4b1f0715e942cefaaa9c1d924962 100644 (file)
@@ -26,9 +26,10 @@ import ConfirmButton from '../../components/controls/ConfirmButton';
 import { Router, withRouter } from '../../components/hoc/withRouter';
 import { translate, translateWithParameters } from '../../helpers/l10n';
 import { isApplication, isPortfolioLike } from '../../types/component';
+import { Component } from '../../types/types';
 
 interface Props {
-  component: Pick<T.Component, 'key' | 'name' | 'qualifier'>;
+  component: Pick<Component, 'key' | 'name' | 'qualifier'>;
   router: Pick<Router, 'replace'>;
 }
 
index a20e57b22ffce5d2aa7c688384145bd9f90aaee9..3db2b1798a901c15185c5c9fe92751f1f4978c91 100644 (file)
  */
 import * as React from 'react';
 import { translate } from '../../helpers/l10n';
+import { Component } from '../../types/types';
 
 interface Props {
-  component: Pick<T.Component, 'qualifier'>;
+  component: Pick<Component, 'qualifier'>;
 }
 
 export default function Header(props: Props) {
index 8414da52c12d8ea68906f49a5420f9a80754da4a..20666cb91928548feeaab885a14d817840a8aee1 100644 (file)
@@ -25,6 +25,7 @@ import { withAppState } from '../../components/hoc/withAppState';
 import { translate } from '../../helpers/l10n';
 import { DumpStatus, DumpTask } from '../../types/project-dump';
 import { TaskStatuses, TaskTypes } from '../../types/tasks';
+import { AppState, Component } from '../../types/types';
 import Export from './components/Export';
 import Import from './components/Import';
 import './styles.css';
@@ -32,8 +33,8 @@ import './styles.css';
 const POLL_INTERNAL = 5000;
 
 interface Props {
-  appState: Pick<T.AppState, 'projectImportFeatureEnabled'>;
-  component: T.Component;
+  appState: Pick<AppState, 'projectImportFeatureEnabled'>;
+  component: Component;
 }
 
 interface State {
index df70da33abbfee6422a60e582736fe69b13ee91b..0b146dbd23ac7e9eaea3b7da057bef895dc6c8c0 100644 (file)
@@ -23,10 +23,11 @@ import { withRouter, WithRouterProps } from 'react-router';
 import { changeKey } from '../../api/components';
 import RecentHistory from '../../app/components/RecentHistory';
 import { translate } from '../../helpers/l10n';
+import { Component } from '../../types/types';
 import UpdateForm from './UpdateForm';
 
 interface Props {
-  component: Pick<T.Component, 'key' | 'name'>;
+  component: Pick<Component, 'key' | 'name'>;
 }
 
 export class Key extends React.PureComponent<Props & WithRouterProps> {
index 1cb39eb737bdf9422f62ed87e8c5ae63d4cfc9a2..2f66aa36d45dbb2a4d819fc2648915f39dc6fe46 100644 (file)
@@ -25,9 +25,10 @@ import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExpla
 import { translate, translateWithParameters } from '../../helpers/l10n';
 import { validateProjectKey } from '../../helpers/projects';
 import { ProjectKeyValidationResult } from '../../types/component';
+import { Component } from '../../types/types';
 
 export interface UpdateFormProps {
-  component: Pick<T.Component, 'key' | 'name'>;
+  component: Pick<Component, 'key' | 'name'>;
   onKeyChange: (newKey: string) => Promise<void>;
 }
 
index 82cc8f6c8a17c7c7ff15fab6c25d3f3896f1f698..d494e1540d28c973babc2e2aee99f1b541b8ef0b 100644 (file)
@@ -22,15 +22,16 @@ import { Helmet } from 'react-helmet-async';
 import { createLink, deleteLink, getProjectLinks } from '../../api/projectLinks';
 import DeferredSpinner from '../../components/ui/DeferredSpinner';
 import { translate } from '../../helpers/l10n';
+import { Component, ProjectLink } from '../../types/types';
 import Header from './Header';
 import Table from './Table';
 
 interface Props {
-  component: Pick<T.Component, 'key'>;
+  component: Pick<Component, 'key'>;
 }
 
 interface State {
-  links?: T.ProjectLink[];
+  links?: ProjectLink[];
   loading: boolean;
 }
 
index 955a2dffd26f41d3b60ae278aca7fe9b176864fa..4983ddbb4afc341e580f4b93d24734240b41a12e 100644 (file)
@@ -24,14 +24,15 @@ 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 { ProjectLink } from '../../types/types';
 
 interface Props {
-  link: T.ProjectLink;
+  link: ProjectLink;
   onDelete: (linkId: string) => Promise<void>;
 }
 
 export default class LinkRow extends React.PureComponent<Props> {
-  renderNameForProvided = (link: T.ProjectLink) => {
+  renderNameForProvided = (link: ProjectLink) => {
     return (
       <div className="display-inline-block text-top">
         <div>
@@ -44,7 +45,7 @@ export default class LinkRow extends React.PureComponent<Props> {
     );
   };
 
-  renderName = (link: T.ProjectLink) => {
+  renderName = (link: ProjectLink) => {
     return (
       <div>
         <ProjectLinkIcon className="little-spacer-right" type={link.type} />
@@ -59,7 +60,7 @@ export default class LinkRow extends React.PureComponent<Props> {
     );
   };
 
-  renderDeleteButton = (link: T.ProjectLink) => {
+  renderDeleteButton = (link: ProjectLink) => {
     if (isProvided(link)) {
       return null;
     }
index 7d33bb5997c8dfc9c81f4372472e52eb84986796..0313d912599ee1dbf5f3ac880e2999dfffffc0fb 100644 (file)
 import * as React from 'react';
 import { translate } from '../../helpers/l10n';
 import { orderLinks } from '../../helpers/projectLinks';
+import { ProjectLink } from '../../types/types';
 import LinkRow from './LinkRow';
 
 interface Props {
-  links: T.ProjectLink[];
+  links: ProjectLink[];
   onDelete: (linkId: string) => Promise<void>;
 }
 
index 08468d1fb8ed3c5276bd884140e4ea7ce2000bda..5deabd5bfb5b815dd0320725cb6616ef9db094e5 100644 (file)
@@ -29,17 +29,18 @@ import {
 import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage';
 import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization';
 import { translate } from '../../helpers/l10n';
+import { Component, QualityGate } from '../../types/types';
 import { USE_SYSTEM_DEFAULT } from './constants';
 import ProjectQualityGateAppRenderer from './ProjectQualityGateAppRenderer';
 
 interface Props {
-  component: T.Component;
+  component: Component;
   onComponentChange: (changes: {}) => void;
 }
 
 interface State {
-  allQualityGates?: T.QualityGate[];
-  currentQualityGate?: T.QualityGate;
+  allQualityGates?: QualityGate[];
+  currentQualityGate?: QualityGate;
   loading: boolean;
   selectedQualityGateId: string;
   submitting: boolean;
@@ -72,7 +73,7 @@ export default class ProjectQualityGateApp extends React.PureComponent<Props, St
     return !!hasPermission;
   };
 
-  isUsingDefault = async (qualityGate: T.QualityGate) => {
+  isUsingDefault = async (qualityGate: QualityGate) => {
     const { component } = this.props;
 
     if (!qualityGate.isDefault) {
index adc0763cbf52a5f1eac49726710d3c0ee6aa9abe..012db878b077436a957ffa0e07fcef83ac3fdb65 100644 (file)
@@ -31,12 +31,13 @@ import SelectLegacy from '../../components/controls/SelectLegacy';
 import { Alert } from '../../components/ui/Alert';
 import { translate } from '../../helpers/l10n';
 import { isDiffMetric } from '../../helpers/measures';
+import { QualityGate } from '../../types/types';
 import BuiltInQualityGateBadge from '../quality-gates/components/BuiltInQualityGateBadge';
 import { USE_SYSTEM_DEFAULT } from './constants';
 
 export interface ProjectQualityGateAppRendererProps {
-  allQualityGates?: T.QualityGate[];
-  currentQualityGate?: T.QualityGate;
+  allQualityGates?: QualityGate[];
+  currentQualityGate?: QualityGate;
   loading: boolean;
   onSelect: (id: string) => void;
   onSubmit: () => void;
@@ -44,7 +45,7 @@ export interface ProjectQualityGateAppRendererProps {
   submitting: boolean;
 }
 
-function hasConditionOnNewCode(qualityGate: T.QualityGate): boolean {
+function hasConditionOnNewCode(qualityGate: QualityGate): boolean {
   return !!qualityGate.conditions?.some(condition => isDiffMetric(condition.metric));
 }
 
index 81b7af22f5d6fda17f96cf85cf69ba642465adad..06abdead367285451da91cbb28c7ad7d186dc725 100644 (file)
@@ -30,11 +30,12 @@ import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage';
 import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization';
 import { translateWithParameters } from '../../helpers/l10n';
 import { isDefined } from '../../helpers/types';
+import { Component } from '../../types/types';
 import ProjectQualityProfilesAppRenderer from './ProjectQualityProfilesAppRenderer';
 import { ProjectProfile } from './types';
 
 interface Props {
-  component: T.Component;
+  component: Component;
 }
 
 interface State {
index 024ca06fab37124f83930b209be3fe74383380da..2a3f057c49f0b92808218fae7477b694abe5f15c 100644 (file)
@@ -30,6 +30,7 @@ import EditIcon from '../../components/icons/EditIcon';
 import PlusCircleIcon from '../../components/icons/PlusCircleIcon';
 import { translate } from '../../helpers/l10n';
 import { getRulesUrl } from '../../helpers/urls';
+import { Component } from '../../types/types';
 import BuiltInQualityProfileBadge from '../quality-profiles/components/BuiltInQualityProfileBadge';
 import AddLanguageModal from './components/AddLanguageModal';
 import SetQualityProfileModal from './components/SetQualityProfileModal';
@@ -37,7 +38,7 @@ import { ProjectProfile } from './types';
 
 export interface ProjectQualityProfilesAppRendererProps {
   allProfiles?: Profile[];
-  component: T.Component;
+  component: Component;
   loading: boolean;
   onAddLanguage: (key: string) => Promise<void>;
   onCloseModal: () => void;
index c01da6619fb7d9116dc3955ce069a714159c6617..58433a959caba169422c23e02ee44fb137896426 100644 (file)
@@ -29,12 +29,13 @@ import SimpleModal from '../../../components/controls/SimpleModal';
 import { translate } from '../../../helpers/l10n';
 import { getQualityProfileUrl } from '../../../helpers/urls';
 import { Store } from '../../../store/rootReducer';
+import { Dict, Languages } from '../../../types/types';
 
 export interface AddLanguageModalProps {
-  languages: T.Languages;
+  languages: Languages;
   onClose: () => void;
   onSubmit: (key: string) => Promise<void>;
-  profilesByLanguage: T.Dict<Profile[]>;
+  profilesByLanguage: Dict<Profile[]>;
   unavailableLanguages: string[];
 }
 
index a8b021b014e54d27a03b012956ed6c01e787c278..7d12696199e3b5c5737946eb72a2cbb0dbbacffb 100644 (file)
@@ -28,12 +28,13 @@ import SimpleModal from '../../../components/controls/SimpleModal';
 import { Alert } from '../../../components/ui/Alert';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { getQualityProfileUrl } from '../../../helpers/urls';
+import { Component } from '../../../types/types';
 import BuiltInQualityProfileBadge from '../../quality-profiles/components/BuiltInQualityProfileBadge';
 import { USE_SYSTEM_DEFAULT } from '../constants';
 
 export interface SetQualityProfileModalProps {
   availableProfiles: Profile[];
-  component: T.Component;
+  component: Component;
   currentProfile: Profile;
   onClose: () => void;
   onSubmit: (newKey: string | undefined, oldKey: string) => Promise<void>;
index 4034a6fd5920c6aa391faec23b1f23d5308db587..816f39f48a4bf2a9da5643dd0b3f6014886a321f 100644 (file)
@@ -33,6 +33,7 @@ import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages';
 import { get, save } from '../../../helpers/storage';
 import { isLoggedIn } from '../../../helpers/users';
 import { ComponentQualifier } from '../../../types/component';
+import { CurrentUser, RawQuery } from '../../../types/types';
 import { hasFilterParams, hasVisualizationParams, parseUrlQuery, Query } from '../query';
 import '../styles.css';
 import { Facets, Project } from '../types';
@@ -43,7 +44,7 @@ import PageSidebar from './PageSidebar';
 import ProjectsList from './ProjectsList';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   isFavorite: boolean;
   location: Pick<Location, 'pathname' | 'query'>;
   qualifiers: ComponentQualifier[];
@@ -216,7 +217,7 @@ export class AllProjects extends React.PureComponent<Props, State> {
     }
   };
 
-  updateLocationQuery = (newQuery: T.RawQuery) => {
+  updateLocationQuery = (newQuery: RawQuery) => {
     const query = omitBy({ ...this.props.location.query, ...newQuery }, x => !x);
     this.props.router.push({ pathname: this.props.location.pathname, query });
   };
index b652a99505bb12f49b6207bbb8765e9e1861f00a..ac77f57192b701533b27d645140b03a0f307f8e9 100644 (file)
@@ -29,11 +29,12 @@ import { getComponentAdminUrl, getComponentOverviewUrl } from '../../../helpers/
 import { hasGlobalPermission } from '../../../helpers/users';
 import { ComponentQualifier } from '../../../types/component';
 import { Permissions } from '../../../types/permissions';
+import { AppState, LoggedInUser } from '../../../types/types';
 
 export interface ApplicationCreationProps {
-  appState: Pick<T.AppState, 'qualifiers'>;
+  appState: Pick<AppState, 'qualifiers'>;
   className?: string;
-  currentUser: T.LoggedInUser;
+  currentUser: LoggedInUser;
   router: Router;
 }
 
index 68329e25c0aef5a9dfe7e66e62fea5b7f452c39d..8d6ac8a797efac69a502bab8c3290bb0850c1615 100644 (file)
@@ -23,11 +23,12 @@ 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 { CurrentUser } from '../../../types/types';
 import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE } from '../utils';
 import AllProjectsContainer from './AllProjectsContainer';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   location: Pick<Location, 'pathname' | 'query'>;
   router: Pick<Router, 'replace'>;
 }
index c1fc2b8209e3b390bd116553286be4e327105c8d..907e07834f2ef24e3b79627c95660a2345a93f19 100644 (file)
@@ -24,9 +24,10 @@ import { withRouter } from '../../../components/hoc/withRouter';
 import { translate } from '../../../helpers/l10n';
 import { hasGlobalPermission, isLoggedIn } from '../../../helpers/users';
 import { Permissions } from '../../../types/permissions';
+import { CurrentUser } from '../../../types/types';
 
 export interface EmptyInstanceProps {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   router: WithRouterProps['router'];
 }
 
index 7a0175381977e2ddb158bacd96db24c0937e1b28..235c3b2cd8f324ffec01895d26f05f77380b81fc 100644 (file)
@@ -22,11 +22,12 @@ import { IndexLink, Link } from 'react-router';
 import { translate } from '../../../helpers/l10n';
 import { save } from '../../../helpers/storage';
 import { isLoggedIn } from '../../../helpers/users';
+import { CurrentUser, RawQuery } from '../../../types/types';
 import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE } from '../utils';
 
 interface Props {
-  currentUser: T.CurrentUser;
-  query?: T.RawQuery;
+  currentUser: CurrentUser;
+  query?: RawQuery;
 }
 
 export default class FavoriteFilter extends React.PureComponent<Props> {
index 8d9e1fbcbc8f959b534e35cec2376ff9877b383e..1d88553877d583da4e4c4b23fb99609d4ab93b90 100644 (file)
@@ -23,6 +23,7 @@ import HomePageSelect from '../../../components/controls/HomePageSelect';
 import Tooltip from '../../../components/controls/Tooltip';
 import { translate } from '../../../helpers/l10n';
 import { isLoggedIn } from '../../../helpers/users';
+import { CurrentUser, RawQuery } from '../../../types/types';
 import SearchFilterContainer from '../filters/SearchFilterContainer';
 import { Project } from '../types';
 import ApplicationCreation from './ApplicationCreation';
@@ -31,13 +32,13 @@ import ProjectCreationMenu from './ProjectCreationMenu';
 import ProjectsSortingSelect from './ProjectsSortingSelect';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   loading: boolean;
   onPerspectiveChange: (x: { view: string; visualization?: string }) => void;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   onSortChange: (sort: string, desc: boolean) => void;
   projects?: Project[];
-  query: T.RawQuery;
+  query: RawQuery;
   selectedSort: string;
   total?: number;
   view: string;
index 138729696329c33a3228ab286d781717cd8b5060..dc4cd58fbe40ba674f31ee746e7bbd229e0e44e0 100644 (file)
@@ -20,6 +20,7 @@
 import { flatMap } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import CoverageFilter from '../filters/CoverageFilter';
 import DuplicationsFilter from '../filters/DuplicationsFilter';
 import LanguagesFilterContainer from '../filters/LanguagesFilterContainer';
@@ -46,8 +47,8 @@ export interface PageSidebarProps {
   applicationsEnabled: boolean;
   facets?: Facets;
   onClearAll: () => void;
-  onQueryChange: (change: T.RawQuery) => void;
-  query: T.RawQuery;
+  onQueryChange: (change: RawQuery) => void;
+  query: RawQuery;
   view: string;
   visualization: string;
 }
@@ -59,7 +60,7 @@ export default function PageSidebar(props: PageSidebarProps) {
   const maxFacetValue = getMaxFacetValue(facets);
   const facetProps = { onQueryChange, maxFacetValue };
 
-  let linkQuery: T.RawQuery | undefined = undefined;
+  let linkQuery: RawQuery | undefined = undefined;
   if (view !== 'overall') {
     linkQuery = { view };
 
index d43ce028420ab3dcf94213a9cd8dd412f2e6cb72..f75875da77ec8cc7851db27ebd979cdf3cf5869a 100644 (file)
@@ -30,11 +30,12 @@ import { translate } from '../../../helpers/l10n';
 import { hasGlobalPermission } from '../../../helpers/users';
 import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
 import { Permissions } from '../../../types/permissions';
+import { LoggedInUser } from '../../../types/types';
 import ProjectCreationMenuItem from './ProjectCreationMenuItem';
 
 interface Props {
   className?: string;
-  currentUser: T.LoggedInUser;
+  currentUser: LoggedInUser;
 }
 
 interface State {
index 8e265138f4370b563b3e72a669898e3ff57de2c7..d2f93deca14223c61664b7f073065ab56dbbe34d 100644 (file)
@@ -23,6 +23,7 @@ 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 '../../../helpers/l10n';
+import { CurrentUser } from '../../../types/types';
 import { Query } from '../query';
 import { Project } from '../types';
 import EmptyFavoriteSearch from './EmptyFavoriteSearch';
@@ -35,7 +36,7 @@ const PROJECT_CARD_MARGIN = 20;
 
 interface Props {
   cardType?: string;
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   handleFavorite: (component: string, isFavorite: boolean) => void;
   isFavorite: boolean;
   isFiltered: boolean;
index 6709060a2ff55d6f54474dced2e8bb87ed5512b5..eccc586ea73995ceab5b960aadca7db8493f6890 100644 (file)
@@ -21,6 +21,7 @@ import { shallow } from 'enzyme';
 import * as React from 'react';
 import { get, save } from '../../../../helpers/storage';
 import { ComponentQualifier } from '../../../../types/component';
+import { Dict } from '../../../../types/types';
 import {
   AllProjects,
   LS_PROJECTS_SORT,
@@ -110,7 +111,7 @@ it('fetches projects', () => {
 });
 
 it('redirects to the saved search', () => {
-  const localeStorageMock: T.Dict<string> = {
+  const localeStorageMock: Dict<string> = {
     [LS_PROJECTS_VIEW]: 'leak',
     [LS_PROJECTS_SORT]: 'coverage',
     [LS_PROJECTS_VISUALIZATION]: 'security'
index 01a5c463cd4ffc14a4b148820322432135d4d547..5ed9e6e8ad9e3a3c34c6ccf33279cd36d12553b3 100644 (file)
@@ -29,6 +29,7 @@ import {
 } from '../../../../helpers/testMocks';
 import { waitAndUpdate } from '../../../../helpers/testUtils';
 import { hasGlobalPermission } from '../../../../helpers/users';
+import { CurrentUser } from '../../../../types/types';
 import { DefaultPageSelector } from '../DefaultPageSelector';
 
 jest.mock(
@@ -46,7 +47,7 @@ jest.mock('../../../../helpers/storage', () => ({
 
 jest.mock('../../../../helpers/users', () => ({
   hasGlobalPermission: jest.fn().mockReturnValue(false),
-  isLoggedIn: jest.fn((u: T.CurrentUser) => u.isLoggedIn)
+  isLoggedIn: jest.fn((u: CurrentUser) => u.isLoggedIn)
 }));
 
 jest.mock('../../../../api/components', () => ({
index 96758862825f0f467720ca1fbb18bc9f62766697..624d6021173ca4d3a17d38b06f4a6623ba12a80c 100644 (file)
@@ -35,6 +35,7 @@ import { getProjectUrl } from '../../../../helpers/urls';
 import { isLoggedIn } from '../../../../helpers/users';
 import { ComponentQualifier } from '../../../../types/component';
 import { MetricKey } from '../../../../types/metrics';
+import { CurrentUser } from '../../../../types/types';
 import { Project } from '../../types';
 import './ProjectCard.css';
 import ProjectCardLanguagesContainer from './ProjectCardLanguagesContainer';
@@ -43,7 +44,7 @@ import ProjectCardMeasures from './ProjectCardMeasures';
 import ProjectCardQualityGate from './ProjectCardQualityGate';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   handleFavorite: (component: string, isFavorite: boolean) => void;
   height: number;
   project: Project;
index 567ca229559146c6f841a154b4c21f957f494076..77309ffdbb35b405181f29bcc82a8820ba840b44 100644 (file)
 import { sortBy } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../../helpers/l10n';
+import { Languages } from '../../../../types/types';
 
 interface Props {
   className?: string;
   distribution?: string;
-  languages: T.Languages;
+  languages: Languages;
 }
 
 export default function ProjectCardLanguages({ className, distribution, languages }: Props) {
@@ -46,7 +47,7 @@ export default function ProjectCardLanguages({ className, distribution, language
   );
 }
 
-function getLanguageName(languages: T.Languages, key: string): string {
+function getLanguageName(languages: Languages, key: string): string {
   if (key === '<null>') {
     return translate('unknown');
   }
index 1694baf44b13cc40ccadaab234f7a335227261e8..6a71ccc1f936f5ffa8c659b52b0690d5473c120a 100644 (file)
@@ -29,12 +29,13 @@ import { translate, translateWithParameters } from '../../../../helpers/l10n';
 import { isDefined } from '../../../../helpers/types';
 import { ComponentQualifier } from '../../../../types/component';
 import { MetricKey } from '../../../../types/metrics';
+import { Dict } from '../../../../types/types';
 import { formatDuration } from '../../utils';
 import ProjectCardMeasure from './ProjectCardMeasure';
 
 export interface ProjectCardMeasuresProps {
   isNewCode: boolean;
-  measures: T.Dict<string | undefined>;
+  measures: Dict<string | undefined>;
   componentQualifier: ComponentQualifier;
   newCodeStartingDate?: string;
 }
index d6cf7f5744bd9490cf79a574795dbc4e255286ee..87cbce08c4b5ace894f210e978fa0968e8369644 100644 (file)
@@ -23,6 +23,7 @@ import PrivacyBadgeContainer from '../../../../../components/common/PrivacyBadge
 import TagsList from '../../../../../components/tags/TagsList';
 import { mockCurrentUser, mockLoggedInUser } from '../../../../../helpers/testMocks';
 import { ComponentQualifier } from '../../../../../types/component';
+import { CurrentUser } from '../../../../../types/types';
 import { Project } from '../../../types';
 import ProjectCard from '../ProjectCard';
 import ProjectCardQualityGate from '../ProjectCardQualityGate';
@@ -108,7 +109,7 @@ it('should display applications', () => {
   ).toMatchSnapshot('with project count');
 });
 
-function shallowRender(project: Project, user: T.CurrentUser = USER_LOGGED_OUT, type?: string) {
+function shallowRender(project: Project, user: CurrentUser = USER_LOGGED_OUT, type?: string) {
   return shallow(
     <ProjectCard
       currentUser={user}
index 788f567050f7c077a4a76c237564d12ceef0e15f..93ebaefec6f0edd2060cefa228cb4c80bc7a808f 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import CoverageRating from '../../../../../components/ui/CoverageRating';
 import { ComponentQualifier } from '../../../../../types/component';
 import { MetricKey } from '../../../../../types/metrics';
+import { Dict } from '../../../../../types/types';
 import ProjectCardMeasures, { ProjectCardMeasuresProps } from '../ProjectCardMeasures';
 
 jest.mock('date-fns', () => ({
@@ -59,7 +60,7 @@ describe('New code measures', () => {
 });
 
 function shallowRender(
-  measuresOverride: T.Dict<string | undefined> = {},
+  measuresOverride: Dict<string | undefined> = {},
   props: Partial<ProjectCardMeasuresProps> = {}
 ) {
   const measures = {
index 4e1463002db98af5c074a4f90e42ae06c54d5bff..69ad7754ac9d46093354ab4b9f08afb17cef7464 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import CoverageRating from '../../../components/ui/CoverageRating';
 import { translate } from '../../../helpers/l10n';
 import { getCoverageRatingAverageValue, getCoverageRatingLabel } from '../../../helpers/ratings';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -29,7 +30,7 @@ export interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property?: string;
   value?: any;
 }
index 8ad097a98260c407ced79a08282d292cf91f3b69..05869513cd56335b22cb177de731e68df32b6e2e 100644 (file)
@@ -24,6 +24,7 @@ import {
   getDuplicationsRatingAverageValue,
   getDuplicationsRatingLabel
 } from '../../../helpers/ratings';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -32,7 +33,7 @@ export interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property?: string;
   value?: any;
 }
index 85a15f0e7b58e263ed9158bc5aaf5ca958ff8187..710133a1af7ec66032a3fcb228528404e0ea504d 100644 (file)
@@ -21,6 +21,7 @@ import classNames from 'classnames';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 
 export type Option = string | number;
@@ -28,7 +29,7 @@ export type Option = string | number;
 interface Props {
   property: string;
   className?: string;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   options: Option[];
   renderOption: (option: Option, isSelected: boolean) => React.ReactNode;
 
index ade2ba79d8510e9a5b407ea93a4c2a4a0cc3863d..aa0e5cda1370cb800b5acb31d93af1f9020089aa 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import Rating from '../../../components/ui/Rating';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -30,7 +31,7 @@ interface Props {
   headerDetail?: React.ReactNode;
   maxFacetValue?: number;
   name: string;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property: string;
   value?: any;
 }
index e3786e0f5b1c82bc0fabaf054a430e3ca3049a6a..9e6b5f23883e8e3e2d7799e16b96f73a82b3d851 100644 (file)
@@ -21,6 +21,7 @@ import { difference, sortBy } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { getLanguageByKey } from '../../../store/languages';
+import { Dict, Languages, RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -29,11 +30,11 @@ import SearchableFilterOption from './SearchableFilterOption';
 
 interface Props {
   facet?: Facet;
-  languages: T.Languages;
+  languages: Languages;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property?: string;
-  query: T.Dict<any>;
+  query: Dict<any>;
   value?: string[];
 }
 
index 73a3c437eca7af169d97316090ca5c53af6da873..b688cd21434e2e21c8ed0ff8f91c8400729dc636 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import CodeSmellIcon from '../../../components/icons/CodeSmellIcon';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import IssuesFilter from './IssuesFilter';
 
@@ -28,7 +29,7 @@ interface Props {
   facet?: Facet;
   headerDetail?: React.ReactNode;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value?: any;
 }
 
index 73b9dceb8dc0ba67785d021f9fff49ac4291d91d..a87dade56df41bf775b144d74d3a0d4f2263fc6f 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { getSizeRatingLabel } from '../../../helpers/ratings';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -28,7 +29,7 @@ export interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property?: string;
   value?: any;
 }
index c151cb3c6fcc52442299c91d0a80ec508df492b6..17ed7eb724fa03af50a959ab1a33c88784fc9f16 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import CodeSmellIcon from '../../../components/icons/CodeSmellIcon';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import IssuesFilter from './IssuesFilter';
 
@@ -27,7 +28,7 @@ interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value?: any;
 }
 
index 423e5fd205ba3db3aa48e6d5d472923439f13bea..62994683e6675f7562c14b3c9b0fb5f3eb951ace 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import BugIcon from '../../../components/icons/BugIcon';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import IssuesFilter from './IssuesFilter';
 
@@ -27,7 +28,7 @@ interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value?: any;
 }
 
index 64614768687584285e77c7fd1d72113061dc6358..bc08d8fee9802186f2e4e21f3a915b0d49cf565f 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import IssuesFilter from './IssuesFilter';
 
@@ -27,7 +28,7 @@ interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value?: any;
 }
 
index 84812b36415f2ca429a95006c6ff1b10cb11d430..a78fa08c5f00f0223883fbe87e78ea318f3d8623 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import QualifierIcon from '../../../components/icons/QualifierIcon';
 import { translate } from '../../../helpers/l10n';
 import { ComponentQualifier } from '../../../types/component';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -28,7 +29,7 @@ import FilterHeader from './FilterHeader';
 export interface QualifierFilterProps {
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value: ComponentQualifier | undefined;
 }
 
index fd857bf2f807ba3b2e25c3401c09f9ff895548f9..b078c0a9bf1153fcba141c77091d50f9da20f17a 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import Level from '../../../components/ui/Level';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -29,7 +30,7 @@ export interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value?: any;
 }
 
index 2f4f683241e6842458c11ecfe84fb1cc567151e0..db278caa5a794f3ea528e1eb456dbdee3a091695 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import BugIcon from '../../../components/icons/BugIcon';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import IssuesFilter from './IssuesFilter';
 
@@ -28,7 +29,7 @@ interface Props {
   facet?: Facet;
   headerDetail?: React.ReactNode;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value?: any;
 }
 
index 61a7e51d413e26b7926bf79fcbcbe9ce8a0948fc..000195204cb10fda6589c33acf7717460f7b81bb 100644 (file)
 import * as React from 'react';
 import SelectLegacy from '../../../components/controls/SelectLegacy';
 import { translate } from '../../../helpers/l10n';
+import { Dict, RawQuery } from '../../../types/types';
 
 interface Props {
   isFavorite?: boolean;
   isLoading?: boolean;
   onInputChange?: (query: string) => void;
   onOpen?: () => void;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   options: Array<{ label: string; value: string }>;
   property: string;
-  query: T.Dict<any>;
+  query: Dict<any>;
 }
 
 export default class SearchableFilterFooter extends React.PureComponent<Props> {
index a553d20587029c1f81497615b9314a33eb06b1d4..fc475918cebbf1e6c62df1ee85cc0cecd3d1ec80 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon';
 import { translate } from '../../../helpers/l10n';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import IssuesFilter from './IssuesFilter';
 
@@ -28,7 +29,7 @@ interface Props {
   facet?: Facet;
   headerDetail?: React.ReactNode;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   value?: any;
 }
 
index 816b7428e3305af8e02b873257fc04a5f00206c3..c36d18f7dcbcaf1c9a62ccfdf4d69d8e3366cc0f 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import SecurityHotspotIcon from '../../../components/icons/SecurityHotspotIcon';
 import Rating from '../../../components/ui/Rating';
 import { translate } from '../../../helpers/l10n';
+import { Dict, RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -29,12 +30,12 @@ export interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property?: string;
   value?: any;
 }
 
-const labels: T.Dict<string> = {
+const labels: Dict<string> = {
   1: '≥ 80%',
   2: '70% - 80%',
   3: '50% - 70%',
index 9df9a168890e0fb55000d665cb64eeb57aa5a6ae..906d7fee9bf6262452206faa6f604ad14fde8916 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import SizeRating from '../../../components/ui/SizeRating';
 import { translate } from '../../../helpers/l10n';
 import { getSizeRatingAverageValue, getSizeRatingLabel } from '../../../helpers/ratings';
+import { RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -29,7 +30,7 @@ export interface Props {
   className?: string;
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property?: string;
   value?: any;
 }
index c7175a3cc3b7d61d5db02716c8c276ab584bfb37..6bfd1e91aa8acb33c3ee33b8b1b72005371f4c97 100644 (file)
@@ -21,6 +21,7 @@ import { debounce, difference, size, sortBy } from 'lodash';
 import * as React from 'react';
 import { searchProjectTags } from '../../../api/components';
 import { translate } from '../../../helpers/l10n';
+import { Dict, RawQuery } from '../../../types/types';
 import { Facet } from '../types';
 import Filter from './Filter';
 import FilterHeader from './FilterHeader';
@@ -30,9 +31,9 @@ import SearchableFilterOption from './SearchableFilterOption';
 interface Props {
   facet?: Facet;
   maxFacetValue?: number;
-  onQueryChange: (change: T.RawQuery) => void;
+  onQueryChange: (change: RawQuery) => void;
   property?: string;
-  query: T.Dict<any>;
+  query: Dict<any>;
   value?: string[];
 }
 
index 97e0eee257f229a18ee9173b2e508f3b555360b7..51334cee3d2154d3e94b35eded57272e5a59afa9 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { ComponentQualifier } from '../../types/component';
+import { Dict, RawQuery } from '../../types/types';
 import { VISUALIZATIONS } from './utils';
 
 type Level = 'ERROR' | 'WARN' | 'OK';
@@ -48,7 +49,7 @@ export interface Query {
   [x: string]: string | number | string[] | undefined;
 }
 
-export function parseUrlQuery(urlQuery: T.RawQuery): Query {
+export function parseUrlQuery(urlQuery: RawQuery): Query {
   return {
     gate: getAsLevel(urlQuery['gate']),
     reliability: getAsNumericRating(urlQuery['reliability']),
@@ -239,7 +240,7 @@ function convertSize(metric: string, size: number): string {
 }
 
 function mapPropertyToMetric(property?: string): string | undefined {
-  const map: T.Dict<string> = {
+  const map: Dict<string> = {
     analysis_date: 'analysisDate',
     reliability: 'reliability_rating',
     new_reliability: 'new_reliability_rating',
index 704412a23f55ed67d547cf1d71fee92f4be8f3d0..257a88aeb67f3559784cfc78b45008e76a3e201d 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { ComponentQualifier } from '../../types/component';
+import { Dict, Visibility } from '../../types/types';
 
 export interface Project {
   analysisDate?: string;
   isFavorite?: boolean;
   key: string;
   leakPeriodDate?: string;
-  measures: T.Dict<string>;
+  measures: Dict<string>;
   name: string;
   projects?: number;
   qualifier: ComponentQualifier;
   tags: string[];
-  visibility: T.Visibility;
+  visibility: Visibility;
   needIssueSync?: boolean;
 }
 
index d9c0446d643b88177aa550fa3031b0162162fccc..947389d5099b13f67ddfc982c446cab896a347d5 100644 (file)
@@ -24,6 +24,7 @@ import { translate, translateWithParameters } from '../../helpers/l10n';
 import { isDiffMetric } from '../../helpers/measures';
 import { RequestData } from '../../helpers/request';
 import { MetricKey } from '../../types/metrics';
+import { Dict } from '../../types/types';
 import { convertToFilter, Query } from './query';
 
 interface SortingOption {
@@ -59,7 +60,7 @@ export const SORTING_LEAK_METRICS: SortingOption[] = [
   { value: 'new_lines', class: 'projects-leak-sorting-option' }
 ];
 
-export const SORTING_SWITCH: T.Dict<string> = {
+export const SORTING_SWITCH: Dict<string> = {
   analysis_date: 'analysis_date',
   name: 'name',
   reliability: 'new_reliability',
@@ -128,7 +129,7 @@ const LEAK_METRICS = [
   MetricKey.projects
 ];
 
-const METRICS_BY_VISUALIZATION: T.Dict<string[]> = {
+const METRICS_BY_VISUALIZATION: Dict<string[]> = {
   risk: [
     MetricKey.reliability_rating,
     MetricKey.security_rating,
@@ -214,7 +215,7 @@ export function fetchProjects(query: Query, isFavorite: boolean, pageIndex = 1)
       return {
         facets: getFacetsMap(facets),
         projects: components.map(component => {
-          const componentMeasures: T.Dict<string> = {};
+          const componentMeasures: Dict<string> = {};
           measures
             .filter(measure => measure.component === component.key)
             .forEach(measure => {
@@ -276,14 +277,14 @@ export function fetchProjectMeasures(projects: Array<{ key: string }>, query: Qu
 }
 
 function mapFacetValues(values: Array<{ val: string; count: number }>) {
-  const map: T.Dict<number> = {};
+  const map: Dict<number> = {};
   values.forEach(value => {
     map[value.val] = value.count;
   });
   return map;
 }
 
-const propertyToMetricMap: T.Dict<string | undefined> = {
+const propertyToMetricMap: Dict<string | undefined> = {
   analysis_date: 'analysisDate',
   reliability: 'reliability_rating',
   new_reliability: 'new_reliability_rating',
@@ -309,7 +310,7 @@ const propertyToMetricMap: T.Dict<string | undefined> = {
 const metricToPropertyMap = invert(propertyToMetricMap);
 
 function getFacetsMap(facets: Facet[]) {
-  const map: T.Dict<T.Dict<number>> = {};
+  const map: Dict<Dict<number>> = {};
   facets.forEach(facet => {
     const property = metricToPropertyMap[facet.property];
     const { values } = facet;
index db77fa42331c245b989b506258bf6912514afe23..65b8ae39a0512e11d0dd8c27cb704e83503dad4f 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 import { Project } from '../types';
 import { localizeSorting } from '../utils';
 import Coverage from './Coverage';
@@ -37,7 +38,7 @@ interface Props {
 
 export default class Visualizations extends React.PureComponent<Props> {
   renderVisualization(projects: Project[]) {
-    const visualizationToComponent: T.Dict<any> = {
+    const visualizationToComponent: Dict<any> = {
       risk: Risk,
       reliability: Reliability,
       security: Security,
index c3c7d9ce91f9fd83cafa9340e450b28fd7702358..5f12052689ab62d8a6fe855fd0a5b910234fb9cd 100644 (file)
@@ -32,20 +32,21 @@ import { hasGlobalPermission } from '../../helpers/users';
 import { getAppState, getCurrentUser, Store } from '../../store/rootReducer';
 import { Permissions } from '../../types/permissions';
 import { SettingsKey } from '../../types/settings';
+import { AppState, LoggedInUser, Visibility } from '../../types/types';
 import CreateProjectForm from './CreateProjectForm';
 import Header from './Header';
 import Projects from './Projects';
 import Search from './Search';
 
 export interface Props {
-  currentUser: T.LoggedInUser;
-  appState: Pick<T.AppState, 'qualifiers'>;
+  currentUser: LoggedInUser;
+  appState: Pick<AppState, 'qualifiers'>;
 }
 
 interface State {
   analyzedBefore?: Date;
   createProjectForm: boolean;
-  defaultProjectVisibility?: T.Visibility;
+  defaultProjectVisibility?: Visibility;
   page: number;
   projects: Project[];
   provisioned: boolean;
@@ -54,7 +55,7 @@ interface State {
   ready: boolean;
   selection: string[];
   total: number;
-  visibility?: T.Visibility;
+  visibility?: Visibility;
 }
 
 const PAGE_SIZE = 50;
@@ -92,11 +93,11 @@ export class App extends React.PureComponent<Props, State> {
     const results = await getValues({ keys: SettingsKey.DefaultProjectVisibility });
 
     if (this.mounted && results.length > 0 && results[0].value) {
-      this.setState({ defaultProjectVisibility: results[0].value as T.Visibility });
+      this.setState({ defaultProjectVisibility: results[0].value as Visibility });
     }
   };
 
-  handleDefaultProjectVisibilityChange = async (visibility: T.Visibility) => {
+  handleDefaultProjectVisibilityChange = async (visibility: Visibility) => {
     await changeProjectDefaultVisibility(visibility);
 
     if (this.mounted) {
@@ -155,7 +156,7 @@ export class App extends React.PureComponent<Props, State> {
     );
   };
 
-  onVisibilityChanged = (newVisibility: T.Visibility | 'all') => {
+  onVisibilityChanged = (newVisibility: Visibility | 'all') => {
     this.setState(
       {
         ready: false,
@@ -262,7 +263,7 @@ export class App extends React.PureComponent<Props, State> {
 
 const mapStateToProps = (state: Store) => ({
   appState: getAppState(state),
-  currentUser: getCurrentUser(state) as T.LoggedInUser
+  currentUser: getCurrentUser(state) as LoggedInUser
 });
 
 export default connect(mapStateToProps)(App);
index 284f42c0e2f02b6e9711aafb6df06db8ce5b54ca..f2f28010c3eb5bdaa683c94e782772d396ef1ef2 100644 (file)
@@ -27,6 +27,7 @@ import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation';
 import { toNotSoISOString } from '../../helpers/dates';
 import { translate, translateWithParameters } from '../../helpers/l10n';
+import { PermissionTemplate } from '../../types/types';
 
 export interface Props {
   analyzedBefore: Date | undefined;
@@ -42,7 +43,7 @@ interface State {
   done: boolean;
   loading: boolean;
   permissionTemplate?: string;
-  permissionTemplates?: T.PermissionTemplate[];
+  permissionTemplates?: PermissionTemplate[];
   submitting: boolean;
 }
 
index 06fe0785b93e2448797f0fe60e8f5269a962e52b..406956ce2b3ad75715e39cfee9e232985c573cff 100644 (file)
@@ -23,15 +23,16 @@ import Modal from '../../components/controls/Modal';
 import Radio from '../../components/controls/Radio';
 import { Alert } from '../../components/ui/Alert';
 import { translate } from '../../helpers/l10n';
+import { Visibility } from '../../types/types';
 
 export interface Props {
-  defaultVisibility: T.Visibility;
+  defaultVisibility: Visibility;
   onClose: () => void;
-  onConfirm: (visiblity: T.Visibility) => void;
+  onConfirm: (visiblity: Visibility) => void;
 }
 
 interface State {
-  visibility: T.Visibility;
+  visibility: Visibility;
 }
 
 export default class ChangeDefaultVisibilityForm extends React.PureComponent<Props, State> {
@@ -45,7 +46,7 @@ export default class ChangeDefaultVisibilityForm extends React.PureComponent<Pro
     this.props.onClose();
   };
 
-  handleVisibilityChange = (visibility: T.Visibility) => {
+  handleVisibilityChange = (visibility: Visibility) => {
     this.setState({ visibility });
   };
 
index b9b7f1aa40c6b33a40b70eb40701aed4413cd541..0d1abe85f31769a4bff41b3084ec9b258c9c0bee 100644 (file)
@@ -29,9 +29,10 @@ import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../helpers/l10n';
 import { getProjectUrl } from '../../helpers/urls';
+import { Visibility } from '../../types/types';
 
 interface Props {
-  defaultProjectVisibility?: T.Visibility;
+  defaultProjectVisibility?: Visibility;
   onClose: () => void;
   onProjectCreated: () => void;
 }
@@ -41,7 +42,7 @@ interface State {
   key: string;
   loading: boolean;
   name: string;
-  visibility?: T.Visibility;
+  visibility?: Visibility;
   // add index declaration to be able to do `this.setState({ [name]: value });`
   [x: string]: any;
 }
@@ -82,7 +83,7 @@ export default class CreateProjectForm extends React.PureComponent<Props, State>
     this.setState({ [name]: value });
   };
 
-  handleVisibilityChange = (visibility: T.Visibility) => {
+  handleVisibilityChange = (visibility: Visibility) => {
     this.setState({ visibility });
   };
 
index 186366ffc0f2d09650db0dc45c4e8728dd764f1b..233d2bc204c9b5461c061e77813c9402a489a32e 100644 (file)
 import * as React from 'react';
 import { Button, EditButton } from '../../components/controls/buttons';
 import { translate } from '../../helpers/l10n';
+import { Visibility } from '../../types/types';
 import ChangeDefaultVisibilityForm from './ChangeDefaultVisibilityForm';
 
 export interface Props {
-  defaultProjectVisibility?: T.Visibility;
+  defaultProjectVisibility?: Visibility;
   hasProvisionPermission?: boolean;
   onProjectCreate: () => void;
-  onChangeDefaultProjectVisibility: (visibility: T.Visibility) => void;
+  onChangeDefaultProjectVisibility: (visibility: Visibility) => void;
 }
 
 interface State {
index 6bcb30683f8cd4b89d3d856f94c3b38dd4ae9c8c..0e603ac00daa3595bd58324dc65d4320ae8426a4 100644 (file)
@@ -26,11 +26,12 @@ import Tooltip from '../../components/controls/Tooltip';
 import QualifierIcon from '../../components/icons/QualifierIcon';
 import DateFormatter from '../../components/intl/DateFormatter';
 import { getComponentOverviewUrl } from '../../helpers/urls';
+import { LoggedInUser } from '../../types/types';
 import './ProjectRow.css';
 import ProjectRowActions from './ProjectRowActions';
 
 interface Props {
-  currentUser: Pick<T.LoggedInUser, 'login'>;
+  currentUser: Pick<LoggedInUser, 'login'>;
   onProjectCheck: (project: Project, checked: boolean) => void;
   project: Project;
   selected: boolean;
index 8110759fa59c71f0c539b2b9b54f573fd85349c2..55c248676480676ba7c48798afd70784313568a0 100644 (file)
@@ -24,11 +24,12 @@ import ActionsDropdown, { ActionsDropdownItem } from '../../components/controls/
 import DeferredSpinner from '../../components/ui/DeferredSpinner';
 import { translate } from '../../helpers/l10n';
 import { getComponentPermissionsUrl } from '../../helpers/urls';
+import { LoggedInUser } from '../../types/types';
 import ApplyTemplate from '../permissions/project/components/ApplyTemplate';
 import RestoreAccessModal from './RestoreAccessModal';
 
 export interface Props {
-  currentUser: Pick<T.LoggedInUser, 'login'>;
+  currentUser: Pick<LoggedInUser, 'login'>;
   project: Project;
 }
 
index a5b575c8bae83b40223278a96592b6e114590eb4..10baa2205b4b9f9097707590cc1060f312331f32 100644 (file)
@@ -21,10 +21,11 @@ import classNames from 'classnames';
 import * as React from 'react';
 import { Project } from '../../api/components';
 import { translate } from '../../helpers/l10n';
+import { LoggedInUser } from '../../types/types';
 import ProjectRow from './ProjectRow';
 
 interface Props {
-  currentUser: Pick<T.LoggedInUser, 'login'>;
+  currentUser: Pick<LoggedInUser, 'login'>;
   onProjectDeselected: (project: string) => void;
   onProjectSelected: (project: string) => void;
   projects: Project[];
index c651f31e4c51c9a38e61859e8a01b0e8d4bb861b..488efd48966c09766d386ffe135c8c89b865fcb3 100644 (file)
@@ -24,9 +24,10 @@ import { grantPermissionToUser } from '../../api/permissions';
 import { ResetButtonLink, SubmitButton } from '../../components/controls/buttons';
 import Modal from '../../components/controls/Modal';
 import { translate } from '../../helpers/l10n';
+import { LoggedInUser } from '../../types/types';
 
 interface Props {
-  currentUser: Pick<T.LoggedInUser, 'login'>;
+  currentUser: Pick<LoggedInUser, 'login'>;
   onClose: () => void;
   onRestoreAccess: () => void;
   project: Project;
index 289a64ba1235907e5965bc165a42b38c2bb05df0..c7932a0a25cf16824e1275d6e0b2691d7b3948ca 100644 (file)
@@ -28,6 +28,7 @@ import SearchBox from '../../components/controls/SearchBox';
 import SelectLegacy from '../../components/controls/SelectLegacy';
 import QualifierIcon from '../../components/icons/QualifierIcon';
 import { translate } from '../../helpers/l10n';
+import { Visibility } from '../../types/types';
 import BulkApplyTemplateModal from './BulkApplyTemplateModal';
 import DeleteModal from './DeleteModal';
 
@@ -49,7 +50,7 @@ export interface Props {
   selection: any[];
   topLevelQualifiers: string[];
   total: number;
-  visibility?: T.Visibility;
+  visibility?: Visibility;
 }
 
 interface State {
index e2bd83f3f84575e9546fc81cb64ec447803a3011..7ff06229f158615f09449e5659aecaff26e473b0 100644 (file)
@@ -33,6 +33,7 @@ import {
   removeWhitePageClass
 } from '../../../helpers/pages';
 import { getQualityGateUrl } from '../../../helpers/urls';
+import { QualityGate } from '../../../types/types';
 import '../styles.css';
 import Details from './Details';
 import List from './List';
@@ -41,7 +42,7 @@ import ListHeader from './ListHeader';
 interface State {
   canCreate: boolean;
   loading: boolean;
-  qualityGates: T.QualityGate[];
+  qualityGates: QualityGate[];
 }
 
 class App extends React.PureComponent<Pick<WithRouterProps, 'params' | 'router'>, State> {
@@ -86,12 +87,12 @@ class App extends React.PureComponent<Pick<WithRouterProps, 'params' | 'router'>
     );
   };
 
-  openDefault(qualityGates: T.QualityGate[]) {
+  openDefault(qualityGates: QualityGate[]) {
     const defaultQualityGate = qualityGates.find(gate => Boolean(gate.isDefault))!;
     this.props.router.replace(getQualityGateUrl(String(defaultQualityGate.id)));
   }
 
-  handleSetDefault = (qualityGate: T.QualityGate) => {
+  handleSetDefault = (qualityGate: QualityGate) => {
     this.setState(({ qualityGates }) => {
       return {
         qualityGates: qualityGates.map(candidate => {
index c03a1bc871f7065bc2c7794c398ddb2a978ba3b4..7a6bc628c0f42d141d21d8b02acf4e68793ba648 100644 (file)
@@ -24,16 +24,17 @@ 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 { Condition as ConditionType, Metric, QualityGate } from '../../../types/types';
 import { getLocalizedMetricNameNoDiffMetric } from '../utils';
 import ConditionModal from './ConditionModal';
 
 interface Props {
-  condition: T.Condition;
+  condition: ConditionType;
   canEdit: boolean;
-  metric: T.Metric;
-  onRemoveCondition: (Condition: T.Condition) => void;
-  onSaveCondition: (newCondition: T.Condition, oldCondition: T.Condition) => void;
-  qualityGate: T.QualityGate;
+  metric: Metric;
+  onRemoveCondition: (Condition: ConditionType) => void;
+  onSaveCondition: (newCondition: ConditionType, oldCondition: ConditionType) => void;
+  qualityGate: QualityGate;
   updated?: boolean;
 }
 
@@ -51,7 +52,7 @@ export default class Condition extends React.PureComponent<Props, State> {
     };
   }
 
-  handleUpdateCondition = (newCondition: T.Condition) => {
+  handleUpdateCondition = (newCondition: ConditionType) => {
     this.props.onSaveCondition(newCondition, this.props.condition);
   };
 
@@ -71,7 +72,7 @@ export default class Condition extends React.PureComponent<Props, State> {
     this.setState({ deleteFormOpen: false });
   };
 
-  removeCondition = (condition: T.Condition) => {
+  removeCondition = (condition: ConditionType) => {
     deleteCondition({ id: condition.id }).then(
       () => this.props.onRemoveCondition(condition),
       () => {}
index c28d5966448c5306c78c8c4f5ccada6d588eff24..cb13248790ef145e1ab997b532281a1eae2550a5 100644 (file)
@@ -24,25 +24,26 @@ import Radio from '../../../components/controls/Radio';
 import { Alert } from '../../../components/ui/Alert';
 import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
 import { isDiffMetric } from '../../../helpers/measures';
+import { Condition, Metric, QualityGate } from '../../../types/types';
 import { getPossibleOperators } from '../utils';
 import ConditionOperator from './ConditionOperator';
 import MetricSelect from './MetricSelect';
 import ThresholdInput from './ThresholdInput';
 
 interface Props {
-  condition?: T.Condition;
-  metric?: T.Metric;
-  metrics?: T.Metric[];
+  condition?: Condition;
+  metric?: Metric;
+  metrics?: Metric[];
   header: string;
-  onAddCondition: (condition: T.Condition) => void;
+  onAddCondition: (condition: Condition) => void;
   onClose: () => void;
-  qualityGate: T.QualityGate;
+  qualityGate: QualityGate;
 }
 
 interface State {
   error: string;
   errorMessage?: string;
-  metric?: T.Metric;
+  metric?: Metric;
   op?: string;
   scope: 'new' | 'overall';
 }
@@ -58,7 +59,7 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
     };
   }
 
-  getSinglePossibleOperator(metric: T.Metric) {
+  getSinglePossibleOperator(metric: Metric) {
     const operators = getPossibleOperators(metric);
     return Array.isArray(operators) ? undefined : operators;
   }
@@ -66,7 +67,7 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
   handleFormSubmit = () => {
     if (this.state.metric) {
       const { condition, qualityGate } = this.props;
-      const newCondition: T.Omit<T.Condition, 'id'> = {
+      const newCondition: Omit<Condition, 'id'> = {
         metric: this.state.metric.key,
         op: this.getSinglePossibleOperator(this.state.metric) || this.state.op,
         error: this.state.error
@@ -94,7 +95,7 @@ export default class ConditionModal extends React.PureComponent<Props, State> {
     });
   };
 
-  handleMetricChange = (metric: T.Metric) => {
+  handleMetricChange = (metric: Metric) => {
     this.setState({ metric, op: undefined, error: '' });
   };
 
index 3f70f2149e679c21010dd5612b886438a171a224..0b249ad49d2acaddf8a5b6fdab930ad6c3a271cc 100644 (file)
 import * as React from 'react';
 import SelectLegacy from '../../../components/controls/SelectLegacy';
 import { translate } from '../../../helpers/l10n';
+import { Metric } from '../../../types/types';
 import { getPossibleOperators } from '../utils';
 
 interface Props {
-  metric: T.Metric;
+  metric: Metric;
   onOperatorChange: (op: string) => void;
   op?: string;
 }
@@ -33,7 +34,7 @@ export default class ConditionOperator extends React.PureComponent<Props> {
     this.props.onOperatorChange(value);
   };
 
-  getLabel(op: string, metric: T.Metric) {
+  getLabel(op: string, metric: Metric) {
     return metric.type === 'RATING'
       ? translate('quality_gates.operator', op, 'rating')
       : translate('quality_gates.operator', op);
index 6d5d1fd5fd9e1052c7431bd0f17254fe117f5ecf..43c01d8f9b2bab42645f88a3e6b49833cec2063a 100644 (file)
@@ -27,18 +27,25 @@ import { Alert } from '../../../components/ui/Alert';
 import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
 import { isDiffMetric } from '../../../helpers/measures';
 import { MetricKey } from '../../../types/metrics';
+import {
+  AppState,
+  Condition as ConditionType,
+  Dict,
+  Metric,
+  QualityGate
+} from '../../../types/types';
 import Condition from './Condition';
 import ConditionModal from './ConditionModal';
 
 interface Props {
-  appState: Pick<T.AppState, 'branchesEnabled'>;
+  appState: Pick<AppState, 'branchesEnabled'>;
   canEdit: boolean;
-  conditions: T.Condition[];
-  metrics: T.Dict<T.Metric>;
-  onAddCondition: (condition: T.Condition) => void;
-  onRemoveCondition: (Condition: T.Condition) => void;
-  onSaveCondition: (newCondition: T.Condition, oldCondition: T.Condition) => void;
-  qualityGate: T.QualityGate;
+  conditions: ConditionType[];
+  metrics: Dict<Metric>;
+  onAddCondition: (condition: ConditionType) => void;
+  onRemoveCondition: (Condition: ConditionType) => void;
+  onSaveCondition: (newCondition: ConditionType, oldCondition: ConditionType) => void;
+  qualityGate: QualityGate;
   updatedConditionId?: number;
 }
 
@@ -51,7 +58,7 @@ const FORBIDDEN_METRICS: string[] = [
 ];
 
 export class Conditions extends React.PureComponent<Props> {
-  renderConditionsTable = (conditions: T.Condition[], scope: 'new' | 'overall') => {
+  renderConditionsTable = (conditions: ConditionType[], scope: 'new' | 'overall') => {
     const {
       qualityGate,
       metrics,
@@ -111,7 +118,7 @@ export class Conditions extends React.PureComponent<Props> {
       isDiffMetric(condition.metric)
     );
 
-    const duplicates: T.Condition[] = [];
+    const duplicates: ConditionType[] = [];
     const savedConditions = existingConditions.filter(condition => condition.id != null);
     savedConditions.forEach(condition => {
       const sameCount = savedConditions.filter(sample => sample.metric === condition.metric).length;
index fbace702f0ebbb37e2eb6f384e63d016f669b87d..7176ad5626f606218ef6f25e21d3430b00f0bdff 100644 (file)
@@ -25,11 +25,12 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../../helpers/l10n';
 import { getQualityGateUrl } from '../../../helpers/urls';
+import { QualityGate } from '../../../types/types';
 
 interface Props {
   onClose: () => void;
   onCopy: () => Promise<void>;
-  qualityGate: T.QualityGate;
+  qualityGate: QualityGate;
   router: Pick<Router, 'push'>;
 }
 
index db52e78926a86792ec6bd607270497fa81883d49..db949d401d15610631469baf78079f6da02d4b92 100644 (file)
@@ -24,10 +24,11 @@ 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 { QualityGate } from '../../../types/types';
 
 interface Props {
   onDelete: () => Promise<void>;
-  qualityGate: T.QualityGate;
+  qualityGate: QualityGate;
   router: Pick<Router, 'push'>;
 }
 
index 9b7f5c7cd333357546f15eda5d537a7c07e5e819..b7a10ee2de637d038f83782ac4a99ac8c1afae5e 100644 (file)
@@ -26,19 +26,20 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
 import { fetchMetrics } from '../../../store/rootActions';
 import { getMetrics, Store } from '../../../store/rootReducer';
+import { Condition, Dict, Metric, QualityGate } from '../../../types/types';
 import { addCondition, checkIfDefault, deleteCondition, replaceCondition } from '../utils';
 import DetailsContent from './DetailsContent';
 import DetailsHeader from './DetailsHeader';
 
 interface OwnProps {
   id: string;
-  onSetDefault: (qualityGate: T.QualityGate) => void;
-  qualityGates: T.QualityGate[];
+  onSetDefault: (qualityGate: QualityGate) => void;
+  qualityGates: QualityGate[];
   refreshQualityGates: () => Promise<void>;
 }
 
 interface StateToProps {
-  metrics: T.Dict<T.Metric>;
+  metrics: Dict<Metric>;
 }
 
 interface DispatchToProps {
@@ -49,7 +50,7 @@ type Props = StateToProps & DispatchToProps & OwnProps;
 
 interface State {
   loading: boolean;
-  qualityGate?: T.QualityGate;
+  qualityGate?: QualityGate;
   updatedConditionId?: number;
 }
 
@@ -90,7 +91,7 @@ export class Details extends React.PureComponent<Props, State> {
     );
   };
 
-  handleAddCondition = (condition: T.Condition) => {
+  handleAddCondition = (condition: Condition) => {
     this.setState(({ qualityGate }) => {
       if (!qualityGate) {
         return null;
@@ -103,7 +104,7 @@ export class Details extends React.PureComponent<Props, State> {
     });
   };
 
-  handleSaveCondition = (newCondition: T.Condition, oldCondition: T.Condition) => {
+  handleSaveCondition = (newCondition: Condition, oldCondition: Condition) => {
     this.setState(({ qualityGate }) => {
       if (!qualityGate) {
         return null;
@@ -116,7 +117,7 @@ export class Details extends React.PureComponent<Props, State> {
     });
   };
 
-  handleRemoveCondition = (condition: T.Condition) => {
+  handleRemoveCondition = (condition: Condition) => {
     this.setState(({ qualityGate }) => {
       if (!qualityGate) {
         return null;
@@ -135,7 +136,7 @@ export class Details extends React.PureComponent<Props, State> {
         return null;
       }
       this.props.onSetDefault(qualityGate);
-      const newQualityGate: T.QualityGate = {
+      const newQualityGate: QualityGate = {
         ...qualityGate,
         actions: { ...qualityGate.actions, delete: false, setAsDefault: false }
       };
index 07fc3d5179ca390081317966a3ada3d185d367b3..9fe3cd100077ecd86330a1f37a4be49feae99e0a 100644 (file)
@@ -21,17 +21,18 @@ import * as React from 'react';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { Alert } from '../../../components/ui/Alert';
 import { translate } from '../../../helpers/l10n';
+import { Condition, Dict, Metric, QualityGate } from '../../../types/types';
 import Conditions from './Conditions';
 import Projects from './Projects';
 import QualityGatePermissions from './QualityGatePermissions';
 
 export interface DetailsContentProps {
   isDefault?: boolean;
-  metrics: T.Dict<T.Metric>;
-  onAddCondition: (condition: T.Condition) => void;
-  onRemoveCondition: (Condition: T.Condition) => void;
-  onSaveCondition: (newCondition: T.Condition, oldCondition: T.Condition) => void;
-  qualityGate: T.QualityGate;
+  metrics: Dict<Metric>;
+  onAddCondition: (condition: Condition) => void;
+  onRemoveCondition: (Condition: Condition) => void;
+  onSaveCondition: (newCondition: Condition, oldCondition: Condition) => void;
+  qualityGate: QualityGate;
   updatedConditionId?: number;
 }
 
index 5bd11877f2a6cf5f5d85510934e13a50c73f6854..f84de737e8015e70a4cb3bad640d045713947f26 100644 (file)
@@ -23,6 +23,7 @@ import { Button } from '../../../components/controls/buttons';
 import ModalButton from '../../../components/controls/ModalButton';
 import Tooltip from '../../../components/controls/Tooltip';
 import { translate } from '../../../helpers/l10n';
+import { QualityGate } from '../../../types/types';
 import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
 import CopyQualityGateForm from './CopyQualityGateForm';
 import DeleteQualityGateForm from './DeleteQualityGateForm';
@@ -30,7 +31,7 @@ import RenameQualityGateForm from './RenameQualityGateForm';
 
 interface Props {
   onSetDefault: () => void;
-  qualityGate: T.QualityGate;
+  qualityGate: QualityGate;
   refreshItem: () => Promise<void>;
   refreshList: () => Promise<void>;
 }
index 873cb4e4870c3cf2ed0f80b5d4c98febeadc4165..e7dca0aaa67b8bdefc0960ea74d1ba647cd650b4 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import { Link } from 'react-router';
 import { translate } from '../../../helpers/l10n';
 import { getQualityGateUrl } from '../../../helpers/urls';
+import { QualityGate } from '../../../types/types';
 import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
 
 interface Props {
-  qualityGates: T.QualityGate[];
+  qualityGates: QualityGate[];
 }
 
 export default function List({ qualityGates }: Props) {
index 089d6fafce21e4cc29f8e751f79b0663743464dd..7a213d430a5759835b8dfd9bd7de3bc552151fe5 100644 (file)
@@ -21,12 +21,13 @@ import { sortBy } from 'lodash';
 import * as React from 'react';
 import SelectLegacy from '../../../components/controls/SelectLegacy';
 import { getLocalizedMetricDomain, translate } from '../../../helpers/l10n';
+import { Metric } from '../../../types/types';
 import { getLocalizedMetricNameNoDiffMetric } from '../utils';
 
 interface Props {
-  metric?: T.Metric;
-  metrics: T.Metric[];
-  onMetricChange: (metric: T.Metric) => void;
+  metric?: Metric;
+  metrics: Metric[];
+  onMetricChange: (metric: Metric) => void;
 }
 
 interface Option {
index 4c3067e598a55a899bcbbd1ba3c61671f0e12a26..9d2558a05ccaba147ef85c7d7148ed66d0f28515 100644 (file)
@@ -22,10 +22,11 @@ import { DeleteButton } from '../../../components/controls/buttons';
 import GroupIcon from '../../../components/icons/GroupIcon';
 import Avatar from '../../../components/ui/Avatar';
 import { Group, isUser } from '../../../types/quality-gates';
+import { UserBase } from '../../../types/types';
 
 export interface PermissionItemProps {
-  onClickDelete: (item: T.UserBase | Group) => void;
-  item: T.UserBase | Group;
+  onClickDelete: (item: UserBase | Group) => void;
+  item: UserBase | Group;
 }
 
 export default function PermissionItem(props: PermissionItemProps) {
index ef0b28780ac6585b505f1a2a71b5fff06897753f..f7a57ab52332728e529b98bbbcd073b7429f0e44 100644 (file)
@@ -29,10 +29,11 @@ import SelectList, {
   SelectListSearchParams
 } from '../../../components/controls/SelectList';
 import { translate } from '../../../helpers/l10n';
+import { QualityGate } from '../../../types/types';
 
 interface Props {
   canEdit?: boolean;
-  qualityGate: T.QualityGate;
+  qualityGate: QualityGate;
 }
 
 interface State {
index 2391486abe1e579726044c339a653d6542ac12ec..9844c11fd07d4e31106df326efc0ff2c6bf4c996 100644 (file)
@@ -28,10 +28,11 @@ import {
   searchUsers
 } from '../../../api/quality-gates';
 import { Group, isUser, SearchPermissionsParameters } from '../../../types/quality-gates';
+import { QualityGate, UserBase } from '../../../types/types';
 import QualityGatePermissionsRenderer from './QualityGatePermissionsRenderer';
 
 interface Props {
-  qualityGate: T.QualityGate;
+  qualityGate: QualityGate;
 }
 
 interface State {
@@ -39,8 +40,8 @@ interface State {
   submitting: boolean;
   loading: boolean;
   showAddModal: boolean;
-  permissionToDelete?: T.UserBase | Group;
-  users: T.UserBase[];
+  permissionToDelete?: UserBase | Group;
+  users: UserBase[];
 }
 
 export default class QualityGatePermissions extends React.Component<Props, State> {
@@ -95,7 +96,7 @@ export default class QualityGatePermissions extends React.Component<Props, State
     this.setState({ showAddModal: true });
   };
 
-  handleSubmitAddPermission = async (item: T.UserBase | Group) => {
+  handleSubmitAddPermission = async (item: UserBase | Group) => {
     const { qualityGate } = this.props;
     this.setState({ submitting: true });
 
@@ -135,11 +136,11 @@ export default class QualityGatePermissions extends React.Component<Props, State
     this.setState({ permissionToDelete: undefined });
   };
 
-  handleClickDeletePermission = (permissionToDelete?: T.UserBase | Group) => {
+  handleClickDeletePermission = (permissionToDelete?: UserBase | Group) => {
     this.setState({ permissionToDelete });
   };
 
-  handleConfirmDeletePermission = async (item: T.UserBase | Group) => {
+  handleConfirmDeletePermission = async (item: UserBase | Group) => {
     const { qualityGate } = this.props;
 
     let error = false;
index a4ae9357c1bfe1c9559efbb79e735d734217b617..18155f51d335a47cf7809cc89d508444c5308374 100644 (file)
@@ -21,20 +21,21 @@ import { debounce } from 'lodash';
 import * as React from 'react';
 import { searchGroups, searchUsers } from '../../../api/quality-gates';
 import { Group, SearchPermissionsParameters } from '../../../types/quality-gates';
+import { QualityGate, UserBase } from '../../../types/types';
 import QualityGatePermissionsAddModalRenderer from './QualityGatePermissionsAddModalRenderer';
 
 interface Props {
   onClose: () => void;
-  onSubmit: (selection: T.UserBase | Group) => void;
-  qualityGate: T.QualityGate;
+  onSubmit: (selection: UserBase | Group) => void;
+  qualityGate: QualityGate;
   submitting: boolean;
 }
 
 interface State {
   loading: boolean;
   query?: string;
-  searchResults: Array<T.UserBase | Group>;
-  selection?: T.UserBase | Group;
+  searchResults: Array<UserBase | Group>;
+  selection?: UserBase | Group;
 }
 
 const DEBOUNCE_DELAY = 250;
@@ -91,7 +92,7 @@ export default class QualityGatePermissionsAddModal extends React.Component<Prop
     }
   };
 
-  handleSelection = (selection: T.UserBase | Group) => {
+  handleSelection = (selection: UserBase | Group) => {
     this.setState({ selection });
   };
 
index bf1dc1944a5bd78cf5e45b7ba41f2d698870e1b0..efbb83991fd3f6ac49efeb99af4fa33cd36c60df 100644 (file)
@@ -25,20 +25,21 @@ import GroupIcon from '../../../components/icons/GroupIcon';
 import Avatar from '../../../components/ui/Avatar';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { Group, isUser } from '../../../types/quality-gates';
+import { UserBase } from '../../../types/types';
 
 export interface QualityGatePermissionsAddModalRendererProps {
   onClose: () => void;
   onInputChange: (query: string) => void;
   onSubmit: (event: React.SyntheticEvent<HTMLFormElement>) => void;
-  onSelection: (selection: T.UserBase | Group) => void;
+  onSelection: (selection: UserBase | Group) => void;
   submitting: boolean;
   loading: boolean;
   query: string;
-  searchResults: Array<T.UserBase | Group>;
-  selection?: T.UserBase | Group;
+  searchResults: Array<UserBase | Group>;
+  selection?: UserBase | Group;
 }
 
-type Option = (T.UserBase | Group) & { value: string };
+type Option = (UserBase | Group) & { value: string };
 
 export default function QualityGatePermissionsAddModalRenderer(
   props: QualityGatePermissionsAddModalRendererProps
index aab84606c75fd5d3d0c3f24ea6a2976b97369796..74dfc7a38517511e708bc45ad404b268feb903ed 100644 (file)
@@ -24,6 +24,7 @@ import ConfirmModal from '../../../components/controls/ConfirmModal';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
 import { Group, isUser } from '../../../types/quality-gates';
+import { QualityGate, UserBase } from '../../../types/types';
 import PermissionItem from './PermissionItem';
 import QualityGatePermissionsAddModal from './QualityGatePermissionsAddModal';
 
@@ -32,15 +33,15 @@ export interface QualityGatePermissionsRendererProps {
   loading: boolean;
   onClickAddPermission: () => void;
   onCloseAddPermission: () => void;
-  onSubmitAddPermission: (item: T.UserBase | Group) => void;
+  onSubmitAddPermission: (item: UserBase | Group) => void;
   onCloseDeletePermission: () => void;
-  onConfirmDeletePermission: (item: T.UserBase | Group) => void;
-  onClickDeletePermission: (item: T.UserBase | Group) => void;
-  permissionToDelete?: T.UserBase | Group;
-  qualityGate: T.QualityGate;
+  onConfirmDeletePermission: (item: UserBase | Group) => void;
+  onClickDeletePermission: (item: UserBase | Group) => void;
+  permissionToDelete?: UserBase | Group;
+  qualityGate: QualityGate;
   showAddModal: boolean;
   submitting: boolean;
-  users: T.UserBase[];
+  users: UserBase[];
 }
 
 export default function QualityGatePermissionsRenderer(props: QualityGatePermissionsRendererProps) {
index 8113666ba3e110c276b01dfb72af7e7fd78942dd..45dad5c864e5d559c9bb5b6629e5aae7c0c955f1 100644 (file)
@@ -23,11 +23,12 @@ import ConfirmModal from '../../../components/controls/ConfirmModal';
 import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../../helpers/l10n';
+import { QualityGate } from '../../../types/types';
 
 interface Props {
   onClose: () => void;
   onRename: () => Promise<void>;
-  qualityGate: T.QualityGate;
+  qualityGate: QualityGate;
 }
 
 interface State {
index 1776243fe989472eaa67a1dbb1d6d34c61ae1622..a2af32073f2603e66a763aeded4762c3c3812a1d 100644 (file)
  */
 import * as React from 'react';
 import SelectLegacy from '../../../components/controls/SelectLegacy';
+import { Metric } from '../../../types/types';
 
 interface Props {
   name: string;
   value: string;
-  metric: T.Metric;
+  metric: Metric;
   onChange: (value: string) => void;
 }
 
index 146f820c9d370d0b1e22c4bbd555df82f13c0f1f..edba64a5b11807bca27b8a46dca42d356f7ccd94 100644 (file)
@@ -21,29 +21,30 @@ import getStore from '../../app/utils/getStore';
 import { getLocalizedMetricName } from '../../helpers/l10n';
 import { isDiffMetric } from '../../helpers/measures';
 import { getMetricByKey } from '../../store/rootReducer';
+import { Condition, Metric, QualityGate } from '../../types/types';
 
-export function checkIfDefault(qualityGate: T.QualityGate, list: T.QualityGate[]): boolean {
+export function checkIfDefault(qualityGate: QualityGate, list: QualityGate[]): boolean {
   const finding = list.find(candidate => candidate.id === qualityGate.id);
   return (finding && finding.isDefault) || false;
 }
 
-export function addCondition(qualityGate: T.QualityGate, condition: T.Condition): T.QualityGate {
+export function addCondition(qualityGate: QualityGate, condition: Condition): QualityGate {
   const oldConditions = qualityGate.conditions || [];
   const conditions = [...oldConditions, condition];
   return { ...qualityGate, conditions };
 }
 
-export function deleteCondition(qualityGate: T.QualityGate, condition: T.Condition): T.QualityGate {
+export function deleteCondition(qualityGate: QualityGate, condition: Condition): QualityGate {
   const conditions =
     qualityGate.conditions && qualityGate.conditions.filter(candidate => candidate !== condition);
   return { ...qualityGate, conditions };
 }
 
 export function replaceCondition(
-  qualityGate: T.QualityGate,
-  newCondition: T.Condition,
-  oldCondition: T.Condition
-): T.QualityGate {
+  qualityGate: QualityGate,
+  newCondition: Condition,
+  oldCondition: Condition
+): QualityGate {
   const conditions =
     qualityGate.conditions &&
     qualityGate.conditions.map(candidate => {
@@ -52,7 +53,7 @@ export function replaceCondition(
   return { ...qualityGate, conditions };
 }
 
-export function getPossibleOperators(metric: T.Metric) {
+export function getPossibleOperators(metric: Metric) {
   if (metric.direction === 1) {
     return 'LT';
   } else if (metric.direction === -1) {
@@ -66,7 +67,7 @@ export function metricKeyExists(key: string) {
   return getMetricByKey(getStore().getState(), key) !== undefined;
 }
 
-function getNoDiffMetric(metric: T.Metric) {
+function getNoDiffMetric(metric: Metric) {
   const store = getStore().getState();
   const regularMetricKey = metric.key.replace(/^new_/, '');
   if (isDiffMetric(metric.key) && metricKeyExists(regularMetricKey)) {
@@ -78,6 +79,6 @@ function getNoDiffMetric(metric: T.Metric) {
   }
 }
 
-export function getLocalizedMetricNameNoDiffMetric(metric: T.Metric) {
+export function getLocalizedMetricNameNoDiffMetric(metric: Metric) {
   return getLocalizedMetricName(getNoDiffMetric(metric));
 }
index ef0d100ba138f226ba90598e7fe0cee25e995387..44bfa0560b2562a1b5418640edfbe8a7082af5c0 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Dict } from '../../../types/types';
 import ParameterChange from './ParameterChange';
 import SeverityChange from './SeverityChange';
 
 interface Props {
-  changes: T.Dict<string | null>;
+  changes: Dict<string | null>;
 }
 
 export default function ChangesList({ changes }: Props) {
index c74b3c05461c5b8de840ed788ab0dc8b666167ea..2b09c0fd60f59704a784a229672f86adfa95a1c6 100644 (file)
@@ -24,6 +24,7 @@ import { Button } from '../../../components/controls/buttons';
 import { lazyLoadComponent } from '../../../components/lazyLoadComponent';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
+import { RuleDetails } from '../../../types/types';
 
 const ActivationFormModal = lazyLoadComponent(
   () => import('../../coding-rules/components/ActivationFormModal'),
@@ -37,7 +38,7 @@ interface Props {
 }
 
 interface State {
-  rule?: T.RuleDetails;
+  rule?: RuleDetails;
   state: 'closed' | 'opening' | 'open';
 }
 
@@ -73,7 +74,7 @@ export default class ComparisonResultActivation extends React.PureComponent<Prop
     this.setState({ state: 'closed' });
   };
 
-  isOpen(state: State): state is { state: 'open'; rule: T.RuleDetails } {
+  isOpen(state: State): state is { state: 'open'; rule: RuleDetails } {
     return state.state === 'open';
   }
 
index 172fde88c4ebb1ee262b6030fb733c26e3292ef7..8265721ef32a2ee4f28429ef38a6a35a0f60b037 100644 (file)
@@ -25,10 +25,11 @@ import ChevronRightIcon from '../../../components/icons/ChevronRightIcon';
 import SeverityIcon from '../../../components/icons/SeverityIcon';
 import { translateWithParameters } from '../../../helpers/l10n';
 import { getRulesUrl } from '../../../helpers/urls';
+import { Dict } from '../../../types/types';
 import ComparisonEmpty from './ComparisonEmpty';
 import ComparisonResultActivation from './ComparisonResultActivation';
 
-type Params = T.Dict<string>;
+type Params = Dict<string>;
 
 interface Props extends CompareResponse {
   leftProfile: Profile;
index 883481de687daed7b05ff4bf98ddc45c540d3c5b..2f7ee6c757a4299059eab7770f39073719b41e49 100644 (file)
@@ -22,13 +22,14 @@ 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 '../../../helpers/l10n';
+import { Languages } from '../../../types/types';
 import '../styles.css';
 import { Exporter, Profile } from '../types';
 import { sortProfiles } from '../utils';
 
 interface Props {
   children: React.ReactElement<any>;
-  languages: T.Languages;
+  languages: Languages;
 }
 
 interface State {
index 1ff81921b64b434cca012f36a2950080e036b997..bbb0f39c3588ddf1b5952eaab401f8753c4306fb 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import { getProfileInheritance } from '../../../api/quality-profiles';
 import { Button } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
+import { ProfileInheritanceDetails } from '../../../types/types';
 import { Profile } from '../types';
 import ChangeParentForm from './ChangeParentForm';
 import ProfileInheritanceBox from './ProfileInheritanceBox';
@@ -33,11 +34,11 @@ interface Props {
 }
 
 interface State {
-  ancestors?: T.ProfileInheritanceDetails[];
-  children?: T.ProfileInheritanceDetails[];
+  ancestors?: ProfileInheritanceDetails[];
+  children?: ProfileInheritanceDetails[];
   formOpen: boolean;
   loading: boolean;
-  profile?: T.ProfileInheritanceDetails;
+  profile?: ProfileInheritanceDetails;
 }
 
 export default class ProfileInheritance extends React.PureComponent<Props, State> {
index d3fad78f1d15b6a2783376174bcd344ffe4208e2..3113a7b8c283626e2e36c740f1499aa3d19ee80d 100644 (file)
@@ -21,6 +21,7 @@ import classNames from 'classnames';
 import * as React from 'react';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { ProfileInheritanceDetails } from '../../../types/types';
 import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
 import ProfileLink from '../components/ProfileLink';
 
@@ -30,7 +31,7 @@ interface Props {
   displayLink?: boolean;
   extendsBuiltIn?: boolean;
   language: string;
-  profile: T.ProfileInheritanceDetails;
+  profile: ProfileInheritanceDetails;
   type?: string;
 }
 
index b3f42f3adfcee992aa2ed9c613b6340df501196a..01d6485668218b48c77b02d8a709ca6b449e94db 100644 (file)
@@ -26,6 +26,7 @@ import {
 } from '../../../api/quality-profiles';
 import { Button } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
+import { UserSelected } from '../../../types/types';
 import { Profile } from '../types';
 import ProfilePermissionsForm from './ProfilePermissionsForm';
 import ProfilePermissionsGroup from './ProfilePermissionsGroup';
@@ -43,7 +44,7 @@ interface State {
   addUserForm: boolean;
   groups?: Group[];
   loading: boolean;
-  users?: T.UserSelected[];
+  users?: UserSelected[];
 }
 
 export default class ProfilePermissions extends React.PureComponent<Props, State> {
@@ -101,7 +102,7 @@ export default class ProfilePermissions extends React.PureComponent<Props, State
     }
   };
 
-  handleUserAdd = (addedUser: T.UserSelected) => {
+  handleUserAdd = (addedUser: UserSelected) => {
     if (this.mounted) {
       this.setState((state: State) => ({
         addUserForm: false,
@@ -110,7 +111,7 @@ export default class ProfilePermissions extends React.PureComponent<Props, State
     }
   };
 
-  handleUserDelete = (removedUser: T.UserSelected) => {
+  handleUserDelete = (removedUser: UserSelected) => {
     if (this.mounted) {
       this.setState((state: State) => ({
         users: state.users && state.users.filter(user => user !== removedUser)
@@ -118,7 +119,7 @@ export default class ProfilePermissions extends React.PureComponent<Props, State
     }
   };
 
-  handleGroupAdd = (addedGroup: T.Group) => {
+  handleGroupAdd = (addedGroup: Group) => {
     if (this.mounted) {
       this.setState((state: State) => ({
         addUserForm: false,
@@ -127,7 +128,7 @@ export default class ProfilePermissions extends React.PureComponent<Props, State
     }
   };
 
-  handleGroupDelete = (removedGroup: T.Group) => {
+  handleGroupDelete = (removedGroup: Group) => {
     if (this.mounted) {
       this.setState((state: State) => ({
         groups: state.groups && state.groups.filter(group => group !== removedGroup)
index 216aadd8f068f104ccb8123638e13785f6b1812b..361bae1eccfc393b00157f2a3c08d39bc7dc6cd3 100644 (file)
@@ -28,18 +28,19 @@ import {
 import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons';
 import Modal from '../../../components/controls/Modal';
 import { translate } from '../../../helpers/l10n';
+import { UserSelected } from '../../../types/types';
 import { Group } from './ProfilePermissions';
 import ProfilePermissionsFormSelect from './ProfilePermissionsFormSelect';
 
 interface Props {
   onClose: () => void;
   onGroupAdd: (group: Group) => void;
-  onUserAdd: (user: T.UserSelected) => void;
+  onUserAdd: (user: UserSelected) => void;
   profile: { language: string; name: string };
 }
 
 interface State {
-  selected?: T.UserSelected | Group;
+  selected?: UserSelected | Group;
   submitting: boolean;
 }
 
@@ -61,7 +62,7 @@ export default class ProfilePermissionsForm extends React.PureComponent<Props, S
     }
   };
 
-  handleUserAdd = (user: T.UserSelected) => {
+  handleUserAdd = (user: UserSelected) => {
     const {
       profile: { language, name }
     } = this.props;
@@ -88,8 +89,8 @@ export default class ProfilePermissionsForm extends React.PureComponent<Props, S
     const { selected } = this.state;
     if (selected) {
       this.setState({ submitting: true });
-      if ((selected as T.UserSelected).login !== undefined) {
-        this.handleUserAdd(selected as T.UserSelected);
+      if ((selected as UserSelected).login !== undefined) {
+        this.handleUserAdd(selected as UserSelected);
       } else {
         this.handleGroupAdd(selected as Group);
       }
@@ -113,7 +114,7 @@ export default class ProfilePermissionsForm extends React.PureComponent<Props, S
     ]);
   };
 
-  handleValueChange = (selected: T.UserSelected | Group) => {
+  handleValueChange = (selected: UserSelected | Group) => {
     this.setState({ selected });
   };
 
index df95a313f114576d84b7c45ea79434563b04c130..08a848ce4143f6acbd03c228094c6bce33d930df 100644 (file)
@@ -23,9 +23,10 @@ import SelectLegacy from '../../../components/controls/SelectLegacy';
 import GroupIcon from '../../../components/icons/GroupIcon';
 import Avatar from '../../../components/ui/Avatar';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { UserSelected } from '../../../types/types';
 import { Group } from './ProfilePermissions';
 
-type Option = T.UserSelected | Group;
+type Option = UserSelected | Group;
 type OptionWithValue = Option & { value: string };
 
 interface Props {
@@ -112,8 +113,8 @@ export default class ProfilePermissionsFormSelect extends React.PureComponent<Pr
   }
 }
 
-function isUser(option: Option): option is T.UserSelected {
-  return (option as T.UserSelected).login !== undefined;
+function isUser(option: Option): option is UserSelected {
+  return (option as UserSelected).login !== undefined;
 }
 
 function getStringValue(option: Option) {
index 899c3f906cf8838e0b4714eda4304a2efded9b79..0eb0d0158878213613d00568ac9556b6bacba001 100644 (file)
@@ -24,11 +24,12 @@ import { DeleteButton, ResetButtonLink, SubmitButton } from '../../../components
 import SimpleModal, { ChildrenProps } from '../../../components/controls/SimpleModal';
 import Avatar from '../../../components/ui/Avatar';
 import { translate } from '../../../helpers/l10n';
+import { UserSelected } from '../../../types/types';
 
 interface Props {
-  onDelete: (user: T.UserSelected) => void;
+  onDelete: (user: UserSelected) => void;
   profile: { language: string; name: string };
-  user: T.UserSelected;
+  user: UserSelected;
 }
 
 interface State {
index c1be69c17e7c4e45d855cc38fdfbf91daea10296..bad314f084cbd285eff1992944b7bc6c1464efb8 100644 (file)
@@ -26,6 +26,7 @@ import { Button } from '../../../components/controls/buttons';
 import Tooltip from '../../../components/controls/Tooltip';
 import { translate } from '../../../helpers/l10n';
 import { getRulesUrl } from '../../../helpers/urls';
+import { Dict } from '../../../types/types';
 import { Profile } from '../types';
 import ProfileRulesDeprecatedWarning from './ProfileRulesDeprecatedWarning';
 import ProfileRulesRowOfType from './ProfileRulesRowOfType';
@@ -45,8 +46,8 @@ interface ByType {
 
 interface State {
   activatedTotal: number | null;
-  activatedByType: T.Dict<ByType>;
-  allByType: T.Dict<ByType>;
+  activatedByType: Dict<ByType>;
+  allByType: Dict<ByType>;
   compareToSonarWay: { profile: string; profileName: string; missingRuleCount: number } | null;
   total: number | null;
 }
index 42d21ab29a2f72e07b8ef8525bef37adf39fbcaf..d0ae297ef8da315ac24ce2fd25e7e30414610652 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import { addGroup, addUser, searchGroups, searchUsers } from '../../../../api/quality-profiles';
 import { mockGroup, mockUser } from '../../../../helpers/testMocks';
 import { submit, waitAndUpdate } from '../../../../helpers/testUtils';
+import { UserSelected } from '../../../../types/types';
 import ProfilePermissionsForm from '../ProfilePermissionsForm';
 import ProfilePermissionsFormSelect from '../ProfilePermissionsFormSelect';
 
@@ -43,7 +44,7 @@ it('correctly adds users', async () => {
   const onUserAdd = jest.fn();
   const wrapper = shallowRender({ onUserAdd });
 
-  const user: T.UserSelected = { ...mockUser(), name: 'John doe', active: true, selected: true };
+  const user: UserSelected = { ...mockUser(), name: 'John doe', active: true, selected: true };
   wrapper.instance().handleValueChange(user);
   expect(wrapper.find(ProfilePermissionsFormSelect).prop('selected')).toBe(user);
 
index 7ba649fe3c3230f101be270d0485868f66332f12..57b11605b5596730f4ac7e2b7777389fd6b53661 100644 (file)
@@ -21,6 +21,7 @@ import { shallow } from 'enzyme';
 import * as React from 'react';
 import { removeUser } from '../../../../api/quality-profiles';
 import { click } from '../../../../helpers/testUtils';
+import { UserSelected } from '../../../../types/types';
 import ProfilePermissionsUser from '../ProfilePermissionsUser';
 
 jest.mock('../../../../api/quality-profiles', () => ({
@@ -28,7 +29,7 @@ jest.mock('../../../../api/quality-profiles', () => ({
 }));
 
 const profile = { language: 'js', name: 'Sonar way' };
-const user: T.UserSelected = { login: 'luke', name: 'Luke Skywalker', selected: true };
+const user: UserSelected = { login: 'luke', name: 'Luke Skywalker', selected: true };
 
 beforeEach(() => {
   jest.clearAllMocks();
index e22e81e24609a8db5373b25a976a965c994483b5..03c084b8498a76060e23208ded9cdd76d3edd9e7 100644 (file)
@@ -25,17 +25,18 @@ import { toShortNotSoISOString } from '../../../helpers/dates';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
 import { getRulesUrl } from '../../../helpers/urls';
+import { Dict, Rule, RuleActivation } from '../../../types/types';
 
 const RULES_LIMIT = 10;
 
-function parseRules(rules: T.Rule[], actives?: T.Dict<T.RuleActivation[]>): ExtendedRule[] {
+function parseRules(rules: Rule[], actives?: Dict<RuleActivation[]>): ExtendedRule[] {
   return rules.map(rule => {
     const activations = actives && actives[rule.key];
     return { ...rule, activations: activations ? activations.length : 0 };
   });
 }
 
-interface ExtendedRule extends T.Rule {
+interface ExtendedRule extends Rule {
   activations: number;
 }
 
index c1256df08507cc124f11d2843fcf78f5c247ea11..8e3e02902fa7c67cde65e7d9b1d9d5502e60e4b1 100644 (file)
@@ -23,12 +23,13 @@ import * as React from 'react';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import { Alert } from '../../../components/ui/Alert';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { Dict, Language } from '../../../types/types';
 import { Profile } from '../types';
 import ProfilesListHeader from './ProfilesListHeader';
 import ProfilesListRow from './ProfilesListRow';
 
 interface Props {
-  languages: T.Language[];
+  languages: Language[];
   location: Pick<Location, 'query'>;
   profiles: Profile[];
   updateProfiles: () => Promise<void>;
@@ -95,10 +96,7 @@ export default class ProfilesList extends React.PureComponent<Props> {
     const { profiles, languages } = this.props;
     const { language } = this.props.location.query;
 
-    const profilesIndex: T.Dict<Profile[]> = groupBy<Profile>(
-      profiles,
-      profile => profile.language
-    );
+    const profilesIndex: Dict<Profile[]> = groupBy<Profile>(profiles, profile => profile.language);
 
     const profilesToShow = language ? pick(profilesIndex, language) : profilesIndex;
 
index 03c64fcac44b6750baaa8c64ae998dac45f620ee..6c6e9c17008146094d755bb225a20a4274b82e78 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { Profile as BaseProfile } from '../../api/quality-profiles';
+import { Dict } from '../../types/types';
 
 export interface Profile extends BaseProfile {
   depth: number;
@@ -34,7 +35,7 @@ export interface ProfileChangelogEvent {
   action: string;
   authorName: string;
   date: string;
-  params?: T.Dict<string | null>;
+  params?: Dict<string | null>;
   ruleKey: string;
   ruleName: string;
 }
index 12a879b338ef97097d5d3a7a20b9ccd39339ae05..4d6f1f2a08ee12b56bd2517f84181dd020a04ba1 100644 (file)
@@ -40,6 +40,7 @@ import {
   HotspotStatusFilter,
   RawHotspot
 } from '../../types/security-hotspots';
+import { Component, CurrentUser, Dict } from '../../types/types';
 import SecurityHotspotsAppRenderer from './SecurityHotspotsAppRenderer';
 import './styles.css';
 import { SECURITY_STANDARDS } from './utils';
@@ -52,8 +53,8 @@ interface DispatchProps {
 
 interface OwnProps {
   branchLike?: BranchLike;
-  currentUser: T.CurrentUser;
-  component: T.Component;
+  currentUser: CurrentUser;
+  component: Component;
   location: Location;
   router: Router;
 }
@@ -270,7 +271,7 @@ export class SecurityHotspotsApp extends React.PureComponent<Props, State> {
     }
 
     if (filterByCategory || filterByCWE || filterByFile) {
-      const hotspotFilters: T.Dict<string> = {};
+      const hotspotFilters: Dict<string> = {};
 
       if (filterByCategory) {
         hotspotFilters[filterByCategory.standard] = filterByCategory.category;
index 8976984bdde908b2ed7d868fd6a2b9177dd4c764..a9e353e1771abdce4820f90a9e640350e993383a 100644 (file)
@@ -29,6 +29,7 @@ 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';
+import { Component, StandardSecurityCategories } from '../../types/types';
 import EmptyHotspotsPage from './components/EmptyHotspotsPage';
 import FilterBar from './components/FilterBar';
 import HotspotList from './components/HotspotList';
@@ -38,7 +39,7 @@ import './styles.css';
 
 export interface SecurityHotspotsAppRendererProps {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   filterByCategory?: {
     standard: SecurityStandard;
     category: string;
@@ -60,7 +61,7 @@ export interface SecurityHotspotsAppRendererProps {
   onSwitchStatusFilter: (option: HotspotStatusFilter) => void;
   onUpdateHotspot: (hotspotKey: string) => Promise<void>;
   selectedHotspot: RawHotspot | undefined;
-  securityCategories: T.StandardSecurityCategories;
+  securityCategories: StandardSecurityCategories;
   standards: Standards;
 }
 
index 295b6bc67149d28b41a00eae1ba9a5acca047936..2f45f29a9da8e6e1617a3713f3fdab8216ffe8de 100644 (file)
@@ -27,6 +27,7 @@ import {
   ReviewHistoryType,
   RiskExposure
 } from '../../../types/security-hotspots';
+import { IssueChangelog } from '../../../types/types';
 import {
   getHotspotReviewHistory,
   getStatusAndResolutionFromStatusOption,
@@ -152,7 +153,7 @@ describe('mapRules', () => {
 
 describe('getHotspotReviewHistory', () => {
   it('should properly create the review history', () => {
-    const changelogElement: T.IssueChangelog = {
+    const changelogElement: IssueChangelog = {
       creationDate: '2018-10-01',
       isUserActive: true,
       user: 'me',
index ffbb0d81a72d0a32837203eec06327c63d4523ab..9c5df620fc3d4c29988aeacd9a5638b5db8a802d 100644 (file)
@@ -29,10 +29,11 @@ import { translate } from '../../../helpers/l10n';
 import { isLoggedIn } from '../../../helpers/users';
 import { ComponentQualifier } from '../../../types/component';
 import { HotspotFilters, HotspotStatusFilter } from '../../../types/security-hotspots';
+import { Component, CurrentUser } from '../../../types/types';
 
 export interface FilterBarProps {
-  currentUser: T.CurrentUser;
-  component: T.Component;
+  currentUser: CurrentUser;
+  component: Component;
   filters: HotspotFilters;
   hotspotsReviewedMeasure?: string;
   isStaticListOfHotspots: boolean;
index 3f73800926e847b436173096c9d347c4107b28a6..25683e66923b5ad4545970ee0851092bbeca4436 100644 (file)
@@ -25,6 +25,7 @@ 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 { Dict, StandardSecurityCategories } from '../../../types/types';
 import { groupByCategory, RISK_EXPOSURE_LEVELS } from '../utils';
 import HotspotCategory from './HotspotCategory';
 import './HotspotList.css';
@@ -36,13 +37,13 @@ interface Props {
   loadingMore: boolean;
   onHotspotClick: (hotspot: RawHotspot) => void;
   onLoadMore: () => void;
-  securityCategories: T.StandardSecurityCategories;
+  securityCategories: StandardSecurityCategories;
   selectedHotspot: RawHotspot;
   statusFilter: HotspotStatusFilter;
 }
 
 interface State {
-  expandedCategories: T.Dict<boolean>;
+  expandedCategories: Dict<boolean>;
   groupedHotspots: Array<{
     risk: RiskExposure;
     categories: Array<{ key: string; hotspots: RawHotspot[]; title: string }>;
@@ -88,7 +89,7 @@ export default class HotspotList extends React.Component<Props, State> {
     removeSideBarClass();
   }
 
-  groupHotspots = (hotspots: RawHotspot[], securityCategories: T.StandardSecurityCategories) => {
+  groupHotspots = (hotspots: RawHotspot[], securityCategories: StandardSecurityCategories) => {
     const risks = groupBy(hotspots, h => h.vulnerabilityProbability);
 
     return RISK_EXPOSURE_LEVELS.map(risk => ({
index b358850b3ca962de3edbe6c863bdf370eb66755f..cfac5a9fb5e1d4b6b5ce076b40a75d670c50e71a 100644 (file)
@@ -28,10 +28,11 @@ import { Button } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
 import { isLoggedIn } from '../../../helpers/users';
 import { Hotspot } from '../../../types/security-hotspots';
+import { CurrentUser } from '../../../types/types';
 import HotspotReviewHistory from './HotspotReviewHistory';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   hotspot: Hotspot;
   commentTextRef: React.RefObject<HTMLTextAreaElement>;
   onCommentUpdate: () => void;
index c8fad0031047cacb12078af62ed4378c5f77d1e7..d438c65123d1654eca992683317993ffbfac18c2 100644 (file)
@@ -24,12 +24,13 @@ import { getBranchLikeQuery } from '../../../helpers/branch-like';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier } from '../../../types/component';
 import { Hotspot } from '../../../types/security-hotspots';
+import { Component, ExpandDirection, SourceLine } from '../../../types/types';
 import { constructSourceViewerFile } from '../utils';
 import HotspotSnippetContainerRenderer from './HotspotSnippetContainerRenderer';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   hotspot: Hotspot;
 }
 
@@ -37,7 +38,7 @@ interface State {
   highlightedSymbols: string[];
   lastLine?: number;
   loading: boolean;
-  sourceLines: T.SourceLine[];
+  sourceLines: SourceLine[];
 }
 
 const BUFFER_LINES = 5;
@@ -66,7 +67,7 @@ export default class HotspotSnippetContainer extends React.Component<Props, Stat
     this.mounted = false;
   }
 
-  checkLastLine(lines: T.SourceLine[], target: number): number | undefined {
+  checkLastLine(lines: SourceLine[], target: number): number | undefined {
     if (lines.length < 1) {
       return undefined;
     }
@@ -100,7 +101,7 @@ export default class HotspotSnippetContainer extends React.Component<Props, Stat
       from,
       to,
       ...getBranchLikeQuery(branchLike)
-    }).catch(() => [] as T.SourceLine[]);
+    }).catch(() => [] as SourceLine[]);
 
     if (this.mounted) {
       const lastLine = this.checkLastLine(sourceLines, to);
@@ -111,7 +112,7 @@ export default class HotspotSnippetContainer extends React.Component<Props, Stat
     }
   }
 
-  handleExpansion = (direction: T.ExpandDirection) => {
+  handleExpansion = (direction: ExpandDirection) => {
     const { branchLike, hotspot } = this.props;
     const { sourceLines } = this.state;
 
index 975abfb7dbf31177f63aa97330526ad2155f6405..176eb60a7492a66326ce54e2c9816579c44856b6 100644 (file)
@@ -24,6 +24,12 @@ import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
 import { BranchLike } from '../../../types/branch-like';
 import { Hotspot } from '../../../types/security-hotspots';
+import {
+  ExpandDirection,
+  LinearIssueLocation,
+  SourceLine,
+  SourceViewerFile
+} from '../../../types/types';
 import SnippetViewer from '../../issues/crossComponentSourceViewer/SnippetViewer';
 
 export interface HotspotSnippetContainerRendererProps {
@@ -32,11 +38,11 @@ export interface HotspotSnippetContainerRendererProps {
   highlightedSymbols: string[];
   hotspot: Hotspot;
   loading: boolean;
-  locations: { [line: number]: T.LinearIssueLocation[] };
-  onExpandBlock: (direction: T.ExpandDirection) => Promise<void>;
+  locations: { [line: number]: LinearIssueLocation[] };
+  onExpandBlock: (direction: ExpandDirection) => Promise<void>;
   onSymbolClick: (symbols: string[]) => void;
-  sourceLines: T.SourceLine[];
-  sourceViewerFile: T.SourceViewerFile;
+  sourceLines: SourceLine[];
+  sourceViewerFile: SourceViewerFile;
 }
 
 const noop = () => undefined;
index 6751bb68ab7f1ca94d046875146bf22c2c98aad3..d96a5a74a135986651a5502f78ca52a1976a417e 100644 (file)
@@ -26,17 +26,18 @@ import {
   HotspotStatusFilter,
   HotspotStatusOption
 } from '../../../types/security-hotspots';
+import { Component, StandardSecurityCategories } from '../../../types/types';
 import { getStatusFilterFromStatusOption } from '../utils';
 import HotspotViewerRenderer from './HotspotViewerRenderer';
 
 interface Props {
   branchLike?: BranchLike;
-  component: T.Component;
+  component: Component;
   hotspotKey: string;
   hotspotsReviewedMeasure?: string;
   onSwitchStatusFilter: (option: HotspotStatusFilter) => void;
   onUpdateHotspot: (hotspotKey: string) => Promise<void>;
-  securityCategories: T.StandardSecurityCategories;
+  securityCategories: StandardSecurityCategories;
 }
 
 interface State {
index 8b0e0a1bf3cae2a4bbdc17dd7a54c6db72b931b5..ce30e9a574b32cf47e22f2c007d21097d0b0e065 100644 (file)
@@ -35,6 +35,7 @@ import {
 import { isLoggedIn } from '../../../helpers/users';
 import { BranchLike } from '../../../types/branch-like';
 import { Hotspot, HotspotStatusOption } from '../../../types/security-hotspots';
+import { Component, CurrentUser, StandardSecurityCategories } from '../../../types/types';
 import Assignee from './assignee/Assignee';
 import HotspotOpenInIdeButton from './HotspotOpenInIdeButton';
 import HotspotReviewHistoryAndComments from './HotspotReviewHistoryAndComments';
@@ -46,8 +47,8 @@ import StatusUpdateSuccessModal from './StatusUpdateSuccessModal';
 
 export interface HotspotViewerRendererProps {
   branchLike?: BranchLike;
-  component: T.Component;
-  currentUser: T.CurrentUser;
+  component: Component;
+  currentUser: CurrentUser;
   hotspot?: Hotspot;
   hotspotsReviewedMeasure?: string;
   lastStatusChangedTo?: HotspotStatusOption;
@@ -58,7 +59,7 @@ export interface HotspotViewerRendererProps {
   onShowCommentForm: () => void;
   onSwitchFilterToStatusOfUpdatedHotspot: () => void;
   showStatusUpdateSuccessModal: boolean;
-  securityCategories: T.StandardSecurityCategories;
+  securityCategories: StandardSecurityCategories;
 }
 
 export function HotspotViewerRenderer(props: HotspotViewerRendererProps) {
index dbc6c822822da580dd763cc90b3bd470b154e876..31f38449e4f4de4c8e340d0114ab05d6afa10549 100644 (file)
@@ -24,10 +24,11 @@ import { withCurrentUser } from '../../../../components/hoc/withCurrentUser';
 import { translate, translateWithParameters } from '../../../../helpers/l10n';
 import { isLoggedIn } from '../../../../helpers/users';
 import { Hotspot, HotspotStatus } from '../../../../types/security-hotspots';
+import { CurrentUser, UserActive } from '../../../../types/types';
 import AssigneeRenderer from './AssigneeRenderer';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   hotspot: Hotspot;
 
   onAssigneeChange: () => void;
@@ -61,7 +62,7 @@ export class Assignee extends React.PureComponent<Props, State> {
     this.setState({ editing: false });
   };
 
-  handleAssign = (newAssignee: T.UserActive) => {
+  handleAssign = (newAssignee: UserActive) => {
     this.setState({ loading: true });
     assignSecurityHotspot(this.props.hotspot.key, {
       assignee: newAssignee?.login
index 78235489ac512dde5ef4fd62d07d1e57c2516f92..fd9c476240f972bd56a4428497fe2012359760bc 100644 (file)
@@ -23,6 +23,7 @@ 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 { LoggedInUser, UserActive, UserBase } from '../../../../types/types';
 import AssigneeSelection from './AssigneeSelection';
 
 export interface AssigneeRendererProps {
@@ -30,10 +31,10 @@ export interface AssigneeRendererProps {
   editing: boolean;
   loading: boolean;
 
-  assignee?: T.UserBase;
-  loggedInUser?: T.LoggedInUser;
+  assignee?: UserBase;
+  loggedInUser?: LoggedInUser;
 
-  onAssign: (user: T.UserActive) => void;
+  onAssign: (user: UserActive) => void;
   onEnterEditionMode: () => void;
   onExitEditionMode: () => void;
 }
index 4469a4d3d6b865b3996dd52b6563bb1b18ca288d..7e46c9ca59c2b3c5a003e4cd39e7b8f57fdc205d 100644 (file)
@@ -23,22 +23,23 @@ import { searchUsers } from '../../../../api/users';
 import { KeyboardCodes } from '../../../../helpers/keycodes';
 import { translate } from '../../../../helpers/l10n';
 import { isUserActive } from '../../../../helpers/users';
+import { LoggedInUser, UserActive } from '../../../../types/types';
 import AssigneeSelectionRenderer from './AssigneeSelectionRenderer';
 
 interface Props {
   allowCurrentUserSelection: boolean;
-  loggedInUser: T.LoggedInUser;
-  onSelect: (user: T.UserActive) => void;
+  loggedInUser: LoggedInUser;
+  onSelect: (user: UserActive) => void;
 }
 
 interface State {
-  highlighted?: T.UserActive;
+  highlighted?: UserActive;
   loading: boolean;
   query?: string;
-  suggestedUsers: T.UserActive[];
+  suggestedUsers: UserActive[];
 }
 
-const UNASSIGNED: T.UserActive = { login: '', name: translate('unassigned') };
+const UNASSIGNED: UserActive = { login: '', name: translate('unassigned') };
 
 export default class AssigneeSelection extends React.PureComponent<Props, State> {
   mounted = false;
@@ -92,7 +93,7 @@ export default class AssigneeSelection extends React.PureComponent<Props, State>
           this.setState({
             loading: false,
             query,
-            suggestedUsers: (result.users.filter(isUserActive) as T.UserActive[]).concat(UNASSIGNED)
+            suggestedUsers: (result.users.filter(isUserActive) as UserActive[]).concat(UNASSIGNED)
           });
         }
       })
index a7add0ef13e7d162ef411c00683e7f52c360a4ce..f958dcb6d942448114b096abda051ab3fc51c93e 100644 (file)
@@ -25,16 +25,17 @@ import Avatar from '../../../../components/ui/Avatar';
 import DeferredSpinner from '../../../../components/ui/DeferredSpinner';
 import { PopupPlacement } from '../../../../components/ui/popups';
 import { translate } from '../../../../helpers/l10n';
+import { UserActive } from '../../../../types/types';
 import './AssigneeSelection.css';
 
 export interface HotspotAssigneeSelectRendererProps {
-  highlighted?: T.UserActive;
+  highlighted?: UserActive;
   loading: boolean;
   onKeyDown: (event: React.KeyboardEvent) => void;
   onSearch: (query: string) => void;
-  onSelect: (user?: T.UserActive) => void;
+  onSelect: (user?: UserActive) => void;
   query?: string;
-  suggestedUsers?: T.UserActive[];
+  suggestedUsers?: UserActive[];
 }
 
 export default function AssigneeSelectionRenderer(props: HotspotAssigneeSelectRendererProps) {
index ce18db2a847c6fa061863f4027cdb834d617e00d..a882f9760cf6f6f50f85be88a26a42d3dfca86f1 100644 (file)
@@ -25,6 +25,7 @@ import { mockHotspot } from '../../../../../helpers/mocks/security-hotspots';
 import { mockCurrentUser, mockUser } from '../../../../../helpers/testMocks';
 import { waitAndUpdate } from '../../../../../helpers/testUtils';
 import { HotspotStatus } from '../../../../../types/security-hotspots';
+import { UserActive } from '../../../../../types/types';
 import { Assignee } from '../Assignee';
 import AssigneeRenderer from '../AssigneeRenderer';
 
@@ -58,9 +59,9 @@ it('should handle edition event correctly', () => {
 });
 
 it.each([
-  ['assign to user', mockUser() as T.UserActive],
-  ['unassign', { login: '', name: 'unassigned' } as T.UserActive]
-])('should handle %s event', async (_, user: T.UserActive) => {
+  ['assign to user', mockUser() as UserActive],
+  ['unassign', { login: '', name: 'unassigned' } as UserActive]
+])('should handle %s event', async (_, user: UserActive) => {
   const hotspot = mockHotspot();
   const onAssigneeChange = jest.fn();
 
index 7d5e5140cc6207ea85bc9c9761c7238101ca8693..7766cbb21b46c4b27e147ffe54253da6bf48feb7 100644 (file)
@@ -23,6 +23,7 @@ import { EditButton } from '../../../../../components/controls/buttons';
 import OutsideClickHandler from '../../../../../components/controls/OutsideClickHandler';
 import { mockLoggedInUser, mockUser } from '../../../../../helpers/testMocks';
 import { click } from '../../../../../helpers/testUtils';
+import { UserActive } from '../../../../../types/types';
 import AssigneeRenderer, { AssigneeRendererProps } from '../AssigneeRenderer';
 import AssigneeSelection from '../AssigneeSelection';
 
@@ -57,7 +58,7 @@ it('should propagate calls correctly', () => {
   wrapper
     .find(AssigneeSelection)
     .props()
-    .onSelect(newAssignee as T.UserActive);
+    .onSelect(newAssignee as UserActive);
   expect(onAssign).toHaveBeenCalledWith(newAssignee);
 
   wrapper
index 73fa33023505608fe9545a16b88d3020eabb9fb6..5b200d3c85f7070d46da780ee24f45d02c7f026b 100644 (file)
@@ -23,6 +23,7 @@ import { searchUsers } from '../../../../../api/users';
 import { KeyboardCodes } from '../../../../../helpers/keycodes';
 import { mockLoggedInUser, mockUser } from '../../../../../helpers/testMocks';
 import { waitAndUpdate } from '../../../../../helpers/testUtils';
+import { UserActive } from '../../../../../types/types';
 import AssigneeSelection from '../AssigneeSelection';
 
 jest.mock('../../../../../api/users', () => ({
@@ -36,9 +37,9 @@ it('should render correctly', () => {
 it('should handle keydown', () => {
   const mockEvent = (code: KeyboardCodes) => ({ preventDefault: jest.fn(), nativeEvent: { code } });
   const suggestedUsers = [
-    mockUser({ login: '1' }) as T.UserActive,
-    mockUser({ login: '2' }) as T.UserActive,
-    mockUser({ login: '3' }) as T.UserActive
+    mockUser({ login: '1' }) as UserActive,
+    mockUser({ login: '2' }) as UserActive,
+    mockUser({ login: '3' }) as UserActive
   ];
 
   const onSelect = jest.fn();
index e0694d8ef2b9d0eace126a43feffdbd333372317..a4a49944f8084cb37629d943398944892c6b9ca4 100644 (file)
@@ -20,6 +20,7 @@
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { mockUser } from '../../../../../helpers/testMocks';
+import { UserActive } from '../../../../../types/types';
 import AssigneeSelectionRenderer, {
   HotspotAssigneeSelectRendererProps
 } from '../AssigneeSelectionRenderer';
@@ -28,17 +29,17 @@ it('should render correctly', () => {
   expect(shallowRender()).toMatchSnapshot();
   expect(shallowRender({ loading: true })).toMatchSnapshot('loading');
 
-  const highlightedUser = mockUser({ login: 'highlighted' }) as T.UserActive;
+  const highlightedUser = mockUser({ login: 'highlighted' }) as UserActive;
   expect(
     shallowRender({
       highlighted: highlightedUser,
-      suggestedUsers: [mockUser() as T.UserActive, highlightedUser]
+      suggestedUsers: [mockUser() as UserActive, highlightedUser]
     })
   ).toMatchSnapshot('open with results');
 });
 
 it('should call onSelect when clicked', () => {
-  const user = mockUser() as T.UserActive;
+  const user = mockUser() as UserActive;
   const onSelect = jest.fn();
   const wrapper = shallowRender({
     onSelect,
index 689eb93c3027f84871d08b4fbe4ebc7bace0c84c..918fd20945a6ab46be49c85895b96979f1bbabfa 100644 (file)
@@ -29,12 +29,13 @@ import { PopupPlacement } from '../../../../components/ui/popups';
 import { translate } from '../../../../helpers/l10n';
 import { isLoggedIn } from '../../../../helpers/users';
 import { Hotspot, HotspotStatusOption } from '../../../../types/security-hotspots';
+import { CurrentUser } from '../../../../types/types';
 import { getStatusOptionFromStatusAndResolution } from '../../utils';
 import StatusDescription from './StatusDescription';
 import StatusSelection from './StatusSelection';
 
 export interface StatusProps {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   hotspot: Hotspot;
 
   onStatusChange: (statusOption: HotspotStatusOption) => Promise<void>;
index ecde73f591e52feaf08541320782dfbc9c543c23..86f7536c1346be0ae5fca73bb234308d156c2d93 100644 (file)
@@ -36,6 +36,7 @@ import {
   ReviewHistoryType,
   RiskExposure
 } from '../../types/security-hotspots';
+import { Dict, SourceViewerFile, StandardSecurityCategories } from '../../types/types';
 
 export const RISK_EXPOSURE_LEVELS = [RiskExposure.HIGH, RiskExposure.MEDIUM, RiskExposure.LOW];
 export const SECURITY_STANDARDS = [
@@ -52,8 +53,8 @@ export const SECURITY_STANDARD_RENDERER = {
   [SecurityStandard.CWE]: renderCWECategory
 };
 
-export function mapRules(rules: Array<{ key: string; name: string }>): T.Dict<string> {
-  return rules.reduce((ruleMap: T.Dict<string>, r) => {
+export function mapRules(rules: Array<{ key: string; name: string }>): Dict<string> {
+  return rules.reduce((ruleMap: Dict<string>, r) => {
     ruleMap[r.key] = r.name;
     return ruleMap;
   }, {});
@@ -61,7 +62,7 @@ export function mapRules(rules: Array<{ key: string; name: string }>): T.Dict<st
 
 export function groupByCategory(
   hotspots: RawHotspot[] = [],
-  securityCategories: T.StandardSecurityCategories
+  securityCategories: StandardSecurityCategories
 ) {
   const groups = groupBy(hotspots, h => h.securityCategory);
 
@@ -72,10 +73,7 @@ export function groupByCategory(
   }));
 }
 
-export function sortHotspots(
-  hotspots: RawHotspot[],
-  securityCategories: T.Dict<{ title: string }>
-) {
+export function sortHotspots(hotspots: RawHotspot[], securityCategories: Dict<{ title: string }>) {
   return sortBy(hotspots, [
     h => RISK_EXPOSURE_LEVELS.indexOf(h.vulnerabilityProbability),
     h => getCategoryTitle(h.securityCategory, securityCategories),
@@ -83,14 +81,14 @@ export function sortHotspots(
   ]);
 }
 
-function getCategoryTitle(key: string, securityCategories: T.StandardSecurityCategories) {
+function getCategoryTitle(key: string, securityCategories: StandardSecurityCategories) {
   return securityCategories[key] ? securityCategories[key].title : key;
 }
 
 export function constructSourceViewerFile(
   { component, project }: Hotspot,
   lines?: number
-): T.SourceViewerFile {
+): SourceViewerFile {
   return {
     key: component.key,
     measures: { lines: lines ? lines.toString() : undefined },
index 2658732ff135775de852250b6b2bb876eda86616..d2153b4f83217a3f81780a8b04444b4cc25b7d25 100644 (file)
@@ -23,6 +23,7 @@ import GlobalMessagesContainer from '../../../app/components/GlobalMessagesConta
 import { Alert } from '../../../components/ui/Alert';
 import { translate } from '../../../helpers/l10n';
 import { Store } from '../../../store/rootReducer';
+import { IdentityProvider } from '../../../types/types';
 import './Login.css';
 import LoginForm from './LoginForm';
 import OAuthProviders from './OAuthProviders';
@@ -30,7 +31,7 @@ import OAuthProviders from './OAuthProviders';
 export interface LoginProps {
   authorizationError?: boolean;
   authenticationError?: boolean;
-  identityProviders: T.IdentityProvider[];
+  identityProviders: IdentityProvider[];
   onSubmit: (login: string, password: string) => Promise<void>;
   returnTo: string;
 }
index f30ee82f972423b75498ab78dfcbf452804dbf4f..eb9ad108f79786a23b98cda8a7733d21b6dfe9ae 100644 (file)
@@ -23,6 +23,7 @@ import { connect } from 'react-redux';
 import { getIdentityProviders } from '../../../api/users';
 import { getReturnUrl } from '../../../helpers/urls';
 import { doLogin } from '../../../store/rootActions';
+import { IdentityProvider } from '../../../types/types';
 import Login from './Login';
 
 interface OwnProps {
@@ -38,7 +39,7 @@ interface DispatchToProps {
 type Props = OwnProps & DispatchToProps;
 
 interface State {
-  identityProviders?: T.IdentityProvider[];
+  identityProviders?: IdentityProvider[];
 }
 
 export class LoginContainer extends React.PureComponent<Props, State> {
index 59724f5860732f24f56d019ca1ff2371f082768c..566e6af463e8c03930f39cb0dac5513f9a90b100 100644 (file)
@@ -24,12 +24,13 @@ import HelpTooltip from '../../../components/controls/HelpTooltip';
 import IdentityProviderLink from '../../../components/controls/IdentityProviderLink';
 import { translateWithParameters } from '../../../helpers/l10n';
 import { getBaseUrl } from '../../../helpers/system';
+import { IdentityProvider } from '../../../types/types';
 import './OAuthProviders.css';
 
 interface Props {
   className?: string;
   formatLabel?: (name: string) => React.ReactNode;
-  identityProviders: T.IdentityProvider[];
+  identityProviders: IdentityProvider[];
   returnTo: string;
 }
 
@@ -51,7 +52,7 @@ export default function OAuthProviders(props: Props) {
 
 interface ItemProps {
   format: (name: string) => React.ReactNode;
-  identityProvider: T.IdentityProvider;
+  identityProvider: IdentityProvider;
   returnTo: string;
 }
 
index aa946fabeae7ca332ce92e56364b41c396d93f72..bcb0db78471baf7448f718c74706e12345f8d495 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 import {
   ALM_INTEGRATION,
   ANALYSIS_SCOPE_CATEGORY,
@@ -33,7 +34,7 @@ import NewCodePeriod from './NewCodePeriod';
 import PullRequestDecorationBinding from './pullRequestDecorationBinding/PRDecorationBinding';
 
 export interface AdditionalCategoryComponentProps {
-  component: T.Component | undefined;
+  component: Component | undefined;
   selectedCategory: string;
 }
 
index 70d39c40770ff2869b39b6cc532684a8a4aade9e..88419881a33842fa0b6b9543125ece702bd02137 100644 (file)
@@ -24,6 +24,7 @@ import { connect } from 'react-redux';
 import { IndexLink } from 'react-router';
 import { getGlobalSettingsUrl, getProjectSettingsUrl } from '../../../helpers/urls';
 import { getAppState, getSettingsAppAllCategories, Store } from '../../../store/rootReducer';
+import { Component } from '../../../types/types';
 import { getCategoryName } from '../utils';
 import { ADDITIONAL_CATEGORIES } from './AdditionalCategories';
 import CATEGORY_OVERRIDES from './CategoryOverrides';
@@ -31,7 +32,7 @@ import CATEGORY_OVERRIDES from './CategoryOverrides';
 export interface CategoriesListProps {
   branchesEnabled?: boolean;
   categories: string[];
-  component?: T.Component;
+  component?: Component;
   defaultCategory: string;
   selectedCategory: string;
 }
index f36d33c40d18afb2366cfb4ab1d9c1eab282d656..a0b789a0666f2ff08d16a5706a00f2d9e22b0874 100644 (file)
  */
 import { connect } from 'react-redux';
 import { getSettingsAppSettingsForCategory, Store } from '../../../store/rootReducer';
+import { Component } from '../../../types/types';
 import { fetchValues } from '../store/actions';
 import SubCategoryDefinitionsList from './SubCategoryDefinitionsList';
 
 interface Props {
   category: string;
-  component?: T.Component;
+  component?: Component;
 }
 
 const mapStateToProps = (state: Store, ownProps: Props) => ({
index 95d249719cbdf623c960c0b4a5018cf2135c50d4..f5e76d6f647eb6fd1515c66837d238a6ae65c447 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import { Dict } from '../../../types/types';
 import { LANGUAGES_CATEGORY } from './AdditionalCategoryKeys';
 
-const CATEGORY_OVERRIDES: T.Dict<string> = {
+const CATEGORY_OVERRIDES: Dict<string> = {
   abap: LANGUAGES_CATEGORY,
   apex: LANGUAGES_CATEGORY,
   'c / c++ / objective-c': LANGUAGES_CATEGORY,
index 0bc426876f82d3e8f23141bcbe11b13c57523286..cdbdab94747321482d96f5eb770a5c23ece4a69b 100644 (file)
@@ -31,6 +31,7 @@ import {
   Store
 } from '../../../store/rootReducer';
 import { Setting } from '../../../types/settings';
+import { Component } from '../../../types/types';
 import { checkValue, resetValue, saveValue } from '../store/actions';
 import { cancelChange, changeValue, passValidation } from '../store/settingsPage';
 import {
@@ -47,7 +48,7 @@ interface Props {
   changeValue: (key: string, value: any) => void;
   changedValue: any;
   checkValue: (key: string) => boolean;
-  component?: T.Component;
+  component?: Component;
   loading: boolean;
   passValidation: (key: string) => void;
   resetValue: (key: string, component?: string) => Promise<void>;
index 8f810e009f019599d5517223a650f1f9addfc2e3..2824d1c41afc9e3f5b6fae6cfc1f705a8918b4e0 100644 (file)
  */
 import * as React from 'react';
 import { Setting } from '../../../types/settings';
+import { Component } from '../../../types/types';
 import Definition from './Definition';
 
 interface Props {
-  component?: T.Component;
+  component?: Component;
   scrollToDefinition: (element: HTMLLIElement) => void;
   settings: Setting[];
 }
index 544a42df889171bf49fda871dfed6df8b1f7ec01..990a9f84e924b4492d2541c3459fa3d41f04b284 100644 (file)
@@ -27,9 +27,10 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { parseError } from '../../../helpers/request';
+import { LoggedInUser } from '../../../types/types';
 
 interface Props {
-  currentUser: T.LoggedInUser;
+  currentUser: LoggedInUser;
 }
 
 interface State {
index ac5b327ae95d545edf27a33edd0e30532c2275a4..caf5fed339592fa3b52c6d41f759d2b0cedd7302 100644 (file)
@@ -25,17 +25,18 @@ import { ResetButtonLink, SubmitButton } from '../../../components/controls/butt
 import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
+import { NewCodePeriodSettingType } from '../../../types/types';
 import BaselineSettingDays from '../../projectBaseline/components/BaselineSettingDays';
 import BaselineSettingPreviousVersion from '../../projectBaseline/components/BaselineSettingPreviousVersion';
 import { validateDays } from '../../projectBaseline/utils';
 
 interface State {
-  currentSetting?: T.NewCodePeriodSettingType;
+  currentSetting?: NewCodePeriodSettingType;
   days: string;
   loading: boolean;
   currentSettingValue?: string | number;
   saving: boolean;
-  selected?: T.NewCodePeriodSettingType;
+  selected?: NewCodePeriodSettingType;
   success: boolean;
 }
 
@@ -81,7 +82,7 @@ export default class NewCodePeriod extends React.PureComponent<{}, State> {
     this.setState({ days, success: false });
   };
 
-  onSelectSetting = (selected: T.NewCodePeriodSettingType) => {
+  onSelectSetting = (selected: NewCodePeriodSettingType) => {
     this.setState({ selected, success: false });
   };
 
index b18ad5646fbaddfdd83e08799d0f8dd828894260..b8f11a64b68bc103d9aac134e5b0a6084fbdd2a5 100644 (file)
 import * as React from 'react';
 import InstanceMessage from '../../../components/common/InstanceMessage';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 import SettingsSearch from './SettingsSearch';
 
 export interface PageHeaderProps {
-  component?: T.Component;
+  component?: Component;
 }
 
 export default function PageHeader({ component }: PageHeaderProps) {
index 5149787010a7f5922b5cffbdc4de1afaabf3fe0e..e9875254569cda58025c8b49f49c6c220ba645ac 100644 (file)
@@ -32,6 +32,7 @@ import {
   removeWhitePageClass
 } from '../../../helpers/pages';
 import { getSettingsAppDefaultCategory, Store } from '../../../store/rootReducer';
+import { Component } from '../../../types/types';
 import { fetchSettings } from '../store/actions';
 import '../styles.css';
 import { ADDITIONAL_CATEGORIES } from './AdditionalCategories';
@@ -41,7 +42,7 @@ import CATEGORY_OVERRIDES from './CategoryOverrides';
 import PageHeader from './PageHeader';
 
 interface Props {
-  component?: T.Component;
+  component?: Component;
   defaultCategory: string;
   fetchSettings(component?: string): Promise<void>;
 }
index d868ed7ad30c99fe9a0dae71f8c993231b28438f..3acbafbf1caabf589d23a00b5f7e58902ae6796e 100644 (file)
@@ -26,6 +26,7 @@ import { withRouter } from '../../../components/hoc/withRouter';
 import { KeyboardCodes } from '../../../helpers/keycodes';
 import { getSettingsAppAllDefinitions, Store } from '../../../store/rootReducer';
 import { SettingCategoryDefinition } from '../../../types/settings';
+import { Component, Dict } from '../../../types/types';
 import {
   ADDITIONAL_PROJECT_SETTING_DEFINITIONS,
   ADDITIONAL_SETTING_DEFINITIONS,
@@ -35,7 +36,7 @@ import SettingsSearchRenderer from './SettingsSearchRenderer';
 
 interface Props {
   className?: string;
-  component?: T.Component;
+  component?: Component;
   definitions: SettingCategoryDefinition[];
   router: InjectedRouter;
 }
@@ -50,7 +51,7 @@ interface State {
 const DEBOUNCE_DELAY = 250;
 
 export class SettingsSearch extends React.Component<Props, State> {
-  definitionsByKey: T.Dict<SettingCategoryDefinition>;
+  definitionsByKey: Dict<SettingCategoryDefinition>;
   index: LunrIndex;
   state: State = {
     searchQuery: '',
index f9d100058d36c858b1b81b9d805521586a5015a8..ea2c8b297005486d5940aee3781e325831db8596 100644 (file)
@@ -26,11 +26,12 @@ import SearchBox from '../../../components/controls/SearchBox';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { scrollToElement } from '../../../helpers/scrolling';
 import { SettingCategoryDefinition } from '../../../types/settings';
+import { Component } from '../../../types/types';
 import { buildSettingLink, isRealSettingKey } from '../utils';
 
 export interface SettingsSearchRendererProps {
   className?: string;
-  component?: T.Component;
+  component?: Component;
   results?: SettingCategoryDefinition[];
   searchQuery: string;
   selectedResult?: string;
index be3b88a7c789881f6c3602f34ad08cfd3fd06fda..36cbd7fa95cf0e53c2e7e3c514ad5badd0135823 100644 (file)
@@ -23,13 +23,14 @@ import { Location, withRouter } from '../../../components/hoc/withRouter';
 import { sanitizeStringRestricted } from '../../../helpers/sanitize';
 import { scrollToElement } from '../../../helpers/scrolling';
 import { SettingWithCategory } from '../../../types/settings';
+import { Component } from '../../../types/types';
 import { getSubCategoryDescription, getSubCategoryName } from '../utils';
 import DefinitionsList from './DefinitionsList';
 import EmailForm from './EmailForm';
 
 export interface SubCategoryDefinitionsListProps {
   category: string;
-  component?: T.Component;
+  component?: Component;
   fetchValues: Function;
   location: Location;
   settings: Array<SettingWithCategory>;
index 043efedf2df56d6c7aa7387a859117a206f87fe6..1f8537cf92ff63b99ef4314eca0b8fe34496f294 100644 (file)
@@ -34,10 +34,11 @@ import {
   AlmSettingsBindingStatus,
   AlmSettingsBindingStatusType
 } from '../../../../types/alm-settings';
+import { AppState, Dict } from '../../../../types/types';
 import AlmIntegrationRenderer from './AlmIntegrationRenderer';
 
 interface Props extends Pick<WithRouterProps, 'location' | 'router'> {
-  appState: Pick<T.AppState, 'branchesEnabled' | 'multipleAlmEnabled'>;
+  appState: Pick<AppState, 'branchesEnabled' | 'multipleAlmEnabled'>;
 }
 
 export type AlmTabs = AlmKeys.Azure | AlmKeys.GitHub | AlmKeys.GitLab | AlmKeys.BitbucketServer;
@@ -46,7 +47,7 @@ interface State {
   currentAlmTab: AlmTabs;
   definitionKeyForDeletion?: string;
   definitions: AlmSettingsBindingDefinitions;
-  definitionStatus: T.Dict<AlmSettingsBindingStatus>;
+  definitionStatus: Dict<AlmSettingsBindingStatus>;
   loadingAlmDefinitions: boolean;
   loadingProjectCount: boolean;
   projectCount?: number;
index 04bd555a4be92c74fa1731b91b4b62fac9ea718b..6f34fbfd50e435fc0fa039c4ad5d8e64fdbd0940 100644 (file)
@@ -26,6 +26,7 @@ import {
   AlmSettingsBindingDefinitions,
   AlmSettingsBindingStatus
 } from '../../../../types/alm-settings';
+import { Dict } from '../../../../types/types';
 import { AlmTabs } from './AlmIntegration';
 import AlmTab from './AlmTab';
 import DeleteModal from './DeleteModal';
@@ -35,7 +36,7 @@ export interface AlmIntegrationRendererProps {
   currentAlmTab: AlmTabs;
   definitionKeyForDeletion?: string;
   definitions: AlmSettingsBindingDefinitions;
-  definitionStatus: T.Dict<AlmSettingsBindingStatus>;
+  definitionStatus: Dict<AlmSettingsBindingStatus>;
   loadingAlmDefinitions: boolean;
   loadingProjectCount: boolean;
   multipleAlmEnabled: boolean;
index 1dd264c83b7a7c9e1fa6b40a444fcfcba3208280..364ab25d34dd092c2446db2e8f28540d2839a3aa 100644 (file)
@@ -23,6 +23,7 @@ import {
   AlmBindingDefinitionBase,
   AlmSettingsBindingStatus
 } from '../../../../types/alm-settings';
+import { Dict } from '../../../../types/types';
 import { AlmTabs } from './AlmIntegration';
 import AlmTabRenderer from './AlmTabRenderer';
 
@@ -30,7 +31,7 @@ interface Props {
   almTab: AlmTabs;
   branchesEnabled: boolean;
   definitions: AlmBindingDefinition[];
-  definitionStatus: T.Dict<AlmSettingsBindingStatus>;
+  definitionStatus: Dict<AlmSettingsBindingStatus>;
   loadingAlmDefinitions: boolean;
   loadingProjectCount: boolean;
   multipleAlmEnabled: boolean;
index 8712e2926170089afca03657be0039e6d5c31e7a..730133ef52691c776c93795a1610423c9b0cf04a 100644 (file)
@@ -28,6 +28,7 @@ import {
   AlmSettingsBindingStatus,
   isBitbucketCloudBindingDefinition
 } from '../../../../types/alm-settings';
+import { Dict } from '../../../../types/types';
 import { ALM_INTEGRATION } from '../AdditionalCategoryKeys';
 import CategoryDefinitionsList from '../CategoryDefinitionsList';
 import AlmBindingDefinitionBox from './AlmBindingDefinitionBox';
@@ -38,7 +39,7 @@ import CreationTooltip from './CreationTooltip';
 export interface AlmTabRendererProps {
   almTab: AlmTabs;
   branchesEnabled: boolean;
-  definitionStatus: T.Dict<AlmSettingsBindingStatus>;
+  definitionStatus: Dict<AlmSettingsBindingStatus>;
   editDefinition?: boolean;
   editedDefinition?: AlmBindingDefinition;
   definitions: AlmBindingDefinition[];
index fc23742666c94637b9c120ad866361bb3ce821e8..87f93b38da3dab1850a10301f79b799a6544d59a 100644 (file)
@@ -25,10 +25,11 @@ import { getEdition, getEditionUrl } from '../../../../helpers/editions';
 import { translate } from '../../../../helpers/l10n';
 import { AlmKeys } from '../../../../types/alm-settings';
 import { EditionKey } from '../../../../types/editions';
+import { AppState } from '../../../../types/types';
 
 export interface CreationTooltipProps {
   alm: AlmKeys;
-  appState: T.AppState;
+  appState: AppState;
   children: React.ReactElement<{}>;
   preventCreation: boolean;
 }
index ddd645f28a023e43a9672b83f4e0723a1aaa3805..b46b54472e35fa9bc2a80b22f172d127f9851f24 100644 (file)
@@ -31,11 +31,12 @@ import {
   AlmSettingsInstance,
   ProjectAlmBindingResponse
 } from '../../../../types/alm-settings';
+import { Dict } from '../../../../types/types';
 
 export interface AlmSpecificFormProps {
   alm: AlmKeys;
   instances: AlmSettingsInstance[];
-  formData: T.Omit<ProjectAlmBindingResponse, 'alm'>;
+  formData: Omit<ProjectAlmBindingResponse, 'alm'>;
   onFieldChange: (id: keyof ProjectAlmBindingResponse, value: string | boolean) => void;
   monorepoEnabled: boolean;
 }
@@ -47,7 +48,7 @@ interface LabelProps {
 
 interface CommonFieldProps extends LabelProps {
   help?: boolean;
-  helpParams?: T.Dict<string | JSX.Element>;
+  helpParams?: Dict<string | JSX.Element>;
   helpExample?: JSX.Element;
   onFieldChange: (id: keyof ProjectAlmBindingResponse, value: string | boolean) => void;
   propKey: keyof ProjectAlmBindingResponse;
index 6a3271221c1098313ef3bf337f39680c4c88c806..7cbc4b356fceb2cbf3c7d27af2e41a8cdcada40b 100644 (file)
@@ -43,17 +43,18 @@ import {
 } from '../../../../types/alm-settings';
 import { EditionKey } from '../../../../types/editions';
 import { Permissions } from '../../../../types/permissions';
+import { Component, CurrentUser } from '../../../../types/types';
 import PRDecorationBindingRenderer from './PRDecorationBindingRenderer';
 
-type FormData = T.Omit<ProjectAlmBindingResponse, 'alm'>;
+type FormData = Omit<ProjectAlmBindingResponse, 'alm'>;
 
 interface StateProps {
   monorepoEnabled: boolean;
 }
 
 interface Props {
-  component: T.Component;
-  currentUser: T.CurrentUser;
+  component: Component;
+  currentUser: CurrentUser;
 }
 
 interface State {
@@ -71,7 +72,7 @@ interface State {
 }
 
 const REQUIRED_FIELDS_BY_ALM: {
-  [almKey in AlmKeys]: Array<keyof T.Omit<FormData, 'key'>>;
+  [almKey in AlmKeys]: Array<keyof Omit<FormData, 'key'>>;
 } = {
   [AlmKeys.Azure]: ['repository', 'slug'],
   [AlmKeys.BitbucketServer]: ['repository', 'slug'],
@@ -174,7 +175,7 @@ export class PRDecorationBinding extends React.PureComponent<Props & StateProps,
   submitProjectAlmBinding(
     alm: AlmKeys,
     key: string,
-    almSpecificFields?: T.Omit<FormData, 'key'>
+    almSpecificFields?: Omit<FormData, 'key'>
   ): Promise<void> {
     const almSetting = key;
     const project = this.props.component.key;
index 352cc27c1d61326de8620a4a3c585645e0b3d383..2a440c25b265c7639d7c29628b3f4c31996158fa 100644 (file)
@@ -39,7 +39,7 @@ import { ALM_INTEGRATION } from '../AdditionalCategoryKeys';
 import AlmSpecificForm from './AlmSpecificForm';
 
 export interface PRDecorationBindingRendererProps {
-  formData: T.Omit<ProjectAlmBindingResponse, 'alm'>;
+  formData: Omit<ProjectAlmBindingResponse, 'alm'>;
   instances: AlmSettingsInstance[];
   isChanged: boolean;
   isConfigured: boolean;
index 8e1af16c1dbb0fc08d449d20fcf86b0b4b060604..729640cfac4b993aa55fb196292e40957e2fb9e2 100644 (file)
@@ -20,6 +20,7 @@
 import { keyBy, sortBy, uniqBy } from 'lodash';
 import { ActionType } from '../../../store/utils/actions';
 import { SettingCategoryDefinition } from '../../../types/settings';
+import { Dict } from '../../../types/types';
 import { DEFAULT_CATEGORY, getCategoryName } from '../utils';
 
 const enum Actions {
@@ -28,7 +29,7 @@ const enum Actions {
 
 type Action = ActionType<typeof receiveDefinitions, Actions.ReceiveDefinitions>;
 
-export type State = T.Dict<SettingCategoryDefinition>;
+export type State = Dict<SettingCategoryDefinition>;
 
 export function receiveDefinitions(definitions: SettingCategoryDefinition[]) {
   return { type: Actions.ReceiveDefinitions, definitions };
index 43797087936474b143c8cf519fe771932fb30450..045b7647f0214faff391ba092c4bf8a156086236 100644 (file)
@@ -20,6 +20,7 @@
 import { omit } from 'lodash';
 import { combineReducers } from 'redux';
 import { ActionType } from '../../../store/utils/actions';
+import { Dict } from '../../../types/types';
 
 const enum Actions {
   CancelChange = 'settingsPage/CANCEL_CHANGE',
@@ -39,9 +40,9 @@ type Action =
   | ActionType<typeof stopLoading, Actions.StopLoading>;
 
 export interface State {
-  changedValues: T.Dict<any>;
-  loading: T.Dict<boolean>;
-  validationMessages: T.Dict<string>;
+  changedValues: Dict<any>;
+  loading: Dict<boolean>;
+  validationMessages: Dict<string>;
 }
 
 export function cancelChange(key: string) {
index 1146d12b3597270428b1712408d55e7008b452b6..f421230d7058a4c61ee03fbf0a82bc02c2c44e64 100644 (file)
@@ -22,6 +22,7 @@ import { combineReducers } from 'redux';
 import { Action as AppStateAction, Actions as AppStateActions } from '../../../store/appState';
 import { ActionType } from '../../../store/utils/actions';
 import { SettingValue } from '../../../types/settings';
+import { Dict } from '../../../types/types';
 
 enum Actions {
   receiveValues = 'RECEIVE_VALUES'
@@ -29,10 +30,10 @@ enum Actions {
 
 type Action = ActionType<typeof receiveValues, Actions.receiveValues>;
 
-type SettingsState = T.Dict<SettingValue>;
+type SettingsState = Dict<SettingValue>;
 
 export interface State {
-  components: T.Dict<SettingsState>;
+  components: Dict<SettingsState>;
   global: SettingsState;
 }
 
index dcb442a75704a41753c464ac9f7e2442dc5d8cce..ba23c0f1d08abf1c5b1280fbeb0011f02c110c9f 100644 (file)
@@ -22,6 +22,7 @@ import { hasMessage, translate } from '../../helpers/l10n';
 import { getGlobalSettingsUrl, getProjectSettingsUrl } from '../../helpers/urls';
 import { AlmKeys } from '../../types/alm-settings';
 import { Setting, SettingCategoryDefinition, SettingDefinition } from '../../types/settings';
+import { Component, Dict } from '../../types/types';
 
 export const DEFAULT_CATEGORY = 'general';
 
@@ -108,7 +109,7 @@ export function getEmptyValue(item: SettingDefinition | SettingCategoryDefinitio
     }
 
     if (item.type === 'PROPERTY_SET') {
-      const value: T.Dict<string> = {};
+      const value: Dict<string> = {};
       item.fields.forEach(field => (value[field.key] = getEmptyValue(field)));
       return [value];
     }
@@ -170,7 +171,7 @@ export function isRealSettingKey(key: string) {
 
 export function buildSettingLink(
   definition: SettingCategoryDefinition,
-  component?: T.Component
+  component?: Component
 ): LocationDescriptor {
   const { category, key } = definition;
 
@@ -181,7 +182,7 @@ export function buildSettingLink(
     };
   }
 
-  const query: T.Dict<string> = {};
+  const query: Dict<string> = {};
 
   if (key.startsWith('sonar.auth.gitlab')) {
     query.alm = 'gitlab';
index 3194894a6ab27c0e008c2cd45c38abba1a991fa6..accdb5de9b5896de6c0776557bf7558c0534986b 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 import { mockClusterSysInfo, mockStandaloneSysInfo } from '../../../helpers/testMocks';
+import { SysInfoBase, SysInfoStandalone } from '../../../types/types';
 import * as u from '../utils';
 
 describe('parseQuery', () => {
@@ -68,7 +69,7 @@ describe('getSystemLogsLevel', () => {
         })
       )
     ).toBe('INFO');
-    expect(u.getSystemLogsLevel({} as T.SysInfoStandalone)).toBe('INFO');
+    expect(u.getSystemLogsLevel({} as SysInfoStandalone)).toBe('INFO');
   });
 });
 
@@ -169,13 +170,13 @@ describe('getNodeName', () => {
 
 describe('getHealthCauses', () => {
   it('should return the correct information', () => {
-    expect(u.getHealthCauses({ 'Health Causes': ['Foo'] } as T.SysInfoBase)).toEqual(['Foo']);
+    expect(u.getHealthCauses({ 'Health Causes': ['Foo'] } as SysInfoBase)).toEqual(['Foo']);
   });
 });
 
 describe('getHealth', () => {
   it('should return the correct information', () => {
-    expect(u.getHealth({ Health: 'GREEN' } as T.SysInfoBase)).toEqual('GREEN');
+    expect(u.getHealth({ Health: 'GREEN' } as SysInfoBase)).toEqual('GREEN');
   });
 });
 
index 7e5cdc02608e24448eeb06dd32a6b351fb5ad641..45532818e9090d26c8121a7357014eb92b990b4d 100644 (file)
@@ -24,6 +24,7 @@ import { getSystemInfo } from '../../../api/system';
 import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
 import UpdateNotification from '../../../app/components/update-notification/UpdateNotification';
 import { translate } from '../../../helpers/l10n';
+import { SysInfoCluster, SysInfoStandalone } from '../../../types/types';
 import '../styles.css';
 import {
   getClusterVersion,
@@ -43,7 +44,7 @@ type Props = WithRouterProps;
 
 interface State {
   loading: boolean;
-  sysInfoData?: T.SysInfoCluster | T.SysInfoStandalone;
+  sysInfoData?: SysInfoCluster | SysInfoStandalone;
 }
 
 export class App extends React.PureComponent<Props, State> {
index 28b52667d184bd5af98ac669582e6b9405e21db6..b1bdf0109a1c27269c7ed7a21eb4099574778013 100644 (file)
@@ -20,6 +20,7 @@
 import { sortBy } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { SysInfoAppNode, SysInfoCluster, SysInfoSearchNode } from '../../../types/types';
 import {
   getAppNodes,
   getClusterMainCardSection,
@@ -33,7 +34,7 @@ import HealthCard from './info-items/HealthCard';
 
 interface Props {
   expandedCards: string[];
-  sysInfoData: T.SysInfoCluster;
+  sysInfoData: SysInfoCluster;
   toggleCard: (toggledCard: string) => void;
 }
 
@@ -53,7 +54,7 @@ export default function ClusterSysInfos({ expandedCards, sysInfoData, toggleCard
       <li className="note system-info-health-title">
         {translate('system.application_nodes_title')}
       </li>
-      {sortBy(getAppNodes(sysInfoData), getNodeName).map((node: T.SysInfoAppNode) => (
+      {sortBy(getAppNodes(sysInfoData), getNodeName).map((node: SysInfoAppNode) => (
         <HealthCard
           health={getHealth(node)}
           healthCauses={getHealthCauses(node)}
@@ -65,7 +66,7 @@ export default function ClusterSysInfos({ expandedCards, sysInfoData, toggleCard
         />
       ))}
       <li className="note system-info-health-title">{translate('system.search_nodes_title')}</li>
-      {sortBy(getSearchNodes(sysInfoData), getNodeName).map((node: T.SysInfoSearchNode) => (
+      {sortBy(getSearchNodes(sysInfoData), getNodeName).map((node: SysInfoSearchNode) => (
         <HealthCard
           key={getNodeName(node)}
           name={getNodeName(node)}
index 650d10fcde199e9634e13c6372bbc825d85c112f..b39595cb16fef9a16e1563c5566216b2531df55d 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { map } from 'lodash';
 import * as React from 'react';
+import { SysInfoStandalone } from '../../../types/types';
 import {
   getHealth,
   getHealthCauses,
@@ -30,7 +31,7 @@ import HealthCard from './info-items/HealthCard';
 
 interface Props {
   expandedCards: string[];
-  sysInfoData: T.SysInfoStandalone;
+  sysInfoData: SysInfoStandalone;
   toggleCard: (toggledCard: string) => void;
 }
 
index 5c403aadf4f2a3e2ed213c8a2e3b5613c0816066..175143c3f32339cb144e924c7a5b186565f96015 100644 (file)
@@ -22,18 +22,19 @@ import * as React from 'react';
 import BoxedGroupAccordion from '../../../../components/controls/BoxedGroupAccordion';
 import { Alert } from '../../../../components/ui/Alert';
 import { translate } from '../../../../helpers/l10n';
+import { HealthType, SysInfoValueObject } from '../../../../types/types';
 import { getLogsLevel, groupSections, LOGS_LEVELS } from '../../utils';
 import HealthItem from './HealthItem';
 import Section from './Section';
 
 interface Props {
   biggerHealth?: boolean;
-  health?: T.HealthType;
+  health?: HealthType;
   healthCauses?: string[];
   onClick: (toggledCard: string) => void;
   open: boolean;
   name: string;
-  sysInfoData: T.SysInfoValueObject;
+  sysInfoData: SysInfoValueObject;
 }
 
 export default function HealthCard({
index f6022748fb5b7178dada3de02d40214af53650c0..56442b15ee88f5d8cdbea031d5c78469c2d4d41b 100644 (file)
 import classNames from 'classnames';
 import * as React from 'react';
 import { Alert } from '../../../../components/ui/Alert';
+import { HealthType } from '../../../../types/types';
 
 interface Props {
   className?: string;
-  health: T.HealthType;
+  health: HealthType;
   healthCause: string;
 }
 
index 3c9fa6acebd25a14be25eb52b9a6b2d6c46944fe..70b0209aa80eacba071f35ed845b3032caea6efd 100644 (file)
@@ -22,13 +22,14 @@ import * as React from 'react';
 import StatusIndicator from '../../../../components/common/StatusIndicator';
 import Tooltip from '../../../../components/controls/Tooltip';
 import { translateWithParameters } from '../../../../helpers/l10n';
+import { HealthType } from '../../../../types/types';
 import HealthCauseItem from './HealthCauseItem';
 
 interface Props {
   biggerHealth?: boolean;
   name?: string;
   className?: string;
-  health: T.HealthType;
+  health: HealthType;
   healthCauses?: string[];
 }
 
index 34087dcf973b09a2be0126344fad5608db2aaf98..85a9a0c1895585e94d354baf1749417cd9d7b3ec 100644 (file)
  */
 import { map } from 'lodash';
 import * as React from 'react';
+import { SysInfoValueObject } from '../../../../types/types';
 import SysInfoItem from './SysInfoItem';
 
 interface Props {
   name?: string;
-  items: T.SysInfoValueObject;
+  items: SysInfoValueObject;
 }
 
 export default function Section({ name, items }: Props) {
index 4cd91ec7c5319d24defe20b097ddfb066e537e8f..aa299cc81da2dda88d2ea0028d41f1890b4c27d0 100644 (file)
 import { map } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../../helpers/l10n';
+import { HealthType, SysInfoValue } from '../../../../types/types';
 import { HEALTH_FIELD, STATE_FIELD } from '../../utils';
 import HealthItem from './HealthItem';
 
 export interface Props {
   name: string;
-  value: T.SysInfoValue;
+  value: SysInfoValue;
 }
 
 export default function SysInfoItem({ name, value }: Props) {
   if (name === HEALTH_FIELD || name === STATE_FIELD) {
-    return <HealthItem className="no-margin" health={value as T.HealthType} />;
+    return <HealthItem className="no-margin" health={value as HealthType} />;
   }
   if (value instanceof Array) {
     return <code>{JSON.stringify(value)}</code>;
index a9857503449f1b503cc3d39a8d01994b67144584..93978f0d9af93bc7af84ea8c3efe5b5f158f8597 100644 (file)
 import { each, memoize, omit, omitBy, pickBy, sortBy } from 'lodash';
 import { formatMeasure } from '../../helpers/measures';
 import { cleanQuery, parseAsArray, parseAsString, serializeStringArray } from '../../helpers/query';
+import {
+  RawQuery,
+  SysInfoAppNode,
+  SysInfoBase,
+  SysInfoCluster,
+  SysInfoLogging,
+  SysInfoSearchNode,
+  SysInfoSection,
+  SysInfoStandalone,
+  SysInfoValueObject
+} from '../../types/types';
 
 export interface Query {
   expandedCards: string[];
@@ -51,7 +62,7 @@ export const VERSION_FIELD = 'Version';
 export const WEB_LOGGING_FIELD = 'Web Logging';
 export const WEB_PREFIX = 'Web';
 
-export function ignoreInfoFields(sysInfoObject: T.SysInfoValueObject) {
+export function ignoreInfoFields(sysInfoObject: SysInfoValueObject) {
   return omit(sysInfoObject, [
     ALMS_FIELD,
     BUNDLED_FIELD,
@@ -65,15 +76,15 @@ export function ignoreInfoFields(sysInfoObject: T.SysInfoValueObject) {
   ]);
 }
 
-export function getHealth(sysInfoObject: T.SysInfoBase) {
+export function getHealth(sysInfoObject: SysInfoBase) {
   return sysInfoObject[HEALTH_FIELD];
 }
 
-export function getHealthCauses(sysInfoObject: T.SysInfoBase) {
+export function getHealthCauses(sysInfoObject: SysInfoBase) {
   return sysInfoObject[HEALTH_CAUSES_FIELD];
 }
 
-export function getLogsLevel(sysInfoObject?: T.SysInfoValueObject): string {
+export function getLogsLevel(sysInfoObject?: SysInfoValueObject): string {
   if (sysInfoObject !== undefined) {
     if (isLogInfoBlock(sysInfoObject)) {
       return sysInfoObject[LOGS_LEVEL_FIELD];
@@ -90,46 +101,44 @@ export function getLogsLevel(sysInfoObject?: T.SysInfoValueObject): string {
   return DEFAULT_LOG_LEVEL;
 }
 
-export function getAppNodes(sysInfoData: T.SysInfoCluster): T.SysInfoAppNode[] {
+export function getAppNodes(sysInfoData: SysInfoCluster): SysInfoAppNode[] {
   return sysInfoData[APP_NODES_FIELD];
 }
 
-export function getSearchNodes(sysInfoData: T.SysInfoCluster): T.SysInfoSearchNode[] {
+export function getSearchNodes(sysInfoData: SysInfoCluster): SysInfoSearchNode[] {
   return sysInfoData[SEARCH_NODES_FIELD];
 }
 
 export function isCluster(
-  sysInfoData: T.SysInfoCluster | T.SysInfoStandalone
-): sysInfoData is T.SysInfoCluster {
+  sysInfoData: SysInfoCluster | SysInfoStandalone
+): sysInfoData is SysInfoCluster {
   return sysInfoData[SYSTEM_FIELD] && sysInfoData[SYSTEM_FIELD][HA_FIELD] === true;
 }
 
-export function isLogInfoBlock(
-  sysInfoObject: T.SysInfoValueObject
-): sysInfoObject is T.SysInfoLogging {
+export function isLogInfoBlock(sysInfoObject: SysInfoValueObject): sysInfoObject is SysInfoLogging {
   return sysInfoObject[LOGS_LEVEL_FIELD] !== undefined;
 }
 
 export function hasLoggingInfo(
-  sysInfoObject: T.SysInfoValueObject
-): sysInfoObject is T.SysInfoStandalone | T.SysInfoAppNode {
+  sysInfoObject: SysInfoValueObject
+): sysInfoObject is SysInfoStandalone | SysInfoAppNode {
   return Boolean(sysInfoObject[WEB_LOGGING_FIELD] || sysInfoObject[CE_LOGGING_FIELD]);
 }
 
-export function getServerId(sysInfoData: T.SysInfoCluster | T.SysInfoStandalone): string {
+export function getServerId(sysInfoData: SysInfoCluster | SysInfoStandalone): string {
   return sysInfoData && sysInfoData[SYSTEM_FIELD][SERVER_ID_FIELD];
 }
 
-export function getVersion(sysInfoData: T.SysInfoStandalone): string | undefined {
+export function getVersion(sysInfoData: SysInfoStandalone): string | undefined {
   return sysInfoData && sysInfoData[SYSTEM_FIELD][VERSION_FIELD];
 }
 
-export function getClusterVersion(sysInfoData: T.SysInfoCluster): string | undefined {
+export function getClusterVersion(sysInfoData: SysInfoCluster): string | undefined {
   const appNodes = getAppNodes(sysInfoData);
   return appNodes.length > 0 ? appNodes[0][SYSTEM_FIELD][VERSION_FIELD] : undefined;
 }
 
-export function getSystemLogsLevel(sysInfoData: T.SysInfoCluster | T.SysInfoStandalone): string {
+export function getSystemLogsLevel(sysInfoData: SysInfoCluster | SysInfoStandalone): string {
   if (isCluster(sysInfoData)) {
     const logLevels = sortBy(getAppNodes(sysInfoData).map(getLogsLevel), logLevel =>
       LOGS_LEVELS.indexOf(logLevel)
@@ -140,20 +149,20 @@ export function getSystemLogsLevel(sysInfoData: T.SysInfoCluster | T.SysInfoStan
   }
 }
 
-export function getNodeName(nodeInfo: T.SysInfoAppNode | T.SysInfoSearchNode): string {
+export function getNodeName(nodeInfo: SysInfoAppNode | SysInfoSearchNode): string {
   return nodeInfo[NAME_FIELD];
 }
 
-function getSystemData(sysInfoData: T.SysInfoBase): T.SysInfoValueObject {
-  const statData: T.SysInfoValueObject = {};
-  const statistics = sysInfoData[STATS_FIELD] as T.SysInfoValueObject; // TODO
+function getSystemData(sysInfoData: SysInfoBase): SysInfoValueObject {
+  const statData: SysInfoValueObject = {};
+  const statistics = sysInfoData[STATS_FIELD] as SysInfoValueObject; // TODO
   if (statistics) {
     statData['Lines of Code'] = formatMeasure(statistics[NCLOC_FIELD] as number, 'INT');
   }
   return { ...sysInfoData[SYSTEM_FIELD], ...statData };
 }
 
-export function getClusterMainCardSection(sysInfoData: T.SysInfoCluster): T.SysInfoValueObject {
+export function getClusterMainCardSection(sysInfoData: SysInfoCluster): SysInfoValueObject {
   return {
     ...getSystemData(sysInfoData),
     ...omit(sysInfoData, [
@@ -167,7 +176,7 @@ export function getClusterMainCardSection(sysInfoData: T.SysInfoCluster): T.SysI
   };
 }
 
-export function getStandaloneMainSections(sysInfoData: T.SysInfoBase): T.SysInfoValueObject {
+export function getStandaloneMainSections(sysInfoData: SysInfoBase): SysInfoValueObject {
   return {
     ...getSystemData(sysInfoData),
     ...(omitBy(
@@ -178,19 +187,19 @@ export function getStandaloneMainSections(sysInfoData: T.SysInfoBase): T.SysInfo
         key.startsWith(CE_FIELD_PREFIX) ||
         key.startsWith(SEARCH_PREFIX) ||
         key.startsWith(WEB_PREFIX)
-    ) as T.SysInfoValueObject)
+    ) as SysInfoValueObject)
   };
 }
 
-export function getStandaloneSecondarySections(sysInfoData: T.SysInfoBase): T.SysInfoSection {
+export function getStandaloneSecondarySections(sysInfoData: SysInfoBase): SysInfoSection {
   return {
-    Web: pickBy(sysInfoData, (_, key) => key.startsWith(WEB_PREFIX)) as T.SysInfoValueObject,
+    Web: pickBy(sysInfoData, (_, key) => key.startsWith(WEB_PREFIX)) as SysInfoValueObject,
     'Compute Engine': pickBy(sysInfoData, (_, key) =>
       key.startsWith(CE_FIELD_PREFIX)
-    ) as T.SysInfoValueObject,
+    ) as SysInfoValueObject,
     'Search Engine': pickBy(sysInfoData, (_, key) =>
       key.startsWith(SEARCH_PREFIX)
-    ) as T.SysInfoValueObject
+    ) as SysInfoValueObject
   };
 }
 
@@ -203,9 +212,9 @@ export function getFileNameSuffix(suffix?: string) {
   );
 }
 
-export function groupSections(sysInfoData: T.SysInfoValueObject) {
-  const mainSection: T.SysInfoValueObject = {};
-  const sections: T.SysInfoSection = {};
+export function groupSections(sysInfoData: SysInfoValueObject) {
+  const mainSection: SysInfoValueObject = {};
+  const sections: SysInfoSection = {};
   each(sysInfoData, (item, key) => {
     if (typeof item !== 'object' || item instanceof Array) {
       mainSection[key] = item;
@@ -217,13 +226,13 @@ export function groupSections(sysInfoData: T.SysInfoValueObject) {
 }
 
 export const parseQuery = memoize(
-  (urlQuery: T.RawQuery): Query => ({
+  (urlQuery: RawQuery): Query => ({
     expandedCards: parseAsArray(urlQuery.expand, parseAsString)
   })
 );
 
 export const serializeQuery = memoize(
-  (query: Query): T.RawQuery =>
+  (query: Query): RawQuery =>
     cleanQuery({
       expand: serializeStringArray(query.expandedCards)
     })
index 15e0ed88dae2e7715be8c60946e2ce29431ca758..56fca6061814b0d6974d3cbf5802e19243143627 100644 (file)
@@ -23,10 +23,11 @@ import TutorialSelection from '../../../components/tutorials/TutorialSelection';
 import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication';
 import { isLoggedIn } from '../../../helpers/users';
 import { ProjectAlmBindingResponse } from '../../../types/alm-settings';
+import { Component, CurrentUser } from '../../../types/types';
 
 export interface TutorialsAppProps {
-  component: T.Component;
-  currentUser: T.CurrentUser;
+  component: Component;
+  currentUser: CurrentUser;
   projectBinding?: ProjectAlmBindingResponse;
 }
 
index 83b6c6d1f310f39b6722cc9e3ff516bf99d986ba..8c7ee82c99cdc7de383fc11a8f7b732e5b50ce87 100644 (file)
@@ -25,6 +25,7 @@ import ListFooter from '../../components/controls/ListFooter';
 import { withCurrentUser } from '../../components/hoc/withCurrentUser';
 import { Location, Router, withRouter } from '../../components/hoc/withRouter';
 import { translate } from '../../helpers/l10n';
+import { IdentityProvider, Paging, User } from '../../types/types';
 import Header from './Header';
 import Search from './Search';
 import UsersList from './UsersList';
@@ -37,10 +38,10 @@ interface Props {
 }
 
 interface State {
-  identityProviders: T.IdentityProvider[];
+  identityProviders: IdentityProvider[];
   loading: boolean;
-  paging?: T.Paging;
-  users: T.User[];
+  paging?: Paging;
+  users: User[];
 }
 
 export class UsersApp extends React.PureComponent<Props, State> {
index a12eb00d3ea0313e01010a32b64ca63b7dc05876..ce4d76e9f067a2df7ee32b1db0dd59f43279c552 100644 (file)
  */
 import * as React from 'react';
 import { translate } from '../../helpers/l10n';
+import { IdentityProvider, User } from '../../types/types';
 import UserListItem from './components/UserListItem';
 
 interface Props {
   currentUser: { isLoggedIn: boolean; login?: string };
-  identityProviders: T.IdentityProvider[];
+  identityProviders: IdentityProvider[];
   onUpdateUsers: () => void;
   updateTokensCount: (login: string, tokensCount: number) => void;
-  users: T.User[];
+  users: User[];
 }
 
 export default function UsersList({
index ff9cac6acd69422bcb4b5a49a92fbe0b94176746..186ab9240ad439aa147e91b664b50aac801fcbc5 100644 (file)
@@ -22,11 +22,12 @@ import { deactivateUser } from '../../../api/users';
 import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons';
 import Modal from '../../../components/controls/Modal';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { UserActive } from '../../../types/types';
 
 export interface Props {
   onClose: () => void;
   onUpdateUsers: () => void;
-  user: T.UserActive;
+  user: UserActive;
 }
 
 interface State {
index a61d96e1ae0a5e60de72644d176514562fc60fc6..0a5eeca46a6473be34f51612bf52d7698f2c1277 100644 (file)
@@ -27,11 +27,12 @@ import SelectList, {
   SelectListSearchParams
 } from '../../../components/controls/SelectList';
 import { translate } from '../../../helpers/l10n';
+import { User } from '../../../types/types';
 
 interface Props {
   onClose: () => void;
   onUpdateUsers: () => void;
-  user: T.User;
+  user: User;
 }
 
 interface State {
index 6dd4d5adbcde6ed49264ff898a91f78b54ba34d7..d428a60162bc5cc80b6213be363b7a91c3a19abe 100644 (file)
@@ -28,11 +28,12 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../../helpers/l10n';
 import { parseError } from '../../../helpers/request';
+import { User } from '../../../types/types';
 
 interface Props {
   isCurrentUser: boolean;
   onClose: () => void;
-  user: T.User;
+  user: User;
 }
 
 interface State {
index 4f4ce1b6dfb5c5a4c0ef4c20cbe993016e34245a..c9a72b57ae64b2963de01c0beb35a7fb7060b3b6 100644 (file)
@@ -22,6 +22,7 @@ import { generateToken, getTokens } from '../../../api/user-tokens';
 import { SubmitButton } from '../../../components/controls/buttons';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
+import { UserToken } from '../../../types/types';
 import TokensFormItem, { TokenDeleteConfirmation } from './TokensFormItem';
 import TokensFormNewToken from './TokensFormNewToken';
 
@@ -36,7 +37,7 @@ interface State {
   loading: boolean;
   newToken?: { name: string; token: string };
   newTokenName: string;
-  tokens: T.UserToken[];
+  tokens: UserToken[];
 }
 
 export default class TokensForm extends React.PureComponent<Props, State> {
@@ -104,7 +105,7 @@ export default class TokensForm extends React.PureComponent<Props, State> {
     }
   };
 
-  handleRevokeToken = (revokedToken: T.UserToken) => {
+  handleRevokeToken = (revokedToken: UserToken) => {
     this.setState(
       state => ({
         tokens: state.tokens.filter(token => token.name !== revokedToken.name)
index 4c8fc26c29fcbafdc646d7fed7eadbebe4a613f8..3cd5689bb39bf470492c918ebf2c54ccb2006c14 100644 (file)
@@ -28,14 +28,15 @@ import DateFromNow from '../../../components/intl/DateFromNow';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate } from '../../../helpers/l10n';
 import { limitComponentName } from '../../../helpers/path';
+import { UserToken } from '../../../types/types';
 
 export type TokenDeleteConfirmation = 'inline' | 'modal';
 
 interface Props {
   deleteConfirmation: TokenDeleteConfirmation;
   login: string;
-  onRevokeToken: (token: T.UserToken) => void;
-  token: T.UserToken;
+  onRevokeToken: (token: UserToken) => void;
+  token: UserToken;
 }
 
 interface State {
index bb9e48a4feb86abfe57e1f2ba6424b5ef18c4156..99f4b441f7867f79620bafe761ffd3f25e59a039 100644 (file)
@@ -22,10 +22,11 @@ import { FormattedMessage } from 'react-intl';
 import { ResetButtonLink } from '../../../components/controls/buttons';
 import Modal from '../../../components/controls/Modal';
 import { translate } from '../../../helpers/l10n';
+import { User } from '../../../types/types';
 import TokensForm from './TokensForm';
 
 interface Props {
-  user: T.User;
+  user: User;
   onClose: () => void;
   updateTokensCount: (login: string, tokensCount: number) => void;
 }
index e58df4f9e094ef5c5cceaba328827533d21d8560..a2db157542180094914aa235984b66b6f1338041 100644 (file)
@@ -24,6 +24,7 @@ import ActionsDropdown, {
 } from '../../../components/controls/ActionsDropdown';
 import { translate } from '../../../helpers/l10n';
 import { isUserActive } from '../../../helpers/users';
+import { User } from '../../../types/types';
 import DeactivateForm from './DeactivateForm';
 import PasswordForm from './PasswordForm';
 import UserForm from './UserForm';
@@ -31,7 +32,7 @@ import UserForm from './UserForm';
 interface Props {
   isCurrentUser: boolean;
   onUpdateUsers: () => void;
-  user: T.User;
+  user: User;
 }
 
 interface State {
index 5519353187800d455235c10a7e7d0f8a580318f7..3431725037212e09b7e2df6643bf8e1cbfc7ccdf 100644 (file)
@@ -28,12 +28,13 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { parseError } from '../../../helpers/request';
+import { User } from '../../../types/types';
 import UserScmAccountInput from './UserScmAccountInput';
 
 export interface Props {
   onClose: () => void;
   onUpdateUsers: () => void;
-  user?: T.User;
+  user?: User;
 }
 
 interface State {
index e525bdeb7faa09f60e50e233958cd07c3277afe9..6c084e871a071513d835c25e81e9e956b2595c44 100644 (file)
@@ -21,12 +21,13 @@ import * as React from 'react';
 import { ButtonIcon } from '../../../components/controls/buttons';
 import BulletListIcon from '../../../components/icons/BulletListIcon';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { User } from '../../../types/types';
 import GroupsForm from './GroupsForm';
 
 interface Props {
   groups: string[];
   onUpdateUsers: () => void;
-  user: T.User;
+  user: User;
 }
 
 interface State {
index dd728bf3f9ce60de9886d9111fba536685a2ad0f..596c7332a718cf1cc6abbcab32cc8c401d8dd591 100644 (file)
@@ -23,6 +23,7 @@ import BulletListIcon from '../../../components/icons/BulletListIcon';
 import DateFromNow from '../../../components/intl/DateFromNow';
 import Avatar from '../../../components/ui/Avatar';
 import { translate } from '../../../helpers/l10n';
+import { IdentityProvider, User } from '../../../types/types';
 import TokensFormModal from './TokensFormModal';
 import UserActions from './UserActions';
 import UserGroups from './UserGroups';
@@ -30,11 +31,11 @@ import UserListItemIdentity from './UserListItemIdentity';
 import UserScmAccounts from './UserScmAccounts';
 
 interface Props {
-  identityProvider?: T.IdentityProvider;
+  identityProvider?: IdentityProvider;
   isCurrentUser: boolean;
   onUpdateUsers: () => void;
   updateTokensCount: (login: string, tokensCount: number) => void;
-  user: T.User;
+  user: User;
 }
 
 interface State {
index 7ad86650cb6d451059bca87b6fc721a4fc5a4a0c..a3408a5175fd325e61200c25302099de4b6b37a0 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import { colors } from '../../../app/theme';
 import { getTextColor } from '../../../helpers/colors';
 import { getBaseUrl } from '../../../helpers/system';
+import { IdentityProvider, User } from '../../../types/types';
 
 export interface Props {
-  identityProvider?: T.IdentityProvider;
-  user: T.User;
+  identityProvider?: IdentityProvider;
+  user: User;
 }
 
 export default function UserListItemIdentity({ identityProvider, user }: Props) {
index 310642b9948c3e637bbddb87a44bcf83a406c69f..1b93097d0d7f0fcdad851e6cb8639d68f36644ee 100644 (file)
@@ -21,6 +21,7 @@ import { shallow } from 'enzyme';
 import * as React from 'react';
 import { revokeToken } from '../../../../api/user-tokens';
 import { click, waitAndUpdate } from '../../../../helpers/testUtils';
+import { UserToken } from '../../../../types/types';
 import TokensFormItem from '../TokensFormItem';
 
 jest.mock('../../../../components/intl/DateFormatter');
@@ -31,7 +32,7 @@ jest.mock('../../../../api/user-tokens', () => ({
   revokeToken: jest.fn().mockResolvedValue(undefined)
 }));
 
-const userToken: T.UserToken = {
+const userToken: UserToken = {
   name: 'foo',
   createdAt: '2019-01-15T15:06:33+0100',
   lastConnectionDate: '2019-01-18T15:06:33+0100'
index 742b4ff7a0105da60f8f9d6b553ad4df45ca0d96..8cb2d13f360550c205c70dab9bdd72ca985826e3 100644 (file)
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { click } from '../../../../helpers/testUtils';
+import { User } from '../../../../types/types';
 import UserListItem from '../UserListItem';
 
 jest.mock('../../../../components/intl/DateFromNow');
 jest.mock('../../../../components/intl/DateTimeFormatter');
 
-const user: T.User = {
+const user: User = {
   active: true,
   lastConnectionDate: '2019-01-18T15:06:33+0100',
   local: false,
index e5b1d89655b53a1e15a6733ada5f30a40028b835..ac6280ab292b406954a3a96e1dfce1ad214c8b28 100644 (file)
  */
 import { memoize } from 'lodash';
 import { cleanQuery, parseAsString, serializeString } from '../../helpers/query';
+import { RawQuery } from '../../types/types';
 
 export interface Query {
   search: string;
 }
 
 export const parseQuery = memoize(
-  (urlQuery: T.RawQuery): Query => ({
+  (urlQuery: RawQuery): Query => ({
     search: parseAsString(urlQuery['search'])
   })
 );
 
 export const serializeQuery = memoize(
-  (query: Query): T.RawQuery =>
+  (query: Query): RawQuery =>
     cleanQuery({
       search: query.search ? serializeString(query.search) : undefined
     })
index cda482e9f61df759b9709f2c719f878e0537ae8d..2777316dd1c3be61e3b2f4cdb58fecb09d8ae0e8 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import { Link } from 'react-router';
 import LinkIcon from '../../../components/icons/LinkIcon';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { WebApi } from '../../../types/types';
 import { getActionKey, serializeQuery } from '../utils';
 import ActionChangelog from './ActionChangelog';
 import DeprecatedBadge from './DeprecatedBadge';
@@ -30,8 +31,8 @@ import Params from './Params';
 import ResponseExample from './ResponseExample';
 
 interface Props {
-  action: T.WebApi.Action;
-  domain: T.WebApi.Domain;
+  action: WebApi.Action;
+  domain: WebApi.Domain;
   showDeprecated: boolean;
   showInternal: boolean;
 }
index 856ccbef995cd0a283031d1907be2ba9e399c97c..e7d8198cfcbd54bf3b34e9121a88433051dafcbe 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { WebApi } from '../../../types/types';
 
 interface Props {
-  changelog: T.WebApi.Changelog[];
+  changelog: WebApi.Changelog[];
 }
 
 export default function ActionChangelog({ changelog }: Props) {
index 47b72c9a46e2c5a3c8fde163989eacc5fbd0f552..9be6638e723109192efe0c9c221cfe3ede680b72 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { WebApi } from '../../../types/types';
 import { actionsFilter, getActionKey, Query } from '../utils';
 import Action from './Action';
 import DeprecatedBadge from './DeprecatedBadge';
 import InternalBadge from './InternalBadge';
 
 interface Props {
-  domain: T.WebApi.Domain;
+  domain: WebApi.Domain;
   query: Query;
 }
 
index c39bf9b2eb1c664981ec387613928f09995393d3..82fa81f2a9f9ffc882aad7267898d871997ec1cf 100644 (file)
 import classNames from 'classnames';
 import * as React from 'react';
 import { Link } from 'react-router';
+import { WebApi } from '../../../types/types';
 import { actionsFilter, isDomainPathActive, Query, serializeQuery } from '../utils';
 import DeprecatedBadge from './DeprecatedBadge';
 import InternalBadge from './InternalBadge';
 
 interface Props {
-  domains: T.WebApi.Domain[];
+  domains: WebApi.Domain[];
   query: Query;
   splat: string;
 }
@@ -39,7 +40,7 @@ export default function Menu(props: Props) {
     })
     .filter(domain => domain.filteredActions.length);
 
-  const renderDomain = (domain: T.WebApi.Domain) => {
+  const renderDomain = (domain: WebApi.Domain) => {
     const internal = !domain.actions.find(action => !action.internal);
     return (
       <Link
index 41746a001d73ae10b1d23c93db77cc8ee69149bd..8b2a4202170fbb2f9d360850961de46b3298d3fd 100644 (file)
  */
 import * as React from 'react';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { WebApi } from '../../../types/types';
 import DeprecatedBadge from './DeprecatedBadge';
 import InternalBadge from './InternalBadge';
 
 interface Props {
-  params: T.WebApi.Param[];
+  params: WebApi.Param[];
   showDeprecated: boolean;
   showInternal: boolean;
 }
 
 export default class Params extends React.PureComponent<Props> {
-  renderKey(param: T.WebApi.Param) {
+  renderKey(param: WebApi.Param) {
     return (
       <td className="markdown" style={{ width: 180 }}>
         <code>{param.key}</code>
@@ -69,7 +70,7 @@ export default class Params extends React.PureComponent<Props> {
     );
   }
 
-  renderConstraint(param: T.WebApi.Param, field: keyof T.WebApi.Param, label: string) {
+  renderConstraint(param: WebApi.Param, field: keyof WebApi.Param, label: string) {
     const value = param[field];
     if (value !== undefined) {
       return (
index ade727b877236403e83789d0a42e9bf683afd18f..393de0a3c45c9f6ecee0e04c3f5c1f57e519609a 100644 (file)
  */
 import * as React from 'react';
 import { fetchResponseExample as fetchResponseExampleApi } from '../../../api/web-api';
+import { WebApi } from '../../../types/types';
 
 interface Props {
-  action: T.WebApi.Action;
-  domain: T.WebApi.Domain;
+  action: WebApi.Action;
+  domain: WebApi.Domain;
 }
 
 interface State {
-  responseExample?: T.WebApi.Example;
+  responseExample?: WebApi.Example;
 }
 
 export default class ResponseExample extends React.PureComponent<Props, State> {
index fda24c8f547e2f8a3b7061eebc6110a8f55e6660..6f9cb520f5a98c512e3c882641e7b408bdb904b7 100644 (file)
@@ -28,6 +28,7 @@ import ScreenPositionHelper from '../../../components/common/ScreenPositionHelpe
 import { translate } from '../../../helpers/l10n';
 import { addSideBarClass, removeSideBarClass } from '../../../helpers/pages';
 import { scrollToElement } from '../../../helpers/scrolling';
+import { WebApi } from '../../../types/types';
 import '../styles/web-api.css';
 import {
   getActionKey,
@@ -44,7 +45,7 @@ import Search from './Search';
 type Props = WithRouterProps;
 
 interface State {
-  domains: T.WebApi.Domain[];
+  domains: WebApi.Domain[];
 }
 
 export class WebApiApp extends React.PureComponent<Props, State> {
@@ -78,7 +79,7 @@ export class WebApiApp extends React.PureComponent<Props, State> {
     );
   }
 
-  parseDomains(domains: any[]): T.WebApi.Domain[] {
+  parseDomains(domains: any[]): WebApi.Domain[] {
     return domains.map(domain => {
       const deprecated = getLatestDeprecatedAction(domain);
       const internal = !domain.actions.find((action: any) => !action.internal);
@@ -199,7 +200,7 @@ export class WebApiApp extends React.PureComponent<Props, State> {
 export default withRouter(WebApiApp);
 
 /** Checks if all actions are deprecated, and returns the latest deprecated one */
-function getLatestDeprecatedAction(domain: Pick<T.WebApi.Domain, 'actions'>) {
+function getLatestDeprecatedAction(domain: Pick<WebApi.Domain, 'actions'>) {
   const noVersion = { major: 0, minor: 0 };
   const allActionsDeprecated = domain.actions.every(
     ({ deprecatedSince }) => deprecatedSince !== undefined
index b47e77c8cd1d0cab7303c11a3c2767b1dc44aaec..4e4f46952e11a6235ba669fea2842d406bdd682b 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { WebApi } from '../../../../types/types';
 import Menu from '../Menu';
 
-const ACTION: T.WebApi.Action = {
+const ACTION: WebApi.Action = {
   key: 'foo',
   changelog: [],
   description: 'Foo Desc',
@@ -29,12 +30,12 @@ const ACTION: T.WebApi.Action = {
   internal: false,
   post: false
 };
-const DOMAIN1: T.WebApi.Domain = {
+const DOMAIN1: WebApi.Domain = {
   actions: [ACTION],
   path: 'foo',
   description: 'API Foo'
 };
-const DOMAIN2: T.WebApi.Domain = {
+const DOMAIN2: WebApi.Domain = {
   actions: [ACTION],
   path: 'bar',
   description: 'API Bar'
@@ -51,7 +52,7 @@ const SEARCH_FOO = { search: 'Foo', deprecated: false, internal: false };
 const SEARCH_BAR = { search: 'Bar', deprecated: false, internal: false };
 
 it('should render deprecated domains', () => {
-  const domain: T.WebApi.Domain = {
+  const domain: WebApi.Domain = {
     ...DOMAIN2,
     deprecatedSince: '5.0',
     actions: [{ ...ACTION, deprecatedSince: '5.0' }]
@@ -61,7 +62,7 @@ it('should render deprecated domains', () => {
 });
 
 it('should not render deprecated domains', () => {
-  const domain: T.WebApi.Domain = {
+  const domain: WebApi.Domain = {
     ...DOMAIN2,
     deprecatedSince: '5.0',
     actions: [{ ...ACTION, deprecatedSince: '5.0' }]
@@ -71,7 +72,7 @@ it('should not render deprecated domains', () => {
 });
 
 it('should render internal domains', () => {
-  const domain: T.WebApi.Domain = {
+  const domain: WebApi.Domain = {
     ...DOMAIN2,
     internal: true,
     actions: [{ ...ACTION, internal: true }]
@@ -81,7 +82,7 @@ it('should render internal domains', () => {
 });
 
 it('should not render internal domains', () => {
-  const domain: T.WebApi.Domain = {
+  const domain: WebApi.Domain = {
     ...DOMAIN2,
     internal: true,
     actions: [{ ...ACTION, internal: true }]
@@ -91,7 +92,7 @@ it('should not render internal domains', () => {
 });
 
 it('should render only domains with an action matching the query', () => {
-  const domain: T.WebApi.Domain = {
+  const domain: WebApi.Domain = {
     ...DOMAIN2,
     actions: [{ ...ACTION, key: 'bar', description: 'Bar Desc' }]
   };
@@ -100,7 +101,7 @@ it('should render only domains with an action matching the query', () => {
 });
 
 it('should also render domains with an actions description matching the query', () => {
-  const domain: T.WebApi.Domain = {
+  const domain: WebApi.Domain = {
     ...DOMAIN1,
     path: 'baz',
     description: 'API Baz',
index 218aff10dbf9731af44b0eaa1a0569ac0ba67170..a12c09bff6a6f6cbd90313be540b229a68584cad 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { WebApi } from '../../../../types/types';
 import Params from '../Params';
 
-const DEFAULT_PARAM: T.WebApi.Param = {
+const DEFAULT_PARAM: WebApi.Param = {
   key: 'foo',
   description: 'Foo desc',
   internal: false,
@@ -56,7 +57,7 @@ it('should render deprecated key', () => {
 });
 
 it('should render different value constraints', () => {
-  const param: T.WebApi.Param = {
+  const param: WebApi.Param = {
     ...DEFAULT_PARAM,
     defaultValue: 'def',
     exampleValue: 'foo',
index 86329e02465e1979cebaa720177db67fe203043e..7655e3c53ddefdd33c706862789b553091ac1a6b 100644 (file)
@@ -24,6 +24,7 @@ import {
   parseAsString,
   serializeString
 } from '../../helpers/query';
+import { RawQuery, WebApi } from '../../types/types';
 
 export interface Query {
   search: string;
@@ -31,7 +32,7 @@ export interface Query {
   internal: boolean;
 }
 
-export function actionsFilter(query: Query, domain: T.WebApi.Domain, action: T.WebApi.Action) {
+export function actionsFilter(query: Query, domain: WebApi.Domain, action: WebApi.Action) {
   const lowSearchQuery = query.search.toLowerCase();
   return (
     (query.internal || !action.internal) &&
@@ -63,7 +64,7 @@ export const isDomainPathActive = (path: string, splat: string) => {
 };
 
 export const parseQuery = memoize(
-  (urlQuery: T.RawQuery): Query => ({
+  (urlQuery: RawQuery): Query => ({
     search: parseAsString(urlQuery['query']),
     deprecated: parseAsOptionalBoolean(urlQuery['deprecated']) || false,
     internal: parseAsOptionalBoolean(urlQuery['internal']) || false
@@ -71,7 +72,7 @@ export const parseQuery = memoize(
 );
 
 export const serializeQuery = memoize(
-  (query: Partial<Query>): T.RawQuery =>
+  (query: Partial<Query>): RawQuery =>
     cleanQuery({
       query: query.search ? serializeString(query.search) : undefined,
       deprecated: query.deprecated || undefined,
index 4ba44aab5d401a79eb6f18071a2ebad3b68e2b9e..29299bb45fa79a5b0ef562d66bc9ba26e6a04f1d 100644 (file)
@@ -22,17 +22,18 @@ 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 '../../../helpers/l10n';
+import { LightComponent, Webhook } from '../../../types/types';
 import PageActions from './PageActions';
 import PageHeader from './PageHeader';
 import WebhooksList from './WebhooksList';
 
 interface Props {
-  component?: T.LightComponent;
+  component?: LightComponent;
 }
 
 interface State {
   loading: boolean;
-  webhooks: T.Webhook[];
+  webhooks: Webhook[];
 }
 
 export default class App extends React.PureComponent<Props, State> {
index cfeb285deed5a58fd25324481bed1a86def96996..323abe9b924f792304633a3376bd19ffab6a5052 100644 (file)
@@ -24,11 +24,12 @@ import ValidationModal from '../../../components/controls/ValidationModal';
 import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../../helpers/l10n';
+import { Webhook } from '../../../types/types';
 
 interface Props {
   onClose: () => void;
   onDone: (data: Values) => Promise<void>;
-  webhook?: T.Webhook;
+  webhook?: Webhook;
 }
 
 interface Values {
index b543fbc1242951060a579dcf1ad74844572bb7e2..38d3d9f60b4b66847cf463dcf0937ca3a5e9e2f5 100644 (file)
@@ -22,11 +22,12 @@ import { ResetButtonLink, SubmitButton } from '../../../components/controls/butt
 import SimpleModal from '../../../components/controls/SimpleModal';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { Webhook } from '../../../types/types';
 
 interface Props {
   onClose: () => void;
   onSubmit: () => Promise<void>;
-  webhook: T.Webhook;
+  webhook: Webhook;
 }
 
 export default function DeleteWebhookForm({ onClose, onSubmit, webhook }: Props) {
index ffd7c4d39d6693027f4830309bc20a9ad95efe6d..1e89a7d979bed7a9946dcee242f6547c79e63333 100644 (file)
@@ -24,17 +24,18 @@ 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 { Paging, Webhook, WebhookDelivery } from '../../../types/types';
 import DeliveryAccordion from './DeliveryAccordion';
 
 interface Props {
   onClose: () => void;
-  webhook: T.Webhook;
+  webhook: Webhook;
 }
 
 interface State {
-  deliveries: T.WebhookDelivery[];
+  deliveries: WebhookDelivery[];
   loading: boolean;
-  paging?: T.Paging;
+  paging?: Paging;
 }
 
 const PAGE_SIZE = 10;
index 42c74882ba982fc3d6271952d8aa3ed0690789c4..3b2c62ab95ccbe5303cf8f1f6596b590fd5b4037 100644 (file)
@@ -23,10 +23,11 @@ import BoxedGroupAccordion from '../../../components/controls/BoxedGroupAccordio
 import AlertErrorIcon from '../../../components/icons/AlertErrorIcon';
 import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon';
 import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
+import { WebhookDelivery } from '../../../types/types';
 import DeliveryItem from './DeliveryItem';
 
 interface Props {
-  delivery: T.WebhookDelivery;
+  delivery: WebhookDelivery;
 }
 
 interface State {
index bfa6d026a17977db00942b51f994170d0c2d2a61..65a077cabfb695b282a7ec11affe0edb14285424 100644 (file)
@@ -22,10 +22,11 @@ import CodeSnippet from '../../../components/common/CodeSnippet';
 import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
+import { WebhookDelivery } from '../../../types/types';
 
 interface Props {
   className?: string;
-  delivery: T.WebhookDelivery;
+  delivery: WebhookDelivery;
   loading: boolean;
   payload: string | undefined;
 }
index 012b9466a50e08559deed254562d25971a0a6a13..8bf162631584af6887aad5eafd0347475c7314e0 100644 (file)
@@ -22,12 +22,13 @@ import { getDelivery } from '../../../api/webhooks';
 import { ResetButtonLink } from '../../../components/controls/buttons';
 import Modal from '../../../components/controls/Modal';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { Webhook, WebhookDelivery } from '../../../types/types';
 import DeliveryItem from './DeliveryItem';
 
 interface Props {
-  delivery: T.WebhookDelivery;
+  delivery: WebhookDelivery;
   onClose: () => void;
-  webhook: T.Webhook;
+  webhook: Webhook;
 }
 
 interface State {
index 5b09c83230e0613d7ff3eed5c0050ed6789c9b22..3837343b040ec312282ba2b7ce307fba0e47ffa0 100644 (file)
@@ -23,6 +23,7 @@ import ActionsDropdown, {
   ActionsDropdownItem
 } from '../../../components/controls/ActionsDropdown';
 import { translate } from '../../../helpers/l10n';
+import { Webhook } from '../../../types/types';
 import CreateWebhookForm from './CreateWebhookForm';
 import DeleteWebhookForm from './DeleteWebhookForm';
 import DeliveriesForm from './DeliveriesForm';
@@ -30,7 +31,7 @@ import DeliveriesForm from './DeliveriesForm';
 interface Props {
   onDelete: (webhook: string) => Promise<void>;
   onUpdate: (data: { webhook: string; name: string; url: string }) => Promise<void>;
-  webhook: T.Webhook;
+  webhook: Webhook;
 }
 
 interface State {
index 22f864d28090dc7737ac522ef95d83eb3324b716..2c3b738f198ded0327c6d44dd285ed28cf197801 100644 (file)
  */
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { Webhook } from '../../../types/types';
 import WebhookActions from './WebhookActions';
 import WebhookItemLatestDelivery from './WebhookItemLatestDelivery';
 
 interface Props {
   onDelete: (webhook: string) => Promise<void>;
   onUpdate: (data: { webhook: string; name: string; url: string }) => Promise<void>;
-  webhook: T.Webhook;
+  webhook: Webhook;
 }
 
 export default function WebhookItem({ onDelete, onUpdate, webhook }: Props) {
index e8e671c10e310ef77d048ca434ea46c2f8f0c29b..88e4656f583d1d3abb6e9452bbce878fcf6ef999 100644 (file)
@@ -24,10 +24,11 @@ import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon';
 import BulletListIcon from '../../../components/icons/BulletListIcon';
 import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
 import { translate } from '../../../helpers/l10n';
+import { Webhook } from '../../../types/types';
 import LatestDeliveryForm from './LatestDeliveryForm';
 
 interface Props {
-  webhook: T.Webhook;
+  webhook: Webhook;
 }
 
 interface State {
index 40f8815a9a9620d27bcbb13a2c9d412ca31a3f35..40ae1294aad6fa0fa448c1393b6c7472053b8f89 100644 (file)
 import { sortBy } from 'lodash';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { Webhook } from '../../../types/types';
 import WebhookItem from './WebhookItem';
 
 interface Props {
   onDelete: (webhook: string) => Promise<void>;
   onUpdate: (data: { webhook: string; name: string; url: string }) => Promise<void>;
-  webhooks: T.Webhook[];
+  webhooks: Webhook[];
 }
 
 export default class WebhooksList extends React.PureComponent<Props> {
index 949673bb7b138159d70ed68736794fbcfe437138..fb1d304694c4183da1b5708b11041e35d164d4d8 100644 (file)
@@ -29,6 +29,17 @@ import { Alert } from '../../components/ui/Alert';
 import { getBranchLikeQuery, isSameBranchLike } from '../../helpers/branch-like';
 import { translate } from '../../helpers/l10n';
 import { BranchLike } from '../../types/branch-like';
+import {
+  Dict,
+  DuplicatedFile,
+  Duplication,
+  FlowLocation,
+  Issue,
+  LinearIssueLocation,
+  Measure,
+  SourceLine,
+  SourceViewerFile
+} from '../../types/types';
 import { WorkspaceContext } from '../workspace/context';
 import DuplicationPopup from './components/DuplicationPopup';
 import {
@@ -56,7 +67,7 @@ export interface Props {
   aroundLine?: number;
   branchLike: BranchLike | undefined;
   component: string;
-  componentMeasures?: T.Measure[];
+  componentMeasures?: Measure[];
   displayAllIssues?: boolean;
   displayIssueLocationsCount?: boolean;
   displayIssueLocationsLink?: boolean;
@@ -64,27 +75,27 @@ export interface Props {
   highlightedLine?: number;
   // `undefined` elements mean they are located in a different file,
   // but kept to maintaint the location indexes
-  highlightedLocations?: (T.FlowLocation | undefined)[];
+  highlightedLocations?: (FlowLocation | undefined)[];
   highlightedLocationMessage?: { index: number; text: string | undefined };
   loadComponent?: (
     component: string,
     branchLike: BranchLike | undefined
-  ) => Promise<T.SourceViewerFile>;
+  ) => Promise<SourceViewerFile>;
   loadIssues?: (
     component: string,
     from: number,
     to: number,
     branchLike: BranchLike | undefined
-  ) => Promise<T.Issue[]>;
+  ) => Promise<Issue[]>;
   loadSources?: (
     component: string,
     from: number,
     to: number,
     branchLike: BranchLike | undefined
-  ) => Promise<T.SourceLine[]>;
-  onLoaded?: (component: T.SourceViewerFile, sources: T.SourceLine[], issues: T.Issue[]) => void;
+  ) => Promise<SourceLine[]>;
+  onLoaded?: (component: SourceViewerFile, sources: SourceLine[], issues: Issue[]) => void;
   onLocationSelect?: (index: number) => void;
-  onIssueChange?: (issue: T.Issue) => void;
+  onIssueChange?: (issue: Issue) => void;
   onIssueSelect?: (issueKey: string) => void;
   onIssueUnselect?: () => void;
   scroll?: (element: HTMLElement) => void;
@@ -95,16 +106,16 @@ export interface Props {
 }
 
 interface State {
-  component?: T.SourceViewerFile;
-  duplicatedFiles?: T.Dict<T.DuplicatedFile>;
-  duplications?: T.Duplication[];
+  component?: SourceViewerFile;
+  duplicatedFiles?: Dict<DuplicatedFile>;
+  duplications?: Duplication[];
   duplicationsByLine: { [line: number]: number[] };
   hasSourcesAfter: boolean;
   highlightedSymbols: string[];
-  issueLocationsByLine: { [line: number]: T.LinearIssueLocation[] };
+  issueLocationsByLine: { [line: number]: LinearIssueLocation[] };
   issuePopup?: { issue: string; name: string };
-  issues?: T.Issue[];
-  issuesByLine: { [line: number]: T.Issue[] };
+  issues?: Issue[];
+  issuesByLine: { [line: number]: Issue[] };
   loading: boolean;
   loadingSourcesAfter: boolean;
   loadingSourcesBefore: boolean;
@@ -113,7 +124,7 @@ interface State {
   openIssuesByLine: { [line: number]: boolean };
   selectedIssue?: string;
   sourceRemoved: boolean;
-  sources?: T.SourceLine[];
+  sources?: SourceLine[];
   symbolsByLine: { [line: number]: string[] };
 }
 
@@ -214,7 +225,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
     return this.props.loadSources || defaultLoadSources;
   }
 
-  computeCoverageStatus(lines: T.SourceLine[]) {
+  computeCoverageStatus(lines: SourceLine[]) {
     return lines.map(line => ({ ...line, coverageStatus: getCoverageStatus(line) }));
   }
 
@@ -233,7 +244,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
     this.setState({ loading: true });
 
     const to = (this.props.aroundLine || 0) + LINES;
-    const loadIssues = (component: T.SourceViewerFile, sources: T.SourceLine[]) => {
+    const loadIssues = (component: SourceViewerFile, sources: SourceLine[]) => {
       this.loadIssues(this.props.component, 1, to, this.props.branchLike).then(
         issues => {
           if (this.mounted) {
@@ -284,7 +295,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
       }
     };
 
-    const onFailLoadSources = (response: Response, component: T.SourceViewerFile) => {
+    const onFailLoadSources = (response: Response, component: SourceViewerFile) => {
       // TODO handle other statuses
       if (this.mounted) {
         if (response.status === 403) {
@@ -295,7 +306,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
       }
     };
 
-    const onResolve = (component: T.SourceViewerFile) => {
+    const onResolve = (component: SourceViewerFile) => {
       const sourcesRequest =
         component.q === 'FIL' || component.q === 'UTS' ? this.loadSources() : Promise.resolve([]);
       sourcesRequest.then(
@@ -361,7 +372,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
     );
   }
 
-  loadSources = (): Promise<T.SourceLine[]> => {
+  loadSources = (): Promise<SourceLine[]> => {
     return new Promise((resolve, reject) => {
       const onFailLoadSources = (response: Response) => {
         // TODO handle other statuses
@@ -525,19 +536,19 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
     }
   };
 
-  handleOpenIssues = (line: T.SourceLine) => {
+  handleOpenIssues = (line: SourceLine) => {
     this.setState(state => ({
       openIssuesByLine: { ...state.openIssuesByLine, [line.line]: true }
     }));
   };
 
-  handleCloseIssues = (line: T.SourceLine) => {
+  handleCloseIssues = (line: SourceLine) => {
     this.setState(state => ({
       openIssuesByLine: { ...state.openIssuesByLine, [line.line]: false }
     }));
   };
 
-  handleIssueChange = (issue: T.Issue) => {
+  handleIssueChange = (issue: Issue) => {
     this.setState(({ issues = [] }) => {
       const newIssues = issues.map(candidate => (candidate.key === issue.key ? issue : candidate));
       return { issues: newIssues, issuesByLine: issuesByLine(newIssues) };
@@ -572,7 +583,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
     );
   };
 
-  renderCode(sources: T.SourceLine[]) {
+  renderCode(sources: SourceLine[]) {
     const hasSourcesBefore = sources.length > 0 && sources[0].line > 1;
     return (
       <SourceViewerCode
@@ -618,7 +629,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
     );
   }
 
-  renderHeader(branchLike: BranchLike | undefined, sourceViewerFile: T.SourceViewerFile) {
+  renderHeader(branchLike: BranchLike | undefined, sourceViewerFile: SourceViewerFile) {
     return this.props.slimHeader ? (
       <SourceViewerHeaderSlim branchLike={branchLike} sourceViewerFile={sourceViewerFile} />
     ) : (
@@ -682,7 +693,7 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
 function defaultLoadComponent(
   component: string,
   branchLike: BranchLike | undefined
-): Promise<T.SourceViewerFile> {
+): Promise<SourceViewerFile> {
   return Promise.all([
     getComponentForSourceViewer({ component, ...getBranchLikeQuery(branchLike) }),
     getComponentData({ component, ...getBranchLikeQuery(branchLike) })
index d108b1442f9180f57a20f0d1cae5bcab66e3ceaf..06e55ef452b35576a72467f61462314c3f39fd1f 100644 (file)
@@ -22,6 +22,13 @@ import { Button } from '../../components/controls/buttons';
 import { translate } from '../../helpers/l10n';
 import { BranchLike } from '../../types/branch-like';
 import { MetricKey } from '../../types/metrics';
+import {
+  Duplication,
+  FlowLocation,
+  Issue,
+  LinearIssueLocation,
+  SourceLine
+} from '../../types/types';
 import Line from './components/Line';
 import { getSecondaryIssueLocationsForLine } from './helpers/issueLocations';
 import {
@@ -46,7 +53,7 @@ interface Props {
   displayIssueLocationsCount?: boolean;
   displayIssueLocationsLink?: boolean;
   displayLocationMarkers?: boolean;
-  duplications: T.Duplication[] | undefined;
+  duplications: Duplication[] | undefined;
   duplicationsByLine: { [line: number]: number[] };
   hasSourcesAfter: boolean;
   hasSourcesBefore: boolean;
@@ -54,22 +61,22 @@ interface Props {
   highlightedLocationMessage: { index: number; text: string | undefined } | undefined;
   // `undefined` elements mean they are located in a different file,
   // but kept to maintain the location indexes
-  highlightedLocations: (T.FlowLocation | undefined)[] | undefined;
+  highlightedLocations: (FlowLocation | undefined)[] | undefined;
   highlightedSymbols: string[];
-  issueLocationsByLine: { [line: number]: T.LinearIssueLocation[] };
+  issueLocationsByLine: { [line: number]: LinearIssueLocation[] };
   issuePopup: { issue: string; name: string } | undefined;
-  issues: T.Issue[] | undefined;
-  issuesByLine: { [line: number]: T.Issue[] };
-  loadDuplications: (line: T.SourceLine) => void;
+  issues: Issue[] | undefined;
+  issuesByLine: { [line: number]: Issue[] };
+  loadDuplications: (line: SourceLine) => void;
   loadingSourcesAfter: boolean;
   loadingSourcesBefore: boolean;
   loadSourcesAfter: () => void;
   loadSourcesBefore: () => void;
-  onIssueChange: (issue: T.Issue) => void;
+  onIssueChange: (issue: Issue) => void;
   onIssuePopupToggle: (issue: string, popupName: string, open?: boolean) => void;
-  onIssuesClose: (line: T.SourceLine) => void;
+  onIssuesClose: (line: SourceLine) => void;
   onIssueSelect: (issueKey: string) => void;
-  onIssuesOpen: (line: T.SourceLine) => void;
+  onIssuesOpen: (line: SourceLine) => void;
   onIssueUnselect: () => void;
   onLocationSelect: ((index: number) => void) | undefined;
   onSymbolClick: (symbols: string[]) => void;
@@ -78,7 +85,7 @@ interface Props {
   scroll?: (element: HTMLElement) => void;
   metricKey?: string;
   selectedIssue: string | undefined;
-  sources: T.SourceLine[];
+  sources: SourceLine[];
   symbolsByLine: { [line: number]: string[] };
 }
 
@@ -91,15 +98,15 @@ export default class SourceViewerCode extends React.PureComponent<Props> {
     }
   }
 
-  getDuplicationsForLine = (line: T.SourceLine): number[] => {
+  getDuplicationsForLine = (line: SourceLine): number[] => {
     return this.props.duplicationsByLine[line.line] || EMPTY_ARRAY;
   };
 
-  getIssuesForLine = (line: T.SourceLine): T.Issue[] => {
+  getIssuesForLine = (line: SourceLine): Issue[] => {
     return this.props.issuesByLine[line.line] || EMPTY_ARRAY;
   };
 
-  getIssueLocationsForLine = (line: T.SourceLine): T.LinearIssueLocation[] => {
+  getIssueLocationsForLine = (line: SourceLine): LinearIssueLocation[] => {
     return this.props.issueLocationsByLine[line.line] || EMPTY_ARRAY;
   };
 
@@ -110,7 +117,7 @@ export default class SourceViewerCode extends React.PureComponent<Props> {
     displayDuplications,
     displayIssues
   }: {
-    line: T.SourceLine;
+    line: SourceLine;
     index: number;
     displayCoverage: boolean;
     displayDuplications: boolean;
index 546f7d01c8f9451b6e794cb4d0bf8977e394fb01..e9273583f0b40f09251ce93f10fabedffbf97f0a 100644 (file)
  */
 import * as React from 'react';
 import { BranchLike } from '../../types/branch-like';
+import { SourceViewerFile } from '../../types/types';
 
 interface SourceViewerContextShape {
   branchLike?: BranchLike;
-  file: T.SourceViewerFile;
+  file: SourceViewerFile;
 }
 
 export const SourceViewerContext = React.createContext<SourceViewerContextShape>({
   branchLike: {} as BranchLike,
-  file: {} as T.SourceViewerFile
+  file: {} as SourceViewerFile
 });
index 2ea560e19374ca3ce422c80acd571c3969ac98c7..2ea13fcc33d80e59e4b586d12368a638c5a108e6 100644 (file)
@@ -41,15 +41,16 @@ import {
 } from '../../helpers/urls';
 import { BranchLike } from '../../types/branch-like';
 import { ComponentQualifier } from '../../types/component';
+import { IssueType, Measure, SourceViewerFile } from '../../types/types';
 import { WorkspaceContextShape } from '../workspace/context';
 import MeasuresOverlay from './components/MeasuresOverlay';
 
 interface Props {
   branchLike: BranchLike | undefined;
-  componentMeasures?: T.Measure[];
+  componentMeasures?: Measure[];
   openComponent: WorkspaceContextShape['openComponent'];
   showMeasures?: boolean;
-  sourceViewerFile: T.SourceViewerFile;
+  sourceViewerFile: SourceViewerFile;
 }
 
 interface State {
@@ -82,7 +83,7 @@ export default class SourceViewerHeader extends React.PureComponent<Props, State
         <>
           <div className="source-viewer-header-measure-separator" />
 
-          {ISSUE_TYPES.map((type: T.IssueType) => {
+          {ISSUE_TYPES.map((type: IssueType) => {
             const params = {
               ...getBranchLikeQuery(branchLike),
               files: sourceViewerFile.path,
index f0c70947618309a98c8a5404ffcb47908a55b2a9..1587c00ee2d50e0bfa15ffb16a5d4d6bbe86718a 100644 (file)
@@ -31,6 +31,7 @@ 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 { SourceViewerFile } from '../../types/types';
 import './SourceViewerHeaderSlim.css';
 
 export interface Props {
@@ -40,7 +41,7 @@ export interface Props {
   linkToProject?: boolean;
   loading?: boolean;
   onExpand?: () => void;
-  sourceViewerFile: T.SourceViewerFile;
+  sourceViewerFile: SourceViewerFile;
 }
 
 export default function SourceViewerHeaderSlim(props: Props) {
index 2daf53f601392d7946eadaaa5a8d069b349f9666..1a879dcb4c8eecce556e755cba38005cd26a1da6 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import { mockMainBranch } from '../../../helpers/mocks/branch-like';
 import { mockSourceViewerFile } from '../../../helpers/testMocks';
 import { MetricKey } from '../../../types/metrics';
+import { Measure } from '../../../types/types';
 import SourceViewerHeader from '../SourceViewerHeader';
 
 it('should render correctly for a regular file', () => {
@@ -38,7 +39,7 @@ it('should render correctly for a unit test', () => {
 });
 
 it('should render correctly if issue details are passed', () => {
-  const componentMeasures: T.Measure[] = [
+  const componentMeasures: Measure[] = [
     { metric: MetricKey.code_smells, value: '1' },
     { metric: MetricKey.file_complexity_distribution, value: '42' }, // unused, should be ignored
     { metric: MetricKey.security_hotspots, value: '2' },
index 3071fbe2ed605778d80d47ed37553cc974bc3dab..746344a4e07d2cbd0ca4c30f0ecb15c44129da5c 100644 (file)
@@ -27,15 +27,16 @@ import { translate } from '../../../helpers/l10n';
 import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path';
 import { getProjectUrl } from '../../../helpers/urls';
 import { BranchLike } from '../../../types/branch-like';
+import { Dict, DuplicatedFile, DuplicationBlock, SourceViewerFile } from '../../../types/types';
 import { WorkspaceContextShape } from '../../workspace/context';
 
 interface Props {
-  blocks: T.DuplicationBlock[];
+  blocks: DuplicationBlock[];
   branchLike: BranchLike | undefined;
-  duplicatedFiles?: T.Dict<T.DuplicatedFile>;
+  duplicatedFiles?: Dict<DuplicatedFile>;
   inRemovedComponent: boolean;
   openComponent: WorkspaceContextShape['openComponent'];
-  sourceViewerFile: T.SourceViewerFile;
+  sourceViewerFile: SourceViewerFile;
 }
 
 export default class DuplicationPopup extends React.PureComponent<Props> {
@@ -64,7 +65,7 @@ export default class DuplicationPopup extends React.PureComponent<Props> {
     }
   };
 
-  renderDuplication(file: T.DuplicatedFile, children: React.ReactNode, line?: number) {
+  renderDuplication(file: DuplicatedFile, children: React.ReactNode, line?: number) {
     return this.shouldLink() ? (
       <a
         data-key={file.key}
index 58b835d88c802fc157079b2fdf1ced92af93c2c2..4aa2507a885c1b361c96fa460a12f8c6b3a54419 100644 (file)
@@ -21,6 +21,7 @@ import classNames from 'classnames';
 import { times } from 'lodash';
 import * as React from 'react';
 import { BranchLike } from '../../../types/branch-like';
+import { Issue, LinearIssueLocation, SourceLine } from '../../../types/types';
 import './Line.css';
 import LineCode from './LineCode';
 import LineCoverage from './LineCoverage';
@@ -46,26 +47,26 @@ interface Props {
   highlighted: boolean;
   highlightedLocationMessage: { index: number; text: string | undefined } | undefined;
   highlightedSymbols: string[] | undefined;
-  issueLocations: T.LinearIssueLocation[];
+  issueLocations: LinearIssueLocation[];
   issuePopup: { issue: string; name: string } | undefined;
-  issues: T.Issue[];
+  issues: Issue[];
   last: boolean;
-  line: T.SourceLine;
-  loadDuplications: (line: T.SourceLine) => void;
-  onIssueChange: (issue: T.Issue) => void;
+  line: SourceLine;
+  loadDuplications: (line: SourceLine) => void;
+  onIssueChange: (issue: Issue) => void;
   onIssuePopupToggle: (issueKey: string, popupName: string, open?: boolean) => void;
-  onIssuesClose: (line: T.SourceLine) => void;
+  onIssuesClose: (line: SourceLine) => void;
   onIssueSelect: (issueKey: string) => void;
-  onIssuesOpen: (line: T.SourceLine) => void;
+  onIssuesOpen: (line: SourceLine) => void;
   onIssueUnselect: () => void;
   onLocationSelect: ((x: number) => void) | undefined;
   onSymbolClick: (symbols: string[]) => void;
   openIssues: boolean;
-  previousLine: T.SourceLine | undefined;
+  previousLine: SourceLine | undefined;
   renderDuplicationPopup: (index: number, line: number) => React.ReactNode;
   scroll?: (element: HTMLElement) => void;
   scrollToUncoveredLine?: boolean;
-  secondaryIssueLocations: T.LinearIssueLocation[];
+  secondaryIssueLocations: LinearIssueLocation[];
   selectedIssue: string | undefined;
   verticalBuffer?: number;
 }
index bcf53776df95aeecc99f2b65c49062e7422658e4..3509f570bd4efa20408f9ff78199b46a5a7d2809 100644 (file)
@@ -20,6 +20,7 @@
 import classNames from 'classnames';
 import * as React from 'react';
 import { BranchLike } from '../../../types/branch-like';
+import { Issue, LinearIssueLocation, SourceLine } from '../../../types/types';
 import LocationIndex from '../../common/LocationIndex';
 import LocationMessage from '../../common/LocationMessage';
 import {
@@ -37,18 +38,18 @@ interface Props {
   displayLocationMarkers?: boolean;
   highlightedLocationMessage: { index: number; text: string | undefined } | undefined;
   highlightedSymbols: string[] | undefined;
-  issueLocations: T.LinearIssueLocation[];
+  issueLocations: LinearIssueLocation[];
   issuePopup: { issue: string; name: string } | undefined;
-  issues: T.Issue[];
-  line: T.SourceLine;
-  onIssueChange: (issue: T.Issue) => void;
+  issues: Issue[];
+  line: SourceLine;
+  onIssueChange: (issue: Issue) => void;
   onIssuePopupToggle: (issue: string, popupName: string, open?: boolean) => void;
   onIssueSelect: (issueKey: string) => void;
   onLocationSelect: ((index: number) => void) | undefined;
   onSymbolClick: (symbols: Array<string>) => void;
   padding?: number;
   scroll?: (element: HTMLElement) => void;
-  secondaryIssueLocations: T.LinearIssueLocation[];
+  secondaryIssueLocations: LinearIssueLocation[];
   selectedIssue: string | undefined;
   showIssues?: boolean;
 }
index 0d36d7830ffb2829b1c965af86d7e468db3ceb0b..14b8d00874c607ed1ab9a1d2cce4847d591dc0a9 100644 (file)
 import * as React from 'react';
 import Tooltip from '../../../components/controls/Tooltip';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { SourceLine } from '../../../types/types';
 
 export interface LineCoverageProps {
-  line: T.SourceLine;
+  line: SourceLine;
   scroll?: (element: HTMLElement) => void;
   scrollToUncoveredLine?: boolean;
 }
@@ -49,7 +50,7 @@ export function LineCoverage({ line, scroll, scrollToUncoveredLine }: LineCovera
   );
 }
 
-function getStatusTooltip(line: T.SourceLine) {
+function getStatusTooltip(line: SourceLine) {
   if (line.coverageStatus === 'uncovered') {
     if (line.conditions) {
       return translateWithParameters('source_viewer.tooltip.uncovered.conditions', line.conditions);
index 225edce276a70386d4a0a24181d2af3fb538285b..6a9cead37eba433e152ad77b9530931c9efdd23a 100644 (file)
@@ -24,13 +24,14 @@ import Toggler from '../../../components/controls/Toggler';
 import Tooltip from '../../../components/controls/Tooltip';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { translate } from '../../../helpers/l10n';
+import { SourceLine } from '../../../types/types';
 
 export interface LineDuplicationBlockProps {
   blocksLoaded: boolean;
   duplicated: boolean;
   index: number;
-  line: T.SourceLine;
-  onClick?: (line: T.SourceLine) => void;
+  line: SourceLine;
+  onClick?: (line: SourceLine) => void;
   renderDuplicationPopup: (index: number, line: number) => React.ReactNode;
 }
 
index 91e1191eedb2c8da40165c4be1a59fef8fb20ee7..e5418fba9ceb8ae28d9d24231c507fc5ff2d07c3 100644 (file)
@@ -24,11 +24,12 @@ import Tooltip from '../../../components/controls/Tooltip';
 import IssueIcon from '../../../components/icons/IssueIcon';
 import { sortByType } from '../../../helpers/issues';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { Issue, SourceLine } from '../../../types/types';
 
 export interface LineIssuesIndicatorProps {
-  issues: T.Issue[];
+  issues: Issue[];
   issuesOpen?: boolean;
-  line: T.SourceLine;
+  line: SourceLine;
   onClick: () => void;
 }
 
index 19d3860bb84d3860b5c2f8a9f38a45ea9c6a09eb..fcc3720b38260d097faa440c5122ccb878f99533 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { BranchLike } from '../../../types/branch-like';
+import { Issue as TypeIssue } from '../../../types/types';
 import Issue from '../../issue/Issue';
 
 interface Props {
@@ -26,8 +27,8 @@ interface Props {
   displayIssueLocationsCount?: boolean;
   displayIssueLocationsLink?: boolean;
   issuePopup: { issue: string; name: string } | undefined;
-  issues: T.Issue[];
-  onIssueChange: (issue: T.Issue) => void;
+  issues: TypeIssue[];
+  onIssueChange: (issue: TypeIssue) => void;
   onIssueClick: (issueKey: string) => void;
   onIssuePopupToggle: (issue: string, popupName: string, open?: boolean) => void;
   selectedIssue: string | undefined;
index 31be34e396519f27521455721064a2baece89fcd..2842ae963cf17e21998c3fe01afc73a1c3263ea4 100644 (file)
 import * as React from 'react';
 import Toggler from '../../../components/controls/Toggler';
 import { translateWithParameters } from '../../../helpers/l10n';
+import { SourceLine } from '../../../types/types';
 import LineOptionsPopup from './LineOptionsPopup';
 
 export interface LineNumberProps {
   displayOptions: boolean;
   firstLineNumber: number;
-  line: T.SourceLine;
+  line: SourceLine;
 }
 
 export function LineNumber({ displayOptions, firstLineNumber, line }: LineNumberProps) {
index 7bd16b97b50e3d64a07a8119ff98da645da5fc2f..321cdbc8ed737b7ae4b5ee5bb41f11a6ae1f2f1b 100644 (file)
@@ -22,12 +22,13 @@ import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { translate } from '../../../helpers/l10n';
 import { getCodeUrl, getPathUrlAsString } from '../../../helpers/urls';
+import { SourceLine } from '../../../types/types';
 import { ActionsDropdownItem } from '../../controls/ActionsDropdown';
 import { SourceViewerContext } from '../SourceViewerContext';
 
 export interface LineOptionsPopupProps {
   firstLineNumber: number;
-  line: T.SourceLine;
+  line: SourceLine;
 }
 
 export function LineOptionsPopup({ firstLineNumber, line }: LineOptionsPopupProps) {
index f4b892213a11a8c72e14effd9e74f94aee7c3632..ff7f294d91531d5efe9067c535dc740c8324ff2f 100644 (file)
@@ -21,11 +21,12 @@ import * as React from 'react';
 import Dropdown from '../../../components/controls/Dropdown';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { SourceLine } from '../../../types/types';
 import SCMPopup from './SCMPopup';
 
 export interface LineSCMProps {
-  line: T.SourceLine;
-  previousLine: T.SourceLine | undefined;
+  line: SourceLine;
+  previousLine: SourceLine | undefined;
 }
 
 export function LineSCM({ line, previousLine }: LineSCMProps) {
@@ -63,7 +64,7 @@ export function LineSCM({ line, previousLine }: LineSCMProps) {
   }
 }
 
-function isSCMChanged(s: T.SourceLine, p: T.SourceLine | undefined) {
+function isSCMChanged(s: SourceLine, p: SourceLine | undefined) {
   let changed = true;
   if (p != null && s.scmRevision != null && p.scmRevision != null) {
     changed = s.scmRevision !== p.scmRevision || s.scmDate !== p.scmDate;
index dbcce374910bacb758d31b6f330eb24799a0566e..209674e7344a5ac4720d1c01dd8f308e75dfa6e8 100644 (file)
@@ -39,6 +39,8 @@ import {
 } from '../../../helpers/measures';
 import { getBranchLikeUrl } from '../../../helpers/urls';
 import { BranchLike } from '../../../types/branch-like';
+import { IssueType as IssueTypeEnum } from '../../../types/issues';
+import { FacetValue, IssueType, MeasureEnhanced, SourceViewerFile } from '../../../types/types';
 import Measure from '../../measure/Measure';
 import SeverityHelper from '../../shared/SeverityHelper';
 import CoverageRating from '../../ui/CoverageRating';
@@ -47,20 +49,20 @@ import MeasuresOverlayMeasure from './MeasuresOverlayMeasure';
 interface Props {
   branchLike: BranchLike | undefined;
   onClose: () => void;
-  sourceViewerFile: T.SourceViewerFile;
+  sourceViewerFile: SourceViewerFile;
 }
 
 interface Measures {
-  [metricKey: string]: T.MeasureEnhanced;
+  [metricKey: string]: MeasureEnhanced;
 }
 
 interface State {
   loading: boolean;
   measures: Measures;
-  severitiesFacet?: T.FacetValue[];
+  severitiesFacet?: FacetValue[];
   showAllMeasures: boolean;
-  tagsFacet?: T.FacetValue[];
-  typesFacet?: T.FacetValue<T.IssueType>[];
+  tagsFacet?: FacetValue[];
+  typesFacet?: FacetValue<IssueType>[];
 }
 
 export default class MeasuresOverlay extends React.PureComponent<Props, State> {
@@ -124,7 +126,7 @@ export default class MeasuresOverlay extends React.PureComponent<Props, State> {
       return {
         severitiesFacet: severitiesFacet && severitiesFacet.values,
         tagsFacet: tagsFacet && tagsFacet.values,
-        typesFacet: typesFacet && (typesFacet.values as T.FacetValue<T.IssueType>[])
+        typesFacet: typesFacet && (typesFacet.values as FacetValue<IssueType>[])
       };
     });
   };
@@ -135,7 +137,7 @@ export default class MeasuresOverlay extends React.PureComponent<Props, State> {
     this.setState({ showAllMeasures: true });
   };
 
-  renderMeasure = (measure: T.MeasureEnhanced | undefined) => {
+  renderMeasure = (measure: MeasureEnhanced | undefined) => {
     return measure ? <MeasuresOverlayMeasure key={measure.metric.key} measure={measure} /> : null;
   };
 
@@ -162,7 +164,7 @@ export default class MeasuresOverlay extends React.PureComponent<Props, State> {
     );
   };
 
-  renderBigMeasure = (measure: T.MeasureEnhanced | undefined) => {
+  renderBigMeasure = (measure: MeasureEnhanced | undefined) => {
     return measure ? (
       <div className="measure measure-big" data-metric={measure.metric.key}>
         <span className="measure-value">
@@ -190,7 +192,7 @@ export default class MeasuresOverlay extends React.PureComponent<Props, State> {
             <>
               {typesFacet && (
                 <div className="measures">
-                  {sortBy(typesFacet, f => ISSUE_TYPES.indexOf(f.val)).map(f => (
+                  {sortBy(typesFacet, f => ISSUE_TYPES.indexOf(f.val as IssueTypeEnum)).map(f => (
                     <div className="measure measure-one-line" key={f.val}>
                       <span className="measure-name">
                         <IssueTypeIcon className="little-spacer-right" query={f.val} />
@@ -327,7 +329,7 @@ export default class MeasuresOverlay extends React.PureComponent<Props, State> {
     );
   };
 
-  renderDomain = (domain: string, measures: T.MeasureEnhanced[]) => {
+  renderDomain = (domain: string, measures: MeasureEnhanced[]) => {
     return (
       <div className="measures-viewer-card" key={domain}>
         <div className="measures">
index 5931b6e9ccf0ff7b232c26dc7d824611fa88be3f..e75807e663f1f07f81a99677e82cf849dd6e847d 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import IssueTypeIcon from '../../../components/icons/IssueTypeIcon';
 import { getLocalizedMetricName } from '../../../helpers/l10n';
 import { isMetricKey, MetricKey } from '../../../types/metrics';
+import { Metric } from '../../../types/types';
 import Measure from '../../measure/Measure';
 
 export interface MeasureWithMetric {
-  metric: T.Metric;
+  metric: Metric;
   value?: string;
 }
 
index b9a23093708451f41ae65e552a68d24189dfc9d2..347ca9d56bfaae52236ca9fbe66b3704bcbc181d 100644 (file)
 import classNames from 'classnames';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { SourceLine } from '../../../types/types';
 import DateFormatter from '../../intl/DateFormatter';
 
 export interface SCMPopupProps {
-  line: T.SourceLine;
+  line: SourceLine;
 }
 
 export function SCMPopup({ line }: SCMPopupProps) {
index 4b9dd3f991ca6b86e0d7edf19515dd420ae6c581..17666dd9599084d75b6df012b4d90e6ea0c14a86 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { Issue } from '../../../../types/types';
 import LineIssuesList from '../LineIssuesList';
 
-const issueBase: T.Issue = {
+const issueBase: Issue = {
   actions: [],
   component: '',
   componentLongName: '',
@@ -45,7 +46,7 @@ const issueBase: T.Issue = {
 };
 
 it('render issues list', () => {
-  const issues: T.Issue[] = [
+  const issues: Issue[] = [
     { ...issueBase, key: 'foo' },
     { ...issueBase, key: 'bar' }
   ];
index e000aea59e2788aed809f1efa7ee1d74e65405e7..01a2346121d19cdb78563cb1d83d21694af22d48 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import { mockBranch } from '../../../../helpers/mocks/branch-like';
 import { click, waitAndUpdate } from '../../../../helpers/testUtils';
 import { MetricKey } from '../../../../types/metrics';
+import { SourceViewerFile } from '../../../../types/types';
 import MeasuresOverlay from '../MeasuresOverlay';
 
 jest.mock('../../../../api/issues', () => ({
@@ -139,7 +140,7 @@ jest.mock('../../../../api/metrics', () => ({
     ])
 }));
 
-const sourceViewerFile: T.SourceViewerFile = {
+const sourceViewerFile: SourceViewerFile = {
   key: 'component-key',
   measures: {},
   path: 'src/file.js',
index ed1d94b690907afd55046fe65dcb40e39dd1669f..9f6eaed3a327673f36da072e3b757a080c5f26f5 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
+import { Duplication, DuplicationBlock } from '../../../types/types';
+
 // TODO Test this function, but I don't get the logic behind it
-export function filterDuplicationBlocksByLine(blocks: T.DuplicationBlock[], line: number) {
+export function filterDuplicationBlocksByLine(blocks: DuplicationBlock[], line: number) {
   /* eslint-disable no-underscore-dangle */
   let foundOne = false;
   return blocks.filter(b => {
@@ -36,12 +39,12 @@ export function filterDuplicationBlocksByLine(blocks: T.DuplicationBlock[], line
 }
 
 export function getDuplicationBlocksForIndex(
-  duplications: T.Duplication[] | undefined,
+  duplications: Duplication[] | undefined,
   index: number
 ) {
   return (duplications && duplications[index] && duplications[index].blocks) || [];
 }
 
-export function isDuplicationBlockInRemovedComponent(blocks: T.DuplicationBlock[]) {
+export function isDuplicationBlockInRemovedComponent(blocks: DuplicationBlock[]) {
   return blocks.some(b => b._ref === undefined); // eslint-disable-line no-underscore-dangle
 }
index 01cafe5ba0f3b189746f48e1b04b9196969bb434..d3413444a2116846c58ad7204b36c3e45c59a9c6 100644 (file)
@@ -1,3 +1,5 @@
+import { SourceLine, SourceLineCoverageStatus } from '../../../types/types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -17,8 +19,8 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-export default function getCoverageStatus(s: T.SourceLine): T.SourceLineCoverageStatus | undefined {
-  let status: T.SourceLineCoverageStatus | undefined;
+export default function getCoverageStatus(s: SourceLine): SourceLineCoverageStatus | undefined {
+  let status: SourceLineCoverageStatus | undefined;
   if (s.lineHits != null && s.lineHits > 0) {
     status = 'partially-covered';
   }
index 814499476725ef6a79e937297b14eb66c168cd00..f2fc860d8ad6bdfe1772ddf6c29d49f3163bd58f 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { uniq } from 'lodash';
+import { LinearIssueLocation } from '../../../types/types';
 
 export interface Token {
   className: string;
@@ -83,7 +84,7 @@ function part(str: string, from: number, to: number, acc: number): string {
  */
 export function highlightIssueLocations(
   tokens: Token[],
-  issueLocations: T.LinearIssueLocation[],
+  issueLocations: LinearIssueLocation[],
   rootClassName: string = ISSUE_LOCATION_CLASS
 ): Token[] {
   issueLocations.forEach(location => {
index 3dc6c118ccdf20f0bb9750ec23a19119a97947c7..fbc09b5235903eac73a810e25e0bf867b2f85ca5 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { flatten } from 'lodash';
+import { Duplication, Issue, LinearIssueLocation, SourceLine } from '../../../types/types';
 import { splitByTokens } from './highlight';
 import { getLinearLocations } from './issueLocations';
 
-export function issuesByLine(issues: T.Issue[]) {
-  const index: { [line: number]: T.Issue[] } = {};
+export function issuesByLine(issues: Issue[]) {
+  const index: { [line: number]: Issue[] } = {};
   issues.forEach(issue => {
     const line = issue.textRange ? issue.textRange.endLine : 0;
     if (!(line in index)) {
@@ -34,9 +35,9 @@ export function issuesByLine(issues: T.Issue[]) {
 }
 
 export function issuesByComponentAndLine(
-  issues: T.Issue[] = []
-): { [component: string]: { [line: number]: T.Issue[] } } {
-  return issues.reduce((mapping: { [component: string]: { [line: number]: T.Issue[] } }, issue) => {
+  issues: Issue[] = []
+): { [component: string]: { [line: number]: Issue[] } } {
+  return issues.reduce((mapping: { [component: string]: { [line: number]: Issue[] } }, issue) => {
     mapping[issue.component] = mapping[issue.component] || {};
     const line = issue.textRange ? issue.textRange.endLine : 0;
     mapping[issue.component][line] = mapping[issue.component][line] || [];
@@ -45,8 +46,8 @@ export function issuesByComponentAndLine(
   }, {});
 }
 
-export function locationsByLine(issues: Pick<T.Issue, 'textRange'>[]) {
-  const index: { [line: number]: T.LinearIssueLocation[] } = {};
+export function locationsByLine(issues: Pick<Issue, 'textRange'>[]) {
+  const index: { [line: number]: LinearIssueLocation[] } = {};
   issues.forEach(issue => {
     getLinearLocations(issue.textRange).forEach(location => {
       if (!(location.line in index)) {
@@ -58,7 +59,7 @@ export function locationsByLine(issues: Pick<T.Issue, 'textRange'>[]) {
   return index;
 }
 
-export function duplicationsByLine(duplications: T.Duplication[] | undefined) {
+export function duplicationsByLine(duplications: Duplication[] | undefined) {
   if (duplications == null) {
     return {};
   }
@@ -82,7 +83,7 @@ export function duplicationsByLine(duplications: T.Duplication[] | undefined) {
   return duplicationsByLine;
 }
 
-export function symbolsByLine(sources: T.SourceLine[]) {
+export function symbolsByLine(sources: SourceLine[]) {
   const index: { [line: number]: string[] } = {};
   sources.forEach(line => {
     const tokens = splitByTokens(line.code || '');
index 1043bb28cf1332a7176d2bd69bd71314e4855d06..4d9584822abb3d2e6c7555c3dd3ec142c45455a6 100644 (file)
@@ -1,3 +1,5 @@
+import { FlowLocation, LinearIssueLocation, SourceLine, TextRange } from '../../../types/types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -17,7 +19,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-export function getLinearLocations(textRange: T.TextRange | undefined): T.LinearIssueLocation[] {
+export function getLinearLocations(textRange: TextRange | undefined): LinearIssueLocation[] {
   if (!textRange) {
     return [];
   }
@@ -34,14 +36,14 @@ export function getLinearLocations(textRange: T.TextRange | undefined): T.Linear
 }
 
 export function getSecondaryIssueLocationsForLine(
-  line: T.SourceLine,
-  highlightedLocations: (T.FlowLocation | undefined)[] | undefined
-): T.LinearIssueLocation[] {
+  line: SourceLine,
+  highlightedLocations: (FlowLocation | undefined)[] | undefined
+): LinearIssueLocation[] {
   if (!highlightedLocations) {
     return [];
   }
   return highlightedLocations.reduce((locations, location) => {
-    const linearLocations: T.LinearIssueLocation[] = location
+    const linearLocations: LinearIssueLocation[] = location
       ? getLinearLocations(location.textRange)
           .filter(l => l.line === line.line)
           .map(l => ({
index 799513ba3d42e1eff8d9e6444e9306a5330e71cd..2ca758c9ef1f54b82abf68c18be3a985364247c1 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { intersection } from 'lodash';
+import { Issue, LinearIssueLocation } from '../../../types/types';
 
 export function optimizeHighlightedSymbols(
   symbolsForLine: string[] = [],
@@ -30,7 +31,7 @@ export function optimizeHighlightedSymbols(
 
 export function optimizeLocationMessage(
   highlightedLocationMessage: { index: number; text: string | undefined } | undefined,
-  optimizedSecondaryIssueLocations: T.LinearIssueLocation[]
+  optimizedSecondaryIssueLocations: LinearIssueLocation[]
 ) {
   return highlightedLocationMessage != null &&
     optimizedSecondaryIssueLocations.some(
@@ -40,7 +41,7 @@ export function optimizeLocationMessage(
     : undefined;
 }
 
-export function optimizeSelectedIssue(selectedIssue: string | undefined, issuesForLine: T.Issue[]) {
+export function optimizeSelectedIssue(selectedIssue: string | undefined, issuesForLine: Issue[]) {
   return selectedIssue !== undefined && issuesForLine.find(issue => issue.key === selectedIssue)
     ? selectedIssue
     : undefined;
index c8ba6e035984427db89485419844390de5168e71..2fced3c40596b7362c9b641902d366a777549da9 100644 (file)
@@ -21,6 +21,7 @@ import { searchIssues } from '../../../api/issues';
 import { getBranchLikeQuery } from '../../../helpers/branch-like';
 import { parseIssueFromResponse } from '../../../helpers/issues';
 import { BranchLike } from '../../../types/branch-like';
+import { Issue, RawQuery } from '../../../types/types';
 
 // maximum possible value
 const PAGE_SIZE = 500;
@@ -35,11 +36,7 @@ function buildQuery(component: string, branchLike: BranchLike | undefined) {
   };
 }
 
-export function loadPage(
-  query: T.RawQuery,
-  page: number,
-  pageSize = PAGE_SIZE
-): Promise<T.Issue[]> {
+export function loadPage(query: RawQuery, page: number, pageSize = PAGE_SIZE): Promise<Issue[]> {
   return searchIssues({
     ...query,
     p: page,
@@ -50,11 +47,11 @@ export function loadPage(
 }
 
 export function loadPageAndNext(
-  query: T.RawQuery,
+  query: RawQuery,
   toLine: number,
   page: number,
   pageSize = PAGE_SIZE
-): Promise<T.Issue[]> {
+): Promise<Issue[]> {
   return loadPage(query, page).then(issues => {
     if (issues.length === 0) {
       return [];
@@ -80,7 +77,7 @@ export default function loadIssues(
   _fromLine: number,
   toLine: number,
   branchLike: BranchLike | undefined
-): Promise<T.Issue[]> {
+): Promise<Issue[]> {
   const query = buildQuery(component, branchLike);
   return new Promise(resolve => {
     loadPageAndNext(query, toLine, 1).then(issues => {
index 6f50f63de03201b1578bce410781d205cf4d1939..7e313936705368cab5707332a3db5644574c55e2 100644 (file)
@@ -24,12 +24,13 @@ import Dropdown from '../../components/controls/Dropdown';
 import DropdownIcon from '../../components/icons/DropdownIcon';
 import { getLocalizedMetricName, translate } from '../../helpers/l10n';
 import { isDiffMetric } from '../../helpers/measures';
+import { Metric } from '../../types/types';
 import AddGraphMetricPopup from './AddGraphMetricPopup';
 
 interface Props {
   addMetric: (metric: string) => void;
   className?: string;
-  metrics: T.Metric[];
+  metrics: Metric[];
   metricsTypeFilter?: string[];
   removeMetric: (metric: string) => void;
   selectedMetrics: string[];
@@ -81,7 +82,7 @@ export default class AddGraphMetric extends React.PureComponent<Props, State> {
       .map(metric => metric.key);
   };
 
-  getSelectedMetricsElements = (metrics: T.Metric[], selectedMetrics?: string[]) => {
+  getSelectedMetricsElements = (metrics: Metric[], selectedMetrics?: string[]) => {
     const selected = selectedMetrics || this.props.selectedMetrics;
     return metrics.filter(metric => selected.includes(metric.key)).map(metric => metric.key);
   };
index af55a9814a6bf007d684dc7932cab90855035b05..ce93bbc2c4dcaffc48097669a8608c0b8b496d1a 100644 (file)
@@ -22,12 +22,13 @@ import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
 import AdvancedTimeline from '../../components/charts/AdvancedTimeline';
 import { formatMeasure, getShortType } from '../../helpers/measures';
 import { MeasureHistory, Serie } from '../../types/project-activity';
+import { AnalysisEvent } from '../../types/types';
 import GraphsLegendCustom from './GraphsLegendCustom';
 import GraphsLegendStatic from './GraphsLegendStatic';
 import GraphsTooltips from './GraphsTooltips';
 
 interface Props {
-  events: T.AnalysisEvent[];
+  events: AnalysisEvent[];
   graph: string;
   graphEndDate?: Date;
   graphStartDate?: Date;
index e783b394cefdbff274ba4f54dc07217d0c730f2f..a2ad51be5073e1292e0b22b24d316515edb123ef 100644 (file)
@@ -21,6 +21,7 @@ import classNames from 'classnames';
 import * as React from 'react';
 import { translate } from '../../helpers/l10n';
 import { GraphType } from '../../types/project-activity';
+import { Metric } from '../../types/types';
 import SelectLegacy from '../controls/SelectLegacy';
 import AddGraphMetric from './AddGraphMetric';
 import './styles.css';
@@ -31,7 +32,7 @@ interface Props {
   className?: string;
   removeCustomMetric?: (metric: string) => void;
   graph: GraphType;
-  metrics: T.Metric[];
+  metrics: Metric[];
   metricsTypeFilter?: string[];
   selectedMetrics?: string[];
   updateGraph: (graphType: string) => void;
index 29d351983c51e046008b27d3e8b8519123339aa0..e4f4894ebd6b98f0e4def8d894ba90a6b45ecded 100644 (file)
@@ -23,12 +23,13 @@ import DeferredSpinner from '../../components/ui/DeferredSpinner';
 import { translate } from '../../helpers/l10n';
 import { getBaseUrl } from '../../helpers/system';
 import { GraphType, MeasureHistory, Serie } from '../../types/project-activity';
+import { ParsedAnalysis } from '../../types/types';
 import GraphHistory from './GraphHistory';
 import './styles.css';
 import { getSeriesMetricType, hasHistoryData, isCustomGraph } from './utils';
 
 interface Props {
-  analyses: T.ParsedAnalysis[];
+  analyses: ParsedAnalysis[];
   graph: GraphType;
   graphs: Serie[][];
   graphEndDate?: Date;
index 5fefe8622787c032bec3f6c2c2202230a0e9786c..4e175e2de88802805fb26249aa4628cde4186a1a 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { Popup, PopupPlacement } from '../../components/ui/popups';
 import { isDefined } from '../../helpers/types';
 import { MeasureHistory, Serie } from '../../types/project-activity';
+import { AnalysisEvent } from '../../types/types';
 import DateTimeFormatter from '../intl/DateTimeFormatter';
 import GraphsTooltipsContent from './GraphsTooltipsContent';
 import GraphsTooltipsContentCoverage from './GraphsTooltipsContentCoverage';
@@ -30,7 +31,7 @@ import GraphsTooltipsContentIssues from './GraphsTooltipsContentIssues';
 import { DEFAULT_GRAPH } from './utils';
 
 interface Props {
-  events: T.AnalysisEvent[];
+  events: AnalysisEvent[];
   formatValue: (tick: number | string) => string;
   graph: string;
   graphWidth: number;
index 98c07f2dc2c6640f40b18c2956deb370f49c0cf6..b905ed858dfd436ef35953edfb43b5b31ae311cd 100644 (file)
  */
 import * as React from 'react';
 import EventInner from '../../apps/projectActivity/components/EventInner';
+import { AnalysisEvent } from '../../types/types';
 
 interface Props {
   addSeparator: boolean;
-  events: T.AnalysisEvent[];
+  events: AnalysisEvent[];
 }
 
 export default function GraphsTooltipsContentEvents({ addSeparator, events }: Props) {
index 14bb68e56b9bed8fbd246d193b8f5f8f50b202b3..7b5b4c6dc7186e0c2fdfd4fdec82479051978fa2 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import ChartLegendIcon from '../../components/icons/ChartLegendIcon';
 import Rating from '../../components/ui/Rating';
 import { MeasureHistory } from '../../types/project-activity';
+import { Dict } from '../../types/types';
 
 export interface GraphsTooltipsContentIssuesProps {
   index: number;
@@ -31,7 +32,7 @@ export interface GraphsTooltipsContentIssuesProps {
   value: string;
 }
 
-const METRIC_RATING: T.Dict<string> = {
+const METRIC_RATING: Dict<string> = {
   bugs: 'reliability_rating',
   vulnerabilities: 'security_rating',
   code_smells: 'sqale_rating'
index c0d44ce9c41a4fbf2edcf2902fa4758e8713c672..e79c9e4e82f794df0ccdef1a054b040305027d57 100644 (file)
@@ -23,16 +23,17 @@ import { localizeMetric } from '../../helpers/measures';
 import { get, save } from '../../helpers/storage';
 import { MetricKey } from '../../types/metrics';
 import { GraphType, MeasureHistory, Serie } from '../../types/project-activity';
+import { Dict, Metric } from '../../types/types';
 
 export const DEFAULT_GRAPH = GraphType.issues;
 
-const GRAPHS_METRICS_DISPLAYED: T.Dict<string[]> = {
+const GRAPHS_METRICS_DISPLAYED: Dict<string[]> = {
   [GraphType.issues]: [MetricKey.bugs, MetricKey.code_smells, MetricKey.vulnerabilities],
   [GraphType.coverage]: [MetricKey.lines_to_cover, MetricKey.uncovered_lines],
   [GraphType.duplications]: [MetricKey.ncloc, MetricKey.duplicated_lines]
 };
 
-const GRAPHS_METRICS: T.Dict<string[]> = {
+const GRAPHS_METRICS: Dict<string[]> = {
   [GraphType.issues]: GRAPHS_METRICS_DISPLAYED[GraphType.issues].concat([
     MetricKey.reliability_rating,
     MetricKey.security_rating,
@@ -106,7 +107,7 @@ export function generateCoveredLinesMetric(
 export function generateSeries(
   measuresHistory: MeasureHistory[],
   graph: GraphType,
-  metrics: T.Metric[] | T.Dict<T.Metric>,
+  metrics: Metric[] | Dict<Metric>,
   displayedMetrics: string[]
 ): Serie[] {
   if (displayedMetrics.length <= 0 || measuresHistory === undefined) {
@@ -158,7 +159,7 @@ export function getActivityGraph(
   };
 }
 
-function findMetric(key: string, metrics: T.Metric[] | T.Dict<T.Metric>) {
+function findMetric(key: string, metrics: Metric[] | Dict<Metric>) {
   if (Array.isArray(metrics)) {
     return metrics.find(metric => metric.key === key);
   }
index 86afbce4763609fac88663b29af354fa1f6486a7..58a1557c988e1662722d903756774b714ab4e5e0 100644 (file)
@@ -25,6 +25,7 @@ import { flatten, isEqual, sortBy, throttle, uniq } from 'lodash';
 import * as React from 'react';
 import { colors, rawSizes } from '../../app/theme';
 import { isDefined } from '../../helpers/types';
+import { Chart } from '../../types/types';
 import './AdvancedTimeline.css';
 import './LineChart.css';
 
@@ -44,7 +45,7 @@ export interface Props {
   metricType: string;
   padding: number[];
   selectedDate?: Date;
-  series: T.Chart.Serie[];
+  series: Chart.Serie[];
   showAreas?: boolean;
   startDate?: Date;
   updateSelectedDate?: (selectedDate?: Date) => void;
@@ -140,7 +141,7 @@ export default class AdvancedTimeline extends React.PureComponent<Props, State>
       .range([availableHeight, 0]);
   };
 
-  getYScale = (props: Props, availableHeight: number, flatData: T.Chart.Point[]): YScale => {
+  getYScale = (props: Props, availableHeight: number, flatData: Chart.Point[]): YScale => {
     if (props.metricType === 'RATING') {
       return this.getRatingScale(availableHeight);
     } else if (props.metricType === 'LEVEL') {
@@ -152,11 +153,7 @@ export default class AdvancedTimeline extends React.PureComponent<Props, State>
       .nice();
   };
 
-  getXScale = (
-    { startDate, endDate }: Props,
-    availableWidth: number,
-    flatData: T.Chart.Point[]
-  ) => {
+  getXScale = ({ startDate, endDate }: Props, availableWidth: number, flatData: 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];
@@ -266,7 +263,7 @@ export default class AdvancedTimeline extends React.PureComponent<Props, State>
       if (state.mouseOver && firstSerie) {
         const { updateTooltip } = this.props;
         const date = state.xScale.invert(xPos);
-        const bisectX = bisector<T.Chart.Point, Date>(d => d.x).right;
+        const bisectX = bisector<Chart.Point, Date>(d => d.x).right;
         let idx = bisectX(firstSerie.data, date);
         if (idx >= 0) {
           const previousPoint = firstSerie.data[idx - 1];
@@ -450,7 +447,7 @@ export default class AdvancedTimeline extends React.PureComponent<Props, State>
   };
 
   renderLines = () => {
-    const lineGenerator = d3Line<T.Chart.Point>()
+    const lineGenerator = d3Line<Chart.Point>()
       .defined(d => Boolean(d.y || d.y === 0))
       .x(d => this.state.xScale(d.x))
       .y(d => this.state.yScale(d.y));
@@ -504,7 +501,7 @@ export default class AdvancedTimeline extends React.PureComponent<Props, State>
   };
 
   renderAreas = () => {
-    const areaGenerator = area<T.Chart.Point>()
+    const areaGenerator = area<Chart.Point>()
       .defined(d => Boolean(d.y || d.y === 0))
       .x(d => this.state.xScale(d.x))
       .y1(d => this.state.yScale(d.y))
index 3aeda4d3b435126c370e80b19b145c144a741aa7..83df85e75b12d0bd17de0fe89bbba889302ec852 100644 (file)
@@ -25,10 +25,11 @@ import { translate } from '../../helpers/l10n';
 import { formatMeasure } from '../../helpers/measures';
 import { getLanguages, Store } from '../../store/rootReducer';
 import { MetricType } from '../../types/metrics';
+import { Languages } from '../../types/types';
 
 interface LanguageDistributionProps {
   distribution: string;
-  languages: T.Languages;
+  languages: Languages;
 }
 
 const NUMBER_FORMAT_THRESHOLD = 1000;
index 30eef58f938e3247dcdcce6af3bdf62db596c6c1..d7e6b4664d30044dcad881d240097f2f47220e1c 100644 (file)
@@ -21,6 +21,7 @@ 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 { ComponentMeasureEnhanced } from '../../types/types';
 import './TreeMap.css';
 import TreeMapRect from './TreeMapRect';
 
@@ -35,7 +36,7 @@ export interface TreeMapItem {
   metric?: { key: string; type: string };
   size: number;
   tooltip?: React.ReactNode;
-  component: T.ComponentMeasureEnhanced;
+  component: ComponentMeasureEnhanced;
 }
 
 interface HierarchicalTreemapItem extends TreeMapItem {
@@ -45,7 +46,7 @@ interface HierarchicalTreemapItem extends TreeMapItem {
 interface Props {
   height: number;
   items: TreeMapItem[];
-  onRectangleClick?: (item: T.ComponentMeasureEnhanced) => void;
+  onRectangleClick?: (item: ComponentMeasureEnhanced) => void;
   width: number;
 }
 
@@ -65,7 +66,7 @@ export default class TreeMap extends React.PureComponent<Props> {
     return prefix.substr(0, prefix.length - lastPrefixPart.length);
   };
 
-  handleClick = (component: T.ComponentMeasureEnhanced) => {
+  handleClick = (component: ComponentMeasureEnhanced) => {
     if (this.props.onRectangleClick) {
       this.props.onRectangleClick(component);
     }
index 41542eda4bf57c2b48719a59c6a4e1b4241d4139..b05a64c85a0f69e924c1ab4972a1ed827f0cc657 100644 (file)
@@ -25,6 +25,7 @@ import { flatten, sortBy, throttle } from 'lodash';
 import * as React from 'react';
 import Draggable, { DraggableBounds, DraggableCore, DraggableData } from 'react-draggable';
 import { colors } from '../../app/theme';
+import { Chart } from '../../types/types';
 import './LineChart.css';
 import './ZoomTimeLine.css';
 
@@ -35,7 +36,7 @@ export interface Props {
   leakPeriodDate?: Date;
   metricType: string;
   padding: number[];
-  series: T.Chart.Serie[];
+  series: Chart.Serie[];
   showAreas?: boolean;
   showXTicks: boolean;
   startDate?: Date;
@@ -79,7 +80,7 @@ export default class ZoomTimeLine extends React.PureComponent<Props, State> {
       .range([availableHeight, 0]);
   };
 
-  getYScale = (availableHeight: number, flatData: T.Chart.Point[]): YScale => {
+  getYScale = (availableHeight: number, flatData: Chart.Point[]): YScale => {
     if (this.props.metricType === 'RATING') {
       return this.getRatingScale(availableHeight);
     } else if (this.props.metricType === 'LEVEL') {
@@ -91,7 +92,7 @@ export default class ZoomTimeLine extends React.PureComponent<Props, State> {
       .nice();
   };
 
-  getXScale = (availableWidth: number, flatData: T.Chart.Point[]): XScale => {
+  getXScale = (availableWidth: number, flatData: Chart.Point[]): XScale => {
     return scaleTime()
       .domain(extent(flatData, d => d.x) as [Date, Date])
       .range([0, availableWidth])
@@ -233,7 +234,7 @@ export default class ZoomTimeLine extends React.PureComponent<Props, State> {
   };
 
   renderLines = (xScale: XScale, yScale: YScale) => {
-    const lineGenerator = d3Line<T.Chart.Point>()
+    const lineGenerator = d3Line<Chart.Point>()
       .defined(d => Boolean(d.y || d.y === 0))
       .x(d => xScale(d.x))
       .y(d => yScale(d.y));
@@ -254,7 +255,7 @@ export default class ZoomTimeLine extends React.PureComponent<Props, State> {
   };
 
   renderAreas = (xScale: XScale, yScale: YScale) => {
-    const areaGenerator = area<T.Chart.Point>()
+    const areaGenerator = area<Chart.Point>()
       .defined(d => Boolean(d.y || d.y === 0))
       .x(d => xScale(d.x))
       .y1(d => yScale(d.y))
index 47a07318c084f07ef90defd573a6a3a9333f0a36..1531d6f34a98dfe27ff0cfd6f5636a8fe890450d 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { Chart } from '../../../types/types';
 import AdvancedTimeline from '../AdvancedTimeline';
 
 const newCodeLegendClass = '.new-code-legend';
@@ -283,7 +284,7 @@ function shallowRender(props?: Partial<AdvancedTimeline['props']>) {
   );
 }
 
-function mockData(i: number, date: string): T.Chart.Serie {
+function mockData(i: number, date: string): Chart.Serie {
   return {
     name: `t${i}`,
     type: 'type',
index 967b075314f7a4585775a3be345ecfa45bdf4d40..72965fc69601ec9ac0dae7046d300fda148c21a4 100644 (file)
@@ -27,6 +27,7 @@ import { mockComponentMeasureEnhanced } from '../../../helpers/mocks/component';
 import { mockHtmlElement } from '../../../helpers/mocks/dom';
 import { mockEvent } from '../../../helpers/testMocks';
 import { click } from '../../../helpers/testUtils';
+import { ComponentMeasureEnhanced } from '../../../types/types';
 import BubbleChart from '../BubbleChart';
 
 jest.mock('react-virtualized/dist/commonjs/AutoSizer', () => ({
@@ -136,8 +137,8 @@ it('should correctly handle zooming', () => {
   });
 });
 
-function shallowRender(props: Partial<BubbleChart<T.ComponentMeasureEnhanced>['props']> = {}) {
-  return shallow<BubbleChart<T.ComponentMeasureEnhanced>>(
+function shallowRender(props: Partial<BubbleChart<ComponentMeasureEnhanced>['props']> = {}) {
+  return shallow<BubbleChart<ComponentMeasureEnhanced>>(
     <BubbleChart
       height={100}
       items={[
index a426bcc7bf608d0eff18562e8bd832f6c51c543e..06e7a880ce51ca0e42a094ae8b9c998e9799d7a0 100644 (file)
@@ -26,11 +26,12 @@ import DeferredSpinner from '../../components/ui/DeferredSpinner';
 import { translate } from '../../helpers/l10n';
 import { sanitizeStringRestricted } from '../../helpers/sanitize';
 import { TaskWarning } from '../../types/tasks';
+import { CurrentUser } from '../../types/types';
 import { withCurrentUser } from '../hoc/withCurrentUser';
 
 interface Props {
   componentKey?: string;
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   onClose: () => void;
   onWarningDismiss?: () => void;
   taskId?: string;
index 9515fc39afe6b19c7f2f9563273b99781a4b7b89..08d11a9ce98e621c84596e2ea6910247a61182c1 100644 (file)
@@ -21,11 +21,12 @@ import classNames from 'classnames';
 import * as React from 'react';
 import Tooltip from '../../components/controls/Tooltip';
 import { translate } from '../../helpers/l10n';
+import { Visibility } from '../../types/types';
 
 interface PrivacyBadgeContainerProps {
   className?: string;
   qualifier: string;
-  visibility: T.Visibility;
+  visibility: Visibility;
 }
 
 export default function PrivacyBadgeContainer({
index d25834908cd114d214acc63bec3ffda9226659c6..e8b47242af31b8897a2d352859161841c061bf0e 100644 (file)
@@ -24,10 +24,11 @@ import { Alert } from '../../components/ui/Alert';
 import MandatoryFieldMarker from '../../components/ui/MandatoryFieldMarker';
 import MandatoryFieldsExplanation from '../../components/ui/MandatoryFieldsExplanation';
 import { translate } from '../../helpers/l10n';
+import { LoggedInUser } from '../../types/types';
 
 interface Props {
   className?: string;
-  user: T.LoggedInUser;
+  user: LoggedInUser;
   onPasswordChange?: () => void;
 }
 
index 612d4caf6d53448dd0b9f7875b48d019487febb5..bcc04b880a1d34ace29166cdad5b4f36209142e0 100644 (file)
@@ -23,11 +23,12 @@ import { restart } from '../../api/system';
 import { Button } from '../../components/controls/buttons';
 import ConfirmButton from '../../components/controls/ConfirmButton';
 import { translate } from '../../helpers/l10n';
+import { SysStatus } from '../../types/types';
 
 interface Props {
   className?: string;
   fetchSystemStatus: () => void;
-  systemStatus: T.SysStatus;
+  systemStatus: SysStatus;
 }
 
 export default class RestartButton extends React.PureComponent<Props> {
index 1432f8df59efc42a92ddb4e6639dad432ad7f5bc..064e638da6e4ca4bede39a8724105148ea7288d8 100644 (file)
@@ -21,13 +21,14 @@ import classNames from 'classnames';
 import * as React from 'react';
 import Radio from '../../components/controls/Radio';
 import { translate } from '../../helpers/l10n';
+import { Visibility } from '../../types/types';
 
 interface Props {
   canTurnToPrivate?: boolean;
   className?: string;
-  onChange: (visibility: T.Visibility) => void;
+  onChange: (visibility: Visibility) => void;
   showDetails?: boolean;
-  visibility?: T.Visibility;
+  visibility?: Visibility;
 }
 
 export default class VisibilitySelector extends React.PureComponent<Props> {
index cda9d227437d72a99f32f486bc380d55fe68cc9a..fa1ca1e896e0d5972deb38258435992fa018f7dd 100644 (file)
@@ -31,14 +31,15 @@ import { Store } from '../../store/rootReducer';
 import { Branch } from '../../types/branch-like';
 import { ComponentQualifier } from '../../types/component';
 import { ComponentReportStatus } from '../../types/component-report';
+import { AppState, Component, CurrentUser } from '../../types/types';
 import { withCurrentUser } from '../hoc/withCurrentUser';
 import ComponentReportActionsRenderer from './ComponentReportActionsRenderer';
 
 interface Props {
-  appState: Pick<T.AppState, 'qualifiers'>;
-  component: T.Component;
+  appState: Pick<AppState, 'qualifiers'>;
+  component: Component;
   branch?: Branch;
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
 interface State {
index ed1d82e8df9526f244e04bc46f07c4374211f192..723c7287539622d3953c6999371dff0c422caadc 100644 (file)
@@ -25,9 +25,10 @@ import Dropdown from '../../components/controls/Dropdown';
 import DropdownIcon from '../../components/icons/DropdownIcon';
 import { translate, translateWithParameters } from '../../helpers/l10n';
 import { Branch } from '../../types/branch-like';
+import { Component } from '../../types/types';
 
 export interface ComponentReportActionsRendererProps {
-  component: T.Component;
+  component: Component;
   branch?: Branch;
   frequency: string;
   subscribed: boolean;
index c0e0517ceeb159d5cee289714b843f4783e5f523..cbbc7a491f72c511c943b7ca9f63fcc030c7cb3d 100644 (file)
@@ -217,7 +217,7 @@ function NullComponent() {
   return null;
 }
 
-type InputWrapperProps = T.Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value'> &
+type InputWrapperProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value'> &
   WrappedComponentProps & {
     innerRef: React.Ref<HTMLInputElement>;
     value: Date | undefined;
index 02b8f33ef4471242b4beac03babcaf2fe6e29200..7badef4259b386edcfd0cb6dad4caa25a921de73 100644 (file)
@@ -27,21 +27,22 @@ import { translate } from '../../helpers/l10n';
 import { isLoggedIn } from '../../helpers/users';
 import { getCurrentUser, Store } from '../../store/rootReducer';
 import { setHomePage } from '../../store/users';
+import { CurrentUser, HomePage } from '../../types/types';
 
 interface StateProps {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
 interface DispatchProps {
-  setHomePage: (homepage: T.HomePage) => void;
+  setHomePage: (homepage: HomePage) => void;
 }
 
 interface Props extends StateProps, DispatchProps {
   className?: string;
-  currentPage: T.HomePage;
+  currentPage: HomePage;
 }
 
-export const DEFAULT_HOMEPAGE: T.HomePage = { type: 'PROJECTS' };
+export const DEFAULT_HOMEPAGE: HomePage = { type: 'PROJECTS' };
 
 export class HomePageSelect extends React.PureComponent<Props> {
   handleClick = () => {
@@ -95,7 +96,7 @@ const mapDispatchToProps: DispatchProps = { setHomePage };
 
 export default connect(mapStateToProps, mapDispatchToProps)(HomePageSelect);
 
-function isSameHomePage(a: T.HomePage, b: T.HomePage) {
+function isSameHomePage(a: HomePage, b: HomePage) {
   return (
     a.type === b.type &&
     (a as any).branch === (b as any).branch &&
index 37e7127014a9ba2174e207592fa0c8e9555d393d..29ecd99987294877815de940d770a25e6164af86 100644 (file)
@@ -20,7 +20,7 @@
 import { Formik, FormikActions, FormikProps } from 'formik';
 import * as React from 'react';
 
-export type ChildrenProps<V> = T.Omit<FormikProps<V>, 'handleSubmit'>;
+export type ChildrenProps<V> = Omit<FormikProps<V>, 'handleSubmit'>;
 
 interface Props<V> {
   children: (props: ChildrenProps<V>) => React.ReactNode;
index 360f3f1ad5e131b1d6038bca0287697a55c77228..2ab071da5c53198caa1e0f4d5aa6e33d638bcfb2 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import { ButtonLink } from '../../../components/controls/buttons';
 import { mockCurrentUser, mockLoggedInUser } from '../../../helpers/testMocks';
 import { click, waitAndUpdate } from '../../../helpers/testUtils';
+import { HomePage } from '../../../types/types';
 import { DEFAULT_HOMEPAGE, HomePageSelect } from '../HomePageSelect';
 
 it('should render correctly', () => {
@@ -40,7 +41,7 @@ it('should render correctly', () => {
 
 it('should correctly call webservices', async () => {
   const setHomePage = jest.fn();
-  const currentPage: T.HomePage = { type: 'MY_ISSUES' };
+  const currentPage: HomePage = { type: 'MY_ISSUES' };
   const wrapper = shallowRender({ setHomePage, currentPage });
 
   // Set homepage.
index d2f39a0a7fd692dbe9de0c479d649a8719cc5cf5..7527d654e7b07316707fdfdce200c3738da20727 100644 (file)
@@ -91,12 +91,12 @@ export function ButtonLink({ className, ...props }: ButtonProps) {
   return <Button {...props} className={classNames('button-link', className)} />;
 }
 
-export function SubmitButton(props: T.Omit<ButtonProps, 'type'>) {
+export function SubmitButton(props: Omit<ButtonProps, 'type'>) {
   // do not prevent default to actually submit a form
   return <Button {...props} preventDefault={false} type="submit" />;
 }
 
-export function ResetButtonLink(props: T.Omit<ButtonProps, 'type'>) {
+export function ResetButtonLink(props: Omit<ButtonProps, 'type'>) {
   return <ButtonLink {...props} type="reset" />;
 }
 
index ff51324b9071008ccb0142ec6265f9bcc3c052f3..3cc0e2c8a7d241c85b4a622a8b57757d45878cdd 100644 (file)
@@ -21,10 +21,11 @@ import * as React from 'react';
 import { Link } from 'react-router';
 import DetachIcon from '../../components/icons/DetachIcon';
 import { isSonarCloud } from '../../helpers/system';
+import { AppState } from '../../types/types';
 import { withAppState } from '../hoc/withAppState';
 
 interface OwnProps {
-  appState: Pick<T.AppState, 'canAdmin'>;
+  appState: Pick<AppState, 'canAdmin'>;
   customProps?: {
     [k: string]: any;
   };
index 9d98c570e30dc9c1d20c1ba6b1942d317c3d9998..ebe7a85d0e5b57bdceeb865bdf98fe27e97d4e80 100644 (file)
@@ -26,6 +26,7 @@ import remark from 'remark';
 import remarkCustomBlocks from 'remark-custom-blocks';
 import remarkRehype from 'remark-rehype';
 import { scrollToElement } from '../../helpers/scrolling';
+import { Dict } from '../../types/types';
 import DocCollapsibleBlock from './DocCollapsibleBlock';
 import DocImg from './DocImg';
 import DocLink from './DocLink';
@@ -34,7 +35,7 @@ import DocToc from './DocToc';
 import DocTooltipLink from './DocTooltipLink';
 
 interface Props {
-  childProps?: T.Dict<string>;
+  childProps?: Dict<string>;
   className?: string;
   content: string;
   isTooltip?: boolean;
@@ -118,8 +119,8 @@ export default class DocMarkdownBlock extends React.PureComponent<Props> {
 }
 
 function withChildProps<P>(
-  WrappedComponent: React.ComponentType<P & { customProps?: T.Dict<any> }>,
-  childProps?: T.Dict<any>
+  WrappedComponent: React.ComponentType<P & { customProps?: Dict<any> }>,
+  childProps?: Dict<any>
 ) {
   return function withChildProps(props: P) {
     return <WrappedComponent customProps={childProps} {...props} />;
index b2d853e180f00a0c4f7e9956736034b12ecd12da..af58e7ccdb9038cd2f3c070d2a2fbd48441d9cfc 100644 (file)
@@ -21,9 +21,10 @@ import { forEach } from 'lodash';
 import * as React from 'react';
 import { Link } from 'react-router';
 import DetachIcon from '../../components/icons/DetachIcon';
+import { Dict } from '../../types/types';
 
 interface OwnProps {
-  customProps?: T.Dict<string>;
+  customProps?: Dict<string>;
 }
 
 type Props = OwnProps & React.AnchorHTMLAttributes<HTMLAnchorElement>;
index bd4933f3ab69919d1baf8bb1e82d9f340e1764e5..8c727e619c254303077620e9bc07803d9b78c515 100644 (file)
@@ -27,6 +27,7 @@ import { Alert } from '../../components/ui/Alert';
 import { translate } from '../../helpers/l10n';
 import { formatMeasure } from '../../helpers/measures';
 import { queriesEqual } from '../../helpers/query';
+import { Dict, Paging, RawQuery } from '../../types/types';
 import FacetBox from './FacetBox';
 import FacetHeader from './FacetHeader';
 import FacetItem from './FacetItem';
@@ -37,7 +38,7 @@ import MultipleSelectionHint from './MultipleSelectionHint';
 interface SearchResponse<S> {
   maxResults?: boolean;
   results: S[];
-  paging?: T.Paging;
+  paging?: Paging;
 }
 
 export interface Props<S> {
@@ -49,23 +50,23 @@ export interface Props<S> {
   getFacetItemText: (item: string) => string;
   getSearchResultKey: (result: S) => string;
   getSearchResultText: (result: S) => string;
-  loadSearchResultCount?: (result: S[]) => Promise<T.Dict<number>>;
+  loadSearchResultCount?: (result: S[]) => Promise<Dict<number>>;
   maxInitialItems: number;
   maxItems: number;
   minSearchLength: number;
-  onChange: (changes: T.Dict<string | string[]>) => void;
+  onChange: (changes: Dict<string | string[]>) => void;
   onClear?: () => void;
   onItemClick?: (itemValue: string, multiple: boolean) => void;
   onSearch: (query: string, page?: number) => Promise<SearchResponse<S>>;
   onToggle: (property: string) => void;
   open: boolean;
   property: string;
-  query?: T.RawQuery;
+  query?: RawQuery;
   renderFacetItem: (item: string) => React.ReactNode;
   renderSearchResult: (result: S, query: string) => React.ReactNode;
   searchPlaceholder: string;
   getSortedItems?: () => string[];
-  stats: T.Dict<number> | undefined;
+  stats: Dict<number> | undefined;
   values: string[];
 }
 
@@ -74,9 +75,9 @@ interface State<S> {
   query: string;
   searching: boolean;
   searchMaxResults?: boolean;
-  searchPaging?: T.Paging;
+  searchPaging?: Paging;
   searchResults?: S[];
-  searchResultsCounts: T.Dict<number>;
+  searchResultsCounts: Dict<number>;
   showFullList: boolean;
 }
 
index 6ccddfec3223a233502e392f98b9210514905824..581fe01ebe239308f6bc00031725ded6aaa21482 100644 (file)
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { mockStore } from '../../../helpers/testMocks';
+import { CurrentUser } from '../../../types/types';
 import { withCurrentUser } from '../withCurrentUser';
 
-class X extends React.Component<{ currentUser: T.CurrentUser }> {
+class X extends React.Component<{ currentUser: CurrentUser }> {
   render() {
     return <div />;
   }
index ac05b25a60f86c0802d56837f63e9f6d72aa4e64..1ee5e7e2361abb535d455fb9c7b1f3030121f6ea 100644 (file)
@@ -22,11 +22,12 @@ import * as React from 'react';
 import { KeyboardCodes } from '../../../helpers/keycodes';
 import { mockComponent } from '../../../helpers/mocks/component';
 import { KEYCODE_MAP, keydown } from '../../../helpers/testUtils';
+import { ComponentMeasure } from '../../../types/types';
 import withKeyboardNavigation, { WithKeyboardNavigationProps } from '../withKeyboardNavigation';
 
 class X extends React.Component<{
-  components?: T.ComponentMeasure[];
-  selected?: T.ComponentMeasure;
+  components?: ComponentMeasure[];
+  selected?: ComponentMeasure;
 }> {
   render() {
     return <div />;
index d258303c773b38b2b874c2d37fb86c5111b59633..4b7840d01145058989d2c2814ba385b2d8cd09c2 100644 (file)
 import * as React from 'react';
 import handleRequiredAuthentication from '../../helpers/handleRequiredAuthentication';
 import { isLoggedIn } from '../../helpers/users';
+import { CurrentUser } from '../../types/types';
 import { getWrappedDisplayName } from './utils';
 import { withCurrentUser } from './withCurrentUser';
 
 export function whenLoggedIn<P>(WrappedComponent: React.ComponentType<P>) {
-  class Wrapper extends React.Component<P & { currentUser: T.CurrentUser }> {
+  class Wrapper extends React.Component<P & { currentUser: CurrentUser }> {
     static displayName = getWrappedDisplayName(WrappedComponent, 'whenLoggedIn');
 
     componentDidMount() {
index 0866eb920878af5418085ef9c5f38bb385488081..e0c32a70f773612e2910e5e95e33090c36f0db49 100644 (file)
 import * as React from 'react';
 import { connect } from 'react-redux';
 import { getAppState, Store } from '../../store/rootReducer';
+import { AppState } from '../../types/types';
 import { getWrappedDisplayName } from './utils';
 
 export function withAppState<P>(
-  WrappedComponent: React.ComponentType<P & { appState: Partial<T.AppState> }>
+  WrappedComponent: React.ComponentType<P & { appState: Partial<AppState> }>
 ) {
-  class Wrapper extends React.Component<P & { appState: T.AppState }> {
+  class Wrapper extends React.Component<P & { appState: AppState }> {
     static displayName = getWrappedDisplayName(WrappedComponent, 'withAppState');
 
     render() {
index f08a11783b8011dfe719052a198521cf8a9ee52d..dd69ef91a44ed940c0a3480d8289a1250063f797 100644 (file)
 import * as React from 'react';
 import { connect } from 'react-redux';
 import { getCurrentUser, Store } from '../../store/rootReducer';
+import { CurrentUser } from '../../types/types';
 import { getWrappedDisplayName } from './utils';
 
 export function withCurrentUser<P>(
-  WrappedComponent: React.ComponentType<P & { currentUser: T.CurrentUser }>
+  WrappedComponent: React.ComponentType<P & { currentUser: CurrentUser }>
 ) {
-  class Wrapper extends React.Component<P & { currentUser: T.CurrentUser }> {
+  class Wrapper extends React.Component<P & { currentUser: CurrentUser }> {
     static displayName = getWrappedDisplayName(WrappedComponent, 'withCurrentUser');
 
     render() {
index cebddd9aa1480f7385a7842652ab40ad2a3eea64..ee15abb0c366cf18fd76635be2b9d33eb8550211 100644 (file)
@@ -21,17 +21,18 @@ import key from 'keymaster';
 import * as React from 'react';
 import PageActions from '../../components/ui/PageActions';
 import { getComponentMeasureUniqueKey } from '../../helpers/component';
+import { ComponentMeasure } from '../../types/types';
 import { getWrappedDisplayName } from './utils';
 
 export interface WithKeyboardNavigationProps {
-  components?: T.ComponentMeasure[];
+  components?: ComponentMeasure[];
   cycle?: boolean;
   isFile?: boolean;
   onEndOfList?: () => void;
   onGoToParent?: () => void;
-  onHighlight?: (item: T.ComponentMeasure) => void;
-  onSelect?: (item: T.ComponentMeasure) => void;
-  selected?: T.ComponentMeasure;
+  onHighlight?: (item: ComponentMeasure) => void;
+  onSelect?: (item: ComponentMeasure) => void;
+  selected?: ComponentMeasure;
 }
 
 const KEY_SCOPE = 'key_nav';
@@ -126,7 +127,7 @@ export default function withKeyboardNavigation<P>(
 
       const { selected } = this.props;
       if (selected !== undefined) {
-        this.props.onSelect(selected as T.ComponentMeasure);
+        this.props.onSelect(selected as ComponentMeasure);
       }
     };
 
index 7a4b2087d022e580396e0ae72181ef5f50802626..b6aae46c8570b3113d74116cad5e0d9d4aa032b9 100644 (file)
 import { uniqWith } from 'lodash';
 import * as React from 'react';
 import { addNotification, getNotifications, removeNotification } from '../../api/notifications';
+import { Notification } from '../../types/types';
 import { getWrappedDisplayName } from './utils';
 
 interface State {
   channels: string[];
   globalTypes: string[];
   loading: boolean;
-  notifications: T.Notification[];
+  notifications: Notification[];
   perProjectTypes: string[];
 }
 
 export interface WithNotificationsProps {
-  addNotification: (added: T.Notification) => void;
+  addNotification: (added: Notification) => void;
   channels: string[];
   globalTypes: string[];
   loading: boolean;
-  notifications: T.Notification[];
+  notifications: Notification[];
   perProjectTypes: string[];
-  removeNotification: (removed: T.Notification) => void;
+  removeNotification: (removed: Notification) => void;
 }
 
 export function withNotifications<P>(
@@ -85,14 +86,14 @@ export function withNotifications<P>(
       );
     };
 
-    addNotificationToState = (added: T.Notification) => {
+    addNotificationToState = (added: Notification) => {
       this.setState(state => {
         const notifications = uniqWith([...state.notifications, added], this.areNotificationsEqual);
         return { notifications };
       });
     };
 
-    removeNotificationFromState = (removed: T.Notification) => {
+    removeNotificationFromState = (removed: Notification) => {
       this.setState(state => {
         const notifications = state.notifications.filter(
           notification => !this.areNotificationsEqual(notification, removed)
@@ -101,7 +102,7 @@ export function withNotifications<P>(
       });
     };
 
-    addNotification = (added: T.Notification) => {
+    addNotification = (added: Notification) => {
       // optimistic update
       this.addNotificationToState(added);
 
@@ -112,7 +113,7 @@ export function withNotifications<P>(
       });
     };
 
-    removeNotification = (removed: T.Notification) => {
+    removeNotification = (removed: Notification) => {
       // optimistic update
       this.removeNotificationFromState(removed);
 
@@ -123,7 +124,7 @@ export function withNotifications<P>(
       });
     };
 
-    areNotificationsEqual = (a: T.Notification, b: T.Notification) => {
+    areNotificationsEqual = (a: Notification, b: Notification) => {
       return a.channel === b.channel && a.type === b.type && a.project === b.project;
     };
 
index ed03762fddc0fc38bf675de60831a187907609fa..7d06624bfa089708ace218648438f29c09650f93 100644 (file)
@@ -30,6 +30,6 @@ interface InjectedProps {
 
 export function withRouter<P extends InjectedProps>(
   WrappedComponent: React.ComponentType<P & InjectedProps>
-): React.ComponentType<T.Omit<P, keyof InjectedProps>> {
+): React.ComponentType<Omit<P, keyof InjectedProps>> {
   return originalWithRouter(WrappedComponent as any);
 }
index e78a91bbc44880a237d52a9378fd84aa3679c910..b3921530bd28cf613cedb4d2f1cd21bbf71f3e9f 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { IssueType } from '../../types/types';
 import BugIcon from './BugIcon';
 import CodeSmellIcon from './CodeSmellIcon';
 import { IconProps } from './Icon';
@@ -25,7 +26,7 @@ import SecurityHotspotIcon from './SecurityHotspotIcon';
 import VulnerabilityIcon from './VulnerabilityIcon';
 
 interface Props extends IconProps {
-  type: T.IssueType;
+  type: IssueType;
 }
 
 export default function IssueIcon({ type, ...iconProps }: Props) {
index 9815ce40a844a4b382375bf33c03b9c908a16263..bf593add8b2ba3def987a00c14f605d3dac50ca2 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { IssueType } from '../../types/types';
 import { IconProps } from './Icon';
 import IssueIcon from './IssueIcon';
 
@@ -26,7 +27,7 @@ export interface Props extends IconProps {
 }
 
 export default function IssueTypeIcon({ query, ...iconProps }: Props) {
-  let type: T.IssueType;
+  let type: IssueType;
 
   switch (query.toLowerCase()) {
     case 'bug':
index 9044dd99080d9b83fdfb9d274834607a3244617b..b4ad684596053b2ff45a65b7f18fe33c7f938667 100644 (file)
  */
 import * as React from 'react';
 import { colors } from '../../app/theme';
+import { Dict } from '../../types/types';
 import Icon, { IconProps } from './Icon';
 
-const qualifierIcons: T.Dict<(props: IconProps) => React.ReactElement> = {
+const qualifierIcons: Dict<(props: IconProps) => React.ReactElement> = {
   app: ApplicationIcon,
   brc: SubProjectIcon,
   dev: DeveloperIcon,
index 044ed7edca04f537c6b666058f65a06c08030ec3..ae613d2a588739567b7b6e32296b63d817dc9531 100644 (file)
  */
 import * as React from 'react';
 import { colors } from '../../app/theme';
+import { Dict } from '../../types/types';
 import Icon, { IconProps } from './Icon';
 
 interface Props extends IconProps {
   severity: string | null | undefined;
 }
 
-const severityIcons: T.Dict<(props: IconProps) => React.ReactElement> = {
+const severityIcons: Dict<(props: IconProps) => React.ReactElement> = {
   blocker: BlockerSeverityIcon,
   critical: CriticalSeverityIcon,
   major: MajorSeverityIcon,
index 713a92cdcecabf71870e01b5e52846a8aef5ac01..f7cb9e352b082c28ce7fcd769110a8c1bb516956 100644 (file)
  */
 import * as React from 'react';
 import { colors } from '../../app/theme';
+import { Dict } from '../../types/types';
 import Icon, { IconProps } from './Icon';
 
 interface Props extends IconProps {
   status: string;
 }
 
-const statusIcons: T.Dict<(props: IconProps) => React.ReactElement> = {
+const statusIcons: Dict<(props: IconProps) => React.ReactElement> = {
   open: OpenStatusIcon,
   confirmed: ConfirmedStatusIcon,
   reopened: ReopenedStatusIcon,
index 6555744c948e4863f18589d5bc2072484e353287..c6b35c106cfa5e1b6ccaaab271bb3b3707608921 100644 (file)
  */
 import * as React from 'react';
 import { colors } from '../../app/theme';
+import { Dict } from '../../types/types';
 import Icon, { IconProps } from './Icon';
 
 interface Props extends IconProps {
   status: string;
 }
 
-const statusIcons: T.Dict<(props: IconProps) => React.ReactElement> = {
+const statusIcons: Dict<(props: IconProps) => React.ReactElement> = {
   ok: OkTestStatusIcon,
   failure: FailureTestStatusIcon,
   error: ErrorTestStatusIcon,
index 852beec5385910ee424bf78fa3321972bc032d1c..95b6a728d3a77f9dd784d7c3b78ef5cfcd70624a 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { IssueType } from '../../../types/types';
 import IssueIcon from '../IssueIcon';
 
 it('should render correctly', () => {
@@ -28,6 +29,6 @@ it('should render correctly', () => {
   expect(shallowRender('SECURITY_HOTSPOT')).toMatchSnapshot();
 });
 
-function shallowRender(type: T.IssueType) {
+function shallowRender(type: IssueType) {
   return shallow(<IssueIcon type={type} />);
 }
index 0b965122f28d4dee35732b4eefe7da60814128a0..aee598539168be8a3935f3f56c6f2bafc29ece01 100644 (file)
@@ -21,6 +21,7 @@ import key from 'keymaster';
 import * as React from 'react';
 import { setIssueAssignee } from '../../api/issues';
 import { BranchLike } from '../../types/branch-like';
+import { Issue as TypeIssue } from '../../types/types';
 import { updateIssue } from './actions';
 import './Issue.css';
 import IssueView from './IssueView';
@@ -30,11 +31,11 @@ interface Props {
   checked?: boolean;
   displayLocationsCount?: boolean;
   displayLocationsLink?: boolean;
-  issue: T.Issue;
-  onChange: (issue: T.Issue) => void;
+  issue: TypeIssue;
+  onChange: (issue: TypeIssue) => void;
   onCheck?: (issue: string) => void;
   onClick: (issueKey: string) => void;
-  onFilter?: (property: string, issue: T.Issue) => void;
+  onFilter?: (property: string, issue: TypeIssue) => void;
   onPopupToggle: (issue: string, popupName: string, open?: boolean) => void;
   openPopup?: string;
   selected: boolean;
index 30b4e9d5ed84f7a4d2e7f635e640c4c68259cfa0..12aa0538fbaf0555de1187c7d352e8b455485ade 100644 (file)
@@ -23,6 +23,7 @@ import { deleteIssueComment, editIssueComment } from '../../api/issues';
 import Checkbox from '../../components/controls/Checkbox';
 import { translate } from '../../helpers/l10n';
 import { BranchLike } from '../../types/branch-like';
+import { Issue } from '../../types/types';
 import { updateIssue } from './actions';
 import IssueActionsBar from './components/IssueActionsBar';
 import IssueCommentLine from './components/IssueCommentLine';
@@ -34,12 +35,12 @@ interface Props {
   currentPopup?: string;
   displayLocationsCount?: boolean;
   displayLocationsLink?: boolean;
-  issue: T.Issue;
+  issue: Issue;
   onAssign: (login: string) => void;
-  onChange: (issue: T.Issue) => void;
+  onChange: (issue: Issue) => void;
   onCheck?: (issue: string) => void;
   onClick: (issueKey: string) => void;
-  onFilter?: (property: string, issue: T.Issue) => void;
+  onFilter?: (property: string, issue: Issue) => void;
   selected: boolean;
   togglePopup: (popup: string, show: boolean | void) => void;
 }
index e8f5fb113ba5ac9264169b029ef93737cbaeb095..471cd84b9cacfbe5c6575ea6d2c793230146c3f9 100644 (file)
 import throwGlobalError from '../../app/utils/throwGlobalError';
 import { parseIssueFromResponse } from '../../helpers/issues';
 import { IssueResponse } from '../../types/issues';
+import { Issue } from '../../types/types';
 
 export const updateIssue = (
-  onChange: (issue: T.Issue) => void,
+  onChange: (issue: Issue) => void,
   resultPromise: Promise<IssueResponse>,
-  oldIssue?: T.Issue,
-  newIssue?: T.Issue
+  oldIssue?: Issue,
+  newIssue?: Issue
 ) => {
   const optimisticUpdate = oldIssue !== undefined && newIssue !== undefined;
   if (optimisticUpdate) {
index 33558cf7f7d4dda5e9872c135d450af91a54af24..dcb5875a097dad042bf98a7504ff55f793ceb82f 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { IssueResponse } from '../../../types/issues';
+import { Issue, RawQuery } from '../../../types/types';
 import { updateIssue } from '../actions';
 import IssueAssign from './IssueAssign';
 import IssueCommentAction from './IssueCommentAction';
@@ -29,10 +30,10 @@ import IssueTransition from './IssueTransition';
 import IssueType from './IssueType';
 
 interface Props {
-  issue: T.Issue;
+  issue: Issue;
   currentPopup?: string;
   onAssign: (login: string) => void;
-  onChange: (issue: T.Issue) => void;
+  onChange: (issue: Issue) => void;
   togglePopup: (popup: string, show?: boolean) => void;
 }
 
@@ -48,9 +49,9 @@ export default class IssueActionsBar extends React.PureComponent<Props, State> {
   };
 
   setIssueProperty = (
-    property: keyof T.Issue,
+    property: keyof Issue,
     popup: string,
-    apiCall: (query: T.RawQuery) => Promise<IssueResponse>,
+    apiCall: (query: RawQuery) => Promise<IssueResponse>,
     value: string
   ) => {
     const { issue } = this.props;
@@ -74,7 +75,7 @@ export default class IssueActionsBar extends React.PureComponent<Props, State> {
     this.props.togglePopup('comment', open);
   };
 
-  handleTransition = (issue: T.Issue) => {
+  handleTransition = (issue: Issue) => {
     this.props.onChange(issue);
     if (
       issue.resolution === 'FALSE-POSITIVE' ||
index 418d68047a91231967ff9e9f86d17c9386b66a0c..c62aaca921727276f5e1bb4e4f8578b1d1df43bf 100644 (file)
@@ -22,12 +22,13 @@ 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 { Issue } from '../../../types/types';
 import Avatar from '../../ui/Avatar';
 import SetAssigneePopup from '../popups/SetAssigneePopup';
 
 interface Props {
   isOpen: boolean;
-  issue: T.Issue;
+  issue: Issue;
   canAssign: boolean;
   onAssign: (login: string) => void;
   togglePopup: (popup: string, show?: boolean) => void;
index a7b11c014e892242f99156ea94bd896e5be4d01b..2be9b9187aa76bc0b0ff33603f857e2cac199c51 100644 (file)
@@ -21,12 +21,13 @@ import * as React from 'react';
 import { ButtonLink } from '../../../components/controls/buttons';
 import Toggler from '../../../components/controls/Toggler';
 import DropdownIcon from '../../../components/icons/DropdownIcon';
+import { Issue } from '../../../types/types';
 import DateFromNow from '../../intl/DateFromNow';
 import ChangelogPopup from '../popups/ChangelogPopup';
 
 interface Props {
   isOpen: boolean;
-  issue: Pick<T.Issue, 'author' | 'creationDate' | 'key'>;
+  issue: Pick<Issue, 'author' | 'creationDate' | 'key'>;
   creationDate: string;
   togglePopup: (popup: string, show?: boolean) => void;
 }
index 16fb333578a6f59c0bb40ac7733d84c959b54e97..7da6900cb8a40d744797436878a9a46e9da19e23 100644 (file)
 import * as React from 'react';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { formatMeasure } from '../../../helpers/measures';
+import { IssueChangelogDiff as TypeIssueChangelogDiff } from '../../../types/types';
 
 interface Props {
-  diff: T.IssueChangelogDiff;
+  diff: TypeIssueChangelogDiff;
 }
 
 export default function IssueChangelogDiff({ diff }: Props) {
index 25bdb8465a0d53df83db88245f763fabe5108fa2..f92aaa1a9237e5b3e66af77a6f56601316b993b7 100644 (file)
@@ -22,6 +22,7 @@ import { addIssueComment } from '../../../api/issues';
 import { ButtonLink } from '../../../components/controls/buttons';
 import Toggler from '../../../components/controls/Toggler';
 import { translate } from '../../../helpers/l10n';
+import { Issue } from '../../../types/types';
 import { updateIssue } from '../actions';
 import CommentPopup from '../popups/CommentPopup';
 
@@ -30,7 +31,7 @@ interface Props {
   commentPlaceholder: string;
   currentPopup?: string;
   issueKey: string;
-  onChange: (issue: T.Issue) => void;
+  onChange: (issue: Issue) => void;
   toggleComment: (open?: boolean, placeholder?: string, autoTriggered?: boolean) => void;
 }
 
index 301a32889b45ac09dedd513ea7bf5a57c0770dba..5df50bc604f09e06e4c0eff36f0a61a4f4d8bb88 100644 (file)
@@ -23,13 +23,14 @@ import Toggler from '../../../components/controls/Toggler';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { sanitizeString } from '../../../helpers/sanitize';
+import { IssueComment } from '../../../types/types';
 import DateFromNow from '../../intl/DateFromNow';
 import Avatar from '../../ui/Avatar';
 import CommentDeletePopup from '../popups/CommentDeletePopup';
 import CommentPopup from '../popups/CommentPopup';
 
 interface Props {
-  comment: T.IssueComment;
+  comment: IssueComment;
   onDelete: (comment: string) => void;
   onEdit: (comment: string, text: string) => void;
 }
index c5f001d36e42f6699a561cc2fcb656c341583f70..113e0836e118de2a2c5de98039c02083c7be30e1 100644 (file)
@@ -24,17 +24,18 @@ import Toggler from '../../../components/controls/Toggler';
 import DropdownIcon from '../../../components/icons/DropdownIcon';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { IssueResponse } from '../../../types/issues';
+import { Issue, RawQuery } from '../../../types/types';
 import SeverityHelper from '../../shared/SeverityHelper';
 import SetSeverityPopup from '../popups/SetSeverityPopup';
 
 interface Props {
   canSetSeverity: boolean;
   isOpen: boolean;
-  issue: Pick<T.Issue, 'severity'>;
+  issue: Pick<Issue, 'severity'>;
   setIssueProperty: (
-    property: keyof T.Issue,
+    property: keyof Issue,
     popup: string,
-    apiCall: (query: T.RawQuery) => Promise<IssueResponse>,
+    apiCall: (query: RawQuery) => Promise<IssueResponse>,
     value: string
   ) => void;
   togglePopup: (popup: string, show?: boolean) => void;
index f5d4ee9fdeb949be23d5860d0d52ac6ade5014f2..7e5094594b436aee9d15f1225bd335816784fdac 100644 (file)
@@ -22,6 +22,7 @@ import { setIssueTags } from '../../../api/issues';
 import { ButtonLink } from '../../../components/controls/buttons';
 import Toggler from '../../../components/controls/Toggler';
 import { translate } from '../../../helpers/l10n';
+import { Issue } from '../../../types/types';
 import TagsList from '../../tags/TagsList';
 import { updateIssue } from '../actions';
 import SetIssueTagsPopup from '../popups/SetIssueTagsPopup';
@@ -29,8 +30,8 @@ import SetIssueTagsPopup from '../popups/SetIssueTagsPopup';
 interface Props {
   canSetTags: boolean;
   isOpen: boolean;
-  issue: Pick<T.Issue, 'key' | 'tags'>;
-  onChange: (issue: T.Issue) => void;
+  issue: Pick<Issue, 'key' | 'tags'>;
+  onChange: (issue: Issue) => void;
   togglePopup: (popup: string, show?: boolean) => void;
 }
 
@@ -45,8 +46,8 @@ export default class IssueTags extends React.PureComponent<Props> {
     updateIssue(
       this.props.onChange,
       setIssueTags({ issue: issue.key, tags: tags.join(',') }),
-      issue as T.Issue,
-      newIssue as T.Issue
+      issue as Issue,
+      newIssue as Issue
     );
   };
 
index 2b3bb81a35b15f066f20ba274b74fcf6589b68a2..9582675c4521a55ddbc01bae9107e6f1309d0b59 100644 (file)
@@ -27,6 +27,7 @@ import { formatMeasure } from '../../../helpers/measures';
 import { getComponentIssuesUrl } from '../../../helpers/urls';
 import { BranchLike } from '../../../types/branch-like';
 import { RuleStatus } from '../../../types/rules';
+import { Issue } from '../../../types/types';
 import LocationIndex from '../../common/LocationIndex';
 import { WorkspaceContext } from '../../workspace/context';
 import IssueChangelog from './IssueChangelog';
@@ -38,8 +39,8 @@ export interface IssueTitleBarProps {
   currentPopup?: string;
   displayLocationsCount?: boolean;
   displayLocationsLink?: boolean;
-  issue: T.Issue;
-  onFilter?: (property: string, issue: T.Issue) => void;
+  issue: Issue;
+  onFilter?: (property: string, issue: Issue) => void;
   togglePopup: (popup: string, show?: boolean) => void;
 }
 
index 0371babb2739acb893ed0d4e4bee36dfca5ac7df..0fecacdc262d49c0f88a701b5f3644d4c2f7ff6c 100644 (file)
@@ -23,6 +23,7 @@ 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 { Issue } from '../../../types/types';
 import StatusHelper from '../../shared/StatusHelper';
 import { updateIssue } from '../actions';
 import SetTransitionPopup from '../popups/SetTransitionPopup';
@@ -30,8 +31,8 @@ import SetTransitionPopup from '../popups/SetTransitionPopup';
 interface Props {
   hasTransitions: boolean;
   isOpen: boolean;
-  issue: Pick<T.Issue, 'fromHotspot' | 'key' | 'resolution' | 'status' | 'transitions' | 'type'>;
-  onChange: (issue: T.Issue) => void;
+  issue: Pick<Issue, 'fromHotspot' | 'key' | 'resolution' | 'status' | 'transitions' | 'type'>;
+  onChange: (issue: Issue) => void;
   togglePopup: (popup: string, show?: boolean) => void;
 }
 
index 8dc32e2ce15b8732dded9a184cbe8cb795c7474a..c19f4ce4f8237ebf586afe1f9dc2c3698692cc09 100644 (file)
@@ -26,16 +26,17 @@ import DropdownIcon from '../../../components/icons/DropdownIcon';
 import IssueTypeIcon from '../../../components/icons/IssueTypeIcon';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { IssueResponse } from '../../../types/issues';
+import { Issue, RawQuery } from '../../../types/types';
 import SetTypePopup from '../popups/SetTypePopup';
 
 interface Props {
   canSetType: boolean;
   isOpen: boolean;
-  issue: Pick<T.Issue, 'type'>;
+  issue: Pick<Issue, 'type'>;
   setIssueProperty: (
-    property: keyof T.Issue,
+    property: keyof Issue,
     popup: string,
-    apiCall: (query: T.RawQuery) => Promise<IssueResponse>,
+    apiCall: (query: RawQuery) => Promise<IssueResponse>,
     value: string
   ) => void;
   togglePopup: (popup: string, show?: boolean) => void;
index 097e398b94664ce58e5f8747b19e71ee73528dd8..5e488c4465612fec1b69796e71814c6258dd9b11 100644 (file)
@@ -23,17 +23,18 @@ import Toggler from '../../../components/controls/Toggler';
 import DropdownIcon from '../../../components/icons/DropdownIcon';
 import FilterIcon from '../../../components/icons/FilterIcon';
 import { translate } from '../../../helpers/l10n';
+import { Issue } from '../../../types/types';
 import SimilarIssuesPopup from '../popups/SimilarIssuesPopup';
 
 interface Props {
   isOpen: boolean;
-  issue: T.Issue;
+  issue: Issue;
   togglePopup: (popup: string, show?: boolean) => void;
-  onFilter?: (property: string, issue: T.Issue) => void;
+  onFilter?: (property: string, issue: Issue) => void;
 }
 
 export default class SimilarIssuesFilter extends React.PureComponent<Props> {
-  handleFilter = (property: string, issue: T.Issue) => {
+  handleFilter = (property: string, issue: Issue) => {
     this.togglePopup(false);
     if (this.props.onFilter) {
       this.props.onFilter(property, issue);
index d7541328b2bda39be7a91156f4e83c5e590a95f8..78803b4449757c7542747104b82693d1396b832e 100644 (file)
@@ -20,6 +20,7 @@
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { mockIssue } from '../../../../helpers/testMocks';
+import { Issue } from '../../../../types/types';
 import IssueActionsBar from '../IssueActionsBar';
 
 jest.mock('../../actions', () => ({ updateIssue: jest.fn() }));
@@ -73,7 +74,7 @@ it('should render effort correctly', () => {
 });
 
 describe('callback', () => {
-  const issue: T.Issue = mockIssue();
+  const issue: Issue = mockIssue();
   const onChangeMock = jest.fn();
   const togglePopupMock = jest.fn();
 
index 11282cd938e3f96cd718c0391c4446ab6e120ab0..bddba7e08e1d3b53f60ab4446078c03218989e10 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { IssueChangelogDiff as TypeIssueChangelogDiff } from '../../../../types/types';
 import IssueChangelogDiff from '../IssueChangelogDiff';
 
 it('should render correctly', () => {
@@ -77,6 +78,6 @@ it('should render correctly effort diff', () => {
   expect(shallowRender({ diff: { key: 'effort', oldValue: '10' } })).toMatchSnapshot();
 });
 
-function shallowRender(props: Partial<{ diff: T.IssueChangelogDiff }> = {}) {
+function shallowRender(props: Partial<{ diff: TypeIssueChangelogDiff }> = {}) {
   return shallow(<IssueChangelogDiff diff={{ key: 'foo' }} {...props} />);
 }
index 5888cba29dcd9bb028695d1b248e74265689a039..a597420ecce4a606b692362ca3623cea7e3a340e 100644 (file)
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { click } from '../../../../helpers/testUtils';
+import { IssueComment } from '../../../../types/types';
 import IssueCommentLine from '../IssueCommentLine';
 
-const comment: T.IssueComment = {
+const comment: IssueComment = {
   author: 'john.doe',
   authorActive: true,
   authorAvatar: 'gravatarhash',
index 0e555b9d9d6682cb1b6881d7413c4d205fd95611..5fec51cfe61f9597df19bd55e52bdf94353e1495 100644 (file)
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { click } from '../../../../helpers/testUtils';
+import { Issue } from '../../../../types/types';
 import IssueType from '../IssueType';
 
-const issue: Pick<T.Issue, 'type'> = { type: 'BUG' };
+const issue: Pick<Issue, 'type'> = { type: 'BUG' };
 
 it('should render without the action when the correct rights are missing', () => {
   expect(shallowRender({ canSetType: false })).toMatchSnapshot();
index eb240165cee63d591293ac90b90bc5b2af1af14b..b9608832d2dd76fd44f17255d679ffe0a4a84266 100644 (file)
@@ -22,16 +22,17 @@ import { getIssueChangelog } from '../../../api/issues';
 import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { Issue, IssueChangelog } from '../../../types/types';
 import DateTimeFormatter from '../../intl/DateTimeFormatter';
 import Avatar from '../../ui/Avatar';
 import IssueChangelogDiff from '../components/IssueChangelogDiff';
 
 interface Props {
-  issue: Pick<T.Issue, 'author' | 'creationDate' | 'key'>;
+  issue: Pick<Issue, 'author' | 'creationDate' | 'key'>;
 }
 
 interface State {
-  changelog: T.IssueChangelog[];
+  changelog: IssueChangelog[];
 }
 
 export default class ChangelogPopup extends React.PureComponent<Props, State> {
index 4481dacee72b4277767d1bfb51dae5bda7d78991..209d19909f911cff52ef60f3a46d9b6f301fed47 100644 (file)
@@ -23,10 +23,11 @@ import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import { PopupPlacement } from '../../../components/ui/popups';
 import { KeyboardCodes } from '../../../helpers/keycodes';
 import { translate } from '../../../helpers/l10n';
+import { IssueComment } from '../../../types/types';
 import FormattingTips from '../../common/FormattingTips';
 
 export interface CommentPopupProps {
-  comment?: Pick<T.IssueComment, 'markdown'>;
+  comment?: Pick<IssueComment, 'markdown'>;
   onComment: (text: string) => void;
   toggleComment: (visible: boolean) => void;
   placeholder: string;
index 725fa526e5f7272e280b2cec0bea8a7c4e92ee13..f80f5abde436d028aac56c75e3e0a7e8a30df27e 100644 (file)
@@ -24,26 +24,27 @@ import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import SearchBox from '../../../components/controls/SearchBox';
 import { translate } from '../../../helpers/l10n';
 import { isLoggedIn, isUserActive } from '../../../helpers/users';
+import { CurrentUser, UserActive, UserBase } from '../../../types/types';
 import SelectList from '../../common/SelectList';
 import SelectListItem from '../../common/SelectListItem';
 import { withCurrentUser } from '../../hoc/withCurrentUser';
 import Avatar from '../../ui/Avatar';
 
 interface Props {
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   onSelect: (login: string) => void;
 }
 
 interface State {
   currentUser: string;
   query: string;
-  users: T.UserActive[];
+  users: UserActive[];
 }
 
 const LIST_SIZE = 10;
 
 export class SetAssigneePopup extends React.PureComponent<Props, State> {
-  defaultUsersArray: T.UserActive[];
+  defaultUsersArray: UserActive[];
 
   constructor(props: Props) {
     super(props);
@@ -64,7 +65,7 @@ export class SetAssigneePopup extends React.PureComponent<Props, State> {
     searchUsers({ q: query, ps: LIST_SIZE }).then(this.handleSearchResult, () => {});
   };
 
-  handleSearchResult = ({ users }: { users: T.UserBase[] }) => {
+  handleSearchResult = ({ users }: { users: UserBase[] }) => {
     const activeUsers = users.filter(isUserActive);
     this.setState({
       users: activeUsers,
index 28e153b03f8c8a8653ba54bd5a280d727e49d3dd..3308ca9721d7d4183124bca11602ab564db495cf 100644 (file)
@@ -21,11 +21,12 @@ import * as React from 'react';
 import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import SeverityIcon from '../../../components/icons/SeverityIcon';
 import { translate } from '../../../helpers/l10n';
+import { Issue } from '../../../types/types';
 import SelectList from '../../common/SelectList';
 import SelectListItem from '../../common/SelectListItem';
 
 type Props = {
-  issue: Pick<T.Issue, 'severity'>;
+  issue: Pick<Issue, 'severity'>;
   onSelect: (severity: string) => void;
 };
 
index 4fa4cf0fc5287e0b11fdaa690c77dec7c18d5135..6083634025d2277dee35b80a604091f7f061c9d3 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import { hasMessage, translate } from '../../../helpers/l10n';
+import { IssueType } from '../../../types/types';
 import SelectList from '../../common/SelectList';
 import SelectListItem from '../../common/SelectListItem';
 
@@ -28,7 +29,7 @@ export interface Props {
   fromHotspot: boolean;
   onSelect: (transition: string) => void;
   transitions: string[];
-  type: T.IssueType;
+  type: IssueType;
 }
 
 export default function SetTransitionPopup({ fromHotspot, onSelect, transitions, type }: Props) {
index 7cb044ffe98fa8354976f664c4669b9657c17f93..3234fb1ea05cb71b675712e9b476e3e897d4359c 100644 (file)
@@ -21,12 +21,13 @@ import * as React from 'react';
 import { DropdownOverlay } from '../../../components/controls/Dropdown';
 import IssueTypeIcon from '../../../components/icons/IssueTypeIcon';
 import { translate } from '../../../helpers/l10n';
+import { Issue, IssueType } from '../../../types/types';
 import SelectList from '../../common/SelectList';
 import SelectListItem from '../../common/SelectListItem';
 
 interface Props {
-  issue: Pick<T.Issue, 'type'>;
-  onSelect: (type: T.IssueType) => void;
+  issue: Pick<Issue, 'type'>;
+  onSelect: (type: IssueType) => void;
 }
 
 const TYPES = ['BUG', 'VULNERABILITY', 'CODE_SMELL'];
index ea5636b26d84688c4d11198e4c7df300be0af4b1..a43e8bfb95e86049273336fa7323cd9fa12cdf35 100644 (file)
@@ -24,6 +24,7 @@ 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 { Issue } from '../../../types/types';
 import SelectList from '../../common/SelectList';
 import SelectListItem from '../../common/SelectListItem';
 import SeverityHelper from '../../shared/SeverityHelper';
@@ -31,8 +32,8 @@ import StatusHelper from '../../shared/StatusHelper';
 import Avatar from '../../ui/Avatar';
 
 interface Props {
-  issue: T.Issue;
-  onFilter: (property: string, issue: T.Issue) => void;
+  issue: Issue;
+  onFilter: (property: string, issue: Issue) => void;
 }
 
 export default class SimilarIssuesPopup extends React.PureComponent<Props> {
index ff4635a077a55bbee955c538965931bb24454da2..f741b05f3cdb995ab25a36be30556d0d580f883b 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { getRatingTooltip as nextGetRatingTooltip, isDiffMetric } from '../../helpers/measures';
+import { Dict, Measure, MeasureEnhanced, MeasureIntern, Metric } from '../../types/types';
 
 const KNOWN_RATINGS = [
   'sqale_rating',
@@ -27,7 +28,7 @@ const KNOWN_RATINGS = [
   'security_review_rating'
 ];
 
-export function enhanceMeasure(measure: T.Measure, metrics: T.Dict<T.Metric>): T.MeasureEnhanced {
+export function enhanceMeasure(measure: Measure, metrics: Dict<Metric>): MeasureEnhanced {
   return {
     ...measure,
     metric: metrics[measure.metric],
@@ -35,7 +36,7 @@ export function enhanceMeasure(measure: T.Measure, metrics: T.Dict<T.Metric>): T
   };
 }
 
-export function getLeakValue(measure: T.MeasureIntern | undefined): string | undefined {
+export function getLeakValue(measure: MeasureIntern | undefined): string | undefined {
   return measure?.period?.value;
 }
 
index 4c173463dbc54b3d91f429e3b8542abd07ad8859..b7ccf9c106b5e78b347c0e8da25fc2b43e856d35 100644 (file)
@@ -22,6 +22,7 @@ import { Link } from 'react-router';
 import { getBranchLikeQuery } from '../../helpers/branch-like';
 import { getComponentDrilldownUrl, getComponentIssuesUrl } from '../../helpers/urls';
 import { BranchLike } from '../../types/branch-like';
+import { Dict } from '../../types/types';
 
 const ISSUE_MEASURES = [
   'violations',
@@ -48,7 +49,7 @@ const ISSUE_MEASURES = [
   'new_vulnerabilities'
 ];
 
-const issueParamsPerMetric: T.Dict<T.Dict<string>> = {
+const issueParamsPerMetric: Dict<Dict<string>> = {
   blocker_violations: { resolved: 'false', severities: 'BLOCKER' },
   new_blocker_violations: { resolved: 'false', severities: 'BLOCKER' },
   critical_violations: { resolved: 'false', severities: 'CRITICAL' },
@@ -86,7 +87,7 @@ export default class DrilldownLink extends React.PureComponent<Props> {
   };
 
   propsToIssueParams = () => {
-    const params: T.Dict<string | boolean> = {
+    const params: Dict<string | boolean> = {
       ...(issueParamsPerMetric[this.props.metric] || { resolved: 'false' })
     };
 
index d3502aac74123b965371238b5257804ebb39b2d4..3747f399691dba6c5aa7563557ae27a878b1d4b4 100644 (file)
 import * as React from 'react';
 import IssueTypeIcon from '../../components/icons/IssueTypeIcon';
 import { translate } from '../../helpers/l10n';
+import { IssueType, RuleType } from '../../types/types';
 
 interface Props {
   className?: string;
-  type: T.IssueType | T.RuleType;
+  type: IssueType | RuleType;
 }
 
 export default function TypeHelper(props: Props) {
index 2379c9f0e15d9c1efb3828b6b5b89aafc8d20dd2..ff94de66c55615d0752760ca4c970375fab4d292 100644 (file)
@@ -24,13 +24,14 @@ import { getValues } from '../../api/settings';
 import { getHostUrl } from '../../helpers/urls';
 import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings';
 import { SettingsKey } from '../../types/settings';
+import { Component, LoggedInUser } from '../../types/types';
 import { withRouter } from '../hoc/withRouter';
 import TutorialSelectionRenderer from './TutorialSelectionRenderer';
 import { TutorialModes } from './types';
 
 interface Props extends Pick<WithRouterProps, 'router' | 'location'> {
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   projectBinding?: ProjectAlmBindingResponse;
   willRefreshAutomatically?: boolean;
 }
index 09d4f3b590866897d21bfc9bd0196f3d01fc760e..79365b55e68d6e5c49dd05152ab2c7080bae682a 100644 (file)
@@ -22,6 +22,7 @@ import EllipsisIcon from '../../components/icons/EllipsisIcon';
 import { translate } from '../../helpers/l10n';
 import { getBaseUrl } from '../../helpers/system';
 import { AlmKeys, AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings';
+import { Component, LoggedInUser } from '../../types/types';
 import AzurePipelinesTutorial from './azure-pipelines/AzurePipelinesTutorial';
 import BitbucketPipelinesTutorial from './bitbucket-pipelines/BitbucketPipelinesTutorial';
 import GitHubActionTutorial from './github-action/GitHubActionTutorial';
@@ -33,8 +34,8 @@ import { TutorialModes } from './types';
 export interface TutorialSelectionRendererProps {
   almBinding?: AlmSettingsInstance;
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   loading: boolean;
   onSelectTutorial: (mode: TutorialModes) => void;
   projectBinding?: ProjectAlmBindingResponse;
index 907ef19d6ef0c7cd957c44bab6b49736ac583b44..97da8d7697259223cdd8c19a6a401ebd5679db09 100644 (file)
@@ -22,13 +22,14 @@ import {
   mockProjectBitbucketCloudBindingResponse,
   mockProjectGithubBindingResponse
 } from '../../../helpers/mocks/alm-settings';
+import { UserToken } from '../../../types/types';
 import { buildBitbucketCloudLink, buildGithubLink, getUniqueTokenName } from '../utils';
 
 describe('getUniqueTokenName', () => {
   const initialTokenName = 'Analyze "lightsaber"';
 
   it('should return the given name when the user has no token', () => {
-    const userTokens: T.UserToken[] = [];
+    const userTokens: UserToken[] = [];
 
     expect(getUniqueTokenName(userTokens, initialTokenName)).toBe(initialTokenName);
   });
index 114bdf1383982e5b16fd86813b7362cb6409cd3f..e35e1d2e10d64c2583e3f9a8d2aaa8ef9a9d68a0 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { Button } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
 import { AlmKeys } from '../../../types/alm-settings';
+import { Component, LoggedInUser } from '../../../types/types';
 import AllSetStep from '../components/AllSetStep';
 import FinishButton from '../components/FinishButton';
 import Step from '../components/Step';
@@ -31,8 +32,8 @@ import ServiceEndpointStepContent from './ServiceEndpointStepContent';
 export interface AzurePipelinesTutorialProps {
   alm?: AlmKeys;
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   willRefreshAutomatically?: boolean;
 }
 
index f621a8f273203e8e260af429c543fa8b513004f0..14c8abe1535070a12255f20e951815f8896a0a31 100644 (file)
@@ -21,13 +21,14 @@ import * as React from 'react';
 import { connect } from 'react-redux';
 import { translate } from '../../../helpers/l10n';
 import { getLanguages, Store } from '../../../store/rootReducer';
+import { Component, Languages } from '../../../types/types';
 import RenderOptions from '../components/RenderOptions';
 import { BuildTools } from '../types';
 import AnalysisCommand from './commands/AnalysisCommand';
 
 export interface BranchesAnalysisStepProps {
-  languages: T.Languages;
-  component: T.Component;
+  languages: Languages;
+  component: Component;
   onStepValidationChange: (isValid: boolean) => void;
 }
 
index 18663b7871e09c7bea2a28f9f1daec5bf483f9fa..4ab594e9e616f893e5a6a2dd943c400d58909e01 100644 (file)
@@ -22,13 +22,14 @@ import { FormattedMessage } from 'react-intl';
 import { Button } from '../../../components/controls/buttons';
 import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { translate } from '../../../helpers/l10n';
+import { Component, LoggedInUser } from '../../../types/types';
 import EditTokenModal from '../components/EditTokenModal';
 import SentenceWithHighlights from '../components/SentenceWithHighlights';
 
 export interface ServiceEndpointStepProps {
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
 }
 
 export default function ServiceEndpointStepContent(props: ServiceEndpointStepProps) {
index 85a29d9ddd321caea208bb23237954df4c9f8880..f54f9f9ffa2087c93d2a68792a67d46a84a7f500 100644 (file)
@@ -25,11 +25,12 @@ import { Alert } from '../../../../components/ui/Alert';
 import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
 import { translate } from '../../../../helpers/l10n';
 import { AlmKeys } from '../../../../types/alm-settings';
+import { AppState } from '../../../../types/types';
 import { withAppState } from '../../../hoc/withAppState';
 import SentenceWithHighlights from '../../components/SentenceWithHighlights';
 
 export interface PublishStepsProps {
-  appState: T.AppState;
+  appState: AppState;
 }
 export function PublishSteps(props: PublishStepsProps) {
   const {
index b5a79c1d5002b78c7e1bacc23c9081249c5438b5..5ae65fee0c1700bece7aaa1c8b35b337d3ad0fd0 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { Dictionary } from 'lodash';
 import * as React from 'react';
+import { AppState, Component } from '../../../types/types';
 import { withAppState } from '../../hoc/withAppState';
 import { CompilationInfo } from '../components/CompilationInfo';
 import CreateYmlFile from '../components/CreateYmlFile';
@@ -31,9 +32,9 @@ import othersExample from './commands/Others';
 import { PreambuleYaml } from './PreambuleYaml';
 
 export interface AnalysisCommandProps {
-  appState: T.AppState;
+  appState: AppState;
   buildTool: BuildTools;
-  component: T.Component;
+  component: Component;
 }
 
 const YamlTemplate: Dictionary<(branchesEnabled?: boolean, projectKey?: string) => string> = {
index 01233e4c91f31de01b91e450eea168c7d1712454..169a03a1790e8358615386fd849f03cb59eaf28e 100644 (file)
@@ -24,6 +24,7 @@ import {
   AlmSettingsInstance,
   ProjectAlmBindingResponse
 } from '../../../types/alm-settings';
+import { Component, LoggedInUser } from '../../../types/types';
 import AllSetStep from '../components/AllSetStep';
 import FinishButton from '../components/FinishButton';
 import GithubCFamilyExampleRepositories from '../components/GithubCFamilyExampleRepositories';
@@ -42,8 +43,8 @@ export enum Steps {
 export interface BitbucketPipelinesTutorialProps {
   almBinding?: AlmSettingsInstance;
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   projectBinding?: ProjectAlmBindingResponse;
   willRefreshAutomatically?: boolean;
 }
index 0e95539c78574d2ac84934334ff7bbca80df4c34..315ca308242f95623e2f5aafaa58b3506fe91674 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 import CodeSnippet from '../../common/CodeSnippet';
 import DefaultProjectKey from '../components/DefaultProjectKey';
 import { BuildTools } from '../types';
@@ -28,7 +29,7 @@ import { buildGradleSnippet } from '../utils';
 
 export interface PreambuleYamlProps {
   buildTool: BuildTools;
-  component: T.Component;
+  component: Component;
 }
 
 export function PreambuleYaml(props: PreambuleYamlProps) {
index 840b3a258ef15ad0fee4d7f37fa53a4c6a123de6..d749df345dce90752715624284784a21d0a46655 100644 (file)
@@ -23,6 +23,7 @@ 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 { Component, LoggedInUser } from '../../../types/types';
 import SentenceWithHighlights from '../components/SentenceWithHighlights';
 import TokenStepGenerator from '../components/TokenStepGenerator';
 import { buildBitbucketCloudLink } from '../utils';
@@ -30,8 +31,8 @@ import { buildBitbucketCloudLink } from '../utils';
 export interface RepositoryVariablesProps {
   almBinding?: AlmSettingsInstance;
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   onDone: () => void;
   projectBinding?: ProjectAlmBindingResponse;
 }
index fa744dacabd8b846a478c6d8c789114117f4a7b0..b296d17d1380dfbce2453310bf927ce4e1a7c0ef 100644 (file)
@@ -21,12 +21,13 @@ import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { getBaseUrl } from '../../../helpers/system';
 import { AlmKeys } from '../../../types/alm-settings';
+import { AppState } from '../../../types/types';
 import { withAppState } from '../../hoc/withAppState';
 import SentenceWithHighlights from './SentenceWithHighlights';
 
 export interface AllSetProps {
   alm: AlmKeys;
-  appState: T.AppState;
+  appState: AppState;
   willRefreshAutomatically?: boolean;
 }
 
index 70f457f5798216d28a245baa390b6b60775352f1..04007b895462a3879a3b24227b338af51a4bac0d 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../types/types';
 import CodeSnippet from '../../common/CodeSnippet';
 import SentenceWithFilename from './SentenceWithFilename';
 
 export interface DefaultProjectKeyProps {
-  component: T.Component;
+  component: Component;
 }
 
 const sonarProjectSnippet = (key: string) => `sonar.projectKey=${key}`;
index 0812e977c29e0d0d542ccd17cf879ef2214242f7..68defb2dce0e97aa21b7a0185a2ab445860b1ba3 100644 (file)
@@ -27,6 +27,7 @@ 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 { Component, LoggedInUser } from '../../../types/types';
 import { getUniqueTokenName } from '../utils';
 
 interface State {
@@ -36,8 +37,8 @@ interface State {
 }
 
 interface Props {
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   onClose: (token?: string) => void;
 }
 
index 46281bed6185944c908576df5d0d8bfb82aa8f28..79f2c2f7078b7a977189e72af00b8b54a653648f 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { translate } from '../../../helpers/l10n';
+import { Dict } from '../../../types/types';
 
 export interface SentenceWithHighlightsProps {
   highlightKeys: string[];
@@ -32,7 +33,7 @@ export default function SentenceWithHighlights({
   translationKey,
   highlightPrefixKeys
 }: SentenceWithHighlightsProps) {
-  const values: T.Dict<JSX.Element> = {};
+  const values: Dict<JSX.Element> = {};
 
   const transhighlightPrefixKeys = highlightPrefixKeys || translationKey;
   highlightKeys.forEach(key => {
index 822850e309e14dad02a2aab390db02d67f54f4cf..a2b927d9740574cb5e792a5b00680f9e576a3453 100644 (file)
@@ -21,11 +21,12 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { Button } from '../../../components/controls/buttons';
 import { translate } from '../../../helpers/l10n';
+import { Component, LoggedInUser } from '../../../types/types';
 import EditTokenModal from './EditTokenModal';
 
 export interface TokenStepGeneratorProps {
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
 }
 
 export default function TokenStepGenerator(props: TokenStepGeneratorProps) {
index e21a74c8dc1065fb40c3ce591a2f6a14fc9f612c..70dbb232bf71ce58500f1c42fd16d3013f77f5f4 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { AppState, Component } from '../../../types/types';
 import { withAppState } from '../../hoc/withAppState';
 import { BuildTools } from '../types';
 import CFamily from './commands/CFamily';
@@ -27,9 +28,9 @@ import JavaMaven from './commands/JavaMaven';
 import Others from './commands/Others';
 
 export interface AnalysisCommandProps {
-  appState: T.AppState;
+  appState: AppState;
   buildTool: BuildTools;
-  component: T.Component;
+  component: Component;
   onDone: () => void;
 }
 
index 51a728699dce372529ba8bb9a59d8a178e3e7935..502c4e875ddf1d406cf701bef06c704399a28928 100644 (file)
@@ -24,6 +24,7 @@ import {
   AlmSettingsInstance,
   ProjectAlmBindingResponse
 } from '../../../types/alm-settings';
+import { Component, LoggedInUser } from '../../../types/types';
 import AllSetStep from '../components/AllSetStep';
 import Step from '../components/Step';
 import YamlFileStep from '../components/YamlFileStep';
@@ -39,8 +40,8 @@ export enum Steps {
 export interface GitHubActionTutorialProps {
   almBinding?: AlmSettingsInstance;
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   projectBinding?: ProjectAlmBindingResponse;
   willRefreshAutomatically?: boolean;
 }
index a3e2c0146ecea1f10691d2b03d54baf9c2da4afe..7abca84d8949b0a3a33fb99744790f752f948f1d 100644 (file)
@@ -23,6 +23,7 @@ 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 { Component, LoggedInUser } from '../../../types/types';
 import SentenceWithHighlights from '../components/SentenceWithHighlights';
 import TokenStepGenerator from '../components/TokenStepGenerator';
 import { buildGithubLink } from '../utils';
@@ -30,8 +31,8 @@ import { buildGithubLink } from '../utils';
 export interface SecretStepProps {
   almBinding?: AlmSettingsInstance;
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   projectBinding?: ProjectAlmBindingResponse;
   onDone: () => void;
 }
index 987115d5339c6826f2219d096ba03abd732199c7..4ac20465b5c4b1fe455412ed298cd741150d5de9 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { translate } from '../../../../helpers/l10n';
+import { Component } from '../../../../types/types';
 import { CompilationInfo } from '../../components/CompilationInfo';
 import CreateYmlFile from '../../components/CreateYmlFile';
 import DefaultProjectKey from '../../components/DefaultProjectKey';
@@ -29,7 +30,7 @@ import { OSs, TutorialModes } from '../../types';
 
 export interface CFamilyProps {
   branchesEnabled?: boolean;
-  component: T.Component;
+  component: Component;
   onDone: () => void;
 }
 
index 003e26868a34bd2c7d1bf78677be5eefbee7bd6d..96caae8bc4314035b66188ff2c64274d8b4339a6 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../../types/types';
 import CreateYmlFile from '../../components/CreateYmlFile';
 import FinishButton from '../../components/FinishButton';
 
 export interface DotNetProps {
   branchesEnabled?: boolean;
-  component: T.Component;
+  component: Component;
   onDone: () => void;
 }
 
index a40b93b61567a60ee5f0e9107723fb3aedde1ba5..0b1c13c9add81d3dc2f1709063b3dc1de86b8cab 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { ClipboardIconButton } from '../../../../components/controls/clipboard';
 import { translate } from '../../../../helpers/l10n';
+import { Component } from '../../../../types/types';
 import CodeSnippet from '../../../common/CodeSnippet';
 import CreateYmlFile from '../../components/CreateYmlFile';
 import FinishButton from '../../components/FinishButton';
@@ -28,7 +29,7 @@ import { buildGradleSnippet } from '../../utils';
 
 export interface GradleProps {
   branchesEnabled?: boolean;
-  component: T.Component;
+  component: Component;
   onDone: () => void;
 }
 const gradleYamlTemplate = (branchesEnabled: boolean) => `name: Build
index 0fd75b17c487832cf8b7bbc5cc2e209e9f4d10b7..75d5af8acdeecd94d0c579673827135e2e6b2a21 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../../types/types';
 import CreateYmlFile from '../../components/CreateYmlFile';
 import FinishButton from '../../components/FinishButton';
 
 export interface JavaMavenProps {
   branchesEnabled?: boolean;
-  component: T.Component;
+  component: Component;
   onDone: () => void;
 }
 
index 425f10557f9170c18383fcc3cd568e75649ad8db..c7fd423f87fa63946656be3fd3a1ce1008cb0d2f 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../../types/types';
 import CreateYmlFile from '../../components/CreateYmlFile';
 import DefaultProjectKey from '../../components/DefaultProjectKey';
 import FinishButton from '../../components/FinishButton';
 
 export interface OthersProps {
   branchesEnabled?: boolean;
-  component: T.Component;
+  component: Component;
   onDone: () => void;
 }
 
index a0ccf13f7b12a9dbc4d4fd030132624ce52b28fe..32bf04e91fe1dfcdd875714b465c35a9022c7e0d 100644 (file)
@@ -22,13 +22,14 @@ import { FormattedMessage } from 'react-intl';
 import { Button } from '../../../components/controls/buttons';
 import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { translate } from '../../../helpers/l10n';
+import { Component, LoggedInUser } from '../../../types/types';
 import Step from '../components/Step';
 import TokenStepGenerator from '../components/TokenStepGenerator';
 
 export interface EnvironmentVariablesStepProps {
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   finished: boolean;
   onDone: () => void;
   onOpen: () => void;
index 83103e54ada05eb7ebdb22be37176976c1adf37a..8472b9953be5e42a962e0995f9fe738e3492ac00 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { AlmKeys } from '../../../types/alm-settings';
+import { Component, LoggedInUser } from '../../../types/types';
 import AllSetStep from '../components/AllSetStep';
 import { BuildTools } from '../types';
 import EnvironmentVariablesStep from './EnvironmentVariablesStep';
@@ -35,8 +36,8 @@ export enum Steps {
 
 export interface GitLabCITutorialProps {
   baseUrl: string;
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
   willRefreshAutomatically?: boolean;
 }
 
index d29d65253b1c623529ccaf87ab4d50cb16198a72..e11016e31b31d62c0a5e6d4eebc314525dc318b8 100644 (file)
@@ -22,6 +22,7 @@ import { FormattedMessage } from 'react-intl';
 import { Button } from '../../../components/controls/buttons';
 import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 import CodeSnippet from '../../common/CodeSnippet';
 import { withCLanguageFeature } from '../../hoc/withCLanguageFeature';
 import RenderOptions from '../components/RenderOptions';
@@ -30,7 +31,7 @@ import { BuildTools } from '../types';
 
 export interface ProjectKeyStepProps {
   buildTool?: BuildTools;
-  component: T.Component;
+  component: Component;
   finished: boolean;
   hasCLanguageFeature: boolean;
   onDone: () => void;
index d8866314d8ab9c5341b757c913f9e345888618ef..1e72a440cd69d695ca6d262f65b865e3734103b2 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { translate } from '../../../helpers/l10n';
+import { AppState } from '../../../types/types';
 import { withAppState } from '../../hoc/withAppState';
 import FinishButton from '../components/FinishButton';
 import GithubCFamilyExampleRepositories from '../components/GithubCFamilyExampleRepositories';
@@ -29,7 +30,7 @@ import { BuildTools, TutorialModes } from '../types';
 import PipeCommand from './commands/PipeCommand';
 
 export interface YmlFileStepProps {
-  appState: T.AppState;
+  appState: AppState;
   buildTool?: BuildTools;
   finished: boolean;
   onDone: () => void;
index e7e5de36c31da47e72254167a037676c770c4bbf..775daa44cbf6e27c2ac5c69cc2f2127be0625d45 100644 (file)
@@ -27,6 +27,7 @@ import {
   AlmSettingsInstance,
   ProjectAlmBindingResponse
 } from '../../../types/alm-settings';
+import { Component, CurrentUserSetting } from '../../../types/types';
 import AllSetStep from '../components/AllSetStep';
 import JenkinsfileStep from './JenkinsfileStep';
 import MultiBranchPipelineStep from './MultiBranchPipelineStep';
@@ -39,9 +40,9 @@ export interface JenkinsTutorialProps {
   almBinding?: AlmSettingsInstance;
   baseUrl: string;
   branchesEnabled: boolean;
-  component: T.Component;
+  component: Component;
   projectBinding?: ProjectAlmBindingResponse;
-  setCurrentUserSetting: (setting: T.CurrentUserSetting) => void;
+  setCurrentUserSetting: (setting: CurrentUserSetting) => void;
   skipPreReqs: boolean;
   willRefreshAutomatically?: boolean;
 }
index e47e66b1677b7eda318a6ffa4be69db332b7f7b1..59fe516b49800154e810666ca6c456af30eec2ef 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import { Alert } from '../../../components/ui/Alert';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 import { withCLanguageFeature } from '../../hoc/withCLanguageFeature';
 import RenderOptions from '../components/RenderOptions';
 import Step from '../components/Step';
@@ -32,7 +33,7 @@ import Other from './buildtool-steps/Other';
 
 export interface JenkinsfileStepProps {
   baseUrl: string;
-  component: T.Component;
+  component: Component;
   hasCLanguageFeature: boolean;
   finished: boolean;
   onDone: () => void;
@@ -42,7 +43,7 @@ export interface JenkinsfileStepProps {
 
 export interface LanguageProps {
   onDone: () => void;
-  component: T.Component;
+  component: Component;
   baseUrl: string;
 }
 
index de4e4b7514000dabe6a7cba0ccf72f4c5038c1de..54732ec3f45aebb38b257e2b7518d9f7bc4909dc 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { translate } from '../../../../helpers/l10n';
+import { Component } from '../../../../types/types';
 import FinishButton from '../../components/FinishButton';
 import RenderOptions from '../../components/RenderOptions';
 import { OSs } from '../../types';
@@ -27,7 +28,7 @@ import DotNetCore from './DotNetCore';
 import DotNetFramework from './DotNetFramework';
 
 export interface DotNetCoreFrameworkProps {
-  component: T.Component;
+  component: Component;
   os: OSDotNet;
 }
 
index 5043267237f23d66a7988cae230e50166b96018e..d9a34eb26919ba7ad1f2716f52a00ffb3ebf3a8c 100644 (file)
@@ -21,9 +21,10 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { Link } from 'react-router';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 
 export interface DoneNextStepsProps {
-  component: T.Component;
+  component: Component;
 }
 
 export default function DoneNextSteps({ component }: DoneNextStepsProps) {
index 2b262228165ea58ec42a97084ff765b7cb06a504..d3b40348e3780a76dca33ef543e069157a85ccc2 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { Component, LoggedInUser } from '../../../types/types';
 import InstanceMessage from '../../common/InstanceMessage';
 import ProjectAnalysisStep from './ProjectAnalysisStep';
 import TokenStep from './TokenStep';
@@ -29,8 +30,8 @@ export enum Steps {
 }
 
 interface Props {
-  component: T.Component;
-  currentUser: T.LoggedInUser;
+  component: Component;
+  currentUser: LoggedInUser;
 }
 
 interface State {
index 285cbea56835ffe1736f74b21091782295b6289c..adbcb653d04e789d82664897a104c100d35e0c91 100644 (file)
  */
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
+import { Component } from '../../../types/types';
 import Step from '../components/Step';
 import { ManualTutorialConfig } from '../types';
 import BuildToolForm from './BuildToolForm';
 import AnalysisCommand from './commands/AnalysisCommand';
 
 interface Props {
-  component: T.Component;
+  component: Component;
   onFinish?: (projectKey?: string) => void;
   open: boolean;
   stepNumber: number;
index 0be6726f9537d76f5ab3d31f01632932722a910c..a026bd6b677638b1126ecd98916bd75d3ff6edc7 100644 (file)
@@ -25,12 +25,13 @@ import { Button, DeleteButton, SubmitButton } from '../../../components/controls
 import Radio from '../../../components/controls/Radio';
 import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon';
 import { translate } from '../../../helpers/l10n';
+import { LoggedInUser, UserToken } from '../../../types/types';
 import AlertErrorIcon from '../../icons/AlertErrorIcon';
 import Step from '../components/Step';
 import { getUniqueTokenName } from '../utils';
 
 interface Props {
-  currentUser: Pick<T.LoggedInUser, 'login'>;
+  currentUser: Pick<LoggedInUser, 'login'>;
   finished: boolean;
   initialTokenName?: string;
   open: boolean;
@@ -45,7 +46,7 @@ interface State {
   selection: string;
   tokenName?: string;
   token?: string;
-  tokens?: T.UserToken[];
+  tokens?: UserToken[];
 }
 
 export default class TokenStep extends React.PureComponent<Props, State> {
index c7106339c46fde59784777f36344b75539e37ba3..452ff0c1f4315d5a4ae86342e2d4fb1127904eb4 100644 (file)
@@ -20,6 +20,7 @@
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import { change, click, submit, waitAndUpdate } from '../../../../helpers/testUtils';
+import { LoggedInUser } from '../../../../types/types';
 import TokenStep from '../TokenStep';
 
 jest.mock('../../../../api/user-tokens', () => ({
@@ -28,7 +29,7 @@ jest.mock('../../../../api/user-tokens', () => ({
   revokeToken: () => Promise.resolve()
 }));
 
-const currentUser: Pick<T.LoggedInUser, 'login'> = { login: 'user' };
+const currentUser: Pick<LoggedInUser, 'login'> = { login: 'user' };
 
 it('generates token', async () => {
   const wrapper = shallow(
index 5bdbc8dd8255e818b3213b87257d62251951b232..f99a87f0d5b66a915c97313e3c40cfe45413d463 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { getHostUrl } from '../../../../helpers/urls';
+import { Component } from '../../../../types/types';
 import { BuildTools, ManualTutorialConfig } from '../../types';
 import ClangGCCCustom from './ClangGCCCommand';
 import DotNet from './DotNet';
@@ -27,7 +28,7 @@ import JavaMaven from './JavaMaven';
 import Other from './Other';
 
 export interface AnalysisCommandProps {
-  component: T.Component;
+  component: Component;
   languageConfig: ManualTutorialConfig;
   token?: string;
 }
index 19cba151e1b322e2ecfd12253a41ac1d7a59f4f8..670e66c7ccc98586255de262677107b2ea6380e4 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../../types/types';
 import { CompilationInfo } from '../../components/CompilationInfo';
 import { OSs } from '../../types';
 import DownloadBuildWrapper from './DownloadBuildWrapper';
@@ -26,7 +27,7 @@ import ExecBuildWrapper from './ExecBuildWrapper';
 import ExecScanner from './ExecScanner';
 
 export interface ClangGCCCustomProps {
-  component: T.Component;
+  component: Component;
   host: string;
   os: OSs;
   token: string;
index 1ba53cf62250df2c26659619aaadd25af69b7045..ee4f13ec6591e91b329c9b9ae3ba4f61e6229504 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../../types/types';
 import RenderOptions from '../../components/RenderOptions';
 import DotNetCore from './DotNetCore';
 import DotNetFramework from './DotNetFramework';
 
 export interface DotNetProps {
-  component: T.Component;
+  component: Component;
   host: string;
   token: string;
 }
index 5a4bc942d950435a24cff241d1393c032da0ce5a..4074e8c73382366feb01ddf4f27dc501b1b3d292 100644 (file)
@@ -22,13 +22,14 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { Link } from 'react-router';
 import { translate } from '../../../../helpers/l10n';
+import { Component } from '../../../../types/types';
 import CodeSnippet from '../../../common/CodeSnippet';
 import InstanceMessage from '../../../common/InstanceMessage';
 import DoneNextSteps from '../DoneNextSteps';
 
 export interface DotNetExecuteProps {
   commands: string[];
-  component: T.Component;
+  component: Component;
 }
 
 export default function DotNetExecute({ commands, component }: DotNetExecuteProps) {
index cd2632eb7a67304c66bb3288c1644971421ea187..48504610f47f46c7b648bd1d8f0008081a6152bd 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { Link } from 'react-router';
 import { translate } from '../../../../helpers/l10n';
+import { Component } from '../../../../types/types';
 import CodeSnippet from '../../../common/CodeSnippet';
 import InstanceMessage from '../../../common/InstanceMessage';
 import { OSs } from '../../types';
@@ -28,7 +29,7 @@ import { quote } from '../../utils';
 import DoneNextSteps from '../DoneNextSteps';
 
 export interface ExecScannerProps {
-  component: T.Component;
+  component: Component;
   host: string;
   os: OSs;
   token: string;
index 13572d1258d9146326fc308643f51716879f4441..c3c1923ee93263e65b69762c1f6dd687e58d5ae1 100644 (file)
@@ -21,12 +21,13 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { Link } from 'react-router';
 import { translate } from '../../../../helpers/l10n';
+import { Component } from '../../../../types/types';
 import CodeSnippet from '../../../common/CodeSnippet';
 import InstanceMessage from '../../../common/InstanceMessage';
 import DoneNextSteps from '../DoneNextSteps';
 
 export interface JavaGradleProps {
-  component: T.Component;
+  component: Component;
   host: string;
   token: string;
 }
index 0ae0a0f26674044705c8343e53bb23c81b7530e3..7326d8f744a7f0477c7632c334bc950ec158a5d7 100644 (file)
@@ -21,12 +21,13 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { Link } from 'react-router';
 import { translate } from '../../../../helpers/l10n';
+import { Component } from '../../../../types/types';
 import CodeSnippet from '../../../common/CodeSnippet';
 import InstanceMessage from '../../../common/InstanceMessage';
 import DoneNextSteps from '../DoneNextSteps';
 
 export interface JavaMavenProps {
-  component: T.Component;
+  component: Component;
   host: string;
   token: string;
 }
index ac53a410e21e1465ab2b85fc20870f398793a99e..c73fcace9303ee7bb5b7433203fb48ad84b4893a 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { Component } from '../../../../types/types';
 import { OSs } from '../../types';
 import DownloadScanner from './DownloadScanner';
 import ExecScanner from './ExecScanner';
 
 export interface OtherProps {
-  component: T.Component;
+  component: Component;
   host: string;
   os: OSs;
   token: string;
index 66b2839c244e015eed8a59fe6be5d42bc53146cb..43bfa55db04bf2a5f2fc7d5bb02f0f8f3e53c5d6 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { convertGithubApiUrlToLink, stripTrailingSlash } from '../../helpers/urls';
 import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings';
+import { UserToken } from '../../types/types';
 
 export function quote(os: string): (s: string) => string {
   return os === 'win' ? (s: string) => `"${s}"` : (s: string) => s;
@@ -36,7 +37,7 @@ sonarqube {
 }`;
 }
 
-export function getUniqueTokenName(tokens: T.UserToken[], initialTokenName = '') {
+export function getUniqueTokenName(tokens: UserToken[], initialTokenName = '') {
   const hasToken = (name: string) => tokens.find(token => token.name === name) !== undefined;
 
   if (!hasToken(initialTokenName)) {
index da30e8e1144395dd3b0c903c0852c1573e064b78..cb4149e4a2538ebaeb88009017b9dbebef7119ba 100644 (file)
@@ -23,6 +23,7 @@ import classNames from 'classnames';
 import * as React from 'react';
 import { colors, sizes } from '../../app/theme';
 import { translate } from '../../helpers/l10n';
+import { Dict } from '../../types/types';
 import AlertErrorIcon from '../icons/AlertErrorIcon';
 import AlertSuccessIcon from '../icons/AlertSuccessIcon';
 import AlertWarnIcon from '../icons/AlertWarnIcon';
@@ -101,7 +102,7 @@ const StyledAlert = styled.div<{ isInline: boolean; variantInfo: AlertVariantInf
 `;
 
 function getAlertVariantInfo(variant: AlertVariant): AlertVariantInformation {
-  const variantList: T.Dict<AlertVariantInformation> = {
+  const variantList: Dict<AlertVariantInformation> = {
     error: {
       icon: <AlertErrorIcon fill={colors.alertIconError} />,
       color: colors.alertTextError,
index 985f8d4600fb12eb8cb594b7004ab9cbbd414c4a..35a6bbcd1b1c5b24d0e9f72c809d2ac08d896aba 100644 (file)
@@ -22,6 +22,7 @@ import * as React from 'react';
 import { translate } from '../../helpers/l10n';
 import { EditionKey } from '../../types/editions';
 import { SystemUpgrade } from '../../types/system';
+import { AppState } from '../../types/types';
 import { ResetButtonLink } from '../controls/buttons';
 import Modal from '../controls/Modal';
 import { withAppState } from '../hoc/withAppState';
@@ -30,7 +31,7 @@ import SystemUpgradeItem from './SystemUpgradeItem';
 import { UpdateUseCase } from './utils';
 
 interface Props {
-  appState: Pick<T.AppState, 'edition' | 'version'>;
+  appState: Pick<AppState, 'edition' | 'version'>;
   onClose: () => void;
   systemUpgrades: SystemUpgrade[][];
   latestLTS: string;
index 50c6711867b09f5a34b8381491066802e3d8e4a7..70451a10e27acedd1873d31d728166c2fd45df8e 100644 (file)
@@ -21,6 +21,7 @@ import { omit, uniqBy } from 'lodash';
 import * as React from 'react';
 import { getRulesApp } from '../../api/rules';
 import { get, save } from '../../helpers/storage';
+import { Dict } from '../../types/types';
 import { lazyLoadComponent } from '../lazyLoadComponent';
 import { ComponentDescriptor, RuleDescriptor, WorkspaceContext } from './context';
 import './styles.css';
@@ -39,7 +40,7 @@ const WorkspaceComponentViewer = lazyLoadComponent(
 
 interface State {
   components: ComponentDescriptor[];
-  externalRulesRepoNames: T.Dict<string>;
+  externalRulesRepoNames: Dict<string>;
   height: number;
   maximized?: boolean;
   open: { component?: string; rule?: string };
@@ -86,7 +87,7 @@ export default class Workspace extends React.PureComponent<{}, State> {
 
   fetchRuleNames = async () => {
     const { repositories } = await getRulesApp();
-    const externalRulesRepoNames: T.Dict<string> = {};
+    const externalRulesRepoNames: Dict<string> = {};
     repositories
       .filter(({ key }) => key.startsWith('external_'))
       .forEach(({ key, name }) => {
index e6faee49b8fbf5f98f307a3111fda276539e06d1..02541b49b57396b36ecd02d5239d579aefcd1ac5 100644 (file)
@@ -25,12 +25,13 @@ import { isPullRequest } from '../../helpers/branch-like';
 import { scrollToElement } from '../../helpers/scrolling';
 import { fetchBranchStatus } from '../../store/rootActions';
 import { BranchLike } from '../../types/branch-like';
+import { Issue, SourceViewerFile } from '../../types/types';
 import SourceViewer from '../SourceViewer/SourceViewer';
 import { ComponentDescriptor } from './context';
 import WorkspaceComponentTitle from './WorkspaceComponentTitle';
 import WorkspaceHeader, { Props as WorkspaceHeaderProps } from './WorkspaceHeader';
 
-export interface Props extends T.Omit<WorkspaceHeaderProps, 'children' | 'onClose'> {
+export interface Props extends Omit<WorkspaceHeaderProps, 'children' | 'onClose'> {
   component: ComponentDescriptor;
   fetchBranchStatus: (branchLike: BranchLike, projectKey: string) => Promise<void>;
   height: number;
@@ -62,11 +63,11 @@ export class WorkspaceComponentViewer extends React.PureComponent<Props> {
     this.props.onClose(this.props.component.key);
   };
 
-  handleIssueChange = (_: T.Issue) => {
+  handleIssueChange = (_: Issue) => {
     this.refreshBranchStatus();
   };
 
-  handleLoaded = (component: T.SourceViewerFile) => {
+  handleLoaded = (component: SourceViewerFile) => {
     this.props.onLoad({
       key: this.props.component.key,
       name: component.path,
index c9ba62a3b55b5db4ac4aa8427ed6bdbcbc6596a2..9a57404ea6b2ff936662ac79ea7df3b71e772d38 100644 (file)
@@ -24,6 +24,7 @@ import RuleDetailsDescription from '../../apps/coding-rules/components/RuleDetai
 import RuleDetailsMeta from '../../apps/coding-rules/components/RuleDetailsMeta';
 import '../../apps/coding-rules/styles.css';
 import DeferredSpinner from '../../components/ui/DeferredSpinner';
+import { Dict, RuleDetails } from '../../types/types';
 
 interface Props {
   onLoad: (details: { name: string }) => void;
@@ -32,8 +33,8 @@ interface Props {
 
 interface State {
   loading: boolean;
-  referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
-  ruleDetails?: T.RuleDetails;
+  referencedRepositories: Dict<{ key: string; language: string; name: string }>;
+  ruleDetails?: RuleDetails;
 }
 
 export default class WorkspaceRuleDetails extends React.PureComponent<Props, State> {
index 0e59f8be83f1ac44254648cc8c00b15b1c314730..8d99b9ba40e3020d65e6b72c9ae58e71833e2585 100644 (file)
@@ -23,7 +23,7 @@ import WorkspaceHeader, { Props as WorkspaceHeaderProps } from './WorkspaceHeade
 import WorkspaceRuleDetails from './WorkspaceRuleDetails';
 import WorkspaceRuleTitle from './WorkspaceRuleTitle';
 
-export interface Props extends T.Omit<WorkspaceHeaderProps, 'children' | 'onClose'> {
+export interface Props extends Omit<WorkspaceHeaderProps, 'children' | 'onClose'> {
   rule: RuleDescriptor;
   height: number;
   onClose: (componentKey: string) => void;
index a7ae908d22a7d5cfc1e282067a11f55eab1e5bda..7491c6770d24f3e648cbea55964b5d646a9bc91d 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { createContext } from 'react';
 import { BranchLike } from '../../types/branch-like';
+import { Dict } from '../../types/types';
 
 export interface ComponentDescriptor {
   branchLike: BranchLike | undefined;
@@ -34,7 +35,7 @@ export interface RuleDescriptor {
 }
 
 export interface WorkspaceContextShape {
-  externalRulesRepoNames: T.Dict<string>;
+  externalRulesRepoNames: Dict<string>;
   openComponent: (component: ComponentDescriptor) => void;
   openRule: (rule: RuleDescriptor) => void;
 }
index 55818d0e7d99344cde4e717403eb473bc4ae0f4d..89fab57bd62f10f2e0d7a4e2bc7d3f39cfb85fa0 100644 (file)
@@ -20,6 +20,7 @@
 
 /* eslint-disable no-await-in-loop */
 
+import { Dict } from '../../types/types';
 import handleRequiredAuthentication from '../handleRequiredAuthentication';
 import {
   checkStatus,
@@ -345,7 +346,7 @@ describe('isSuccessStatus', () => {
   });
 });
 
-function mockResponse(headers: T.Dict<string> = {}, status = HttpStatus.Ok, value?: any): Response {
+function mockResponse(headers: Dict<string> = {}, status = HttpStatus.Ok, value?: any): Response {
   const body = value && value instanceof Object ? JSON.stringify(value) : value;
   const response = new Response(body, { headers, status });
   response.json = jest.fn().mockResolvedValue(value);
index c3820cb2a2d916a183f08faaf22d23a9ed5da6c9..7e702b2acbf7b7e5dcf4aceb7237851121c88319 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+import { ComponentMeasure, ComponentMeasureEnhanced } from '../types/types';
+
 export function getComponentMeasureUniqueKey(
-  component?: T.ComponentMeasure | T.ComponentMeasureEnhanced
+  component?: ComponentMeasure | ComponentMeasureEnhanced
 ) {
   return component ? [component.key, component.branch].filter(s => !!s).join('/') : undefined;
 }
index 96f776c6af87da2673b431523dc6fb481dc4c957..8ccab49087f5140aecb1642f9ed3beaafdd6b0eb 100644 (file)
@@ -21,10 +21,11 @@ import { colors } from '../app/theme';
 import { AlmKeys } from '../types/alm-settings';
 import { ComponentQualifier } from '../types/component';
 import { IssueScope, IssueType } from '../types/issues';
+import { RuleType } from '../types/types';
 
 export const SEVERITIES = ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'];
 export const STATUSES = ['OPEN', 'REOPENED', 'CONFIRMED', 'RESOLVED', 'CLOSED'];
-export const ISSUE_TYPES: T.IssueType[] = [
+export const ISSUE_TYPES: IssueType[] = [
   IssueType.Bug,
   IssueType.Vulnerability,
   IssueType.CodeSmell,
@@ -34,7 +35,7 @@ export const SOURCE_SCOPES = [
   { scope: IssueScope.Main, qualifier: ComponentQualifier.File },
   { scope: IssueScope.Test, qualifier: ComponentQualifier.TestFile }
 ];
-export const RULE_TYPES: T.RuleType[] = ['BUG', 'VULNERABILITY', 'CODE_SMELL', 'SECURITY_HOTSPOT'];
+export const RULE_TYPES: RuleType[] = ['BUG', 'VULNERABILITY', 'CODE_SMELL', 'SECURITY_HOTSPOT'];
 export const RULE_STATUSES = ['READY', 'BETA', 'DEPRECATED'];
 
 export const CHART_COLORS_RANGE_PERCENT = [
index d717044f4b0bb8afcdb6444391ba16c1168d781f..3a4aef6b5011b3efabc42a6397631a220ec1adea 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { memoize } from 'lodash';
+import { Dict } from '../types/types';
 
 const parseCookies = memoize(
-  (documentCookie: string): T.Dict<string> => {
+  (documentCookie: string): Dict<string> => {
     const rawCookies = documentCookie.split('; ');
-    const cookies: T.Dict<string> = {};
+    const cookies: Dict<string> = {};
     rawCookies.forEach(candidate => {
       const [key, value] = candidate.split('=');
       cookies[key] = value;
index 078cc9ca6e3888049421553a06602ee70b26b619..1af989fd0c24241737bdb3f8ac9b477c191318e1 100644 (file)
 // Do not import dependencies in this helper, to keep initial bundle load as small as possible
 
 import { ExtensionRegistryEntry, ExtensionStartMethod } from '../types/extension';
+import { Dict } from '../types/types';
 import { getEnhancedWindow } from './browser';
 
 const WEB_ANALYTICS_EXTENSION = 'sq-web-analytics';
 
-const extensions: T.Dict<ExtensionRegistryEntry> = {};
+const extensions: Dict<ExtensionRegistryEntry> = {};
 
 function registerExtension(key: string, start: ExtensionStartMethod, providesCSSFile = false) {
   extensions[key] = { start, providesCSSFile };
index 75d2dfb0c5883f3d057fa9e1997738ef0f78d2a6..fb5ed0ec043a7d073e22b4c131847ea52926b7c3 100644 (file)
@@ -24,6 +24,7 @@ import SecurityHotspotIcon from '../components/icons/SecurityHotspotIcon';
 import VulnerabilityIcon from '../components/icons/VulnerabilityIcon';
 import { IssueType, RawIssue } from '../types/issues';
 import { MetricKey } from '../types/metrics';
+import { Dict, FlowLocation, Issue, TextRange, UserBase } from '../types/types';
 import { ISSUE_TYPES } from './constants';
 
 interface Rule {}
@@ -33,17 +34,17 @@ interface Component {
   name: string;
 }
 
-export function sortByType<T extends Pick<T.Issue, 'type'>>(issues: T[]): T[] {
-  return sortBy(issues, issue => ISSUE_TYPES.indexOf(issue.type));
+export function sortByType<T extends Pick<Issue, 'type'>>(issues: T[]): T[] {
+  return sortBy(issues, issue => ISSUE_TYPES.indexOf(issue.type as IssueType));
 }
 
 function injectRelational(
-  issue: T.Dict<any>,
+  issue: Dict<any>,
   source: any[] | undefined,
   baseField: string,
   lookupField: string
 ) {
-  const newFields: T.Dict<any> = {};
+  const newFields: Dict<any> = {};
   const baseValue = issue[baseField];
   if (baseValue !== undefined && source !== undefined) {
     const lookupValue = source.find(candidate => candidate[lookupField] === baseValue);
@@ -57,7 +58,7 @@ function injectRelational(
   return newFields;
 }
 
-function injectCommentsRelational(issue: RawIssue, users?: T.UserBase[]) {
+function injectCommentsRelational(issue: RawIssue, users?: UserBase[]) {
   if (!issue.comments) {
     return {};
   }
@@ -73,15 +74,15 @@ function injectCommentsRelational(issue: RawIssue, users?: T.UserBase[]) {
 
 function prepareClosed(
   issue: RawIssue,
-  secondaryLocations: T.FlowLocation[],
-  flows: T.FlowLocation[][]
+  secondaryLocations: FlowLocation[],
+  flows: FlowLocation[][]
 ) {
   return issue.status === 'CLOSED'
     ? { flows: [], line: undefined, textRange: undefined, secondaryLocations: [] }
     : { flows, secondaryLocations };
 }
 
-function ensureTextRange(issue: RawIssue): { textRange?: T.TextRange } {
+function ensureTextRange(issue: RawIssue): { textRange?: TextRange } {
   return issue.line && !issue.textRange
     ? {
         textRange: {
@@ -94,7 +95,7 @@ function ensureTextRange(issue: RawIssue): { textRange?: T.TextRange } {
     : {};
 }
 
-function reverseLocations(locations: T.FlowLocation[]): T.FlowLocation[] {
+function reverseLocations(locations: FlowLocation[]): FlowLocation[] {
   const x = [...locations];
   x.reverse();
   return x;
@@ -103,8 +104,8 @@ function reverseLocations(locations: T.FlowLocation[]): T.FlowLocation[] {
 function splitFlows(
   issue: RawIssue,
   components: Component[] = []
-): { secondaryLocations: T.FlowLocation[]; flows: T.FlowLocation[][] } {
-  const parsedFlows: T.FlowLocation[][] = (issue.flows || [])
+): { secondaryLocations: FlowLocation[]; flows: FlowLocation[][] } {
+  const parsedFlows: FlowLocation[][] = (issue.flows || [])
     .filter(flow => flow.locations !== undefined)
     .map(flow => flow.locations!.filter(location => location.textRange != null))
     .map(flow =>
@@ -121,7 +122,7 @@ function splitFlows(
     : { secondaryLocations: [], flows: parsedFlows.map(reverseLocations) };
 }
 
-function orderLocations(locations: T.FlowLocation[]) {
+function orderLocations(locations: FlowLocation[]) {
   return sortBy(
     locations,
     location => location.textRange && location.textRange.startLine,
@@ -132,9 +133,9 @@ function orderLocations(locations: T.FlowLocation[]) {
 export function parseIssueFromResponse(
   issue: RawIssue,
   components?: Component[],
-  users?: T.UserBase[],
+  users?: UserBase[],
   rules?: Rule[]
-): T.Issue {
+): Issue {
   const { secondaryLocations, flows } = splitFlows(issue, components);
   return {
     ...issue,
@@ -146,7 +147,7 @@ export function parseIssueFromResponse(
     ...injectCommentsRelational(issue, users),
     ...prepareClosed(issue, secondaryLocations, flows),
     ...ensureTextRange(issue)
-  } as T.Issue;
+  } as Issue;
 }
 
 export const ISSUETYPE_METRIC_KEYS_MAP = {
index a57732333ca7257a32976b3bf013e96738da482a..cf01bde7d68101b656cf67180314b35fd676e193 100644 (file)
  */
 import { fetchL10nBundle } from '../api/l10n';
 import { L10nBundle, L10nBundleRequestParams } from '../types/l10n';
+import { Dict } from '../types/types';
 import { toNotSoISOString } from './dates';
 import { get as loadFromLocalStorage, save as saveInLocalStorage } from './storage';
 
-export type Messages = T.Dict<string>;
+export type Messages = Dict<string>;
 
 export const DEFAULT_LOCALE = 'en';
 export const DEFAULT_MESSAGES = {
index 86451fc6e0b374bebb186db3d087aa02252500ce..27347cb7b69bb51b59f54fbc94ac03cdb2f71f5a 100644 (file)
@@ -22,13 +22,14 @@ import {
   QualityGateStatusCondition,
   QualityGateStatusConditionEnhanced
 } from '../types/quality-gates';
+import { Dict, Measure, MeasureEnhanced, Metric } from '../types/types';
 import { getCurrentLocale, translate, translateWithParameters } from './l10n';
 import { isDefined } from './types';
 
 export function enhanceMeasuresWithMetrics(
-  measures: T.Measure[],
-  metrics: T.Metric[]
-): T.MeasureEnhanced[] {
+  measures: Measure[],
+  metrics: Metric[]
+): MeasureEnhanced[] {
   return measures
     .map(measure => {
       const metric = metrics.find(metric => metric.key === measure.metric);
@@ -39,7 +40,7 @@ export function enhanceMeasuresWithMetrics(
 
 export function enhanceConditionWithMeasure(
   condition: QualityGateStatusCondition,
-  measures: T.MeasureEnhanced[]
+  measures: MeasureEnhanced[]
 ): QualityGateStatusConditionEnhanced | undefined {
   const measure = measures.find(m => m.metric.key === condition.metric);
 
@@ -53,7 +54,7 @@ export function enhanceConditionWithMeasure(
   return measure && { ...condition, period, measure };
 }
 
-export function isPeriodBestValue(measure: T.Measure | T.MeasureEnhanced): boolean {
+export function isPeriodBestValue(measure: Measure | MeasureEnhanced): boolean {
   return measure.period?.bestValue || false;
 }
 
@@ -124,11 +125,11 @@ export function getRatingTooltip(metricKey: MetricKey | string, value: number |
     : translate('metric', finalMetricKey, 'tooltip', ratingLetter);
 }
 
-export function getDisplayMetrics(metrics: T.Metric[]) {
+export function getDisplayMetrics(metrics: Metric[]) {
   return metrics.filter(metric => !metric.hidden && !['DATA', 'DISTRIB'].includes(metric.type));
 }
 
-export function findMeasure(measures: T.MeasureEnhanced[], metric: MetricKey | string) {
+export function findMeasure(measures: MeasureEnhanced[], metric: MetricKey | string) {
   return measures.find(measure => measure.metric.key === metric);
 }
 
@@ -196,7 +197,7 @@ function useFormatter(
 }
 
 function getFormatter(type: string): Formatter {
-  const FORMATTERS: T.Dict<Formatter> = {
+  const FORMATTERS: Dict<Formatter> = {
     INT: intFormatter,
     SHORT_INT: shortIntFormatter,
     FLOAT: floatFormatter,
index 19149a524c24458028ea857862aa7c157acc0c92..08074edb34432fb8b4d7f1c17e29255b9e92a486 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { ComponentQualifier, TreeComponent } from '../../types/component';
+import { ComponentQualifier, TreeComponent, Visibility } from '../../types/component';
 import { MetricKey } from '../../types/metrics';
+import { Component, ComponentMeasure, ComponentMeasureEnhanced } from '../../types/types';
 import { mockMeasureEnhanced } from '../testMocks';
 
-export function mockComponent(overrides: Partial<T.Component> = {}): T.Component {
+export function mockComponent(overrides: Partial<Component> = {}): Component {
   return {
     breadcrumbs: [],
     key: 'my-project',
@@ -46,15 +47,15 @@ export function mockTreeComponent(overrides: Partial<TreeComponent>): TreeCompon
     key: 'my-key',
     qualifier: ComponentQualifier.Project,
     name: 'component',
-    visibility: 'public',
+    visibility: Visibility.Public,
     ...overrides
   };
 }
 
 export function mockComponentMeasure(
   file = false,
-  overrides: Partial<T.ComponentMeasure> = {}
-): T.ComponentMeasure {
+  overrides: Partial<ComponentMeasure> = {}
+): ComponentMeasure {
   if (file) {
     return {
       key: 'foo:src/index.tsx',
@@ -75,10 +76,10 @@ export function mockComponentMeasure(
 }
 
 export function mockComponentMeasureEnhanced(
-  overrides: Partial<T.ComponentMeasureEnhanced> = {}
-): T.ComponentMeasureEnhanced {
+  overrides: Partial<ComponentMeasureEnhanced> = {}
+): ComponentMeasureEnhanced {
   return {
-    ...mockComponentMeasure(false, overrides as T.ComponentMeasure),
+    ...mockComponentMeasure(false, overrides as ComponentMeasure),
     leak: undefined,
     measures: [mockMeasureEnhanced()],
     value: undefined,
index 034eb0af1397779a19f40ff544fb4fda079ab94e..a2c4bf1a2a2c2291f36539f6e6e768ed1e3f037e 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { ReferencedRule } from '../../types/issues';
+import { IssueChangelog } from '../../types/types';
 
 export function mockReferencedRule(overrides: Partial<ReferencedRule> = {}): ReferencedRule {
   return {
@@ -27,7 +28,7 @@ export function mockReferencedRule(overrides: Partial<ReferencedRule> = {}): Ref
   };
 }
 
-export function mockIssueChangelog(overrides: Partial<T.IssueChangelog> = {}): T.IssueChangelog {
+export function mockIssueChangelog(overrides: Partial<IssueChangelog> = {}): IssueChangelog {
   return {
     creationDate: '2018-10-01',
     isUserActive: true,
index 815074d0fd945e4f54de10041b509983e8259890..59564250d93aee3bab7322afa8dee0f8b5bb2fcb 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import { PermissionGroup, PermissionUser } from '../../types/types';
 import { mockUser } from '../testMocks';
 
-export function mockPermissionGroup(overrides: Partial<T.PermissionGroup> = {}): T.PermissionGroup {
+export function mockPermissionGroup(overrides: Partial<PermissionGroup> = {}): PermissionGroup {
   return {
     name: 'sonar-admins',
     permissions: ['provisioning'],
@@ -27,7 +28,7 @@ export function mockPermissionGroup(overrides: Partial<T.PermissionGroup> = {}):
   };
 }
 
-export function mockPermissionUser(overrides: Partial<T.PermissionUser> = {}): T.PermissionUser {
+export function mockPermissionUser(overrides: Partial<PermissionUser> = {}): PermissionUser {
   return {
     ...mockUser(),
     active: true,
index 546a32c7799241596dd84bfe1f06919e7dc866b3..3ea683465a6eaeee72e44f9a371d04d275816d8a 100644 (file)
@@ -25,9 +25,10 @@ import {
   QualityGateStatusCondition,
   QualityGateStatusConditionEnhanced
 } from '../../types/quality-gates';
+import { QualityGate } from '../../types/types';
 import { mockMeasureEnhanced, mockMetric } from '../testMocks';
 
-export function mockQualityGate(overrides: Partial<T.QualityGate> = {}): T.QualityGate {
+export function mockQualityGate(overrides: Partial<QualityGate> = {}): QualityGate {
   return {
     id: '1',
     name: 'qualitygate',
index b1bd18b75665aaa1c23cd5865f6e3075ad9c9666..358cc54a42ca2c23c9bfb0f2c88e5657f77b44f0 100644 (file)
@@ -18,7 +18,9 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-export function mockUserBase(overrides: Partial<T.UserBase> = {}): T.UserBase {
+import { UserBase } from '../../types/types';
+
+export function mockUserBase(overrides: Partial<UserBase> = {}): UserBase {
   return {
     login: 'userlogin',
     ...overrides
index 63892450b9cdacf9385ba666988ebbb4e598c1a3..b776d0f966fa889cc1976968e3b79cc13b32ece4 100644 (file)
 import { parseDate } from '../helpers/dates';
 import { translate, translateWithParameters } from '../helpers/l10n';
 import { ApplicationPeriod } from '../types/application';
+import { Period } from '../types/types';
 
 export function getPeriodLabel(
-  period: T.Period | undefined,
+  period: Period | undefined,
   dateFormatter: (date: string) => string
 ) {
   if (!period) {
@@ -63,7 +64,7 @@ export function getPeriodDate(period?: { date?: string }): Date | undefined {
 }
 
 export function isApplicationPeriod(
-  period: T.Period | ApplicationPeriod
+  period: Period | ApplicationPeriod
 ): period is ApplicationPeriod {
   return (period as ApplicationPeriod).project !== undefined;
 }
index cf567cdb4cd7b8f9f9088b436e81d1d2ec1aee63..30d9b6fa637aed98c0a05bb527f5b107bc2d08c9 100644 (file)
  */
 import { partition, sortBy } from 'lodash';
 import { translate } from '../helpers/l10n';
+import { ProjectLink } from '../types/types';
 
 const PROVIDED_TYPES = ['homepage', 'ci', 'issue', 'scm', 'scm_dev'];
-type NameAndType = Pick<T.ProjectLink, 'name' | 'type'>;
+type NameAndType = Pick<ProjectLink, 'name' | 'type'>;
 
-export function isProvided(link: Pick<T.ProjectLink, 'type'>) {
+export function isProvided(link: Pick<ProjectLink, 'type'>) {
   return PROVIDED_TYPES.includes(link.type);
 }
 
index bc5fa4dd6d29625bf2375e11514ca35d84aae55a..9df3777d6f79db4445c27f6bf81a2c0f89ab028b 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { isEqual, isNil, omitBy } from 'lodash';
+import { RawQuery } from '../types/types';
 import { isValidDate, parseDate, toNotSoISOString, toShortNotSoISOString } from './dates';
 
-export function queriesEqual(a: T.RawQuery, b: T.RawQuery): boolean {
+export function queriesEqual(a: RawQuery, b: RawQuery): boolean {
   const keysA = Object.keys(a);
   const keysB = Object.keys(b);
 
@@ -31,7 +32,7 @@ export function queriesEqual(a: T.RawQuery, b: T.RawQuery): boolean {
   return keysA.every(key => isEqual(a[key], b[key]));
 }
 
-export function cleanQuery(query: T.RawQuery): T.RawQuery {
+export function cleanQuery(query: RawQuery): RawQuery {
   return omitBy(query, isNil);
 }
 
index 029ac9c37c40359c1ad2fe47a150d8657f0d52b1..7b342bf52c4449a7d5911b41d828d9200b89d136 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { isNil, omitBy } from 'lodash';
+import { Dict } from '../types/types';
 import { getCookie } from './cookies';
 import { translate } from './l10n';
 import { stringify } from './stringify-queryparams';
@@ -39,14 +40,14 @@ export function getCSRFTokenValue(): string {
 /**
  * Return an object containing a special http request header used to prevent CSRF attacks.
  */
-export function getCSRFToken(): T.Dict<string> {
+export function getCSRFToken(): Dict<string> {
   // Fetch API in Edge doesn't work with empty header,
   // so we ensure non-empty value
   const value = getCSRFTokenValue();
   return value ? { [getCSRFTokenName()]: value } : {};
 }
 
-export type RequestData = T.Dict<any>;
+export type RequestData = Dict<any>;
 
 export function omitNil(obj: RequestData): RequestData {
   return omitBy(obj, isNil);
index 7b701a7f7bd5aa75333ee1b04f8858401d36c996..a44a024ac0b6c506348917fdd1ec643e9a62ce27 100644 (file)
@@ -17,6 +17,9 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
+import { Dict } from '../types/types';
+
 /*
  * Latinize string by removing all diacritics
  * From http://stackoverflow.com/questions/990904/javascript-remove-accents-in-strings
@@ -393,7 +396,7 @@ const defaultDiacriticsRemovalap = [
   }
 ];
 
-const diacriticsMap: T.Dict<string> = {};
+const diacriticsMap: Dict<string> = {};
 defaultDiacriticsRemovalap.forEach(defaultDiacritic =>
   defaultDiacritic.letters.split('').forEach(letter => {
     diacriticsMap[letter] = defaultDiacritic.base;
index 1e77d0f49204ecff61bcd490a496416331d84582..29b6497b232becfc2ddd114973d00d210fc2cedc 100644 (file)
@@ -25,8 +25,41 @@ import { DocumentationEntry } from '../apps/documentation/utils';
 import { Exporter, Profile } from '../apps/quality-profiles/types';
 import { DumpStatus, DumpTask } from '../types/project-dump';
 import { TaskStatuses } from '../types/tasks';
-
-export function mockAlmApplication(overrides: Partial<T.AlmApplication> = {}): T.AlmApplication {
+import {
+  AlmApplication,
+  Analysis,
+  AnalysisEvent,
+  AppState,
+  Condition,
+  CurrentUser,
+  FlowLocation,
+  Group,
+  HealthType,
+  IdentityProvider,
+  Issue,
+  Language,
+  LoggedInUser,
+  Measure,
+  MeasureEnhanced,
+  Metric,
+  Paging,
+  ParsedAnalysis,
+  Period,
+  ProfileInheritanceDetails,
+  Rule,
+  RuleActivation,
+  RuleDetails,
+  RuleParameter,
+  SnippetsByComponent,
+  SourceLine,
+  SourceViewerFile,
+  SysInfoBase,
+  SysInfoCluster,
+  SysInfoStandalone,
+  User
+} from '../types/types';
+
+export function mockAlmApplication(overrides: Partial<AlmApplication> = {}): AlmApplication {
   return {
     backgroundColor: '#444444',
     iconPath: '/images/sonarcloud/github-white.svg',
@@ -37,7 +70,7 @@ export function mockAlmApplication(overrides: Partial<T.AlmApplication> = {}): T
   };
 }
 
-export function mockAnalysis(overrides: Partial<T.Analysis> = {}): T.Analysis {
+export function mockAnalysis(overrides: Partial<Analysis> = {}): Analysis {
   return {
     date: '2017-03-01T09:36:01+0100',
     events: [],
@@ -47,7 +80,7 @@ export function mockAnalysis(overrides: Partial<T.Analysis> = {}): T.Analysis {
   };
 }
 
-export function mockParsedAnalysis(overrides: Partial<T.ParsedAnalysis> = {}): T.ParsedAnalysis {
+export function mockParsedAnalysis(overrides: Partial<ParsedAnalysis> = {}): ParsedAnalysis {
   return {
     date: new Date('2017-03-01T09:37:01+0100'),
     events: [],
@@ -57,7 +90,7 @@ export function mockParsedAnalysis(overrides: Partial<T.ParsedAnalysis> = {}): T
   };
 }
 
-export function mockAnalysisEvent(overrides: Partial<T.AnalysisEvent> = {}): T.AnalysisEvent {
+export function mockAnalysisEvent(overrides: Partial<AnalysisEvent> = {}): AnalysisEvent {
   return {
     category: 'QUALITY_GATE',
     key: 'E11',
@@ -83,7 +116,7 @@ export function mockAnalysisEvent(overrides: Partial<T.AnalysisEvent> = {}): T.A
   };
 }
 
-export function mockAppState(overrides: Partial<T.AppState> = {}): T.AppState {
+export function mockAppState(overrides: Partial<AppState> = {}): AppState {
   return {
     edition: 'community',
     productionDatabase: true,
@@ -94,9 +127,9 @@ export function mockAppState(overrides: Partial<T.AppState> = {}): T.AppState {
   };
 }
 
-export function mockBaseSysInfo(overrides: Partial<any> = {}): T.SysInfoBase {
+export function mockBaseSysInfo(overrides: Partial<any> = {}): SysInfoBase {
   return {
-    Health: 'GREEN' as T.HealthType,
+    Health: 'GREEN' as HealthType,
     'Health Causes': [],
     System: {
       Version: '7.8'
@@ -122,7 +155,7 @@ export function mockBaseSysInfo(overrides: Partial<any> = {}): T.SysInfoBase {
   };
 }
 
-export function mockClusterSysInfo(overrides: Partial<any> = {}): T.SysInfoCluster {
+export function mockClusterSysInfo(overrides: Partial<any> = {}): SysInfoCluster {
   const baseInfo = mockBaseSysInfo(overrides);
   return {
     ...baseInfo,
@@ -139,7 +172,7 @@ export function mockClusterSysInfo(overrides: Partial<any> = {}): T.SysInfoClust
       {
         Name: 'server9.example.com',
         Host: '10.0.0.0',
-        Health: 'GREEN' as T.HealthType,
+        Health: 'GREEN' as HealthType,
         'Health Causes': [],
         System: {
           Version: '7.8'
@@ -182,7 +215,7 @@ export function mockClusterSysInfo(overrides: Partial<any> = {}): T.SysInfoClust
       {
         Name: 'server9.example.com',
         Host: '10.0.0.0',
-        Health: 'GREEN' as T.HealthType,
+        Health: 'GREEN' as HealthType,
         'Health Causes': [],
         System: {
           Version: '7.8'
@@ -257,7 +290,7 @@ export function mockClusterSysInfo(overrides: Partial<any> = {}): T.SysInfoClust
   };
 }
 
-export function mockCondition(overrides: Partial<T.Condition> = {}): T.Condition {
+export function mockCondition(overrides: Partial<Condition> = {}): Condition {
   return {
     error: '10',
     id: 1,
@@ -270,8 +303,8 @@ export function mockCondition(overrides: Partial<T.Condition> = {}): T.Condition
 export function mockSnippetsByComponent(
   component = 'main.js',
   lines: number[] = [16]
-): T.SnippetsByComponent {
-  const sources = lines.reduce((lines: { [key: number]: T.SourceLine }, line) => {
+): SnippetsByComponent {
+  const sources = lines.reduce((lines: { [key: number]: SourceLine }, line) => {
     lines[line] = mockSourceLine({ line });
     return lines;
   }, {});
@@ -284,7 +317,7 @@ export function mockSnippetsByComponent(
   };
 }
 
-export function mockSourceLine(overrides: Partial<T.SourceLine> = {}): T.SourceLine {
+export function mockSourceLine(overrides: Partial<SourceLine> = {}): SourceLine {
   return {
     line: 16,
     code: '<span class="k">import</span> java.util.<span class="sym-9 sym">ArrayList</span>;',
@@ -299,14 +332,14 @@ export function mockSourceLine(overrides: Partial<T.SourceLine> = {}): T.SourceL
   };
 }
 
-export function mockCurrentUser(overrides: Partial<T.CurrentUser> = {}): T.CurrentUser {
+export function mockCurrentUser(overrides: Partial<CurrentUser> = {}): CurrentUser {
   return {
     isLoggedIn: false,
     ...overrides
   };
 }
 
-export function mockLoggedInUser(overrides: Partial<T.LoggedInUser> = {}): T.LoggedInUser {
+export function mockLoggedInUser(overrides: Partial<LoggedInUser> = {}): LoggedInUser {
   return {
     groups: [],
     isLoggedIn: true,
@@ -317,7 +350,7 @@ export function mockLoggedInUser(overrides: Partial<T.LoggedInUser> = {}): T.Log
   };
 }
 
-export function mockGroup(overrides: Partial<T.Group> = {}): T.Group {
+export function mockGroup(overrides: Partial<Group> = {}): Group {
   return {
     id: 1,
     membersCount: 1,
@@ -336,8 +369,8 @@ export function mockEvent(overrides = {}) {
   } as any;
 }
 
-export function mockIssue(withLocations = false, overrides: Partial<T.Issue> = {}) {
-  const issue: T.Issue = {
+export function mockIssue(withLocations = false, overrides: Partial<Issue> = {}) {
+  const issue: Issue = {
     actions: [],
     component: 'main.js',
     componentLongName: 'main.js',
@@ -391,9 +424,7 @@ export function mockLocation(overrides: Partial<Location> = {}): Location {
   };
 }
 
-export function mockMetric(
-  overrides: Partial<Pick<T.Metric, 'key' | 'name' | 'type'>> = {}
-): T.Metric {
+export function mockMetric(overrides: Partial<Pick<Metric, 'key' | 'name' | 'type'>> = {}): Metric {
   const key = overrides.key || 'coverage';
   const name = overrides.name || key[0].toUpperCase() + key.substr(1);
   const type = overrides.type || 'PERCENT';
@@ -405,7 +436,7 @@ export function mockMetric(
   };
 }
 
-export function mockMeasure(overrides: Partial<T.Measure> = {}): T.Measure {
+export function mockMeasure(overrides: Partial<Measure> = {}): Measure {
   return {
     bestValue: true,
     metric: 'bugs',
@@ -419,7 +450,7 @@ export function mockMeasure(overrides: Partial<T.Measure> = {}): T.Measure {
   };
 }
 
-export function mockMeasureEnhanced(overrides: Partial<T.MeasureEnhanced> = {}): T.MeasureEnhanced {
+export function mockMeasureEnhanced(overrides: Partial<MeasureEnhanced> = {}): MeasureEnhanced {
   return {
     bestValue: true,
     leak: '1',
@@ -434,7 +465,7 @@ export function mockMeasureEnhanced(overrides: Partial<T.MeasureEnhanced> = {}):
   };
 }
 
-export function mockPeriod(overrides: Partial<T.Period> = {}): T.Period {
+export function mockPeriod(overrides: Partial<Period> = {}): Period {
   return {
     date: '2019-04-23T02:12:32+0100',
     index: 0,
@@ -462,8 +493,8 @@ export function mockQualityProfile(overrides: Partial<Profile> = {}): Profile {
 }
 
 export function mockQualityProfileInheritance(
-  overrides: Partial<T.ProfileInheritanceDetails> = {}
-): T.ProfileInheritanceDetails {
+  overrides: Partial<ProfileInheritanceDetails> = {}
+): ProfileInheritanceDetails {
   return {
     activeRuleCount: 4,
     isBuiltIn: false,
@@ -511,7 +542,7 @@ export function mockRouter(overrides: { push?: Function; replace?: Function } =
   } as InjectedRouter;
 }
 
-export function mockRule(overrides: Partial<T.Rule> = {}): T.Rule {
+export function mockRule(overrides: Partial<Rule> = {}): Rule {
   return {
     key: 'javascript:S1067',
     lang: 'js',
@@ -523,10 +554,10 @@ export function mockRule(overrides: Partial<T.Rule> = {}): T.Rule {
     tags: ['x'],
     type: 'CODE_SMELL',
     ...overrides
-  } as T.Rule;
+  } as Rule;
 }
 
-export function mockRuleActivation(overrides: Partial<T.RuleActivation> = {}): T.RuleActivation {
+export function mockRuleActivation(overrides: Partial<RuleActivation> = {}): RuleActivation {
   return {
     createdAt: '2020-02-01',
     inherit: 'NONE',
@@ -537,7 +568,7 @@ export function mockRuleActivation(overrides: Partial<T.RuleActivation> = {}): T
   };
 }
 
-export function mockRuleDetails(overrides: Partial<T.RuleDetails> = {}): T.RuleDetails {
+export function mockRuleDetails(overrides: Partial<RuleDetails> = {}): RuleDetails {
   return {
     key: 'squid:S1337',
     repo: 'squid',
@@ -570,9 +601,7 @@ export function mockRuleDetails(overrides: Partial<T.RuleDetails> = {}): T.RuleD
   };
 }
 
-export function mockRuleDetailsParameter(
-  overrides: Partial<T.RuleParameter> = {}
-): T.RuleParameter {
+export function mockRuleDetailsParameter(overrides: Partial<RuleParameter> = {}): RuleParameter {
   return {
     defaultValue: '1',
     htmlDesc: 'description',
@@ -582,9 +611,7 @@ export function mockRuleDetailsParameter(
   };
 }
 
-export function mockSourceViewerFile(
-  overrides: Partial<T.SourceViewerFile> = {}
-): T.SourceViewerFile {
+export function mockSourceViewerFile(overrides: Partial<SourceViewerFile> = {}): SourceViewerFile {
   return {
     key: 'foo',
     measures: {
@@ -602,7 +629,7 @@ export function mockSourceViewerFile(
   };
 }
 
-export function mockStandaloneSysInfo(overrides: Partial<any> = {}): T.SysInfoStandalone {
+export function mockStandaloneSysInfo(overrides: Partial<any> = {}): SysInfoStandalone {
   const baseInfo = mockBaseSysInfo(overrides);
   return {
     ...baseInfo,
@@ -659,7 +686,7 @@ export function mockStore(state: any = {}, reducer = (state: any) => state): Sto
   return createStore(reducer, state);
 }
 
-export function mockUser(overrides: Partial<T.User> = {}): T.User {
+export function mockUser(overrides: Partial<User> = {}): User {
   return {
     active: true,
     local: true,
@@ -705,7 +732,7 @@ export function mockDocumentationEntry(
   };
 }
 
-export function mockLanguage(overrides: Partial<T.Language> = {}): T.Language {
+export function mockLanguage(overrides: Partial<Language> = {}): Language {
   return {
     key: 'css',
     name: 'CSS',
@@ -713,7 +740,7 @@ export function mockLanguage(overrides: Partial<T.Language> = {}): T.Language {
   };
 }
 
-export function mockFlowLocation(overrides: Partial<T.FlowLocation> = {}): T.FlowLocation {
+export function mockFlowLocation(overrides: Partial<FlowLocation> = {}): FlowLocation {
   return {
     component: 'main.js',
     textRange: {
@@ -726,9 +753,7 @@ export function mockFlowLocation(overrides: Partial<T.FlowLocation> = {}): T.Flo
   };
 }
 
-export function mockIdentityProvider(
-  overrides: Partial<T.IdentityProvider> = {}
-): T.IdentityProvider {
+export function mockIdentityProvider(overrides: Partial<IdentityProvider> = {}): IdentityProvider {
   return {
     backgroundColor: '#000000',
     iconPath: '/path/icon.svg',
@@ -749,7 +774,7 @@ export function mockRef(
   } as React.RefObject<HTMLElement>;
 }
 
-export function mockPaging(overrides: Partial<T.Paging> = {}): T.Paging {
+export function mockPaging(overrides: Partial<Paging> = {}): Paging {
   return {
     pageIndex: 1,
     pageSize: 100,
index ee616508baafd54b5d3decb6fc119983bc65da10..85816bd3e70ab641a6e72b792e57da858546fd4c 100644 (file)
@@ -24,13 +24,14 @@ import { ComponentQualifier, isApplication, isPortfolioLike } from '../types/com
 import { MeasurePageView } from '../types/measures';
 import { GraphType } from '../types/project-activity';
 import { SecurityStandard } from '../types/security';
+import { Dict, HomePage } from '../types/types';
 import { getBranchLikeQuery, isBranch, isMainBranch, isPullRequest } from './branch-like';
 import { IS_SSR } from './browser';
 import { getBaseUrl } from './system';
 
 export interface Location {
   pathname: string;
-  query?: T.Dict<string | undefined | number>;
+  query?: Dict<string | undefined | number>;
 }
 
 type Query = Location['query'];
@@ -246,7 +247,7 @@ export function getQualityGatesUrl(): Location {
 
 export function getGlobalSettingsUrl(
   category?: string,
-  query?: T.Dict<string | undefined | number>
+  query?: Dict<string | undefined | number>
 ): Location {
   return {
     pathname: '/admin/settings',
@@ -296,7 +297,7 @@ export function getCodeUrl(
   };
 }
 
-export function getHomePageUrl(homepage: T.HomePage) {
+export function getHomePageUrl(homepage: HomePage) {
   switch (homepage.type) {
     case 'APPLICATION':
       return homepage.branch
index ca64aa532778073ee97a1dae289f55ce431969ab..0bec8925c3fa651d176f64986ccbe73a20a8aca2 100644 (file)
@@ -1,3 +1,5 @@
+import { CurrentUser, LoggedInUser, UserActive, UserBase } from '../types/types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-export function hasGlobalPermission(user: T.CurrentUser, permission: string): boolean {
+export function hasGlobalPermission(user: CurrentUser, permission: string): boolean {
   if (!user.permissions) {
     return false;
   }
   return user.permissions.global.includes(permission);
 }
 
-export function isLoggedIn(user: T.CurrentUser): user is T.LoggedInUser {
+export function isLoggedIn(user: CurrentUser): user is LoggedInUser {
   return user.isLoggedIn;
 }
 
-export function isUserActive(user: T.UserBase): user is T.UserActive {
+export function isUserActive(user: UserBase): user is UserActive {
   return user.active !== false && Boolean(user.name);
 }
index 9b71e91540f3201b6378df8c45cb68de609445bd..497d597a581a43cac1d53f11aaf9b4bf067b86d2 100644 (file)
@@ -22,13 +22,14 @@ import { mockBranch, mockPullRequest } from '../../helpers/mocks/branch-like';
 import { mockQualityGateStatusCondition } from '../../helpers/mocks/quality-gates';
 import { BranchLike } from '../../types/branch-like';
 import { QualityGateStatusCondition } from '../../types/quality-gates';
+import { Status } from '../../types/types';
 import reducer, {
   getBranchStatusByBranchLike,
   registerBranchStatusAction,
   State
 } from '../branches';
 
-type TestArgs = [BranchLike, string, T.Status, QualityGateStatusCondition[], boolean?];
+type TestArgs = [BranchLike, string, Status, QualityGateStatusCondition[], boolean?];
 
 const FAILING_CONDITION = mockQualityGateStatusCondition();
 const COMPONENT = 'foo';
index 2547c9aca88b6dfe5cec17952f101e01598e5b42..0e4995bcfbab02027ef26edbce6db6e8bd4270bc 100644 (file)
@@ -20,6 +20,7 @@
 
 import { mockCurrentUser, mockLoggedInUser, mockUser } from '../../helpers/testMocks';
 import { isLoggedIn } from '../../helpers/users';
+import { CurrentUserSetting, HomePage, LoggedInUser } from '../../types/types';
 import reducer, {
   getCurrentUser,
   getCurrentUserSetting,
@@ -42,39 +43,39 @@ describe('reducer and actions', () => {
   });
 
   it('should allow to set the homepage', () => {
-    const homepage: T.HomePage = { type: 'PROJECTS' };
+    const homepage: HomePage = { type: 'PROJECTS' };
     const currentUser = mockLoggedInUser({ homepage: undefined });
     const initialState: State = createState({ currentUser });
 
     const newState = reducer(initialState, setHomePageAction(homepage));
     expect(newState).toEqual(
-      createState({ currentUser: { ...currentUser, homepage } as T.LoggedInUser })
+      createState({ currentUser: { ...currentUser, homepage } as LoggedInUser })
     );
   });
 
   it('should allow to set a user setting', () => {
-    const setting1: T.CurrentUserSetting = { key: 'notifications.optOut', value: '1' };
-    const setting2: T.CurrentUserSetting = { key: 'notifications.readDate', value: '2' };
-    const setting3: T.CurrentUserSetting = { key: 'notifications.optOut', value: '2' };
+    const setting1: CurrentUserSetting = { key: 'notifications.optOut', value: '1' };
+    const setting2: CurrentUserSetting = { key: 'notifications.readDate', value: '2' };
+    const setting3: CurrentUserSetting = { key: 'notifications.optOut', value: '2' };
     const currentUser = mockLoggedInUser();
     const initialState: State = createState({ currentUser });
 
     const newState = reducer(initialState, setCurrentUserSettingAction(setting1));
     expect(newState).toEqual(
-      createState({ currentUser: { ...currentUser, settings: [setting1] } as T.LoggedInUser })
+      createState({ currentUser: { ...currentUser, settings: [setting1] } as LoggedInUser })
     );
 
     const newerState = reducer(newState, setCurrentUserSettingAction(setting2));
     expect(newerState).toEqual(
       createState({
-        currentUser: { ...currentUser, settings: [setting1, setting2] } as T.LoggedInUser
+        currentUser: { ...currentUser, settings: [setting1, setting2] } as LoggedInUser
       })
     );
 
     const newestState = reducer(newerState, setCurrentUserSettingAction(setting3));
     expect(newestState).toEqual(
       createState({
-        currentUser: { ...currentUser, settings: [setting3, setting2] } as T.LoggedInUser
+        currentUser: { ...currentUser, settings: [setting3, setting2] } as LoggedInUser
       })
     );
   });
index 2dda669acaa597af85a11e2f234250b9444389e0..01cf1a579790d3469987f70fe2766c87bc3a5055 100644 (file)
@@ -17,6 +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 { AppState, Extension } from '../types/types';
 import { ActionType } from './utils/actions';
 
 export const enum Actions {
@@ -30,11 +31,11 @@ export type Action =
   | ActionType<typeof setAdminPages, Actions.SetAdminPages>
   | ActionType<typeof requireAuthorization, Actions.RequireAuthorization>;
 
-export function setAppState(appState: T.AppState) {
+export function setAppState(appState: AppState) {
   return { type: Actions.SetAppState, appState };
 }
 
-export function setAdminPages(adminPages: T.Extension[]) {
+export function setAdminPages(adminPages: Extension[]) {
   return { type: Actions.SetAdminPages, adminPages };
 }
 
@@ -42,7 +43,7 @@ export function requireAuthorization() {
   return { type: Actions.RequireAuthorization };
 }
 
-const defaultValue: T.AppState = {
+const defaultValue: AppState = {
   authenticationError: false,
   authorizationError: false,
   edition: undefined,
@@ -52,7 +53,7 @@ const defaultValue: T.AppState = {
   version: ''
 };
 
-export default function(state: T.AppState = defaultValue, action: Action): T.AppState {
+export default function(state: AppState = defaultValue, action: Action): AppState {
   if (action.type === Actions.SetAppState) {
     return { ...state, ...action.appState };
   }
index baa8facef046f22d4d6a13830d6df019e14e35fe..0acfbf7b6a2e3dfd66907ca969da7fe56ebdad50 100644 (file)
 import { getBranchLikeKey } from '../helpers/branch-like';
 import { BranchLike } from '../types/branch-like';
 import { QualityGateStatusCondition } from '../types/quality-gates';
+import { Dict, Status } from '../types/types';
 import { ActionType } from './utils/actions';
 
 export interface BranchStatusData {
   conditions?: QualityGateStatusCondition[];
   ignoredConditions?: boolean;
-  status?: T.Status;
+  status?: Status;
 }
 
 export interface State {
-  byComponent: T.Dict<T.Dict<BranchStatusData>>;
+  byComponent: Dict<Dict<BranchStatusData>>;
 }
 
 const enum Actions {
@@ -41,7 +42,7 @@ type Action = ActionType<typeof registerBranchStatusAction, Actions.RegisterBran
 export function registerBranchStatusAction(
   branchLike: BranchLike,
   component: string,
-  status: T.Status,
+  status: Status,
   conditions?: QualityGateStatusCondition[],
   ignoredConditions?: boolean
 ) {
index 06a7a0b70519ecba5583e454c6e0deb73f680609..d7f2e556141bb2c36c915751b026642379e24ee5 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { keyBy } from 'lodash';
+import { Languages } from '../types/types';
 import { ActionType } from './utils/actions';
 
 export function receiveLanguages(languages: Array<{ key: string; name: string }>) {
@@ -26,7 +27,7 @@ export function receiveLanguages(languages: Array<{ key: string; name: string }>
 
 type Action = ActionType<typeof receiveLanguages, 'RECEIVE_LANGUAGES'>;
 
-export default function(state: T.Languages = {}, action: Action): T.Languages {
+export default function(state: Languages = {}, action: Action): Languages {
   if (action.type === 'RECEIVE_LANGUAGES') {
     return keyBy(action.languages, 'key');
   }
@@ -34,10 +35,10 @@ export default function(state: T.Languages = {}, action: Action): T.Languages {
   return state;
 }
 
-export function getLanguages(state: T.Languages) {
+export function getLanguages(state: Languages) {
   return state;
 }
 
-export function getLanguageByKey(state: T.Languages, key: string) {
+export function getLanguageByKey(state: Languages, key: string) {
   return state[key];
 }
index f4024268ae4417c3d562fddaad13f6b435a64b18..615daddc78759e2c8ce3ce287a327db4b14c137b 100644 (file)
  */
 import { keyBy } from 'lodash';
 import { combineReducers } from 'redux';
+import { Dict, Metric } from '../types/types';
 import { ActionType } from './utils/actions';
 
-export function receiveMetrics(metrics: T.Metric[]) {
+export function receiveMetrics(metrics: Metric[]) {
   return { type: 'RECEIVE_METRICS', metrics };
 }
 
 type Action = ActionType<typeof receiveMetrics, 'RECEIVE_METRICS'>;
 
-export type State = { byKey: T.Dict<T.Metric>; keys: string[] };
+export type State = { byKey: Dict<Metric>; keys: string[] };
 
 const byKey = (state: State['byKey'] = {}, action: Action) => {
   if (action.type === 'RECEIVE_METRICS') {
index 5d802c4a96d1abccb5eb590b00886df7c9248fff..3a47ad4fac9d37fadcee8a2096b134f6b00d481e 100644 (file)
@@ -26,6 +26,7 @@ import { getQualityGateProjectStatus } from '../api/quality-gates';
 import { getBranchLikeQuery } from '../helpers/branch-like';
 import { extractStatusConditionsFromProjectStatus } from '../helpers/qualityGates';
 import { BranchLike } from '../types/branch-like';
+import { Status } from '../types/types';
 import { requireAuthorization as requireAuthorizationAction } from './appState';
 import { registerBranchStatusAction } from './branches';
 import { addGlobalErrorMessage } from './globalMessages';
@@ -103,7 +104,7 @@ export function requireAuthorization(router: Pick<InjectedRouter, 'replace'>) {
   return requireAuthorizationAction();
 }
 
-export function registerBranchStatus(branchLike: BranchLike, component: string, status: T.Status) {
+export function registerBranchStatus(branchLike: BranchLike, component: string, status: Status) {
   return (dispatch: Dispatch) => {
     dispatch(registerBranchStatusAction(branchLike, component, status));
   };
index 5ec1467a7f07bf9794b0eee67686205668a4b19a..37db13aababe9f1808145ccaf0fdc4481696b8c0 100644 (file)
@@ -20,6 +20,7 @@
 import { combineReducers } from 'redux';
 import settingsApp, * as fromSettingsApp from '../apps/settings/store/rootReducer';
 import { BranchLike } from '../types/branch-like';
+import { AppState, CurrentUserSettingNames, Languages } from '../types/types';
 import appState from './appState';
 import branches, * as fromBranches from './branches';
 import globalMessages, * as fromGlobalMessages from './globalMessages';
@@ -28,10 +29,10 @@ import metrics, * as fromMetrics from './metrics';
 import users, * as fromUsers from './users';
 
 export type Store = {
-  appState: T.AppState;
+  appState: AppState;
   branches: fromBranches.State;
   globalMessages: fromGlobalMessages.State;
-  languages: T.Languages;
+  languages: Languages;
   metrics: fromMetrics.State;
   users: fromUsers.State;
 
@@ -63,7 +64,7 @@ export function getLanguages(state: Store) {
   return fromLanguages.getLanguages(state.languages);
 }
 
-export function getCurrentUserSetting(state: Store, key: T.CurrentUserSettingNames) {
+export function getCurrentUserSetting(state: Store, key: CurrentUserSettingNames) {
   return fromUsers.getCurrentUserSetting(state.users, key);
 }
 
index e637a551f637d539d6ccf7f7347bc64111ca65bd..287a8a2fa626f027a3ea5951402a8ce80303937f 100644 (file)
@@ -21,6 +21,14 @@ import { uniq } from 'lodash';
 import { combineReducers, Dispatch } from 'redux';
 import * as api from '../api/users';
 import { isLoggedIn } from '../helpers/users';
+import {
+  CurrentUser,
+  CurrentUserSetting,
+  CurrentUserSettingNames,
+  Dict,
+  HomePage,
+  LoggedInUser
+} from '../types/types';
 import { ActionType } from './utils/actions';
 
 const enum Actions {
@@ -37,20 +45,20 @@ type Action =
   | ActionType<typeof setSonarlintAd, Actions.SetSonarlintAd>;
 
 export interface State {
-  usersByLogin: T.Dict<any>;
+  usersByLogin: Dict<any>;
   userLogins: string[];
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
 }
 
-export function receiveCurrentUser(user: T.CurrentUser) {
+export function receiveCurrentUser(user: CurrentUser) {
   return { type: Actions.ReceiveCurrentUser, user };
 }
 
-export function setHomePageAction(homepage: T.HomePage) {
+export function setHomePageAction(homepage: HomePage) {
   return { type: Actions.SetHomePageAction, homepage };
 }
 
-export function setCurrentUserSettingAction(setting: T.CurrentUserSetting) {
+export function setCurrentUserSettingAction(setting: CurrentUserSetting) {
   return { type: Actions.SetCurrentUserSetting, setting };
 }
 
@@ -58,7 +66,7 @@ export function setSonarlintAd() {
   return { type: Actions.SetSonarlintAd };
 }
 
-export function setHomePage(homepage: T.HomePage) {
+export function setHomePage(homepage: HomePage) {
   return (dispatch: Dispatch) => {
     api.setHomePage(homepage).then(
       () => {
@@ -69,7 +77,7 @@ export function setHomePage(homepage: T.HomePage) {
   };
 }
 
-export function setCurrentUserSetting(setting: T.CurrentUserSetting) {
+export function setCurrentUserSetting(setting: CurrentUserSetting) {
   return (dispatch: Dispatch, getState: () => { users: State }) => {
     const oldSetting = getCurrentUserSetting(getState().users, setting.key);
     dispatch(setCurrentUserSettingAction(setting));
@@ -106,10 +114,10 @@ function currentUser(
     return action.user;
   }
   if (action.type === Actions.SetHomePageAction && isLoggedIn(state)) {
-    return { ...state, homepage: action.homepage } as T.LoggedInUser;
+    return { ...state, homepage: action.homepage } as LoggedInUser;
   }
   if (action.type === Actions.SetCurrentUserSetting && isLoggedIn(state)) {
-    let settings: T.CurrentUserSetting[];
+    let settings: CurrentUserSetting[];
     if (state.settings) {
       settings = [...state.settings];
       const index = settings.findIndex(setting => setting.key === action.setting.key);
@@ -121,10 +129,10 @@ function currentUser(
     } else {
       settings = [action.setting];
     }
-    return { ...state, settings } as T.LoggedInUser;
+    return { ...state, settings } as LoggedInUser;
   }
   if (action.type === Actions.SetSonarlintAd && isLoggedIn(state)) {
-    return { ...state, sonarLintAdSeen: true } as T.LoggedInUser;
+    return { ...state, sonarLintAdSeen: true } as LoggedInUser;
   }
   return state;
 }
@@ -135,7 +143,7 @@ export function getCurrentUser(state: State) {
   return state.currentUser;
 }
 
-export function getCurrentUserSetting(state: State, key: T.CurrentUserSettingNames) {
+export function getCurrentUserSetting(state: State, key: CurrentUserSettingNames) {
   let setting;
   if (isLoggedIn(state.currentUser) && state.currentUser.settings) {
     setting = state.currentUser.settings.find(setting => setting.key === key);
index 8419e6de5baa383f1b3cc0dafd4dd2ce9d911719..0a768a2a24ec86af9f2aadf34503a239429fd537 100644 (file)
@@ -19,4 +19,4 @@
  */
 type ActionCreator = (...args: any[]) => { type: string };
 
-export type ActionType<F extends ActionCreator, T> = T.Omit<ReturnType<F>, 'type'> & { type: T };
+export type ActionType<F extends ActionCreator, T> = Omit<ReturnType<F>, 'type'> & { type: T };
index cbd7350238363682a600328067fcad612f854986..9f6e39ebd0d318ca7f72f91b1cc94b9d8406a3bc 100644 (file)
@@ -1,3 +1,5 @@
+import { Dict } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -52,7 +54,7 @@ export interface BitbucketCloudRepository {
   workspace: string;
 }
 
-export type BitbucketProjectRepositories = T.Dict<{
+export type BitbucketProjectRepositories = Dict<{
   allShown: boolean;
   repositories: BitbucketRepository[];
 }>;
index 3741e8b80008c4b064175c5387b19d52395f25f1..418093b27a98cc2c7276ac8b0b2be00523e0e816 100644 (file)
@@ -1,3 +1,5 @@
+import { NewCodePeriod, Status } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -22,7 +24,7 @@ export interface Branch {
   excludedFromPurge: boolean;
   isMain: boolean;
   name: string;
-  status?: { qualityGateStatus: T.Status };
+  status?: { qualityGateStatus: Status };
 }
 
 export interface MainBranch extends Branch {
@@ -35,7 +37,7 @@ export interface PullRequest {
   branch: string;
   key: string;
   isOrphan?: true;
-  status?: { qualityGateStatus: T.Status };
+  status?: { qualityGateStatus: Status };
   target: string;
   title: string;
   url?: string;
@@ -58,5 +60,5 @@ export interface BranchLikeTree {
 export type BranchParameters = { branch?: string } | { pullRequest?: string };
 
 export interface BranchWithNewCodePeriod extends Branch {
-  newCodePeriod?: T.NewCodePeriod;
+  newCodePeriod?: NewCodePeriod;
 }
index 7757a3364f37615de274a744747efcbc112b7905..83e5898412cbc4427b5a1dd7df7e1ab79e7206b6 100644 (file)
  */
 import { ExtensionStartMethod } from './extension';
 import { InstanceType } from './system';
+import { SysStatus } from './types';
 
 export interface EnhancedWindow extends Window {
   baseUrl: string;
-  serverStatus: T.SysStatus;
+  serverStatus: SysStatus;
   instance: InstanceType;
   official: boolean;
 
index 9ede5aebb51aac5f7e8b367ca505c2a7006d5237..c0d1597a2cc752019c84b1c431025bab6d75894d 100644 (file)
@@ -1,3 +1,5 @@
+import { Dict, Rule, RuleActivation } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -23,10 +25,10 @@ export interface GetRulesAppResponse {
 }
 
 export interface SearchRulesResponse {
-  actives?: T.Dict<T.RuleActivation[]>;
+  actives?: Dict<RuleActivation[]>;
   facets?: { property: string; values: { count: number; val: string }[] }[];
   p: number;
   ps: number;
-  rules: T.Rule[];
+  rules: Rule[];
   total: number;
 }
index 1e843536ee73a7c88ba85a0fff999339af676a95..e6ffc524cb7bd8b3f0d5fb644404d2006d9c4b38 100644 (file)
@@ -1,3 +1,5 @@
+import { LightComponent } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -42,14 +44,14 @@ export enum ProjectKeyValidationResult {
   OnlyDigits = 'only_digits'
 }
 
-export interface TreeComponent extends T.LightComponent {
+export interface TreeComponent extends LightComponent {
   id?: string;
   name: string;
   path?: string;
   refId?: string;
   refKey?: string;
   tags?: string[];
-  visibility: T.Visibility;
+  visibility: Visibility;
 }
 
 export interface TreeComponentWithPath extends TreeComponent {
index 30630dd2fc33e636e7c3991c20709ed547ee20c1..c768bc9834b3d89feee51e7415e1b4ce22f3fcba 100644 (file)
@@ -22,6 +22,7 @@ import { Store as ReduxStore } from 'redux';
 import { Location, Router } from '../components/hoc/withRouter';
 import { Store } from '../store/rootReducer';
 import { L10nBundle } from './l10n';
+import { CurrentUser, Dict } from './types';
 
 export enum AdminPageExtension {
   GovernanceConsole = 'governance/views_console'
@@ -39,17 +40,17 @@ export interface ExtensionStartMethod {
 export interface ExtensionStartMethodParameter {
   store: ReduxStore<Store, any>;
   el: HTMLElement | undefined | null;
-  currentUser: T.CurrentUser;
+  currentUser: CurrentUser;
   intl: IntlShape;
   location: Location;
   router: Router;
   theme: {
-    colors: T.Dict<string>;
-    sizes: T.Dict<string>;
-    rawSizes: T.Dict<number>;
-    fonts: T.Dict<string>;
-    zIndexes: T.Dict<string>;
-    others: T.Dict<string>;
+    colors: Dict<string>;
+    sizes: Dict<string>;
+    rawSizes: Dict<number>;
+    fonts: Dict<string>;
+    zIndexes: Dict<string>;
+    others: Dict<string>;
   };
   baseUrl: string;
   l10nBundle: L10nBundle;
index b7252e20dadd5605667733a9bb0d2d938ddd6096..de5beae1a3267bf40928dbea5c4dad54eabe1e15 100644 (file)
@@ -1,3 +1,5 @@
+import { FlowLocation, Issue, Paging, TextRange, UserBase } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -45,7 +47,7 @@ export interface RawIssue {
   component: string;
   flows?: Array<{
     // `componentName` is not available in RawIssue
-    locations?: Array<T.Omit<T.FlowLocation, 'componentName'>>;
+    locations?: Array<Omit<FlowLocation, 'componentName'>>;
   }>;
   key: string;
   line?: number;
@@ -54,14 +56,14 @@ export interface RawIssue {
   severity: string;
   status: string;
   subProject?: string;
-  textRange?: T.TextRange;
+  textRange?: TextRange;
 }
 
 export interface IssueResponse {
   components?: Array<{ key: string; name: string }>;
   issue: RawIssue;
   rules?: Array<{}>;
-  users?: Array<T.UserBase>;
+  users?: Array<UserBase>;
 }
 
 export interface RawIssuesResponse {
@@ -70,20 +72,20 @@ export interface RawIssuesResponse {
   facets: RawFacet[];
   issues: RawIssue[];
   languages: ReferencedLanguage[];
-  paging: T.Paging;
+  paging: Paging;
   rules?: Array<{}>;
-  users?: Array<T.UserBase>;
+  users?: Array<UserBase>;
 }
 
 export interface FetchIssuesPromise {
   components: ReferencedComponent[];
   effortTotal: number;
   facets: RawFacet[];
-  issues: T.Issue[];
+  issues: Issue[];
   languages: ReferencedLanguage[];
-  paging: T.Paging;
+  paging: Paging;
   rules: ReferencedRule[];
-  users: T.UserBase[];
+  users: UserBase[];
 }
 
 export interface ReferencedComponent {
index 11d5cbbf11fb1e6523ee0ee1ab5fc9840f677dc8..b34fae733aaeb18435d698d03a98d75b12baca64 100644 (file)
@@ -1,3 +1,5 @@
+import { Dict } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -24,11 +26,11 @@ export interface L10nBundleRequestParams {
 
 export interface L10nBundleRequestResponse {
   effectiveLocale: string;
-  messages: T.Dict<string>;
+  messages: Dict<string>;
 }
 
 export interface L10nBundle {
   timestamp?: string;
   locale?: string;
-  messages?: T.Dict<string>;
+  messages?: Dict<string>;
 }
index cc48756a394c246a8834bb6e0053e3043df566f9..6d95de4c879b6972de73a53a5ee5655f7bd0ba65 100644 (file)
@@ -1,3 +1,5 @@
+import { ComponentMeasure, Metric, Period, PeriodMeasure } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
 export interface MeasuresForProjects {
   component: string;
   metric: string;
-  period?: T.PeriodMeasure;
+  period?: PeriodMeasure;
   value?: string;
 }
 
 export interface MeasuresAndMetaWithMetrics {
-  component: T.ComponentMeasure;
-  metrics: T.Metric[];
+  component: ComponentMeasure;
+  metrics: Metric[];
 }
 
 export interface MeasuresAndMetaWithPeriod {
-  component: T.ComponentMeasure;
-  period: T.Period;
+  component: ComponentMeasure;
+  period: Period;
 }
 
 export type MeasurePageView = 'list' | 'tree' | 'treemap';
index 1814b8fc89dd2aaf50a6d104f6412ec14e500ff1..6edefb593af3c699bc3ff9068b8f5134676532e9 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { BranchLike } from './branch-like';
+import { MeasureEnhanced, Metric, Status, UserBase } from './types';
 
 export interface QualityGateProjectStatus {
   conditions?: QualityGateProjectStatusCondition[];
   ignoredConditions: boolean;
-  status: T.Status;
+  status: Status;
 }
 
 export interface QualityGateProjectStatusCondition {
@@ -31,13 +32,13 @@ export interface QualityGateProjectStatusCondition {
   errorThreshold: string;
   metricKey: string;
   periodIndex: number;
-  status: T.Status;
+  status: Status;
 }
 
 export interface QualityGateApplicationStatus {
-  metrics: T.Metric[];
+  metrics: Metric[];
   projects: QualityGateApplicationStatusChildProject[];
-  status: T.Status;
+  status: Status;
 }
 
 export interface QualityGateApplicationStatusCondition {
@@ -46,7 +47,7 @@ export interface QualityGateApplicationStatusCondition {
   metric: string;
   periodIndex?: number;
   onLeak?: boolean;
-  status: T.Status;
+  status: Status;
   value: string;
   warningThreshold?: string;
 }
@@ -55,7 +56,7 @@ export interface QualityGateApplicationStatusChildProject {
   conditions: QualityGateApplicationStatusCondition[];
   key: string;
   name: string;
-  status: T.Status;
+  status: Status;
 }
 
 export interface QualityGateStatus {
@@ -63,14 +64,14 @@ export interface QualityGateStatus {
   ignoredConditions?: boolean;
   key: string;
   name: string;
-  status: T.Status;
+  status: Status;
   branchLike?: BranchLike;
 }
 
 export interface QualityGateStatusCondition {
   actual?: string;
   error?: string;
-  level: T.Status;
+  level: Status;
   metric: string;
   op: string;
   period?: number;
@@ -78,7 +79,7 @@ export interface QualityGateStatusCondition {
 }
 
 export interface QualityGateStatusConditionEnhanced extends QualityGateStatusCondition {
-  measure: T.MeasureEnhanced;
+  measure: MeasureEnhanced;
 }
 
 export interface SearchPermissionsParameters {
@@ -101,6 +102,6 @@ export interface Group {
   name: string;
 }
 
-export function isUser(item: T.UserBase | Group): item is T.UserBase {
-  return item && (item as T.UserBase).login !== undefined;
+export function isUser(item: UserBase | Group): item is UserBase {
+  return item && (item as UserBase).login !== undefined;
 }
index 557f92ac3eca8cf42623d81ff2971c8e6a584bcb..581269468c19e0706e14fb9422f4cf24d18736b8 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { ComponentQualifier } from './component';
+import { IssueChangelog, IssueChangelogDiff, Paging, TextRange, UserBase } from './types';
 
 export enum RiskExposure {
   LOW = 'LOW',
@@ -73,11 +74,11 @@ export interface RawHotspot {
 
 export interface Hotspot {
   assignee?: string;
-  assigneeUser?: T.UserBase;
+  assigneeUser?: UserBase;
   author: string;
-  authorUser: T.UserBase;
+  authorUser: UserBase;
   canChangeStatus: boolean;
-  changelog: T.IssueChangelog[];
+  changelog: IssueChangelog[];
   comment: HotspotComment[];
   component: HotspotComponent;
   creationDate: string;
@@ -88,9 +89,9 @@ export interface Hotspot {
   resolution?: HotspotResolution;
   rule: HotspotRule;
   status: HotspotStatus;
-  textRange?: T.TextRange;
+  textRange?: TextRange;
   updateDate: string;
-  users: T.UserBase[];
+  users: UserBase[];
 }
 
 export interface HotspotComponent {
@@ -129,14 +130,14 @@ export interface HotspotComment {
   updatable: boolean;
   createdAt: string;
   login: string;
-  user: T.UserBase;
+  user: UserBase;
 }
 
 export interface ReviewHistoryElement {
   type: ReviewHistoryType;
   date: string;
-  user: Pick<T.UserBase, 'active' | 'avatar' | 'name'>;
-  diffs?: T.IssueChangelogDiff[];
+  user: Pick<UserBase, 'active' | 'avatar' | 'name'>;
+  diffs?: IssueChangelogDiff[];
   html?: string;
   key?: string;
   updatable?: boolean;
@@ -152,7 +153,7 @@ export enum ReviewHistoryType {
 export interface HotspotSearchResponse {
   components?: { key: string; qualifier: string; name: string }[];
   hotspots: RawHotspot[];
-  paging: T.Paging;
+  paging: Paging;
 }
 
 export interface HotspotSetStatusRequest {
index 152401d913d105539da3fee34c72965c711c6fe0..a12cd3b3940ae4455348699a6d24b8b663822c03 100644 (file)
@@ -1,3 +1,5 @@
+import { Dict } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -27,5 +29,5 @@ export enum SecurityStandard {
 export type StandardType = SecurityStandard;
 
 export type Standards = {
-  [key in StandardType]: T.Dict<{ title: string; description?: string }>;
+  [key in StandardType]: Dict<{ title: string; description?: string }>;
 };
index 2d50a443fe25001f20789197b9fe329da7be5d62..f47940461e9363321c15be004571aac5517eb2cb 100644 (file)
@@ -1,3 +1,5 @@
+import { Dict } from './types';
+
 /*
  * SonarQube
  * Copyright (C) 2009-2021 SonarSource SA
@@ -69,10 +71,10 @@ export interface SettingValueResponse {
 }
 
 export interface SettingValue {
-  fieldValues?: Array<T.Dict<string>>;
+  fieldValues?: Array<Dict<string>>;
   inherited?: boolean;
   key: string;
-  parentFieldValues?: Array<T.Dict<string>>;
+  parentFieldValues?: Array<Dict<string>>;
   parentValue?: string;
   parentValues?: string[];
   value?: string;
diff --git a/server/sonar-web/src/main/js/types/types.d.ts b/server/sonar-web/src/main/js/types/types.d.ts
deleted file mode 100644 (file)
index b4700e1..0000000
+++ /dev/null
@@ -1,970 +0,0 @@
-/*
- * 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.
- */
-declare namespace T {
-  // Type ordered alphabetically to prevent merge conflicts
-  export type Dict<T> = { [key: string]: T };
-  export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
-
-  export interface A11ySkipLink {
-    key: string;
-    label: string;
-    weight?: number;
-  }
-
-  export interface AlmApplication extends IdentityProvider {
-    installationUrl: string;
-  }
-
-  export interface AlmRepository {
-    label: string;
-    installationKey: string;
-    linkedProjectKey?: string;
-    linkedProjectName?: string;
-    private?: boolean;
-  }
-
-  export interface AlmUnboundApplication {
-    installationId: string;
-    key: string;
-    name: string;
-  }
-
-  interface BaseAnalysis {
-    buildString?: string;
-    detectedCI?: string;
-    events: AnalysisEvent[];
-    key: string;
-    manualNewCodePeriodBaseline?: boolean;
-    projectVersion?: string;
-  }
-
-  export interface Analysis extends BaseAnalysis {
-    date: string;
-  }
-
-  export interface ParsedAnalysis extends BaseAnalysis {
-    date: Date;
-  }
-
-  export interface AnalysisEvent {
-    category: string;
-    description?: string;
-    key: string;
-    name: string;
-    qualityGate?: {
-      failing: Array<{ branch: string; key: string; name: string }>;
-      status: string;
-      stillFailing: boolean;
-    };
-    definitionChange?: {
-      projects: Array<{
-        branch?: string;
-        changeType: string;
-        key: string;
-        name: string;
-        newBranch?: string;
-        oldBranch?: string;
-      }>;
-    };
-  }
-
-  export interface AppState {
-    adminPages?: Extension[];
-    authenticationError?: boolean;
-    authorizationError?: boolean;
-    branchesEnabled?: boolean;
-    canAdmin?: boolean;
-    edition: 'community' | 'developer' | 'enterprise' | 'datacenter' | undefined;
-    globalPages?: Extension[];
-    projectImportFeatureEnabled?: boolean;
-    instanceUsesDefaultAdminCredentials?: boolean;
-    multipleAlmEnabled?: boolean;
-    needIssueSync?: boolean;
-    productionDatabase: boolean;
-    qualifiers: string[];
-    settings: T.Dict<string>;
-    standalone?: boolean;
-    version: string;
-    webAnalyticsJsPath?: string;
-  }
-
-  export interface Breadcrumb {
-    key: string;
-    name: string;
-    qualifier: string;
-  }
-
-  export namespace Chart {
-    export interface Point {
-      x: Date;
-      y: number | string | undefined;
-    }
-
-    export interface Serie {
-      data: Point[];
-      name: string;
-      translatedName: string;
-      type: string;
-    }
-  }
-
-  export interface Component extends LightComponent {
-    alm?: { key: string; url: string };
-    analysisDate?: string;
-    breadcrumbs: Breadcrumb[];
-    canBrowseAllChildProjects?: boolean;
-    configuration?: ComponentConfiguration;
-    description?: string;
-    extensions?: Extension[];
-    isFavorite?: boolean;
-    leakPeriodDate?: string;
-    name: string;
-    needIssueSync?: boolean;
-    path?: string;
-    refKey?: string;
-    qualityProfiles?: ComponentQualityProfile[];
-    qualityGate?: { isDefault?: boolean; key: string; name: string };
-    tags?: string[];
-    version?: string;
-    visibility?: Visibility;
-  }
-
-  interface ComponentConfiguration {
-    canApplyPermissionTemplate?: boolean;
-    canBrowseProject?: boolean;
-    canUpdateProjectVisibilityToPrivate?: boolean;
-    extensions?: Extension[];
-    showBackgroundTasks?: boolean;
-    showHistory?: boolean;
-    showLinks?: boolean;
-    showQualityGates?: boolean;
-    showQualityProfiles?: boolean;
-    showPermissions?: boolean;
-    showSettings?: boolean;
-    showUpdateKey?: boolean;
-  }
-
-  export interface ComponentQualityProfile {
-    deleted?: boolean;
-    key: string;
-    language: string;
-    name: string;
-  }
-
-  export interface ComponentMeasureIntern {
-    branch?: string;
-    description?: string;
-    isFavorite?: boolean;
-    isRecentlyBrowsed?: boolean;
-    canBrowseAllChildProjects?: boolean;
-    key: string;
-    match?: string;
-    name: string;
-    path?: string;
-    project?: string;
-    qualifier: string;
-    refKey?: string;
-  }
-
-  export interface ComponentMeasure extends ComponentMeasureIntern {
-    measures?: Measure[];
-  }
-
-  export interface ComponentMeasureEnhanced extends ComponentMeasureIntern {
-    value?: string;
-    leak?: string;
-    measures: MeasureEnhanced[];
-  }
-
-  export interface Condition {
-    error: string;
-    id: number;
-    metric: string;
-    op?: string;
-  }
-
-  export interface CoveredFile {
-    key: string;
-    longName: string;
-    coveredLines: number;
-  }
-
-  export interface Coupon {
-    billing?: {
-      address?: string;
-      country?: string;
-      email?: string;
-      name?: string;
-      use?: string;
-    };
-    maxNcloc: number;
-    planActiveUntil: string;
-  }
-
-  export interface CurrentUser {
-    isLoggedIn: boolean;
-    permissions?: { global: string[] };
-    usingSonarLintConnectedMode?: boolean;
-  }
-
-  export interface CurrentUserSetting {
-    key: CurrentUserSettingNames;
-    value: string;
-  }
-
-  type CurrentUserSettingNames =
-    | 'notifications.optOut'
-    | 'notifications.readDate'
-    | 'tutorials.jenkins.skipBitbucketPreReqs';
-
-  export interface CustomMeasure {
-    createdAt?: string;
-    description?: string;
-    id: string;
-    metric: {
-      key: string;
-      name: string;
-      domain?: string;
-      type: string;
-    };
-    projectKey: string;
-    pending?: boolean;
-    user: T.UserBase;
-    value: string;
-    updatedAt?: string;
-  }
-
-  export interface Duplication {
-    blocks: DuplicationBlock[];
-  }
-
-  export interface DuplicationBlock {
-    _ref?: string;
-    from: number;
-    size: number;
-  }
-
-  export interface DuplicatedFile {
-    key: string;
-    name: string;
-    project: string;
-    projectName: string;
-    subProject?: string;
-    subProjectName?: string;
-  }
-
-  export type ExpandDirection = 'up' | 'down';
-
-  export interface Extension {
-    key: string;
-    name: string;
-  }
-
-  export interface FacetValue<T = string> {
-    count: number;
-    val: T;
-  }
-
-  export interface FlowLocation {
-    component: string;
-    componentName?: string;
-    index?: number;
-    msg?: string;
-    textRange: TextRange;
-  }
-
-  export interface Group {
-    default?: boolean;
-    description?: string;
-    id: number;
-    membersCount: number;
-    name: string;
-  }
-
-  export type HealthType = 'RED' | 'YELLOW' | 'GREEN';
-
-  export type HomePage =
-    | { type: 'APPLICATION'; branch: string | undefined; component: string }
-    | { type: 'ISSUES' }
-    | { type: 'MY_ISSUES' }
-    | { type: 'MY_PROJECTS' }
-    | { type: 'PORTFOLIO'; component: string }
-    | { type: 'PORTFOLIOS' }
-    | { type: 'PROJECT'; branch: string | undefined; component: string }
-    | { type: 'PROJECTS' };
-
-  export type HomePageType =
-    | 'APPLICATION'
-    | 'ISSUES'
-    | 'MY_ISSUES'
-    | 'MY_PROJECTS'
-    | 'PORTFOLIO'
-    | 'PORTFOLIOS'
-    | 'PROJECT'
-    | 'PROJECTS';
-
-  export interface IdentityProvider {
-    backgroundColor: string;
-    helpMessage?: string;
-    iconPath: string;
-    key: string;
-    name: string;
-  }
-
-  export interface Issue {
-    actions: string[];
-    assignee?: string;
-    assigneeActive?: boolean;
-    assigneeAvatar?: string;
-    assigneeLogin?: string;
-    assigneeName?: string;
-    author?: string;
-    branch?: string;
-    comments?: IssueComment[];
-    component: string;
-    componentLongName: string;
-    componentQualifier: string;
-    componentUuid: string;
-    creationDate: string;
-    effort?: string;
-    externalRuleEngine?: string;
-    fromExternalRule?: boolean;
-    quickFixAvailable?: boolean;
-    key: string;
-    flows: FlowLocation[][];
-    fromHotspot: boolean;
-    line?: number;
-    message: string;
-    project: string;
-    projectName: string;
-    projectKey: string;
-    pullRequest?: string;
-    resolution?: string;
-    rule: string;
-    ruleName: string;
-    ruleStatus?: string;
-    secondaryLocations: FlowLocation[];
-    severity: string;
-    status: string;
-    subProject?: string;
-    subProjectName?: string;
-    tags?: string[];
-    textRange?: TextRange;
-    transitions: string[];
-    type: T.IssueType;
-  }
-
-  export interface IssueChangelog {
-    avatar?: string;
-    creationDate: string;
-    diffs: IssueChangelogDiff[];
-    user: string;
-    isUserActive: boolean;
-    userName: string;
-  }
-
-  export interface IssueChangelogDiff {
-    key: string;
-    newValue?: string;
-    oldValue?: string;
-  }
-
-  export interface IssueComment {
-    author?: string;
-    authorActive?: boolean;
-    authorAvatar?: string;
-    authorLogin?: string;
-    authorName?: string;
-    createdAt: string;
-    htmlText: string;
-    key: string;
-    markdown: string;
-    updatable: boolean;
-  }
-
-  export interface IssuesByLine {
-    [key: number]: Issue[];
-  }
-
-  export type IssueType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT';
-
-  export interface Language {
-    key: string;
-    name: string;
-  }
-
-  export type Languages = T.Dict<Language>;
-
-  export interface LightComponent {
-    key: string;
-    qualifier: string;
-  }
-
-  export interface LinearIssueLocation {
-    from: number;
-    index?: number;
-    line: number;
-    startLine?: number;
-    text?: string;
-    to: number;
-  }
-
-  export interface LineMap {
-    [line: number]: SourceLine;
-  }
-
-  export interface LinePopup {
-    index?: number;
-    line: number;
-    name: string;
-    open?: boolean;
-  }
-
-  export interface LoggedInUser extends CurrentUser, UserActive {
-    externalIdentity?: string;
-    externalProvider?: string;
-    groups: string[];
-    homepage?: HomePage;
-    isLoggedIn: true;
-    local?: boolean;
-    scmAccounts: string[];
-    settings?: CurrentUserSetting[];
-    sonarLintAdSeen?: boolean;
-  }
-
-  export interface Measure extends MeasureIntern {
-    metric: string;
-  }
-
-  export interface MeasureEnhanced extends MeasureIntern {
-    metric: Metric;
-    leak?: string;
-  }
-
-  interface MeasureIntern {
-    bestValue?: boolean;
-    period?: PeriodMeasure;
-    value?: string;
-  }
-
-  export interface Metric {
-    bestValue?: string;
-    custom?: boolean;
-    decimalScale?: number;
-    description?: string;
-    direction?: number;
-    domain?: string;
-    hidden?: boolean;
-    higherValuesAreBetter?: boolean;
-    id: string;
-    key: string;
-    name: string;
-    qualitative?: boolean;
-    type: string;
-    worstValue?: string;
-  }
-
-  export interface MyProject {
-    description?: string;
-    key: string;
-    lastAnalysisDate?: string;
-    links: Array<{
-      name: string;
-      type: string;
-      href: string;
-    }>;
-    name: string;
-    qualityGate?: string;
-  }
-
-  export interface NewCodePeriod {
-    type?: NewCodePeriodSettingType;
-    value?: string;
-    effectiveValue?: string;
-    inherited?: boolean;
-  }
-
-  export interface NewCodePeriodBranch {
-    projectKey: string;
-    branchKey: string;
-    inherited?: boolean;
-    type?: NewCodePeriodSettingType;
-    value?: string;
-    effectiveValue?: string;
-  }
-
-  export type NewCodePeriodSettingType =
-    | 'PREVIOUS_VERSION'
-    | 'NUMBER_OF_DAYS'
-    | 'SPECIFIC_ANALYSIS'
-    | 'REFERENCE_BRANCH';
-
-  export interface Notification {
-    channel: string;
-    project?: string;
-    projectName?: string;
-    type: string;
-  }
-
-  export interface NotificationProject {
-    project: string;
-    projectName: string;
-  }
-
-  export interface Paging {
-    pageIndex: number;
-    pageSize: number;
-    total: number;
-  }
-
-  export interface Period {
-    date: string;
-    index?: number;
-    mode: PeriodMode | NewCodePeriodSettingType;
-    modeParam?: string;
-    parameter?: string;
-  }
-
-  export interface PeriodMeasure {
-    bestValue?: boolean;
-    index: number;
-    value: string;
-  }
-
-  /*
-   * These are old baseline setting types, necessary for
-   * backward compatibility.
-   */
-  export type PeriodMode =
-    | 'days'
-    | 'date'
-    | 'version'
-    | 'previous_analysis'
-    | 'previous_version'
-    | 'manual_baseline';
-
-  export interface Permission {
-    description: string;
-    key: string;
-    name: string;
-  }
-
-  export interface PermissionDefinition {
-    key: string;
-    name: string;
-    description: string;
-  }
-
-  export type PermissionDefinitions = Array<PermissionDefinition | PermissionDefinitionGroup>;
-
-  export interface PermissionDefinitionGroup {
-    category: string;
-    permissions: PermissionDefinition[];
-  }
-
-  export interface PermissionGroup {
-    description?: string;
-    id?: string;
-    name: string;
-    permissions: string[];
-  }
-
-  export interface PermissionUser extends UserActive {
-    permissions: string[];
-  }
-
-  export interface PermissionTemplate {
-    defaultFor: string[];
-    id: string;
-    name: string;
-    description?: string;
-    projectKeyPattern?: string;
-    createdAt: string;
-    updatedAt?: string;
-    permissions: Array<{
-      key: string;
-      usersCount: number;
-      groupsCount: number;
-      withProjectCreator?: boolean;
-    }>;
-  }
-
-  export interface ProfileInheritanceDetails {
-    activeRuleCount: number;
-    isBuiltIn: boolean;
-    key: string;
-    name: string;
-    overridingRuleCount?: number;
-  }
-
-  export interface ProjectLink {
-    id: string;
-    name?: string;
-    type: string;
-    url: string;
-  }
-
-  export interface QualityGate {
-    actions?: {
-      associateProjects?: boolean;
-      copy?: boolean;
-      delegate?: boolean;
-      delete?: boolean;
-      manageConditions?: boolean;
-      rename?: boolean;
-      setAsDefault?: boolean;
-    };
-    conditions?: Condition[];
-    id: string;
-    isBuiltIn?: boolean;
-    isDefault?: boolean;
-    name: string;
-  }
-
-  export type RawQuery = T.Dict<any>;
-
-  export interface Rule {
-    isTemplate?: boolean;
-    key: string;
-    lang?: string;
-    langName?: string;
-    name: string;
-    params?: RuleParameter[];
-    severity: string;
-    status: string;
-    sysTags?: string[];
-    tags?: string[];
-    type: RuleType;
-  }
-
-  export interface RuleActivation {
-    createdAt: string;
-    inherit: RuleInheritance;
-    params: { key: string; value: string }[];
-    qProfile: string;
-    severity: string;
-  }
-
-  export interface RuleDetails extends Rule {
-    createdAt: string;
-    debtOverloaded?: boolean;
-    debtRemFnCoeff?: string;
-    debtRemFnOffset?: string;
-    debtRemFnType?: string;
-    defaultDebtRemFnOffset?: string;
-    defaultDebtRemFnType?: string;
-    defaultRemFnBaseEffort?: string;
-    defaultRemFnType?: string;
-    effortToFixDescription?: string;
-    htmlDesc?: string;
-    htmlNote?: string;
-    internalKey?: string;
-    isExternal?: boolean;
-    mdDesc?: string;
-    mdNote?: string;
-    remFnBaseEffort?: string;
-    remFnOverloaded?: boolean;
-    remFnType?: string;
-    repo: string;
-    scope?: RuleScope;
-    templateKey?: string;
-  }
-
-  export type RuleInheritance = 'NONE' | 'INHERITED' | 'OVERRIDES';
-
-  export interface RuleParameter {
-    defaultValue?: string;
-    htmlDesc?: string;
-    key: string;
-    type: string;
-  }
-
-  export type RuleScope = 'MAIN' | 'TEST' | 'ALL';
-
-  export type RuleType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT' | 'UNKNOWN';
-
-  export interface Snippet {
-    start: number;
-    end: number;
-    index: number;
-    toDelete?: boolean;
-  }
-
-  export interface SnippetGroup extends SnippetsByComponent {
-    locations: T.FlowLocation[];
-  }
-  export interface SnippetsByComponent {
-    component: SourceViewerFile;
-    sources: { [line: number]: SourceLine };
-  }
-
-  export interface SourceLine {
-    code?: string;
-    conditions?: number;
-    coverageStatus?: SourceLineCoverageStatus;
-    coveredConditions?: number;
-    duplicated?: boolean;
-    isNew?: boolean;
-    line: number;
-    lineHits?: number;
-    scmAuthor?: string;
-    scmDate?: string;
-    scmRevision?: string;
-  }
-
-  export type SourceLineCoverageStatus = 'uncovered' | 'partially-covered' | 'covered';
-
-  export interface SourceViewerFile {
-    fav?: boolean;
-    key: string;
-    leakPeriodDate?: string;
-    measures: {
-      coverage?: string;
-      duplicationDensity?: string;
-      issues?: string;
-      lines?: string;
-      tests?: string;
-    };
-    path: string;
-    project: string;
-    projectName: string;
-    q: string;
-    subProject?: string;
-    subProjectName?: string;
-    uuid: string;
-  }
-
-  export type StandardSecurityCategories = T.Dict<{ title: string; description?: string }>;
-
-  export type Status = 'ERROR' | 'OK';
-
-  export interface SubscriptionPlan {
-    maxNcloc: number;
-    price: number;
-  }
-
-  export interface SuggestionLink {
-    link: string;
-    scope?: 'sonarcloud';
-    text: string;
-  }
-
-  export interface SysInfoAppNode extends SysInfoBase {
-    'Compute Engine Logging': SysInfoLogging;
-    Name: string;
-    'Web Logging': SysInfoLogging;
-  }
-
-  export interface SysInfoBase extends SysInfoValueObject {
-    Health: HealthType;
-    'Health Causes': string[];
-    Plugins?: Dict<string>;
-    System: {
-      Version: string;
-    };
-  }
-
-  export interface SysInfoCluster extends SysInfoBase {
-    'Application Nodes': SysInfoAppNode[];
-    'Search Nodes': SysInfoSearchNode[];
-    Settings: Dict<string>;
-    Statistics?: {
-      ncloc: number;
-    };
-    System: {
-      'High Availability': true;
-      'Server ID': string;
-      Version: string;
-    };
-  }
-
-  export interface SysInfoLogging extends Dict<string> {
-    'Logs Level': string;
-  }
-
-  export interface SysInfoSearchNode extends SysInfoValueObject {
-    Name: string;
-  }
-
-  export interface SysInfoSection extends Dict<SysInfoValueObject> {}
-
-  export interface SysInfoStandalone extends SysInfoBase {
-    'Compute Engine Logging': SysInfoLogging;
-    Settings: Dict<string>;
-    Statistics?: {
-      ncloc: number;
-    } & Dict<string | number>;
-    System: {
-      'High Availability': false;
-      'Server ID': string;
-      Version: string;
-    };
-    'Web Logging': SysInfoLogging;
-  }
-
-  export type SysInfoValue =
-    | boolean
-    | string
-    | number
-    | undefined
-    | HealthType
-    | SysInfoValueObject
-    | SysInfoValueArray;
-
-  export interface SysInfoValueArray extends Array<SysInfoValue> {}
-
-  export interface SysInfoValueObject extends Dict<SysInfoValue> {}
-
-  export type SysStatus =
-    | 'STARTING'
-    | 'UP'
-    | 'DOWN'
-    | 'RESTARTING'
-    | 'DB_MIGRATION_NEEDED'
-    | 'DB_MIGRATION_RUNNING';
-
-  export interface TestCase {
-    coveredLines: number;
-    durationInMs: number;
-    fileId: string;
-    fileKey: string;
-    fileName: string;
-    id: string;
-    message?: string;
-    name: string;
-    stacktrace?: string;
-    status: string;
-  }
-
-  export interface TextRange {
-    startLine: number;
-    startOffset: number;
-    endLine: number;
-    endOffset: number;
-  }
-
-  export interface User extends UserBase {
-    externalIdentity?: string;
-    externalProvider?: string;
-    groups?: string[];
-    lastConnectionDate?: string;
-    local: boolean;
-    scmAccounts?: string[];
-    tokensCount?: number;
-  }
-
-  export interface UserActive extends UserBase {
-    active?: true;
-    name: string;
-  }
-
-  export interface UserBase {
-    active?: boolean;
-    avatar?: string;
-    email?: string;
-    login: string;
-    name?: string;
-  }
-
-  export interface UserSelected extends UserActive {
-    selected: boolean;
-  }
-
-  export interface UserToken {
-    name: string;
-    createdAt: string;
-    lastConnectionDate?: string;
-  }
-
-  export interface NewUserToken extends UserToken {
-    login: string;
-    token: string;
-  }
-
-  export type Visibility = 'public' | 'private';
-
-  export interface Webhook {
-    key: string;
-    latestDelivery?: WebhookDelivery;
-    name: string;
-    secret?: string;
-    url: string;
-  }
-
-  export interface WebhookDelivery {
-    at: string;
-    durationMs: number;
-    httpStatus?: number;
-    id: string;
-    success: boolean;
-  }
-
-  export namespace WebApi {
-    export interface Action {
-      key: string;
-      changelog: Changelog[];
-      description: string;
-      deprecatedSince?: string;
-      hasResponseExample: boolean;
-      internal: boolean;
-      params?: Param[];
-      post: boolean;
-      since?: string;
-    }
-
-    export interface Changelog {
-      description: string;
-      version: string;
-    }
-
-    export interface Domain {
-      actions: Action[];
-      deprecatedSince?: string;
-      description: string;
-      internal?: boolean;
-      path: string;
-      since?: string;
-    }
-
-    export interface Example {
-      example: string;
-      format: string;
-    }
-
-    export interface Param {
-      defaultValue?: string;
-      deprecatedKey?: string;
-      deprecatedKeySince?: string;
-      deprecatedSince?: string;
-      description: string;
-      exampleValue?: string;
-      internal: boolean;
-      key: string;
-      maximumLength?: number;
-      maximumValue?: number;
-      maxValuesAllowed?: number;
-      minimumLength?: number;
-      minimumValue?: number;
-      possibleValues?: string[];
-      required: boolean;
-      since?: string;
-    }
-  }
-}
diff --git a/server/sonar-web/src/main/js/types/types.ts b/server/sonar-web/src/main/js/types/types.ts
new file mode 100644 (file)
index 0000000..d53d311
--- /dev/null
@@ -0,0 +1,968 @@
+/*
+ * 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.
+ */
+
+export type Dict<T> = { [key: string]: T };
+export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
+
+export interface A11ySkipLink {
+  key: string;
+  label: string;
+  weight?: number;
+}
+
+export interface AlmApplication extends IdentityProvider {
+  installationUrl: string;
+}
+
+export interface AlmRepository {
+  label: string;
+  installationKey: string;
+  linkedProjectKey?: string;
+  linkedProjectName?: string;
+  private?: boolean;
+}
+
+export interface AlmUnboundApplication {
+  installationId: string;
+  key: string;
+  name: string;
+}
+
+interface BaseAnalysis {
+  buildString?: string;
+  detectedCI?: string;
+  events: AnalysisEvent[];
+  key: string;
+  manualNewCodePeriodBaseline?: boolean;
+  projectVersion?: string;
+}
+
+export interface Analysis extends BaseAnalysis {
+  date: string;
+}
+
+export interface ParsedAnalysis extends BaseAnalysis {
+  date: Date;
+}
+
+export interface AnalysisEvent {
+  category: string;
+  description?: string;
+  key: string;
+  name: string;
+  qualityGate?: {
+    failing: Array<{ branch: string; key: string; name: string }>;
+    status: string;
+    stillFailing: boolean;
+  };
+  definitionChange?: {
+    projects: Array<{
+      branch?: string;
+      changeType: string;
+      key: string;
+      name: string;
+      newBranch?: string;
+      oldBranch?: string;
+    }>;
+  };
+}
+
+export interface AppState {
+  adminPages?: Extension[];
+  authenticationError?: boolean;
+  authorizationError?: boolean;
+  branchesEnabled?: boolean;
+  canAdmin?: boolean;
+  edition: 'community' | 'developer' | 'enterprise' | 'datacenter' | undefined;
+  globalPages?: Extension[];
+  projectImportFeatureEnabled?: boolean;
+  instanceUsesDefaultAdminCredentials?: boolean;
+  multipleAlmEnabled?: boolean;
+  needIssueSync?: boolean;
+  productionDatabase: boolean;
+  qualifiers: string[];
+  settings: Dict<string>;
+  standalone?: boolean;
+  version: string;
+  webAnalyticsJsPath?: string;
+}
+
+export interface Breadcrumb {
+  key: string;
+  name: string;
+  qualifier: string;
+}
+
+export namespace Chart {
+  export interface Point {
+    x: Date;
+    y: number | string | undefined;
+  }
+
+  export interface Serie {
+    data: Point[];
+    name: string;
+    translatedName: string;
+    type: string;
+  }
+}
+
+export interface Component extends LightComponent {
+  alm?: { key: string; url: string };
+  analysisDate?: string;
+  breadcrumbs: Breadcrumb[];
+  canBrowseAllChildProjects?: boolean;
+  configuration?: ComponentConfiguration;
+  description?: string;
+  extensions?: Extension[];
+  isFavorite?: boolean;
+  leakPeriodDate?: string;
+  name: string;
+  needIssueSync?: boolean;
+  path?: string;
+  refKey?: string;
+  qualityProfiles?: ComponentQualityProfile[];
+  qualityGate?: { isDefault?: boolean; key: string; name: string };
+  tags?: string[];
+  version?: string;
+  visibility?: Visibility;
+}
+
+interface ComponentConfiguration {
+  canApplyPermissionTemplate?: boolean;
+  canBrowseProject?: boolean;
+  canUpdateProjectVisibilityToPrivate?: boolean;
+  extensions?: Extension[];
+  showBackgroundTasks?: boolean;
+  showHistory?: boolean;
+  showLinks?: boolean;
+  showQualityGates?: boolean;
+  showQualityProfiles?: boolean;
+  showPermissions?: boolean;
+  showSettings?: boolean;
+  showUpdateKey?: boolean;
+}
+
+export interface ComponentQualityProfile {
+  deleted?: boolean;
+  key: string;
+  language: string;
+  name: string;
+}
+
+export interface ComponentMeasureIntern {
+  branch?: string;
+  description?: string;
+  isFavorite?: boolean;
+  isRecentlyBrowsed?: boolean;
+  canBrowseAllChildProjects?: boolean;
+  key: string;
+  match?: string;
+  name: string;
+  path?: string;
+  project?: string;
+  qualifier: string;
+  refKey?: string;
+}
+
+export interface ComponentMeasure extends ComponentMeasureIntern {
+  measures?: Measure[];
+}
+
+export interface ComponentMeasureEnhanced extends ComponentMeasureIntern {
+  value?: string;
+  leak?: string;
+  measures: MeasureEnhanced[];
+}
+
+export interface Condition {
+  error: string;
+  id: number;
+  metric: string;
+  op?: string;
+}
+
+export interface CoveredFile {
+  key: string;
+  longName: string;
+  coveredLines: number;
+}
+
+export interface Coupon {
+  billing?: {
+    address?: string;
+    country?: string;
+    email?: string;
+    name?: string;
+    use?: string;
+  };
+  maxNcloc: number;
+  planActiveUntil: string;
+}
+
+export interface CurrentUser {
+  isLoggedIn: boolean;
+  permissions?: { global: string[] };
+  usingSonarLintConnectedMode?: boolean;
+}
+
+export interface CurrentUserSetting {
+  key: CurrentUserSettingNames;
+  value: string;
+}
+
+export type CurrentUserSettingNames =
+  | 'notifications.optOut'
+  | 'notifications.readDate'
+  | 'tutorials.jenkins.skipBitbucketPreReqs';
+
+export interface CustomMeasure {
+  createdAt?: string;
+  description?: string;
+  id: string;
+  metric: {
+    key: string;
+    name: string;
+    domain?: string;
+    type: string;
+  };
+  projectKey: string;
+  pending?: boolean;
+  user: UserBase;
+  value: string;
+  updatedAt?: string;
+}
+
+export interface Duplication {
+  blocks: DuplicationBlock[];
+}
+
+export interface DuplicationBlock {
+  _ref?: string;
+  from: number;
+  size: number;
+}
+
+export interface DuplicatedFile {
+  key: string;
+  name: string;
+  project: string;
+  projectName: string;
+  subProject?: string;
+  subProjectName?: string;
+}
+
+export type ExpandDirection = 'up' | 'down';
+
+export interface Extension {
+  key: string;
+  name: string;
+}
+
+export interface FacetValue<T = string> {
+  count: number;
+  val: T;
+}
+
+export interface FlowLocation {
+  component: string;
+  componentName?: string;
+  index?: number;
+  msg?: string;
+  textRange: TextRange;
+}
+
+export interface Group {
+  default?: boolean;
+  description?: string;
+  id: number;
+  membersCount: number;
+  name: string;
+}
+
+export type HealthType = 'RED' | 'YELLOW' | 'GREEN';
+
+export type HomePage =
+  | { type: 'APPLICATION'; branch: string | undefined; component: string }
+  | { type: 'ISSUES' }
+  | { type: 'MY_ISSUES' }
+  | { type: 'MY_PROJECTS' }
+  | { type: 'PORTFOLIO'; component: string }
+  | { type: 'PORTFOLIOS' }
+  | { type: 'PROJECT'; branch: string | undefined; component: string }
+  | { type: 'PROJECTS' };
+
+export type HomePageType =
+  | 'APPLICATION'
+  | 'ISSUES'
+  | 'MY_ISSUES'
+  | 'MY_PROJECTS'
+  | 'PORTFOLIO'
+  | 'PORTFOLIOS'
+  | 'PROJECT'
+  | 'PROJECTS';
+
+export interface IdentityProvider {
+  backgroundColor: string;
+  helpMessage?: string;
+  iconPath: string;
+  key: string;
+  name: string;
+}
+
+export interface Issue {
+  actions: string[];
+  assignee?: string;
+  assigneeActive?: boolean;
+  assigneeAvatar?: string;
+  assigneeLogin?: string;
+  assigneeName?: string;
+  author?: string;
+  branch?: string;
+  comments?: IssueComment[];
+  component: string;
+  componentLongName: string;
+  componentQualifier: string;
+  componentUuid: string;
+  creationDate: string;
+  effort?: string;
+  externalRuleEngine?: string;
+  fromExternalRule?: boolean;
+  quickFixAvailable?: boolean;
+  key: string;
+  flows: FlowLocation[][];
+  fromHotspot: boolean;
+  line?: number;
+  message: string;
+  project: string;
+  projectName: string;
+  projectKey: string;
+  pullRequest?: string;
+  resolution?: string;
+  rule: string;
+  ruleName: string;
+  ruleStatus?: string;
+  secondaryLocations: FlowLocation[];
+  severity: string;
+  status: string;
+  subProject?: string;
+  subProjectName?: string;
+  tags?: string[];
+  textRange?: TextRange;
+  transitions: string[];
+  type: IssueType;
+}
+
+export interface IssueChangelog {
+  avatar?: string;
+  creationDate: string;
+  diffs: IssueChangelogDiff[];
+  user: string;
+  isUserActive: boolean;
+  userName: string;
+}
+
+export interface IssueChangelogDiff {
+  key: string;
+  newValue?: string;
+  oldValue?: string;
+}
+
+export interface IssueComment {
+  author?: string;
+  authorActive?: boolean;
+  authorAvatar?: string;
+  authorLogin?: string;
+  authorName?: string;
+  createdAt: string;
+  htmlText: string;
+  key: string;
+  markdown: string;
+  updatable: boolean;
+}
+
+export interface IssuesByLine {
+  [key: number]: Issue[];
+}
+
+export type IssueType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT';
+
+export interface Language {
+  key: string;
+  name: string;
+}
+
+export type Languages = Dict<Language>;
+
+export interface LightComponent {
+  key: string;
+  qualifier: string;
+}
+
+export interface LinearIssueLocation {
+  from: number;
+  index?: number;
+  line: number;
+  startLine?: number;
+  text?: string;
+  to: number;
+}
+
+export interface LineMap {
+  [line: number]: SourceLine;
+}
+
+export interface LinePopup {
+  index?: number;
+  line: number;
+  name: string;
+  open?: boolean;
+}
+
+export interface LoggedInUser extends CurrentUser, UserActive {
+  externalIdentity?: string;
+  externalProvider?: string;
+  groups: string[];
+  homepage?: HomePage;
+  isLoggedIn: true;
+  local?: boolean;
+  scmAccounts: string[];
+  settings?: CurrentUserSetting[];
+  sonarLintAdSeen?: boolean;
+}
+
+export interface Measure extends MeasureIntern {
+  metric: string;
+}
+
+export interface MeasureEnhanced extends MeasureIntern {
+  metric: Metric;
+  leak?: string;
+}
+
+export interface MeasureIntern {
+  bestValue?: boolean;
+  period?: PeriodMeasure;
+  value?: string;
+}
+
+export interface Metric {
+  bestValue?: string;
+  custom?: boolean;
+  decimalScale?: number;
+  description?: string;
+  direction?: number;
+  domain?: string;
+  hidden?: boolean;
+  higherValuesAreBetter?: boolean;
+  id: string;
+  key: string;
+  name: string;
+  qualitative?: boolean;
+  type: string;
+  worstValue?: string;
+}
+
+export interface MyProject {
+  description?: string;
+  key: string;
+  lastAnalysisDate?: string;
+  links: Array<{
+    name: string;
+    type: string;
+    href: string;
+  }>;
+  name: string;
+  qualityGate?: string;
+}
+
+export interface NewCodePeriod {
+  type?: NewCodePeriodSettingType;
+  value?: string;
+  effectiveValue?: string;
+  inherited?: boolean;
+}
+
+export interface NewCodePeriodBranch {
+  projectKey: string;
+  branchKey: string;
+  inherited?: boolean;
+  type?: NewCodePeriodSettingType;
+  value?: string;
+  effectiveValue?: string;
+}
+
+export type NewCodePeriodSettingType =
+  | 'PREVIOUS_VERSION'
+  | 'NUMBER_OF_DAYS'
+  | 'SPECIFIC_ANALYSIS'
+  | 'REFERENCE_BRANCH';
+
+export interface Notification {
+  channel: string;
+  project?: string;
+  projectName?: string;
+  type: string;
+}
+
+export interface NotificationProject {
+  project: string;
+  projectName: string;
+}
+
+export interface Paging {
+  pageIndex: number;
+  pageSize: number;
+  total: number;
+}
+
+export interface Period {
+  date: string;
+  index?: number;
+  mode: PeriodMode | NewCodePeriodSettingType;
+  modeParam?: string;
+  parameter?: string;
+}
+
+export interface PeriodMeasure {
+  bestValue?: boolean;
+  index: number;
+  value: string;
+}
+
+/*
+ * These are old baseline setting types, necessary for
+ * backward compatibility.
+ */
+export type PeriodMode =
+  | 'days'
+  | 'date'
+  | 'version'
+  | 'previous_analysis'
+  | 'previous_version'
+  | 'manual_baseline';
+
+export interface Permission {
+  description: string;
+  key: string;
+  name: string;
+}
+
+export interface PermissionDefinition {
+  key: string;
+  name: string;
+  description: string;
+}
+
+export type PermissionDefinitions = Array<PermissionDefinition | PermissionDefinitionGroup>;
+
+export interface PermissionDefinitionGroup {
+  category: string;
+  permissions: PermissionDefinition[];
+}
+
+export interface PermissionGroup {
+  description?: string;
+  id?: string;
+  name: string;
+  permissions: string[];
+}
+
+export interface PermissionUser extends UserActive {
+  permissions: string[];
+}
+
+export interface PermissionTemplate {
+  defaultFor: string[];
+  id: string;
+  name: string;
+  description?: string;
+  projectKeyPattern?: string;
+  createdAt: string;
+  updatedAt?: string;
+  permissions: Array<{
+    key: string;
+    usersCount: number;
+    groupsCount: number;
+    withProjectCreator?: boolean;
+  }>;
+}
+
+export interface ProfileInheritanceDetails {
+  activeRuleCount: number;
+  isBuiltIn: boolean;
+  key: string;
+  name: string;
+  overridingRuleCount?: number;
+}
+
+export interface ProjectLink {
+  id: string;
+  name?: string;
+  type: string;
+  url: string;
+}
+
+export interface QualityGate {
+  actions?: {
+    associateProjects?: boolean;
+    copy?: boolean;
+    delegate?: boolean;
+    delete?: boolean;
+    manageConditions?: boolean;
+    rename?: boolean;
+    setAsDefault?: boolean;
+  };
+  conditions?: Condition[];
+  id: string;
+  isBuiltIn?: boolean;
+  isDefault?: boolean;
+  name: string;
+}
+
+export type RawQuery = Dict<any>;
+
+export interface Rule {
+  isTemplate?: boolean;
+  key: string;
+  lang?: string;
+  langName?: string;
+  name: string;
+  params?: RuleParameter[];
+  severity: string;
+  status: string;
+  sysTags?: string[];
+  tags?: string[];
+  type: RuleType;
+}
+
+export interface RuleActivation {
+  createdAt: string;
+  inherit: RuleInheritance;
+  params: { key: string; value: string }[];
+  qProfile: string;
+  severity: string;
+}
+
+export interface RuleDetails extends Rule {
+  createdAt: string;
+  debtOverloaded?: boolean;
+  debtRemFnCoeff?: string;
+  debtRemFnOffset?: string;
+  debtRemFnType?: string;
+  defaultDebtRemFnOffset?: string;
+  defaultDebtRemFnType?: string;
+  defaultRemFnBaseEffort?: string;
+  defaultRemFnType?: string;
+  effortToFixDescription?: string;
+  htmlDesc?: string;
+  htmlNote?: string;
+  internalKey?: string;
+  isExternal?: boolean;
+  mdDesc?: string;
+  mdNote?: string;
+  remFnBaseEffort?: string;
+  remFnOverloaded?: boolean;
+  remFnType?: string;
+  repo: string;
+  scope?: RuleScope;
+  templateKey?: string;
+}
+
+export type RuleInheritance = 'NONE' | 'INHERITED' | 'OVERRIDES';
+
+export interface RuleParameter {
+  defaultValue?: string;
+  htmlDesc?: string;
+  key: string;
+  type: string;
+}
+
+export type RuleScope = 'MAIN' | 'TEST' | 'ALL';
+
+export type RuleType = 'BUG' | 'VULNERABILITY' | 'CODE_SMELL' | 'SECURITY_HOTSPOT' | 'UNKNOWN';
+
+export interface Snippet {
+  start: number;
+  end: number;
+  index: number;
+  toDelete?: boolean;
+}
+
+export interface SnippetGroup extends SnippetsByComponent {
+  locations: FlowLocation[];
+}
+export interface SnippetsByComponent {
+  component: SourceViewerFile;
+  sources: { [line: number]: SourceLine };
+}
+
+export interface SourceLine {
+  code?: string;
+  conditions?: number;
+  coverageStatus?: SourceLineCoverageStatus;
+  coveredConditions?: number;
+  duplicated?: boolean;
+  isNew?: boolean;
+  line: number;
+  lineHits?: number;
+  scmAuthor?: string;
+  scmDate?: string;
+  scmRevision?: string;
+}
+
+export type SourceLineCoverageStatus = 'uncovered' | 'partially-covered' | 'covered';
+
+export interface SourceViewerFile {
+  fav?: boolean;
+  key: string;
+  leakPeriodDate?: string;
+  measures: {
+    coverage?: string;
+    duplicationDensity?: string;
+    issues?: string;
+    lines?: string;
+    tests?: string;
+  };
+  path: string;
+  project: string;
+  projectName: string;
+  q: string;
+  subProject?: string;
+  subProjectName?: string;
+  uuid: string;
+}
+
+export type StandardSecurityCategories = Dict<{ title: string; description?: string }>;
+
+export type Status = 'ERROR' | 'OK';
+
+export interface SubscriptionPlan {
+  maxNcloc: number;
+  price: number;
+}
+
+export interface SuggestionLink {
+  link: string;
+  scope?: 'sonarcloud';
+  text: string;
+}
+
+export interface SysInfoAppNode extends SysInfoBase {
+  'Compute Engine Logging': SysInfoLogging;
+  Name: string;
+  'Web Logging': SysInfoLogging;
+}
+
+export interface SysInfoBase extends SysInfoValueObject {
+  Health: HealthType;
+  'Health Causes': string[];
+  Plugins?: Dict<string>;
+  System: {
+    Version: string;
+  };
+}
+
+export interface SysInfoCluster extends SysInfoBase {
+  'Application Nodes': SysInfoAppNode[];
+  'Search Nodes': SysInfoSearchNode[];
+  Settings: Dict<string>;
+  Statistics?: {
+    ncloc: number;
+  };
+  System: {
+    'High Availability': true;
+    'Server ID': string;
+    Version: string;
+  };
+}
+
+export interface SysInfoLogging extends Dict<string> {
+  'Logs Level': string;
+}
+
+export interface SysInfoSearchNode extends SysInfoValueObject {
+  Name: string;
+}
+
+export interface SysInfoSection extends Dict<SysInfoValueObject> {}
+
+export interface SysInfoStandalone extends SysInfoBase {
+  'Compute Engine Logging': SysInfoLogging;
+  Settings: Dict<string>;
+  Statistics?: {
+    ncloc: number;
+  } & Dict<string | number>;
+  System: {
+    'High Availability': false;
+    'Server ID': string;
+    Version: string;
+  };
+  'Web Logging': SysInfoLogging;
+}
+
+export type SysInfoValue =
+  | boolean
+  | string
+  | number
+  | undefined
+  | HealthType
+  | SysInfoValueObject
+  | SysInfoValueArray;
+
+export interface SysInfoValueArray extends Array<SysInfoValue> {}
+
+export interface SysInfoValueObject extends Dict<SysInfoValue> {}
+
+export type SysStatus =
+  | 'STARTING'
+  | 'UP'
+  | 'DOWN'
+  | 'RESTARTING'
+  | 'DB_MIGRATION_NEEDED'
+  | 'DB_MIGRATION_RUNNING';
+
+export interface TestCase {
+  coveredLines: number;
+  durationInMs: number;
+  fileId: string;
+  fileKey: string;
+  fileName: string;
+  id: string;
+  message?: string;
+  name: string;
+  stacktrace?: string;
+  status: string;
+}
+
+export interface TextRange {
+  startLine: number;
+  startOffset: number;
+  endLine: number;
+  endOffset: number;
+}
+
+export interface User extends UserBase {
+  externalIdentity?: string;
+  externalProvider?: string;
+  groups?: string[];
+  lastConnectionDate?: string;
+  local: boolean;
+  scmAccounts?: string[];
+  tokensCount?: number;
+}
+
+export interface UserActive extends UserBase {
+  active?: true;
+  name: string;
+}
+
+export interface UserBase {
+  active?: boolean;
+  avatar?: string;
+  email?: string;
+  login: string;
+  name?: string;
+}
+
+export interface UserSelected extends UserActive {
+  selected: boolean;
+}
+
+export interface UserToken {
+  name: string;
+  createdAt: string;
+  lastConnectionDate?: string;
+}
+
+export interface NewUserToken extends UserToken {
+  login: string;
+  token: string;
+}
+
+export type Visibility = 'public' | 'private';
+
+export interface Webhook {
+  key: string;
+  latestDelivery?: WebhookDelivery;
+  name: string;
+  secret?: string;
+  url: string;
+}
+
+export interface WebhookDelivery {
+  at: string;
+  durationMs: number;
+  httpStatus?: number;
+  id: string;
+  success: boolean;
+}
+
+export namespace WebApi {
+  export interface Action {
+    key: string;
+    changelog: Changelog[];
+    description: string;
+    deprecatedSince?: string;
+    hasResponseExample: boolean;
+    internal: boolean;
+    params?: Param[];
+    post: boolean;
+    since?: string;
+  }
+
+  export interface Changelog {
+    description: string;
+    version: string;
+  }
+
+  export interface Domain {
+    actions: Action[];
+    deprecatedSince?: string;
+    description: string;
+    internal?: boolean;
+    path: string;
+    since?: string;
+  }
+
+  export interface Example {
+    example: string;
+    format: string;
+  }
+
+  export interface Param {
+    defaultValue?: string;
+    deprecatedKey?: string;
+    deprecatedKeySince?: string;
+    deprecatedSince?: string;
+    description: string;
+    exampleValue?: string;
+    internal: boolean;
+    key: string;
+    maximumLength?: number;
+    maximumValue?: number;
+    maxValuesAllowed?: number;
+    minimumLength?: number;
+    minimumValue?: number;
+    possibleValues?: string[];
+    required: boolean;
+    since?: string;
+  }
+}