diff options
Diffstat (limited to 'server/sonar-web/src/main/js/app/components/nav')
29 files changed, 84 insertions, 55 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx b/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx index 37a77838362..69e580ef0d9 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/Breadcrumb.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx index df02475cfcf..4c25501f4c3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx index a802c839259..2c3d19b4cb6 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBgTaskNotif.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx index 28a8a51a725..526be9ad391 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx index 5ceeb6675e9..ee50074ebbd 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavProjectBindingErrorNotif.tsx @@ -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( diff --git a/server/sonar-web/src/main/js/app/components/nav/component/Header.tsx b/server/sonar-web/src/main/js/app/components/nav/component/Header.tsx index dfbb27a8db7..5d16418d4c3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/Header.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/Header.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx b/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx index 3a7f2a4c454..92937c38839 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx index 609f6461392..b40c25cb88a 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx @@ -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 ( diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx index 5b748818f9b..457f73fd977 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx index 8d8b3b7d837..15bc425c6c0 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/CurrentBranchLike.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx index e9d079c80c6..f5a0c4f746e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx @@ -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'>; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx index 16631eeba2c..07b0f84f772 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx index cddc6aba4d8..05d0d2caf67 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx index 3df9c2b97f0..21f8af7f3ab 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx index f322b691ee4..39d964949e8 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx index 0327f91c636..d546cf3a8f8 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx index b219a077bae..ae3438a5ae6 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx @@ -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 { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeParams-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeParams-test.tsx index 696ec84f04f..436999cd6fe 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeParams-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/BadgeParams-test.tsx @@ -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', () => { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx index a8856725e8d..2df7e993348 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx @@ -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 { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx index 0c6915d8dc1..7c9868e16e8 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx @@ -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> { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx index fdbcfeb82fd..abdc03228d2 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx @@ -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; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx index ebafe436f72..2c025b6af57 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx @@ -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) { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx index 5cd57a46e5b..25ff262bcc7 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx index 835b0bf5255..1932ce09689 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx @@ -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) { diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx index fb04e40f614..eab30c61e22 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx @@ -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 }; } diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx index c72524bd66e..4113762716f 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx @@ -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> diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx index f1a1d0a989b..5c4fdabb799 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx @@ -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" diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx index 664f80ee8e1..da4fe7a37fa 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/PendingPluginsActionNotif.tsx @@ -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> { diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx index e78a3252499..51974109b4c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx @@ -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}`}> |