aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2019-03-25 11:29:23 +0100
committersonartech <sonartech@sonarsource.com>2019-03-29 09:44:57 +0100
commit10cb25f0f8634d392a029a54f23ebb5e48b96e36 (patch)
tree3a1a23663f240a62b4a763ac7278c2586a9b1131 /server
parent2beaf73c2d10dcaaf3949889af53579e7d5aba13 (diff)
downloadsonarqube-10cb25f0f8634d392a029a54f23ebb5e48b96e36.tar.gz
sonarqube-10cb25f0f8634d392a029a54f23ebb5e48b96e36.zip
Introduce new T.Dict<T> type constructor
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/api/quality-profiles.ts6
-rw-r--r--server/sonar-web/src/main/js/api/rules.ts2
-rw-r--r--server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/search/Search.tsx6
-rw-r--r--server/sonar-web/src/main/js/app/components/search/SearchResult.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/types.d.ts12
-rw-r--r--server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/code/bucket.ts16
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Components.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx8
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx7
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/utils.ts9
-rw-r--r--server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/App.tsx16
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx16
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx6
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/utils.ts8
-rw-r--r--server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx6
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/utils.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/App.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/types.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/utils.ts4
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/utils.ts10
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/query.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/types.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/utils.ts14
-rw-r--r--server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangesList.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/HomeContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/types.ts2
-rwxr-xr-xserver/sonar-web/src/main/js/apps/securityReports/components/VulnerabilityList.tsx6
-rwxr-xr-xserver/sonar-web/src/main/js/apps/securityReports/utils.ts6
-rw-r--r--server/sonar-web/src/main/js/apps/settings/store/definitions.ts4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/store/settingsPage.ts6
-rw-r--r--server/sonar-web/src/main/js/apps/settings/store/values.ts6
-rw-r--r--server/sonar-web/src/main/js/apps/settings/utils.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/commands/BuildWrapper.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/commands/ClangGCC.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx6
-rw-r--r--server/sonar-web/src/main/js/components/docs/DocTooltip.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx8
-rw-r--r--server/sonar-web/src/main/js/components/icons-components/QualifierIcon.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/icons-components/SeverityIcon.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/icons-components/StatusIcon.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/icons-components/TestStatusIcon.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/measure/utils.ts5
-rw-r--r--server/sonar-web/src/main/js/components/preview-graph/PreviewGraph.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/workspace/WorkspaceRuleDetails.tsx2
-rw-r--r--server/sonar-web/src/main/js/helpers/cookies.ts4
-rw-r--r--server/sonar-web/src/main/js/helpers/issues.ts4
-rw-r--r--server/sonar-web/src/main/js/helpers/measures.ts2
-rw-r--r--server/sonar-web/src/main/js/helpers/request.ts6
-rw-r--r--server/sonar-web/src/main/js/helpers/strings.ts2
-rw-r--r--server/sonar-web/src/main/js/store/metrics.ts2
-rw-r--r--server/sonar-web/src/main/js/store/organizations.ts2
-rw-r--r--server/sonar-web/src/main/js/store/users.ts2
142 files changed, 232 insertions, 254 deletions
diff --git a/server/sonar-web/src/main/js/api/quality-profiles.ts b/server/sonar-web/src/main/js/api/quality-profiles.ts
index 2002c06c65a..a7c6b3f1f2a 100644
--- a/server/sonar-web/src/main/js/api/quality-profiles.ts
+++ b/server/sonar-web/src/main/js/api/quality-profiles.ts
@@ -169,8 +169,8 @@ export interface CompareResponse {
modified: Array<{
key: string;
name: string;
- left: { params: { [p: string]: string }; severity: string };
- right: { params: { [p: string]: string }; severity: string };
+ left: { params: T.Dict<string>; severity: string };
+ right: { params: T.Dict<string>; severity: string };
}>;
}
@@ -284,7 +284,7 @@ export function bulkDeactivateRules(data: BulkActivateParameters) {
export function activateRule(data: {
key: string;
organization: string | undefined;
- params?: { [key: string]: string };
+ params?: T.Dict<string>;
reset?: boolean;
rule: string;
severity?: string;
diff --git a/server/sonar-web/src/main/js/api/rules.ts b/server/sonar-web/src/main/js/api/rules.ts
index 8ea8821b574..60b45746e32 100644
--- a/server/sonar-web/src/main/js/api/rules.ts
+++ b/server/sonar-web/src/main/js/api/rules.ts
@@ -32,7 +32,7 @@ export function getRulesApp(data: {
}
export interface SearchRulesResponse {
- actives?: { [rule: string]: T.RuleActivation[] };
+ actives?: T.Dict<T.RuleActivation[]>;
facets?: { property: string; values: { count: number; val: string }[] }[];
p: number;
ps: number;
diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx
index 61610c62902..4e119d95eac 100644
--- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx
+++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx
@@ -22,9 +22,7 @@ import suggestionsJson from 'Docs/EmbedDocsSuggestions.json';
import { SuggestionsContext } from './SuggestionsContext';
import { isSonarCloud } from '../../../helpers/system';
-interface SuggestionsJson {
- [key: string]: T.SuggestionLink[];
-}
+type SuggestionsJson = T.Dict<T.SuggestionLink[]>;
interface State {
suggestions: T.SuggestionLink[];
diff --git a/server/sonar-web/src/main/js/app/components/search/Search.tsx b/server/sonar-web/src/main/js/app/components/search/Search.tsx
index 8fa9aa71747..9d358998335 100644
--- a/server/sonar-web/src/main/js/app/components/search/Search.tsx
+++ b/server/sonar-web/src/main/js/app/components/search/Search.tsx
@@ -51,8 +51,8 @@ interface State {
loadingMore?: string;
more: More;
open: boolean;
- organizations: { [key: string]: { name: string } };
- projects: { [key: string]: { name: string } };
+ organizations: T.Dict<{ name: string }>;
+ projects: T.Dict<{ name: string }>;
query: string;
results: Results;
selected?: string;
@@ -62,7 +62,7 @@ interface State {
export class Search extends React.PureComponent<Props, State> {
input?: HTMLInputElement | null;
node?: HTMLElement | null;
- nodes: { [x: string]: HTMLElement };
+ nodes: T.Dict<HTMLElement>;
mounted = false;
constructor(props: Props) {
diff --git a/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx b/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx
index b68ebdceeb4..5ffab5ec6a4 100644
--- a/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx
+++ b/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx
@@ -32,8 +32,8 @@ interface Props {
innerRef: (componentKey: string, node: HTMLElement | null) => void;
onClose: () => void;
onSelect: (componentKey: string) => void;
- organizations: { [key: string]: { name: string } };
- projects: { [key: string]: { name: string } };
+ organizations: T.Dict<{ name: string }>;
+ projects: T.Dict<{ name: string }>;
selected: boolean;
}
diff --git a/server/sonar-web/src/main/js/app/types.d.ts b/server/sonar-web/src/main/js/app/types.d.ts
index 24d81014308..16d74f126c0 100644
--- a/server/sonar-web/src/main/js/app/types.d.ts
+++ b/server/sonar-web/src/main/js/app/types.d.ts
@@ -18,6 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
declare namespace T {
+ export type Dict<T> = { [key: string]: T };
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
// Type ordered alphabetically to prevent merge conflicts
@@ -97,7 +99,7 @@ declare namespace T {
organizationsEnabled?: boolean;
productionDatabase: boolean;
qualifiers: string[];
- settings: { [key: string]: string };
+ settings: T.Dict<string>;
standalone?: boolean;
version: string;
}
@@ -400,9 +402,7 @@ declare namespace T {
name: string;
}
- export interface Languages {
- [key: string]: Language;
- }
+ export type Languages = T.Dict<Language>;
export interface LightComponent {
key: string;
@@ -773,10 +773,10 @@ declare namespace T {
}
export interface SettingValue {
- fieldValues?: Array<{ [key: string]: string }>;
+ fieldValues?: Array<T.Dict<string>>;
inherited?: boolean;
key: string;
- parentFieldValues?: Array<{ [key: string]: string }>;
+ parentFieldValues?: Array<T.Dict<string>>;
parentValue?: string;
parentValues?: string[];
value?: string;
diff --git a/server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts b/server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts
index 21fb3d0c52b..adf94c2d84a 100644
--- a/server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts
+++ b/server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-const extensions: { [key: string]: Function } = {};
+const extensions: T.Dict<Function> = {};
const registerExtension = (key: string, start: Function) => {
extensions[key] = start;
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx
index 4e93eb52bac..7c35f893d3a 100644
--- a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx
+++ b/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx
@@ -55,7 +55,7 @@ interface Props {
}
interface State {
- issueTypes?: { [key: string]: { count: number } };
+ issueTypes?: T.Dict<{ count: number }>;
loading: boolean;
projectsCount: number;
}
diff --git a/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx b/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx
index 56683108cfe..5c116e15665 100644
--- a/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx
+++ b/server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx
@@ -29,7 +29,7 @@ import { translate } from '../../../helpers/l10n';
export interface Props {
addNotification: (n: T.Notification) => void;
channels: string[];
- notificationsByProject: { [project: string]: T.Notification[] };
+ notificationsByProject: T.Dict<T.Notification[]>;
projects: NotificationProject[];
removeNotification: (n: T.Notification) => void;
types: string[];
diff --git a/server/sonar-web/src/main/js/apps/code/bucket.ts b/server/sonar-web/src/main/js/apps/code/bucket.ts
index a005027ac35..aba36f31d4a 100644
--- a/server/sonar-web/src/main/js/apps/code/bucket.ts
+++ b/server/sonar-web/src/main/js/apps/code/bucket.ts
@@ -17,15 +17,13 @@
* 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: { [key: string]: T.ComponentMeasure } = {};
-let childrenBucket: {
- [key: string]: {
- children: T.ComponentMeasure[];
- page: number;
- total: number;
- };
-} = {};
-let breadcrumbsBucket: { [key: string]: T.Breadcrumb[] } = {};
+let bucket: T.Dict<T.ComponentMeasure> = {};
+let childrenBucket: T.Dict<{
+ children: T.ComponentMeasure[];
+ page: number;
+ total: number;
+}> = {};
+let breadcrumbsBucket: T.Dict<T.Breadcrumb[]> = {};
export function addComponent(component: T.ComponentMeasure): void {
bucket[component.key] = component;
diff --git a/server/sonar-web/src/main/js/apps/code/components/App.tsx b/server/sonar-web/src/main/js/apps/code/components/App.tsx
index 10b3fc08349..1c030f377a2 100644
--- a/server/sonar-web/src/main/js/apps/code/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/code/components/App.tsx
@@ -40,7 +40,7 @@ import { getProjectUrl, getCodeUrl } from '../../../helpers/urls';
import '../code.css';
interface StateToProps {
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
}
interface DispatchToProps {
diff --git a/server/sonar-web/src/main/js/apps/code/components/Components.tsx b/server/sonar-web/src/main/js/apps/code/components/Components.tsx
index 7fd2c4f50c3..b83e015aae5 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Components.tsx
+++ b/server/sonar-web/src/main/js/apps/code/components/Components.tsx
@@ -29,7 +29,7 @@ interface Props {
baseComponent?: T.ComponentMeasure;
branchLike?: T.BranchLike;
components: T.ComponentMeasure[];
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
rootComponent: T.ComponentMeasure;
selected?: T.ComponentMeasure;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
index 50b5cce4633..d5264e69c5d 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
@@ -39,7 +39,7 @@ interface Props {
}
interface State {
- params: { [p: string]: string };
+ params: T.Dict<string>;
profile: string;
severity: string;
submitting: boolean;
@@ -68,7 +68,7 @@ export default class ActivationFormModal extends React.PureComponent<Props, Stat
}
getParams = ({ activation, rule } = this.props) => {
- const params: { [p: string]: string } = {};
+ const params: T.Dict<string> = {};
if (rule && rule.params) {
for (const param of rule.params) {
params[param.key] = param.defaultValue || '';
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
index 36230f89c60..0ae3109d4a0 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
@@ -96,8 +96,8 @@ interface State {
openRule?: T.Rule;
paging?: T.Paging;
query: Query;
- referencedProfiles: { [profile: string]: Profile };
- referencedRepositories: { [repository: string]: { key: string; language: string; name: string } };
+ referencedProfiles: T.Dict<Profile>;
+ referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
rules: T.Rule[];
selected?: string;
}
@@ -615,7 +615,7 @@ export class App extends React.PureComponent<Props, State> {
}
}
-function parseActives(rawActives: { [rule: string]: T.RuleActivation[] }) {
+function parseActives(rawActives: T.Dict<T.RuleActivation[]>) {
const actives: Actives = {};
for (const [rule, activations] of Object.entries(rawActives)) {
actives[rule] = {};
@@ -629,7 +629,7 @@ function parseActives(rawActives: { [rule: string]: T.RuleActivation[] }) {
function parseFacets(rawFacets: { property: string; values: { count: number; val: string }[] }[]) {
const facets: Facets = {};
for (const rawFacet of rawFacets) {
- const values: { [value: string]: number } = {};
+ const values: T.Dict<number> = {};
for (const rawValue of rawFacet.values) {
values[rawValue.val] = rawValue.count;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
index ca6a67e2345..508c9bfc621 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
@@ -29,7 +29,7 @@ interface Props {
languages: T.Languages;
organization: string | undefined;
query: Query;
- referencedProfiles: { [profile: string]: Profile };
+ referencedProfiles: T.Dict<Profile>;
total: number;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
index b6bf6c9d4ec..a7df07d3130 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
@@ -34,7 +34,7 @@ interface Props {
organization: string | undefined;
profile?: Profile;
query: Query;
- referencedProfiles: { [profile: string]: Profile };
+ referencedProfiles: T.Dict<Profile>;
total: number;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
index c97036fd75a..0ce7a3cab59 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
@@ -44,7 +44,7 @@ interface State {
key: string;
keyModifiedByUser: boolean;
name: string;
- params: { [p: string]: string };
+ params: T.Dict<string>;
reactivating: boolean;
severity: string;
status: string;
@@ -57,7 +57,7 @@ export default class CustomRuleFormModal extends React.PureComponent<Props, Stat
constructor(props: Props) {
super(props);
- const params: { [p: string]: string } = {};
+ const params: T.Dict<string> = {};
if (props.customRule && props.customRule.params) {
for (const param of props.customRule.params) {
params[param.key] = param.defaultValue || '';
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx
index fb0386b422d..a39e77d2398 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx
@@ -30,10 +30,10 @@ import { translate } from '../../../helpers/l10n';
import { formatMeasure } from '../../../helpers/measures';
export interface BasicProps {
- onChange: (changes: { [x: string]: string | string[] | undefined }) => void;
+ onChange: (changes: T.Dict<string | string[] | undefined>) => void;
onToggle: (facet: FacetKey) => void;
open: boolean;
- stats?: { [x: string]: number };
+ stats?: T.Dict<number>;
values: string[];
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
index 7d92e5133bc..b934ab4a1f7 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
@@ -41,8 +41,8 @@ interface Props {
organization: string | undefined;
organizationsEnabled?: boolean;
query: Query;
- referencedProfiles: { [profile: string]: Profile };
- referencedRepositories: { [repository: string]: { key: string; language: string; name: string } };
+ referencedProfiles: T.Dict<Profile>;
+ referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
selectedProfile?: Profile;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx
index afc1f06cfbc..2e15cea1b9c 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx
@@ -36,7 +36,7 @@ interface Props {
onChange: (changes: Partial<Query>) => void;
onToggle: (facet: FacetKey) => void;
open: boolean;
- referencedProfiles: { [profile: string]: Profile };
+ referencedProfiles: T.Dict<Profile>;
value: string | undefined;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx
index 5a51cedf82c..e3f82deade2 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx
@@ -23,11 +23,11 @@ import Facet, { BasicProps } from './Facet';
import { getLanguages, Store } from '../../../store/rootReducer';
interface StateProps {
- referencedLanguages: { [language: string]: { key: string; name: string } };
+ referencedLanguages: T.Dict<{ key: string; name: string }>;
}
interface Props extends BasicProps, StateProps {
- referencedRepositories: { [repository: string]: { key: string; language: string; name: string } };
+ referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
}
class RepositoryFacet extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
index 276be9e6f2c..b56478416fe 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
@@ -43,8 +43,8 @@ interface Props {
onDelete: (rule: string) => void;
onFilterChange: (changes: Partial<Query>) => void;
organization: string | undefined;
- referencedProfiles: { [profile: string]: Profile };
- referencedRepositories: { [repository: string]: { key: string; language: string; name: string } };
+ referencedProfiles: T.Dict<Profile>;
+ referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
ruleKey: string;
selectedProfile?: Profile;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx
index 78ef447f8b7..4e9b534f34c 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx
@@ -42,7 +42,7 @@ interface Props {
onFilterChange: (changes: Partial<Query>) => void;
onTagsChange: (tags: string[]) => void;
organization: string | undefined;
- referencedRepositories: { [repository: string]: { key: string; language: string; name: string } };
+ referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
ruleDetails: T.RuleDetails;
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
index 29f4de18cba..f112a6edd95 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
@@ -38,7 +38,7 @@ interface Props {
onActivate: () => Promise<void>;
onDeactivate: () => Promise<void>;
organization: string | undefined;
- referencedProfiles: { [profile: string]: Profile };
+ referencedProfiles: T.Dict<Profile>;
ruleDetails: T.RuleDetails;
}
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx
index 0603e1a269b..c55fae9ab8c 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx
@@ -74,7 +74,7 @@ interface State {
leakPeriod?: T.Period;
loading: boolean;
measures: T.MeasureEnhanced[];
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
}
export class App extends React.PureComponent<Props, State> {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
index 80920d1895e..e47aaf7ac34 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
@@ -42,7 +42,7 @@ interface Props {
branchLike?: T.BranchLike;
leakPeriod?: T.Period;
requestedMetric: Pick<T.Metric, 'key' | 'direction'>;
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
rootComponent: T.ComponentMeasure;
router: InjectedRouter;
selected?: string;
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
index 3cd2bbd362c..d8b3a9c5075 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
@@ -37,9 +37,9 @@ interface Props {
domain: string;
leakPeriod?: T.Period;
loading: boolean;
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
rootComponent: T.ComponentMeasure;
- updateLoading: (param: { [key: string]: boolean }) => void;
+ updateLoading: (param: T.Dict<boolean>) => void;
updateSelected: (component: string) => void;
}
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx
index af26325e68a..4808cc21741 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx
@@ -30,7 +30,7 @@ interface Props {
className?: string;
domain: string;
leakPeriod?: T.Period;
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
rootComponent: T.ComponentMeasure;
router: InjectedRouter;
selected?: string;
diff --git a/server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts b/server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts
index 349638f97eb..3f1795e0b9f 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts
+++ b/server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-export const complementary: { [metric: string]: string[] } = {
+export const complementary: T.Dict<string[]> = {
coverage: ['uncovered_lines', 'uncovered_conditions'],
line_coverage: ['uncovered_lines'],
branch_coverage: ['uncovered_conditions'],
diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx
index 83cd304c288..16ff032dbb4 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx
@@ -39,7 +39,7 @@ interface Props {
component: T.ComponentMeasure;
components: T.ComponentMeasureEnhanced[];
domain: string;
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
updateSelected: (component: string) => void;
}
diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx
index 21777417bec..877ea41f70e 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx
@@ -29,7 +29,7 @@ interface Props {
components: T.ComponentMeasureEnhanced[];
onClick: (component: string) => void;
metric: T.Metric;
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
rootComponent: T.ComponentMeasure;
selectedComponent?: string;
view: View;
diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx
index 3a2f52bd98f..52fc3caa4b1 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx
@@ -38,7 +38,7 @@ interface Props {
handleOpen: (component: string) => void;
loadingMore: boolean;
metric: T.Metric;
- metrics: { [metric: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
paging?: T.Paging;
rootComponent: T.ComponentMeasure;
selectedKey?: string;
diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx
index ef78ac7809e..f72dd25d0b5 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx
@@ -32,7 +32,7 @@ interface Props {
}
interface State {
- openFacets: { [metric: string]: boolean };
+ openFacets: T.Dict<boolean>;
}
export default class Sidebar extends React.PureComponent<Props, State> {
@@ -84,10 +84,7 @@ export default class Sidebar extends React.PureComponent<Props, State> {
}
}
-function getOpenFacets(
- openFacets: { [metric: string]: boolean },
- { measures, selectedMetric }: Props
-) {
+function getOpenFacets(openFacets: T.Dict<boolean>, { measures, selectedMetric }: Props) {
const newOpenFacets = { ...openFacets };
const measure = measures.find(measure => measure.metric.key === selectedMetric);
if (measure && measure.metric && measure.metric.domain) {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/utils.ts b/server/sonar-web/src/main/js/apps/component-measures/utils.ts
index b28a82613cc..8efbde6ded0 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/utils.ts
+++ b/server/sonar-web/src/main/js/apps/component-measures/utils.ts
@@ -93,7 +93,7 @@ export function addMeasureCategories(domainName: string, measures: T.MeasureEnha
export function enhanceComponent(
component: T.ComponentMeasure,
metric: Pick<T.Metric, 'key'> | undefined,
- metrics: { [key: string]: T.Metric }
+ metrics: T.Dict<T.Metric>
): T.ComponentMeasureEnhanced {
if (!component.measures) {
return { ...component, measures: [] };
@@ -153,10 +153,7 @@ export function hasFullMeasures(branch?: T.BranchLike) {
return !branch || isLongLivingBranch(branch) || isMainBranch(branch);
}
-export function getMeasuresPageMetricKeys(
- metrics: { [key: string]: T.Metric },
- branch?: T.BranchLike
-) {
+export function getMeasuresPageMetricKeys(metrics: T.Dict<T.Metric>, branch?: T.BranchLike) {
const metricKeys = getDisplayMetrics(Object.values(metrics)).map(metric => metric.key);
if (isPullRequest(branch) || isShortLivingBranch(branch)) {
@@ -166,7 +163,7 @@ export function getMeasuresPageMetricKeys(
}
}
-export function getBubbleMetrics(domain: string, metrics: { [key: string]: T.Metric }) {
+export function getBubbleMetrics(domain: string, metrics: T.Dict<T.Metric>) {
const conf = bubbles[domain];
return {
x: metrics[conf.x],
diff --git a/server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx b/server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx
index a94edf14f99..6451e98e024 100644
--- a/server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx
+++ b/server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx
@@ -36,7 +36,7 @@ interface Props {
organization: T.Organization;
}
-type SelectedRepositories = { [key: string]: T.AlmRepository | undefined };
+type SelectedRepositories = T.Dict<T.AlmRepository | undefined>;
interface State {
highlight: boolean;
diff --git a/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx b/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx
index 57083fa5021..613616375b1 100644
--- a/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx
+++ b/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx
@@ -24,7 +24,7 @@ import { highlightMarks, cutWords, DocumentationEntry } from '../utils';
export interface SearchResult {
exactMatch?: boolean;
- highlights: { [field: string]: [number, number][] };
+ highlights: T.Dict<[number, number][]>;
longestTerm: string;
page: DocumentationEntry;
query: string;
diff --git a/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx b/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx
index fc70715270b..e2db1c0bf6b 100644
--- a/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx
+++ b/server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx
@@ -60,7 +60,7 @@ export default class SearchResults extends React.PureComponent<Props> {
)
.map(match => {
const page = this.props.pages.find(page => page.relativeName === match.ref);
- const highlights: { [field: string]: [number, number][] } = {};
+ const highlights: T.Dict<[number, number][]> = {};
let longestTerm = '';
let exactMatch = false;
diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.tsx b/server/sonar-web/src/main/js/apps/issues/components/App.tsx
index 632211d2af7..8e079deebbe 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/components/App.tsx
@@ -115,23 +115,23 @@ export interface State {
checkAll?: boolean;
checked: string[];
effortTotal?: number;
- facets: { [facet: string]: Facet };
+ facets: T.Dict<Facet>;
issues: T.Issue[];
loading: boolean;
- loadingFacets: { [key: string]: boolean };
+ loadingFacets: T.Dict<boolean>;
loadingMore: boolean;
locationsNavigator: boolean;
myIssues: boolean;
- openFacets: { [facet: string]: boolean };
+ openFacets: T.Dict<boolean>;
openIssue?: T.Issue;
openPopup?: { issue: string; name: string };
paging?: T.Paging;
query: Query;
- referencedComponentsById: { [id: string]: ReferencedComponent };
- referencedComponentsByKey: { [key: string]: ReferencedComponent };
- referencedLanguages: { [languageKey: string]: ReferencedLanguage };
- referencedRules: { [ruleKey: string]: ReferencedRule };
- referencedUsers: { [login: string]: ReferencedUser };
+ referencedComponentsById: T.Dict<ReferencedComponent>;
+ referencedComponentsByKey: T.Dict<ReferencedComponent>;
+ referencedLanguages: T.Dict<ReferencedLanguage>;
+ referencedRules: T.Dict<ReferencedRule>;
+ referencedUsers: T.Dict<ReferencedUser>;
selected?: string;
selectedFlowIndex?: number;
selectedLocationIndex?: number;
diff --git a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx
index 5082742f980..744a1552a6c 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx
@@ -239,7 +239,7 @@ export default class BulkChangeModal extends React.PureComponent<Props, State> {
};
getAvailableTransitions(issues: T.Issue[]) {
- const transitions: { [x: string]: number } = {};
+ const transitions: T.Dict<number> = {};
issues.forEach(issue => {
if (issue.transitions) {
issue.transitions.forEach(t => {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
index add1d6e1cc8..ba19f5264f8 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
@@ -35,8 +35,8 @@ export interface Props {
open: boolean;
organization: string | undefined;
query: Query;
- stats: { [x: string]: number } | undefined;
- referencedUsers: { [login: string]: ReferencedUser };
+ stats: T.Dict<number> | undefined;
+ referencedUsers: T.Dict<ReferencedUser>;
}
export default class AssigneeFacet extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx
index c1576a95fb0..02e0da6331d 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx
@@ -34,7 +34,7 @@ interface Props {
open: boolean;
organization: string | undefined;
query: Query;
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
authors: string[];
}
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx
index 256fafa9afc..ba6b59c2df9 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx
@@ -45,7 +45,7 @@ interface Props {
onToggle: (property: string) => void;
open: boolean;
sinceLeakPeriod: boolean;
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
}
class CreationDateFacet extends React.PureComponent<Props & InjectedIntlProps> {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx
index c210ec54e6e..c605a2bf106 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx
@@ -36,7 +36,7 @@ interface Props {
onToggle: (property: string) => void;
open: boolean;
query: Query;
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
}
export default class DirectoryFacet extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx
index b36e6ac47b4..92b10e4399d 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx
@@ -36,8 +36,8 @@ interface Props {
onToggle: (property: string) => void;
open: boolean;
query: Query;
- referencedComponents: { [componentKey: string]: ReferencedComponent };
- stats: { [x: string]: number } | undefined;
+ referencedComponents: T.Dict<ReferencedComponent>;
+ stats: T.Dict<number> | undefined;
}
export default class FileFacet extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx
index 0b77a39c980..1fc34ff91be 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx
@@ -40,8 +40,8 @@ interface Props {
onToggle: (property: string) => void;
open: boolean;
query: Query;
- referencedLanguages: { [languageKey: string]: ReferencedLanguage };
- stats: { [x: string]: number } | undefined;
+ referencedLanguages: T.Dict<ReferencedLanguage>;
+ stats: T.Dict<number> | undefined;
}
class LanguageFacet extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx
index f9bb06a221d..5b314670034 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx
@@ -37,8 +37,8 @@ interface Props {
organization: { key: string } | undefined;
projects: string[];
query: Query;
- referencedComponents: { [componentKey: string]: ReferencedComponent };
- stats: { [x: string]: number } | undefined;
+ referencedComponents: T.Dict<ReferencedComponent>;
+ stats: T.Dict<number> | undefined;
}
interface SearchedProject {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx
index 6dadfe235b3..5e069b27e14 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx
@@ -35,7 +35,7 @@ interface Props {
open: boolean;
resolved: boolean;
resolutions: string[];
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
}
const RESOLUTIONS = ['', 'FIXED', 'FALSE-POSITIVE', 'WONTFIX', 'REMOVED'];
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx
index 5ab823fe6a7..599b401951a 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx
@@ -33,9 +33,9 @@ interface Props {
open: boolean;
organization: string | undefined;
query: Query;
- referencedRules: { [ruleKey: string]: ReferencedRule };
+ referencedRules: T.Dict<ReferencedRule>;
rules: string[];
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
}
export default class RuleFacet extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
index b8055caa5ff..4bd9b25755a 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
@@ -35,7 +35,7 @@ interface Props {
onToggle: (property: string) => void;
open: boolean;
severities: string[];
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
}
const SEVERITIES = ['BLOCKER', 'MINOR', 'CRITICAL', 'INFO', 'MAJOR'];
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
index f401c1ee99c..c40f1889559 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
@@ -44,21 +44,21 @@ import {
export interface Props {
component: T.Component | undefined;
- facets: { [facet: string]: Facet };
+ facets: T.Dict<Facet>;
hideAuthorFacet?: boolean;
loadSearchResultCount: (property: string, changes: Partial<Query>) => Promise<Facet>;
- loadingFacets: { [key: string]: boolean };
+ loadingFacets: T.Dict<boolean>;
myIssues: boolean;
onFacetToggle: (property: string) => void;
onFilterChange: (changes: Partial<Query>) => void;
- openFacets: { [facet: string]: boolean };
+ openFacets: T.Dict<boolean>;
organization: { key: string } | undefined;
query: Query;
- referencedComponentsById: { [id: string]: ReferencedComponent };
- referencedComponentsByKey: { [key: string]: ReferencedComponent };
- referencedLanguages: { [languageKey: string]: ReferencedLanguage };
- referencedRules: { [ruleKey: string]: ReferencedRule };
- referencedUsers: { [login: string]: ReferencedUser };
+ referencedComponentsById: T.Dict<ReferencedComponent>;
+ referencedComponentsByKey: T.Dict<ReferencedComponent>;
+ referencedLanguages: T.Dict<ReferencedLanguage>;
+ referencedRules: T.Dict<ReferencedRule>;
+ referencedUsers: T.Dict<ReferencedUser>;
}
export default class Sidebar extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx
index cee06f90ec2..534482898a9 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx
@@ -39,7 +39,7 @@ import ListStyleFacet from '../../../components/facet/ListStyleFacet';
export interface Props {
cwe: string[];
cweOpen: boolean;
- cweStats: { [x: string]: number } | undefined;
+ cweStats: T.Dict<number> | undefined;
fetchingOwaspTop10: boolean;
fetchingSansTop25: boolean;
fetchingCwe: boolean;
@@ -49,11 +49,11 @@ export interface Props {
open: boolean;
owaspTop10: string[];
owaspTop10Open: boolean;
- owaspTop10Stats: { [x: string]: number } | undefined;
+ owaspTop10Stats: T.Dict<number> | undefined;
query: Query;
sansTop25: string[];
sansTop25Open: boolean;
- sansTop25Stats: { [x: string]: number } | undefined;
+ sansTop25Stats: T.Dict<number> | undefined;
}
interface State {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx
index 07b0087532f..03d6864947a 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx
@@ -34,7 +34,7 @@ interface Props {
onChange: (changes: Partial<Query>) => void;
onToggle: (property: string) => void;
open: boolean;
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
statuses: string[];
}
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
index 0b0afc552e0..682485997bc 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
@@ -36,7 +36,7 @@ interface Props {
open: boolean;
organization: string | undefined;
query: Query;
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
tags: string[];
}
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx
index f20673e9341..f315d310387 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx
@@ -35,7 +35,7 @@ interface Props {
onChange: (changes: Partial<Query>) => void;
onToggle: (property: string) => void;
open: boolean;
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
types: string[];
}
diff --git a/server/sonar-web/src/main/js/apps/issues/utils.ts b/server/sonar-web/src/main/js/apps/issues/utils.ts
index 1f5e3e31e03..528be4778af 100644
--- a/server/sonar-web/src/main/js/apps/issues/utils.ts
+++ b/server/sonar-web/src/main/js/apps/issues/utils.ts
@@ -149,25 +149,25 @@ export interface Facet {
}
export function mapFacet(facet: string) {
- const propertyMapping: { [x: string]: string } = {
+ const propertyMapping: T.Dict<string> = {
files: 'fileUuids',
modules: 'moduleUuids'
};
return propertyMapping[facet] || facet;
}
-export function parseFacets(facets: RawFacet[]): { [x: string]: Facet } {
+export function parseFacets(facets: RawFacet[]): T.Dict<Facet> {
if (!facets) {
return {};
}
// for readability purpose
- const propertyMapping: { [x: string]: string } = {
+ const propertyMapping: T.Dict<string> = {
fileUuids: 'files',
moduleUuids: 'modules'
};
- const result: { [x: string]: Facet } = {};
+ const result: T.Dict<Facet> = {};
facets.forEach(facet => {
const values: Facet = {};
facet.values.forEach(value => {
diff --git a/server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx b/server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx
index 1bc300691ad..fbc68ce2d8f 100644
--- a/server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx
+++ b/server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx
@@ -39,7 +39,7 @@ interface Props {
}
interface State {
- userGroups?: { [k: string]: UserGroup & { status?: string } };
+ userGroups?: T.Dict<UserGroup & { status?: string }>;
loading?: boolean;
}
diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx
index 431262cd3a9..4eab0d0de2b 100644
--- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx
+++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx
@@ -22,7 +22,7 @@ import AllProjectsContainer from '../../projects/components/AllProjectsContainer
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
interface Props {
- location: { pathname: string; query: { [x: string]: string } };
+ location: { pathname: string; query: T.Dict<string> };
organization: T.Organization;
}
diff --git a/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx b/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
index d2ae576f636..d0b351ff799 100644
--- a/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
@@ -26,7 +26,7 @@ import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
interface Props {
className?: string;
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
options: BadgeOptions;
type: BadgeType;
updateOptions: (options: Partial<BadgeOptions>) => void;
diff --git a/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx b/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx
index 214645981c1..3f4bf8d33ce 100644
--- a/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx
@@ -31,7 +31,7 @@ import './styles.css';
interface Props {
branchLike?: T.BranchLike;
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
project: string;
qualifier: string;
}
diff --git a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
index 5969ecc588f..59c6ff4fefd 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
@@ -54,7 +54,7 @@ interface Props {
component: T.Component;
fetchMetrics: () => void;
onComponentChange: (changes: {}) => void;
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
}
interface State {
@@ -119,7 +119,7 @@ export class OverviewApp extends React.PureComponent<Props, State> {
metrics: metrics.join()
}).then(r => {
if (this.mounted) {
- const history: { [metric: string]: Array<{ date: Date; value?: string }> } = {};
+ const history: T.Dict<Array<{ date: Date; value?: string }>> = {};
r.measures.forEach(measure => {
const measureHistory = measure.history.map(analysis => ({
date: parseDate(analysis.date),
diff --git a/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx b/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
index 37ebc13ca01..c21b0dc01b8 100644
--- a/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
@@ -32,7 +32,7 @@ interface Props {
history?: {
[metric: string]: Array<{ date: Date; value?: string }>;
};
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
qualifier: string;
}
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx
index bcd1bccf8e5..709754c92b0 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx
@@ -53,7 +53,7 @@ interface OwnProps {
[metric: string]: Array<{ date: Date; value?: string }>;
};
measures?: T.MeasureEnhanced[];
- metrics?: { [key: string]: T.Metric };
+ metrics?: T.Dict<T.Metric>;
onComponentChange: (changes: {}) => void;
}
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
index 808be87db1d..f5e666d5b87 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
@@ -38,7 +38,7 @@ interface OwnProps {
}
interface State {
- deprecatedByKey: { [key: string]: number };
+ deprecatedByKey: T.Dict<number>;
}
class MetaQualityProfiles extends React.PureComponent<StateProps & OwnProps, State> {
@@ -61,7 +61,7 @@ class MetaQualityProfiles extends React.PureComponent<StateProps & OwnProps, Sta
Promise.all(requests).then(
responses => {
if (this.mounted) {
- const deprecatedByKey: { [key: string]: number } = {};
+ const deprecatedByKey: T.Dict<number> = {};
responses.forEach((count, i) => {
const profileKey = this.props.profiles[i].key;
deprecatedByKey[profileKey] = count;
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
index a0037f4684a..7af63eba6fb 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
@@ -33,7 +33,7 @@ interface Props {
type State = {
loading: boolean;
- metrics?: { [key: string]: T.Metric };
+ metrics?: T.Dict<T.Metric>;
projects?: ApplicationProject[];
status?: string;
};
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx
index a865777e0ab..07c44a34741 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx
@@ -27,7 +27,7 @@ import './ApplicationQualityGateProject.css';
import { ApplicationProject, ConditionAnalysis } from '../../../api/quality-gates';
interface Props {
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
project: ApplicationProject;
}
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx
index 693d5739e1c..c02add35b60 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx
@@ -45,8 +45,8 @@ export default class QualityGateCondition extends React.PureComponent<Props> {
}
}
- getIssuesUrl = (sinceLeakPeriod: boolean, customQuery: { [x: string]: string }) => {
- const query: { [x: string]: string | undefined } = {
+ getIssuesUrl = (sinceLeakPeriod: boolean, customQuery: T.Dict<string>) => {
+ const query: T.Dict<string | undefined> = {
resolved: 'false',
...getBranchLikeQuery(this.props.branchLike),
...customQuery
@@ -98,7 +98,7 @@ export default class QualityGateCondition extends React.PureComponent<Props> {
const metricKey = condition.measure.metric.key;
- const RATING_METRICS_MAPPING: { [metric: string]: [string, boolean] } = {
+ const RATING_METRICS_MAPPING: T.Dict<[string, boolean]> = {
reliability_rating: ['BUG', false],
new_reliability_rating: ['BUG', true],
security_rating: ['VULNERABILITY', false],
diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx
index 05c510aaf58..5ad0b29ba3b 100644
--- a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx
+++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx
@@ -40,7 +40,7 @@ interface Props {
}
interface State {
- initialPermissionsCount: { [key: string]: number };
+ initialPermissionsCount: T.Dict<number>;
}
export default class HoldersList extends React.PureComponent<Props, State> {
state: State = { initialPermissionsCount: {} };
diff --git a/server/sonar-web/src/main/js/apps/permissions/utils.ts b/server/sonar-web/src/main/js/apps/permissions/utils.ts
index d2c1ea6ad75..4f44cdb3f25 100644
--- a/server/sonar-web/src/main/js/apps/permissions/utils.ts
+++ b/server/sonar-web/src/main/js/apps/permissions/utils.ts
@@ -46,7 +46,7 @@ export const PERMISSIONS_ORDER_FOR_VIEW = ['user', 'admin'];
export const PERMISSIONS_ORDER_FOR_DEV = ['user', 'admin'];
-export const PERMISSIONS_ORDER_BY_QUALIFIER: { [index: string]: string[] } = {
+export const PERMISSIONS_ORDER_BY_QUALIFIER: T.Dict<string[]> = {
TRK: PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE,
VW: PERMISSIONS_ORDER_FOR_VIEW,
SVW: PERMISSIONS_ORDER_FOR_VIEW,
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
index 93a9f377231..4e08fb2e46f 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
@@ -30,7 +30,7 @@ import { translate } from '../../../helpers/l10n';
interface Props {
component: string;
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
}
interface State {
@@ -72,7 +72,7 @@ export default class Activity extends React.PureComponent<Props> {
return getAllTimeMachineData({ component, metrics: graphMetrics.join() }).then(
timeMachine => {
if (this.mounted) {
- const history: { [metric: string]: Array<{ date: Date; value?: string }> } = {};
+ const history: T.Dict<Array<{ date: Date; value?: string }>> = {};
timeMachine.measures.forEach(measure => {
const measureHistory = measure.history.map(analysis => ({
date: parseDate(analysis.date),
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
index e53553217ee..7c18623172a 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
@@ -42,7 +42,7 @@ interface OwnProps {
}
interface StateToProps {
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
}
interface DispatchToProps {
@@ -53,7 +53,7 @@ type Props = StateToProps & DispatchToProps & OwnProps;
interface State {
loading: boolean;
- measures?: { [key: string]: string | undefined };
+ measures?: T.Dict<string | undefined>;
subComponents?: SubComponent[];
totalSubComponents?: number;
}
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx
index 3a16b681676..29c58da3fea 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx
@@ -27,7 +27,7 @@ import { translate } from '../../../helpers/l10n';
interface Props {
component: string;
- measures: { [key: string]: string | undefined };
+ measures: T.Dict<string | undefined>;
}
export default function MaintainabilityBox({ component, measures }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx
index 896e030def6..fdffce0d3dc 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx
@@ -28,7 +28,7 @@ import { getComponentDrilldownUrl } from '../../../helpers/urls';
interface Props {
component: string;
- measures: { [key: string]: string | undefined };
+ measures: T.Dict<string | undefined>;
}
export default function ReleasabilityBox({ component, measures }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx
index c1988e2f689..2e2c1893d11 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx
@@ -27,7 +27,7 @@ import { translate } from '../../../helpers/l10n';
interface Props {
component: string;
- measures: { [key: string]: string | undefined };
+ measures: T.Dict<string | undefined>;
}
export default function ReliabilityBox({ component, measures }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx
index e4b9f861d88..b8101d7f8f9 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx
@@ -27,7 +27,7 @@ import { translate } from '../../../helpers/l10n';
interface Props {
component: string;
- measures: { [key: string]: string | undefined };
+ measures: T.Dict<string | undefined>;
}
export default function SecurityBox({ component, measures }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx
index 8005fce9b96..b396276a003 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx
@@ -26,7 +26,7 @@ import { getComponentDrilldownUrl } from '../../../helpers/urls';
interface Props {
component: { description?: string; key: string };
- measures: { [key: string]: string | undefined };
+ measures: T.Dict<string | undefined>;
}
export default function Summary({ component, measures }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx
index 96f0daa134b..2d9f11e89df 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx
@@ -107,7 +107,7 @@ export default function WorstProjects({ component, subComponents, total }: Props
);
}
-function renderCell(measures: { [key: string]: string | undefined }, metric: string, type: string) {
+function renderCell(measures: T.Dict<string | undefined>, metric: string, type: string) {
return (
<td className="text-center">
<Measure metricKey={metric} metricType={type} value={measures[metric]} />
@@ -115,7 +115,7 @@ function renderCell(measures: { [key: string]: string | undefined }, metric: str
);
}
-function renderNcloc(measures: { [key: string]: string | undefined }, maxLoc: number) {
+function renderNcloc(measures: T.Dict<string | undefined>, maxLoc: number) {
const ncloc = Number(measures['ncloc'] || 0);
const barWidth = maxLoc > 0 ? Math.max(1, Math.round((ncloc / maxLoc) * 50)) : 0;
return (
diff --git a/server/sonar-web/src/main/js/apps/portfolio/types.ts b/server/sonar-web/src/main/js/apps/portfolio/types.ts
index 45de85de01f..496ed85db50 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/types.ts
+++ b/server/sonar-web/src/main/js/apps/portfolio/types.ts
@@ -19,7 +19,7 @@
*/
export interface SubComponent {
key: string;
- measures: { [key: string]: string | undefined };
+ measures: T.Dict<string | undefined>;
name: string;
refKey?: string;
qualifier: string;
diff --git a/server/sonar-web/src/main/js/apps/portfolio/utils.ts b/server/sonar-web/src/main/js/apps/portfolio/utils.ts
index 8d219ac5953..f3d76eeab2e 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/utils.ts
+++ b/server/sonar-web/src/main/js/apps/portfolio/utils.ts
@@ -24,7 +24,7 @@ export function getNextRating(rating: number): number | undefined {
function getWorstSeverity(data: string): { severity: string; count: number } | undefined {
const SEVERITY_ORDER = ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'];
- const severities: { [key: string]: number } = {};
+ const severities: T.Dict<number> = {};
data.split(';').forEach(equality => {
const [key, count] = equality.split('=');
severities[key] = Number(count);
@@ -84,7 +84,7 @@ export const SUB_COMPONENTS_METRICS = [
];
export function convertMeasures(measures: Array<{ metric: string; value?: string }>) {
- const result: { [key: string]: string | undefined } = {};
+ const result: T.Dict<string | undefined> = {};
measures.forEach(measure => {
result[measure.metric] = measure.value;
});
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx
index 07a28ff5f70..c99cb179741 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx
@@ -31,7 +31,7 @@ interface Props {
value: string;
}
-const METRIC_RATING: { [x: string]: string } = {
+const METRIC_RATING: T.Dict<string> = {
bugs: 'reliability_rating',
vulnerabilities: 'security_rating',
code_smells: 'sqale_rating'
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts
index fbb551988d6..85653d2319d 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts
+++ b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts
@@ -70,12 +70,12 @@ export const EVENT_TYPES = ['VERSION', 'QUALITY_GATE', 'QUALITY_PROFILE', 'OTHER
export const APPLICATION_EVENT_TYPES = ['QUALITY_GATE', 'DEFINITION_CHANGE', 'OTHER'];
export const DEFAULT_GRAPH = 'issues';
export const GRAPH_TYPES = ['issues', 'coverage', 'duplications', 'custom'];
-export const GRAPHS_METRICS_DISPLAYED: { [x: string]: string[] } = {
+export const GRAPHS_METRICS_DISPLAYED: T.Dict<string[]> = {
issues: ['bugs', 'code_smells', 'vulnerabilities'],
coverage: ['lines_to_cover', 'uncovered_lines'],
duplications: ['ncloc', 'duplicated_lines']
};
-export const GRAPHS_METRICS: { [x: string]: string[] } = {
+export const GRAPHS_METRICS: T.Dict<string[]> = {
issues: GRAPHS_METRICS_DISPLAYED['issues'].concat([
'reliability_rating',
'security_rating',
@@ -142,7 +142,7 @@ export function generateCoveredLinesMetric(
};
}
-function findMetric(key: string, metrics: T.Metric[] | { [key: string]: T.Metric }) {
+function findMetric(key: string, metrics: T.Metric[] | T.Dict<T.Metric>) {
if (Array.isArray(metrics)) {
return metrics.find(metric => metric.key === key);
}
@@ -152,7 +152,7 @@ function findMetric(key: string, metrics: T.Metric[] | { [key: string]: T.Metric
export function generateSeries(
measuresHistory: MeasureHistory[],
graph: string,
- metrics: T.Metric[] | { [key: string]: T.Metric },
+ metrics: T.Metric[] | T.Dict<T.Metric>,
displayedMetrics: string[]
): Serie[] {
if (displayedMetrics.length <= 0 || typeof measuresHistory === 'undefined') {
@@ -193,7 +193,7 @@ export function getSeriesMetricType(series: Serie[]) {
}
interface AnalysesByDay {
- byDay: { [x: string]: ParsedAnalysis[] };
+ byDay: T.Dict<ParsedAnalysis[]>;
version: string | null;
key: string | null;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx
index c91d412a6a4..81fe78f56d6 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx
@@ -26,7 +26,7 @@ import VulnerabilityIcon from '../../../components/icons-components/Vulnerabilit
import { translate } from '../../../helpers/l10n';
interface Props {
- measures: { [key: string]: string };
+ measures: T.Dict<string>;
}
export default function ProjectCardLeakMeasures({ measures }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx
index c5f201a76d9..821257cb266 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx
@@ -30,7 +30,7 @@ import CodeSmellIcon from '../../../components/icons-components/CodeSmellIcon';
import VulnerabilityIcon from '../../../components/icons-components/VulnerabilityIcon';
interface Props {
- measures: { [key: string]: string | undefined };
+ measures: T.Dict<string | undefined>;
}
export default function ProjectCardOverallMeasures({ measures }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx
index bbaf688eb5f..cc2b9b8683b 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx
@@ -33,7 +33,7 @@ export interface Props {
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
property?: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx
index dbb7252ef81..d0d16e754ed 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx
@@ -36,7 +36,7 @@ export interface Props {
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
property?: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx
index a1316915e15..f5d9ddf3a35 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx
@@ -31,7 +31,7 @@ interface Props {
className?: string;
onQueryChange: (change: RawQuery) => void;
options: Option[];
- query: { [x: string]: any };
+ query: T.Dict<any>;
renderOption: (option: Option, isSelected: boolean) => React.ReactNode;
value?: Option | Option[];
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx
index 3aeb23e4e66..71592f4d272 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx
@@ -34,7 +34,7 @@ interface Props {
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
property: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx
index 52be2d5df6b..aeba3067a00 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx
@@ -35,7 +35,7 @@ interface Props {
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
property?: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: string[];
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx
index 8ef4a9c93da..39cfebbc357 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx
@@ -31,7 +31,7 @@ interface Props {
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx
index e4abe096478..a3550fa8e70 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx
@@ -32,7 +32,7 @@ export interface Props {
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
property?: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx
index d59f5a75112..fc4a94a38e8 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx
@@ -30,7 +30,7 @@ interface Props {
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx
index e2e00e1d1dc..5646371d4b5 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx
@@ -30,7 +30,7 @@ interface Props {
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx
index 527592cd420..a1765c4fee8 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx
@@ -30,7 +30,7 @@ interface Props {
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx
index 3b8f6c5fff8..7fa456cadc3 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx
@@ -32,7 +32,7 @@ export interface Props {
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx
index 9236cdeba84..a8a0c354fc2 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx
@@ -31,7 +31,7 @@ interface Props {
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx
index 9b748bfe66a..1348341fc7f 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx
@@ -31,7 +31,7 @@ interface Props {
options: Array<{ label: string; value: string }>;
organization?: { key: string };
property: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
}
export default class SearchableFilterFooter extends React.PureComponent<Props> {
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx
index a0459e9d8e2..5c70922ae34 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx
@@ -31,7 +31,7 @@ interface Props {
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx
index f3c93b6c251..9b19c58e26a 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx
@@ -33,7 +33,7 @@ export interface Props {
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
property?: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: any;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
index 18032d0c6c4..2b1be5918cc 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
@@ -34,7 +34,7 @@ interface Props {
onQueryChange: (change: RawQuery) => void;
organization?: { key: string };
property?: string;
- query: { [x: string]: any };
+ query: T.Dict<any>;
value?: string[];
}
diff --git a/server/sonar-web/src/main/js/apps/projects/query.ts b/server/sonar-web/src/main/js/apps/projects/query.ts
index 68dfdb7a63e..33adc5cd096 100644
--- a/server/sonar-web/src/main/js/apps/projects/query.ts
+++ b/server/sonar-web/src/main/js/apps/projects/query.ts
@@ -227,7 +227,7 @@ function convertSize(metric: string, size: number): string {
}
function mapPropertyToMetric(property?: string): string | undefined {
- const map: { [property: string]: string } = {
+ const map: T.Dict<string> = {
analysis_date: 'analysisDate',
reliability: 'reliability_rating',
new_reliability: 'new_reliability_rating',
diff --git a/server/sonar-web/src/main/js/apps/projects/types.ts b/server/sonar-web/src/main/js/apps/projects/types.ts
index d841caf3c96..183106c84e2 100644
--- a/server/sonar-web/src/main/js/apps/projects/types.ts
+++ b/server/sonar-web/src/main/js/apps/projects/types.ts
@@ -22,7 +22,7 @@ export interface Project {
isFavorite?: boolean;
key: string;
leakPeriodDate?: string;
- measures: { [key: string]: string };
+ measures: T.Dict<string>;
name: string;
organization?: { key: string; name: string };
tags: string[];
diff --git a/server/sonar-web/src/main/js/apps/projects/utils.ts b/server/sonar-web/src/main/js/apps/projects/utils.ts
index 256c21ef866..3971132c87f 100644
--- a/server/sonar-web/src/main/js/apps/projects/utils.ts
+++ b/server/sonar-web/src/main/js/apps/projects/utils.ts
@@ -57,7 +57,7 @@ export const SORTING_LEAK_METRICS: SortingOption[] = [
{ value: 'new_lines', class: 'projects-leak-sorting-option' }
];
-export const SORTING_SWITCH: { [x: string]: string } = {
+export const SORTING_SWITCH: T.Dict<string> = {
analysis_date: 'analysis_date',
name: 'name',
reliability: 'new_reliability',
@@ -115,7 +115,7 @@ const LEAK_METRICS = [
'new_lines'
];
-const METRICS_BY_VISUALIZATION: { [x: string]: string[] } = {
+const METRICS_BY_VISUALIZATION: T.Dict<string[]> = {
risk: ['reliability_rating', 'security_rating', 'coverage', 'ncloc', 'sqale_index'],
// x, y, size, color
reliability: ['ncloc', 'reliability_remediation_effort', 'bugs', 'reliability_rating'],
@@ -186,7 +186,7 @@ export function fetchProjects(
facets: getFacetsMap(facets),
projects: components
.map(component => {
- const componentMeasures: { [key: string]: string } = {};
+ const componentMeasures: T.Dict<string> = {};
measures.filter(measure => measure.component === component.key).forEach(measure => {
const value = isDiffMetric(measure.metric)
? getPeriodValue(measure, 1)
@@ -272,7 +272,7 @@ export function fetchProjectOrganizations(
}
function mapFacetValues(values: Array<{ val: string; count: number }>) {
- const map: { [value: string]: number } = {};
+ const map: T.Dict<number> = {};
values.forEach(value => {
map[value.val] = value.count;
});
@@ -280,7 +280,7 @@ function mapFacetValues(values: Array<{ val: string; count: number }>) {
}
function getFacetsMap(facets: Facet[]) {
- const map: { [property: string]: { [value: string]: number } } = {};
+ const map: T.Dict<T.Dict<number>> = {};
facets.forEach(facet => {
const property = mapMetricToProperty(facet.property);
const { values } = facet;
@@ -293,7 +293,7 @@ function getFacetsMap(facets: Facet[]) {
}
function mapPropertyToMetric(property?: string) {
- const map: { [property: string]: string } = {
+ const map: T.Dict<string> = {
analysis_date: 'analysisDate',
reliability: 'reliability_rating',
new_reliability: 'new_reliability_rating',
@@ -323,7 +323,7 @@ function convertToSorting({ sort }: Query): { s?: string; asc?: boolean } {
}
function mapMetricToProperty(metricKey: string) {
- const map: { [metric: string]: string } = {
+ const map: T.Dict<string> = {
analysisDate: 'analysis_date',
reliability_rating: 'reliability',
new_reliability_rating: 'new_reliability',
diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
index 8d3c81f9e34..153c74fd54b 100644
--- a/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
@@ -38,7 +38,7 @@ interface Props {
export default class Visualizations extends React.PureComponent<Props> {
renderVisualization(projects: Project[]) {
- const visualizationToComponent: { [x: string]: any } = {
+ const visualizationToComponent: T.Dict<any> = {
risk: Risk,
reliability: Reliability,
security: Security,
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
index 6dae3053fc3..be63b21b251 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
@@ -30,7 +30,7 @@ import { Alert } from '../../../components/ui/Alert';
interface Props {
canEdit: boolean;
conditions: T.Condition[];
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
onAddCondition: (condition: T.Condition) => void;
onSaveCondition: (newCondition: T.Condition, oldCondition: T.Condition) => void;
onRemoveCondition: (Condition: T.Condition) => void;
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
index fb9a7580e8c..614f6ddecea 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
@@ -37,7 +37,7 @@ interface OwnProps {
}
interface StateToProps {
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
}
interface DispatchToProps {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
index a6083c473f8..b420ada7a14 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
@@ -25,7 +25,7 @@ import { translate } from '../../../helpers/l10n';
interface Props {
isDefault?: boolean;
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
organization?: string;
onAddCondition: (condition: T.Condition) => void;
onRemoveCondition: (Condition: T.Condition) => void;
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangesList.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangesList.tsx
index acbb45c981d..2f27ed4c65d 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangesList.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangesList.tsx
@@ -22,7 +22,7 @@ import SeverityChange from './SeverityChange';
import ParameterChange from './ParameterChange';
interface Props {
- changes: { [change: string]: string | null };
+ changes: T.Dict<string | null>;
}
export default function ChangesList({ changes }: Props) {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx
index bbb8269caad..34a3e6f7f67 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx
@@ -28,7 +28,7 @@ import { CompareResponse, Profile } from '../../../api/quality-profiles';
import ChevronRightIcon from '../../../components/icons-components/ChevronRightcon';
import ChevronLeftIcon from '../../../components/icons-components/ChevronLeftIcon';
-type Params = { [p: string]: string };
+type Params = T.Dict<string>;
interface Props extends CompareResponse {
organization?: string;
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
index bb6692db7fe..b9060b042c0 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
@@ -46,8 +46,8 @@ interface ByType {
interface State {
activatedTotal: number | null;
- activatedByType: { [type: string]: ByType };
- allByType: { [type: string]: ByType };
+ activatedByType: T.Dict<ByType>;
+ allByType: T.Dict<ByType>;
compareToSonarWay: { profile: string; profileName: string; missingRuleCount: number } | null;
loading: boolean;
total: number | null;
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
index 3bea7a17198..b0c46e36abe 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
@@ -28,10 +28,7 @@ import { formatMeasure } from '../../../helpers/measures';
const RULES_LIMIT = 10;
-function parseRules(
- rules: T.Rule[],
- actives?: { [rule: string]: T.RuleActivation[] }
-): ExtendedRule[] {
+function parseRules(rules: T.Rule[], actives?: T.Dict<T.RuleActivation[]>): ExtendedRule[] {
return rules.map(rule => {
const activations = actives && actives[rule.key];
return { ...rule, activations: activations ? activations.length : 0 };
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/HomeContainer.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/HomeContainer.tsx
index cb09d54819a..defe270b574 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/HomeContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/HomeContainer.tsx
@@ -27,7 +27,7 @@ import { Actions } from '../../../api/quality-profiles';
interface Props {
actions: Actions;
languages: Array<{ key: string; name: string }>;
- location: { query: { [p: string]: string } };
+ location: { query: T.Dict<string> };
organization: string | null;
profiles: Profile[];
updateProfiles: () => Promise<void>;
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx
index ca4b28b4595..9a50bcfca9a 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx
@@ -28,7 +28,7 @@ import { Alert } from '../../../components/ui/Alert';
interface Props {
languages: Array<{ key: string; name: string }>;
- location: { query: { [p: string]: string } };
+ location: { query: T.Dict<string> };
organization: string | null;
profiles: Profile[];
updateProfiles: () => Promise<void>;
@@ -92,7 +92,7 @@ export default class ProfilesList extends React.PureComponent<Props> {
const { profiles, languages } = this.props;
const { language } = this.props.location.query;
- const profilesIndex: { [language: string]: Profile[] } = groupBy<Profile>(
+ const profilesIndex: T.Dict<Profile[]> = groupBy<Profile>(
profiles,
profile => profile.language
);
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/types.ts b/server/sonar-web/src/main/js/apps/quality-profiles/types.ts
index 2fdcdb9d80e..70e522f9bb7 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/types.ts
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/types.ts
@@ -34,7 +34,7 @@ export interface ProfileChangelogEvent {
action: string;
authorName: string;
date: string;
- params?: { [change: string]: string | null };
+ params?: T.Dict<string | null>;
ruleKey: string;
ruleName: string;
}
diff --git a/server/sonar-web/src/main/js/apps/securityReports/components/VulnerabilityList.tsx b/server/sonar-web/src/main/js/apps/securityReports/components/VulnerabilityList.tsx
index 61571b8a565..95dc4630e29 100755
--- a/server/sonar-web/src/main/js/apps/securityReports/components/VulnerabilityList.tsx
+++ b/server/sonar-web/src/main/js/apps/securityReports/components/VulnerabilityList.tsx
@@ -122,7 +122,7 @@ export default class VulnerabilityList extends React.PureComponent<Props, State>
const languages = this.props.component.qualityProfiles
? this.props.component.qualityProfiles.map(qp => qp.language).join(',')
: '';
- const sansTopCategoryTags: { [key: string]: string } = {
+ const sansTopCategoryTags: T.Dict<string> = {
'insecure-interaction': 'insecure',
'porous-defenses': 'porous',
'risky-resource': 'risky'
@@ -168,7 +168,7 @@ export default class VulnerabilityList extends React.PureComponent<Props, State>
renderComponentIssuesLink = (
activeRules: number,
- query: { [x: string]: string | undefined },
+ query: T.Dict<string | undefined>,
value: number,
tooltip?: JSX.Element
) => {
@@ -194,7 +194,7 @@ export default class VulnerabilityList extends React.PureComponent<Props, State>
parent?: T.SecurityHotspot
): React.ReactFragment {
const { branchLike, component, type } = this.props;
- const params: { [name: string]: string | undefined } = {
+ const params: T.Dict<string | undefined> = {
...getBranchLikeQuery(branchLike),
types: 'SECURITY_HOTSPOT'
};
diff --git a/server/sonar-web/src/main/js/apps/securityReports/utils.ts b/server/sonar-web/src/main/js/apps/securityReports/utils.ts
index e9394d7edc3..023f7f76dba 100755
--- a/server/sonar-web/src/main/js/apps/securityReports/utils.ts
+++ b/server/sonar-web/src/main/js/apps/securityReports/utils.ts
@@ -20,9 +20,9 @@
export type StandardType = 'owaspTop10' | 'sansTop25' | 'cwe';
export interface Standards {
- owaspTop10: { [x: string]: { title: string; description?: string } };
- sansTop25: { [x: string]: { title: string; description?: string } };
- cwe: { [x: string]: { title: string; description?: string } };
+ owaspTop10: T.Dict<{ title: string; description?: string }>;
+ sansTop25: T.Dict<{ title: string; description?: string }>;
+ cwe: T.Dict<{ title: string; description?: string }>;
}
export function renderOwaspTop10Category(
diff --git a/server/sonar-web/src/main/js/apps/settings/store/definitions.ts b/server/sonar-web/src/main/js/apps/settings/store/definitions.ts
index f0054d4af17..4eccf0d7a9a 100644
--- a/server/sonar-web/src/main/js/apps/settings/store/definitions.ts
+++ b/server/sonar-web/src/main/js/apps/settings/store/definitions.ts
@@ -27,9 +27,7 @@ const enum Actions {
type Action = ActionType<typeof receiveDefinitions, Actions.ReceiveDefinitions>;
-export interface State {
- [key: string]: T.SettingCategoryDefinition;
-}
+export type State = T.Dict<T.SettingCategoryDefinition>;
export function receiveDefinitions(definitions: T.SettingCategoryDefinition[]) {
return { type: Actions.ReceiveDefinitions, definitions };
diff --git a/server/sonar-web/src/main/js/apps/settings/store/settingsPage.ts b/server/sonar-web/src/main/js/apps/settings/store/settingsPage.ts
index 703da03714a..cc672c28fb6 100644
--- a/server/sonar-web/src/main/js/apps/settings/store/settingsPage.ts
+++ b/server/sonar-web/src/main/js/apps/settings/store/settingsPage.ts
@@ -39,9 +39,9 @@ type Action =
| ActionType<typeof stopLoading, Actions.StopLoading>;
export interface State {
- changedValues: { [key: string]: any };
- loading: { [key: string]: boolean };
- validationMessages: { [key: string]: string };
+ changedValues: T.Dict<any>;
+ loading: T.Dict<boolean>;
+ validationMessages: T.Dict<string>;
}
export function cancelChange(key: string) {
diff --git a/server/sonar-web/src/main/js/apps/settings/store/values.ts b/server/sonar-web/src/main/js/apps/settings/store/values.ts
index d92ae47d739..7dfeb996fc1 100644
--- a/server/sonar-web/src/main/js/apps/settings/store/values.ts
+++ b/server/sonar-web/src/main/js/apps/settings/store/values.ts
@@ -28,12 +28,10 @@ enum Actions {
type Action = ActionType<typeof receiveValues, Actions.receiveValues>;
-interface SettingsState {
- [key: string]: T.SettingValue;
-}
+type SettingsState = T.Dict<T.SettingValue>;
export interface State {
- components: { [component: string]: SettingsState };
+ components: T.Dict<SettingsState>;
global: SettingsState;
}
diff --git a/server/sonar-web/src/main/js/apps/settings/utils.ts b/server/sonar-web/src/main/js/apps/settings/utils.ts
index e52ce100c21..09484304223 100644
--- a/server/sonar-web/src/main/js/apps/settings/utils.ts
+++ b/server/sonar-web/src/main/js/apps/settings/utils.ts
@@ -98,7 +98,7 @@ export function getEmptyValue(item: T.SettingDefinition | T.SettingCategoryDefin
}
if (item.type === 'PROPERTY_SET') {
- const value: { [key: string]: string } = {};
+ const value: T.Dict<string> = {};
item.fields.forEach(field => (value[field.key] = getEmptyValue(field)));
return [value];
}
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/commands/BuildWrapper.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/commands/BuildWrapper.tsx
index bc8d5448966..829c09c02d6 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/commands/BuildWrapper.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/commands/BuildWrapper.tsx
@@ -26,7 +26,7 @@ interface Props {
os: string;
}
-const filenames: { [key: string]: string } = {
+const filenames: T.Dict<string> = {
win: 'build-wrapper-win-x86.zip',
linux: 'build-wrapper-linux-x86.zip',
mac: 'build-wrapper-macosx-x86.zip'
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/commands/ClangGCC.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/commands/ClangGCC.tsx
index e0b29454704..c36574af7d8 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/commands/ClangGCC.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/commands/ClangGCC.tsx
@@ -34,7 +34,7 @@ interface Props {
token: string;
}
-const executables: { [key: string]: string } = {
+const executables: T.Dict<string> = {
linux: 'build-wrapper-linux-x86-64',
win: 'build-wrapper-win-x86-64.exe',
mac: 'build-wrapper-macosx-x86'
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx
index db24f1d0ceb..071cdbf65e5 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx
@@ -87,7 +87,7 @@ export interface Props {
interface State {
component?: T.SourceViewerFile;
displayDuplications: boolean;
- duplicatedFiles?: { [ref: string]: T.DuplicatedFile };
+ duplicatedFiles?: T.Dict<T.DuplicatedFile>;
duplications?: T.Duplication[];
duplicationsByLine: { [line: number]: number[] };
hasSourcesAfter: boolean;
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
index 295ce16edc7..f35ea78319e 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
@@ -33,7 +33,7 @@ import { Alert } from '../../ui/Alert';
interface Props {
blocks: T.DuplicationBlock[];
branchLike: T.BranchLike | undefined;
- duplicatedFiles?: { [ref: string]: T.DuplicatedFile };
+ duplicatedFiles?: T.Dict<T.DuplicatedFile>;
inRemovedComponent: boolean;
onClose: () => void;
openComponent: WorkspaceContextShape['openComponent'];
diff --git a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
index 389b799d863..92c34ad59b6 100644
--- a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
+++ b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
@@ -33,7 +33,7 @@ import { separateFrontMatter, filterContent } from '../../helpers/markdown';
import { scrollToElement } from '../../helpers/scrolling';
interface Props {
- childProps?: { [k: string]: string };
+ childProps?: T.Dict<string>;
className?: string;
content: string | undefined;
displayH1?: boolean;
@@ -108,8 +108,8 @@ export default class DocMarkdownBlock extends React.PureComponent<Props> {
}
function withChildProps<P>(
- WrappedComponent: React.ComponentType<P & { customProps?: { [k: string]: any } }>,
- childProps?: { [k: string]: any }
+ WrappedComponent: React.ComponentType<P & { customProps?: T.Dict<any> }>,
+ childProps?: T.Dict<any>
) {
return function withChildProps(props: P) {
return <WrappedComponent customProps={childProps} {...props} />;
diff --git a/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx b/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx
index 42c421c8e72..bc818f68f69 100644
--- a/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx
+++ b/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx
@@ -28,7 +28,7 @@ interface Props {
children?: React.ReactNode;
// Use as `import(/* webpackMode: "eager" */ 'Docs/tooltips/foo/bar.md')`
doc: Promise<{ default: string }>;
- overlayProps?: { [k: string]: string };
+ overlayProps?: T.Dict<string>;
}
interface State {
diff --git a/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx b/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx
index 12b3fb9d054..f2ebad3840f 100644
--- a/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx
+++ b/server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx
@@ -23,7 +23,7 @@ import { forEach } from 'lodash';
import DetachIcon from '../icons-components/DetachIcon';
interface OwnProps {
- customProps?: { [k: string]: string };
+ customProps?: T.Dict<string>;
}
type Props = OwnProps & React.AnchorHTMLAttributes<HTMLAnchorElement>;
diff --git a/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx b/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx
index f52b6ab10bc..0845c888738 100644
--- a/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx
+++ b/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx
@@ -50,11 +50,11 @@ export interface Props<S> {
getFacetItemText: (item: string) => string;
getSearchResultKey: (result: S) => string;
getSearchResultText: (result: S) => string;
- loadSearchResultCount?: (result: S[]) => Promise<{ [x: string]: number }>;
+ loadSearchResultCount?: (result: S[]) => Promise<T.Dict<number>>;
maxInitialItems: number;
maxItems: number;
minSearchLength: number;
- onChange: (changes: { [x: string]: string | string[] }) => void;
+ onChange: (changes: T.Dict<string | string[]>) => void;
onClear?: () => void;
onItemClick?: (itemValue: string, multiple: boolean) => void;
onSearch: (query: string, page?: number) => Promise<SearchResponse<S>>;
@@ -66,7 +66,7 @@ export interface Props<S> {
renderSearchResult: (result: S, query: string) => React.ReactNode;
searchPlaceholder: string;
getSortedItems?: () => string[];
- stats: { [x: string]: number } | undefined;
+ stats: T.Dict<number> | undefined;
values: string[];
}
@@ -77,7 +77,7 @@ interface State<S> {
searchMaxResults?: boolean;
searchPaging?: T.Paging;
searchResults?: S[];
- searchResultsCounts: { [key: string]: number };
+ searchResultsCounts: T.Dict<number>;
showFullList: boolean;
}
diff --git a/server/sonar-web/src/main/js/components/icons-components/QualifierIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/QualifierIcon.tsx
index 5b4fa09cb07..84475054e9b 100644
--- a/server/sonar-web/src/main/js/components/icons-components/QualifierIcon.tsx
+++ b/server/sonar-web/src/main/js/components/icons-components/QualifierIcon.tsx
@@ -21,7 +21,7 @@ import * as React from 'react';
import Icon, { IconProps } from './Icon';
import * as theme from '../../app/theme';
-const qualifierIcons: { [x: string]: (props: IconProps) => React.ReactElement<any> } = {
+const qualifierIcons: T.Dict<(props: IconProps) => React.ReactElement<any>> = {
app: ApplicationIcon,
brc: SubProjectIcon,
dev: DeveloperIcon,
diff --git a/server/sonar-web/src/main/js/components/icons-components/SeverityIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/SeverityIcon.tsx
index a08be1b0e3e..2fc2a95def7 100644
--- a/server/sonar-web/src/main/js/components/icons-components/SeverityIcon.tsx
+++ b/server/sonar-web/src/main/js/components/icons-components/SeverityIcon.tsx
@@ -26,7 +26,7 @@ interface Props {
severity: string | null | undefined;
}
-const severityIcons: { [x: string]: (props: IconProps) => React.ReactElement<any> } = {
+const severityIcons: T.Dict<(props: IconProps) => React.ReactElement<any>> = {
blocker: BlockerSeverityIcon,
critical: CriticalSeverityIcon,
major: MajorSeverityIcon,
diff --git a/server/sonar-web/src/main/js/components/icons-components/StatusIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/StatusIcon.tsx
index cf96fe44b3b..a4d0e3bfcb9 100644
--- a/server/sonar-web/src/main/js/components/icons-components/StatusIcon.tsx
+++ b/server/sonar-web/src/main/js/components/icons-components/StatusIcon.tsx
@@ -26,7 +26,7 @@ interface Props {
status: string;
}
-const statusIcons: { [x: string]: (props: IconProps) => React.ReactElement<any> } = {
+const statusIcons: T.Dict<(props: IconProps) => React.ReactElement<any>> = {
open: OpenStatusIcon,
confirmed: ConfirmedStatusIcon,
reopened: ReopenedStatusIcon,
diff --git a/server/sonar-web/src/main/js/components/icons-components/TestStatusIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/TestStatusIcon.tsx
index 48f7925edbe..eb859471cfb 100644
--- a/server/sonar-web/src/main/js/components/icons-components/TestStatusIcon.tsx
+++ b/server/sonar-web/src/main/js/components/icons-components/TestStatusIcon.tsx
@@ -26,7 +26,7 @@ interface Props {
status: string;
}
-const statusIcons: { [x: string]: (props: IconProps) => React.ReactElement<any> } = {
+const statusIcons: T.Dict<(props: IconProps) => React.ReactElement<any>> = {
ok: OkTestStatusIcon,
failure: FailureTestStatusIcon,
error: ErrorTestStatusIcon,
diff --git a/server/sonar-web/src/main/js/components/measure/utils.ts b/server/sonar-web/src/main/js/components/measure/utils.ts
index 06be324ca14..d1067cdc40b 100644
--- a/server/sonar-web/src/main/js/components/measure/utils.ts
+++ b/server/sonar-web/src/main/js/components/measure/utils.ts
@@ -27,10 +27,7 @@ const KNOWN_RATINGS = [
'security_rating'
];
-export function enhanceMeasure(
- measure: T.Measure,
- metrics: { [key: string]: T.Metric }
-): T.MeasureEnhanced {
+export function enhanceMeasure(measure: T.Measure, metrics: T.Dict<T.Metric>): T.MeasureEnhanced {
return {
...measure,
metric: metrics[measure.metric],
diff --git a/server/sonar-web/src/main/js/components/preview-graph/PreviewGraph.tsx b/server/sonar-web/src/main/js/components/preview-graph/PreviewGraph.tsx
index 2709e650cb9..917bed05128 100644
--- a/server/sonar-web/src/main/js/components/preview-graph/PreviewGraph.tsx
+++ b/server/sonar-web/src/main/js/components/preview-graph/PreviewGraph.tsx
@@ -43,7 +43,7 @@ interface History {
interface Props {
branchLike?: T.BranchLike;
history?: History;
- metrics: { [key: string]: T.Metric };
+ metrics: T.Dict<T.Metric>;
project: string;
renderWhenEmpty?: () => React.ReactNode;
router: Pick<Router, 'push'>;
@@ -110,7 +110,7 @@ class PreviewGraph extends React.PureComponent<Props, State> {
history: History | undefined,
graph: string,
customMetrics: string[],
- metrics: { [x: string]: T.Metric }
+ metrics: T.Dict<T.Metric>
) => {
const myHistory = history;
if (!myHistory) {
diff --git a/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx b/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
index 0d69d1afa7c..62a52952146 100644
--- a/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
+++ b/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
@@ -47,7 +47,7 @@ const ISSUE_MEASURES = [
'new_vulnerabilities'
];
-const issueParamsPerMetric: { [key: string]: { [key: string]: string } } = {
+const issueParamsPerMetric: T.Dict<T.Dict<string>> = {
blocker_violations: { resolved: 'false', severities: 'BLOCKER' },
new_blocker_violations: { resolved: 'false', severities: 'BLOCKER' },
critical_violations: { resolved: 'false', severities: 'CRITICAL' },
@@ -85,7 +85,7 @@ export default class DrilldownLink extends React.PureComponent<Props> {
};
propsToIssueParams = () => {
- const params: { [key: string]: string | boolean } = {
+ const params: T.Dict<string | boolean> = {
...(issueParamsPerMetric[this.props.metric] || { resolved: 'false' })
};
diff --git a/server/sonar-web/src/main/js/components/workspace/WorkspaceRuleDetails.tsx b/server/sonar-web/src/main/js/components/workspace/WorkspaceRuleDetails.tsx
index 6560908b09a..159424d0b8c 100644
--- a/server/sonar-web/src/main/js/components/workspace/WorkspaceRuleDetails.tsx
+++ b/server/sonar-web/src/main/js/components/workspace/WorkspaceRuleDetails.tsx
@@ -35,7 +35,7 @@ interface Props {
interface State {
loading: boolean;
- referencedRepositories: { [repository: string]: { key: string; language: string; name: string } };
+ referencedRepositories: T.Dict<{ key: string; language: string; name: string }>;
ruleDetails?: T.RuleDetails;
}
diff --git a/server/sonar-web/src/main/js/helpers/cookies.ts b/server/sonar-web/src/main/js/helpers/cookies.ts
index 4d767b711b8..f170a2da925 100644
--- a/server/sonar-web/src/main/js/helpers/cookies.ts
+++ b/server/sonar-web/src/main/js/helpers/cookies.ts
@@ -20,9 +20,9 @@
import { memoize } from 'lodash';
const parseCookies = memoize(
- (documentCookie: string): { [key: string]: string } => {
+ (documentCookie: string): T.Dict<string> => {
const rawCookies = documentCookie.split('; ');
- const cookies: { [key: string]: string } = {};
+ const cookies: T.Dict<string> = {};
rawCookies.forEach(candidate => {
const [key, value] = candidate.split('=');
cookies[key] = value;
diff --git a/server/sonar-web/src/main/js/helpers/issues.ts b/server/sonar-web/src/main/js/helpers/issues.ts
index 221480a4302..3a2fe6696a2 100644
--- a/server/sonar-web/src/main/js/helpers/issues.ts
+++ b/server/sonar-web/src/main/js/helpers/issues.ts
@@ -64,12 +64,12 @@ export function sortBySeverity(issues: T.Issue[]): T.Issue[] {
}
function injectRelational(
- issue: { [x: string]: any },
+ issue: T.Dict<any>,
source: any[] | undefined,
baseField: string,
lookupField: string
) {
- const newFields: { [x: string]: any } = {};
+ const newFields: T.Dict<any> = {};
const baseValue = issue[baseField];
if (baseValue !== undefined && source !== undefined) {
const lookupValue = source.find(candidate => candidate[lookupField] === baseValue);
diff --git a/server/sonar-web/src/main/js/helpers/measures.ts b/server/sonar-web/src/main/js/helpers/measures.ts
index 36bdae7ed38..8f6443bb9be 100644
--- a/server/sonar-web/src/main/js/helpers/measures.ts
+++ b/server/sonar-web/src/main/js/helpers/measures.ts
@@ -93,7 +93,7 @@ function useFormatter(
}
function getFormatter(type: string): Formatter {
- const FORMATTERS: { [type: string]: Formatter } = {
+ const FORMATTERS: T.Dict<Formatter> = {
INT: intFormatter,
SHORT_INT: shortIntFormatter,
FLOAT: floatFormatter,
diff --git a/server/sonar-web/src/main/js/helpers/request.ts b/server/sonar-web/src/main/js/helpers/request.ts
index 29d4bb7aaff..5834fafbe28 100644
--- a/server/sonar-web/src/main/js/helpers/request.ts
+++ b/server/sonar-web/src/main/js/helpers/request.ts
@@ -41,16 +41,14 @@ export function getCSRFTokenValue(): string {
/**
* Return an object containing a special http request header used to prevent CSRF attacks.
*/
-export function getCSRFToken(): { [x: string]: string } {
+export function getCSRFToken(): T.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 interface RequestData {
- [x: string]: any;
-}
+export type RequestData = T.Dict<any>;
export function omitNil(obj: RequestData): RequestData {
return omitBy(obj, isNil);
diff --git a/server/sonar-web/src/main/js/helpers/strings.ts b/server/sonar-web/src/main/js/helpers/strings.ts
index 22e17c36b7f..27d4222c84d 100644
--- a/server/sonar-web/src/main/js/helpers/strings.ts
+++ b/server/sonar-web/src/main/js/helpers/strings.ts
@@ -393,7 +393,7 @@ const defaultDiacriticsRemovalap = [
}
];
-const diacriticsMap: { [x: string]: string } = {};
+const diacriticsMap: T.Dict<string> = {};
defaultDiacriticsRemovalap.forEach(defaultDiacritic =>
defaultDiacritic.letters.split('').forEach(letter => {
diacriticsMap[letter] = defaultDiacritic.base;
diff --git a/server/sonar-web/src/main/js/store/metrics.ts b/server/sonar-web/src/main/js/store/metrics.ts
index 8ba20a84bfe..95e3e96cd43 100644
--- a/server/sonar-web/src/main/js/store/metrics.ts
+++ b/server/sonar-web/src/main/js/store/metrics.ts
@@ -27,7 +27,7 @@ export function receiveMetrics(metrics: T.Metric[]) {
type Action = ActionType<typeof receiveMetrics, 'RECEIVE_METRICS'>;
-export type State = { byKey: { [key: string]: T.Metric }; keys: string[] };
+export type State = { byKey: T.Dict<T.Metric>; keys: string[] };
const byKey = (state: State['byKey'] = {}, action: Action) => {
if (action.type === 'RECEIVE_METRICS') {
diff --git a/server/sonar-web/src/main/js/store/organizations.ts b/server/sonar-web/src/main/js/store/organizations.ts
index 00709482c26..e1f870d23bd 100644
--- a/server/sonar-web/src/main/js/store/organizations.ts
+++ b/server/sonar-web/src/main/js/store/organizations.ts
@@ -32,7 +32,7 @@ type Action =
| ActionType<typeof deleteOrganization, 'DELETE_ORGANIZATION'>;
export interface State {
- byKey: { [key: string]: T.Organization };
+ byKey: T.Dict<T.Organization>;
my: string[];
}
diff --git a/server/sonar-web/src/main/js/store/users.ts b/server/sonar-web/src/main/js/store/users.ts
index 1a7601256c0..3075ff565bd 100644
--- a/server/sonar-web/src/main/js/store/users.ts
+++ b/server/sonar-web/src/main/js/store/users.ts
@@ -37,7 +37,7 @@ type Action =
| ActionType<typeof skipOnboardingAction, Actions.SkipOnboardingAction>;
export interface State {
- usersByLogin: { [login: string]: any };
+ usersByLogin: T.Dict<any>;
userLogins: string[];
currentUser: T.CurrentUser;
}