]> source.dussan.org Git - sonarqube.git/commitdiff
Introduce new T.Dict<T> type constructor
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Mon, 25 Mar 2019 10:29:23 +0000 (11:29 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 29 Mar 2019 08:44:57 +0000 (09:44 +0100)
142 files changed:
server/sonar-web/src/main/js/api/quality-profiles.ts
server/sonar-web/src/main/js/api/rules.ts
server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx
server/sonar-web/src/main/js/app/components/search/Search.tsx
server/sonar-web/src/main/js/app/components/search/SearchResult.tsx
server/sonar-web/src/main/js/app/types.d.ts
server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts
server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx
server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx
server/sonar-web/src/main/js/apps/code/bucket.ts
server/sonar-web/src/main/js/apps/code/components/App.tsx
server/sonar-web/src/main/js/apps/code/components/Components.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
server/sonar-web/src/main/js/apps/component-measures/components/App.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx
server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts
server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx
server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx
server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx
server/sonar-web/src/main/js/apps/component-measures/utils.ts
server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx
server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx
server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx
server/sonar-web/src/main/js/apps/issues/components/App.tsx
server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx
server/sonar-web/src/main/js/apps/issues/utils.ts
server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx
server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx
server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx
server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx
server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx
server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx
server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx
server/sonar-web/src/main/js/apps/permissions/utils.ts
server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx
server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx
server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx
server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx
server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx
server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx
server/sonar-web/src/main/js/apps/portfolio/types.ts
server/sonar-web/src/main/js/apps/portfolio/utils.ts
server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx
server/sonar-web/src/main/js/apps/projectActivity/utils.ts
server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx
server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx
server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx
server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx
server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx
server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
server/sonar-web/src/main/js/apps/projects/query.ts
server/sonar-web/src/main/js/apps/projects/types.ts
server/sonar-web/src/main/js/apps/projects/utils.ts
server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx
server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangesList.tsx
server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/HomeContainer.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx
server/sonar-web/src/main/js/apps/quality-profiles/types.ts
server/sonar-web/src/main/js/apps/securityReports/components/VulnerabilityList.tsx
server/sonar-web/src/main/js/apps/securityReports/utils.ts
server/sonar-web/src/main/js/apps/settings/store/definitions.ts
server/sonar-web/src/main/js/apps/settings/store/settingsPage.ts
server/sonar-web/src/main/js/apps/settings/store/values.ts
server/sonar-web/src/main/js/apps/settings/utils.ts
server/sonar-web/src/main/js/apps/tutorials/components/commands/BuildWrapper.tsx
server/sonar-web/src/main/js/apps/tutorials/components/commands/ClangGCC.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
server/sonar-web/src/main/js/components/docs/DocTooltip.tsx
server/sonar-web/src/main/js/components/docs/DocTooltipLink.tsx
server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx
server/sonar-web/src/main/js/components/icons-components/QualifierIcon.tsx
server/sonar-web/src/main/js/components/icons-components/SeverityIcon.tsx
server/sonar-web/src/main/js/components/icons-components/StatusIcon.tsx
server/sonar-web/src/main/js/components/icons-components/TestStatusIcon.tsx
server/sonar-web/src/main/js/components/measure/utils.ts
server/sonar-web/src/main/js/components/preview-graph/PreviewGraph.tsx
server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
server/sonar-web/src/main/js/components/workspace/WorkspaceRuleDetails.tsx
server/sonar-web/src/main/js/helpers/cookies.ts
server/sonar-web/src/main/js/helpers/issues.ts
server/sonar-web/src/main/js/helpers/measures.ts
server/sonar-web/src/main/js/helpers/request.ts
server/sonar-web/src/main/js/helpers/strings.ts
server/sonar-web/src/main/js/store/metrics.ts
server/sonar-web/src/main/js/store/organizations.ts
server/sonar-web/src/main/js/store/users.ts

index 2002c06c65a31a63da40ab874edc1a9ea63f3b4a..a7c6b3f1f2ad9799309b805721cd36858f08f359 100644 (file)
@@ -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;
index 8ea8821b574ec4e7acb2f3cf8ca1a0040aae306f..60b45746e32afcbe03a422bd317d25134e38af69 100644 (file)
@@ -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;
index 61610c62902aa3c4feccac4fc31c6c679cbc36d4..4e119d95eac070f3c3ccc153de3fb739ca3334af 100644 (file)
@@ -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[];
index 8fa9aa71747615c00dc8daf5a3a1bad76bbb5b4d..9d35899833500d09bcab1811b65c3a3fa33e4b47 100644 (file)
@@ -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) {
index b68ebdceeb4be77d680430ed6ec6a3fc224ec7d3..5ffab5ec6a42c0b3acde37534df8bdee3c48e0cb 100644 (file)
@@ -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;
 }
 
index 24d8101430802c79e2e4d27ccd2f766bce54dc1f..16d74f126c0cfb13d45c983696a9812674227839 100644 (file)
@@ -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;
index 21fb3d0c52b4a51c68bf2ec1aadb462218698cf0..adf94c2d84a5d54585354b9b3687badd5db1f73e 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-const extensions: { [key: string]: Function } = {};
+const extensions: T.Dict<Function> = {};
 
 const registerExtension = (key: string, start: Function) => {
   extensions[key] = start;
index 4e93eb52bac8a46a1f53e44931076bad403054c9..7c35f893d3a53af1258e5380304c7356ecdcf57f 100644 (file)
@@ -55,7 +55,7 @@ interface Props {
 }
 
 interface State {
-  issueTypes?: { [key: string]: { count: number } };
+  issueTypes?: T.Dict<{ count: number }>;
   loading: boolean;
   projectsCount: number;
 }
index 56683108cfee474ed3ee46448f7f28c92a5f413a..5c116e1566509b00c807cf3443c3e7924f7221b0 100644 (file)
@@ -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[];
index a005027ac3551c13581d58a97a2a473fe74af566..aba36f31d4ab8da2cbb87c79d10fa4facc594424 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-let bucket: { [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;
index 10b3fc083495145e993363b02e86d38c2aa4134c..1c030f377a281483a6ebe3dd783f364a80e7912c 100644 (file)
@@ -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 {
index 7fd2c4f50c32eb4991e4ae4bb0d055b3d00ec347..b83e015aae5cd243a2f9dd96b7cc109adc56b237 100644 (file)
@@ -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;
 }
index 50b5cce46333815a5a1dfc5f711331bcf40f1ff4..d5264e69c5dcc79c4c6b4ba985e779ee5b00ccc4 100644 (file)
@@ -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 || '';
index 36230f89c60640cff7c26e8a44a1208efdb43021..0ae3109d4a05d4a7ecfa5784bd41068ae037a98f 100644 (file)
@@ -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;
     }
index ca6a67e23457879daff59b194fedf88d18725396..508c9bfc6210a47c4736d7dd893853af93a42ff6 100644 (file)
@@ -29,7 +29,7 @@ interface Props {
   languages: T.Languages;
   organization: string | undefined;
   query: Query;
-  referencedProfiles: { [profile: string]: Profile };
+  referencedProfiles: T.Dict<Profile>;
   total: number;
 }
 
index b6bf6c9d4ec857929fbe8e8be1dd248cc5931d57..a7df07d3130e4777e8893f4f77d2cb7c3c4c6b5d 100644 (file)
@@ -34,7 +34,7 @@ interface Props {
   organization: string | undefined;
   profile?: Profile;
   query: Query;
-  referencedProfiles: { [profile: string]: Profile };
+  referencedProfiles: T.Dict<Profile>;
   total: number;
 }
 
index c97036fd75a0c513c0d45d71f563c8a740ee390b..0ce7a3cab5951b151a257652ea80408c393cb86f 100644 (file)
@@ -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 || '';
index fb0386b422df960ff16db849399e58e8cccd053a..a39e77d239861ba63a6dee655cd111fdf4cee9d9 100644 (file)
@@ -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[];
 }
 
index 7d92e5133bc668b4ea73cdc58bb004bf25c5c008..b934ab4a1f7f6e06b96804f37786081b582d6611 100644 (file)
@@ -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;
 }
 
index afc1f06cfbc0ed8b4cc115ca60186c681eee081d..2e15cea1b9ca0d22853106f404e88da783555385 100644 (file)
@@ -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;
 }
 
index 5a51cedf82c94c05bb596a9f7697059b0429ee68..e3f82deade20b6c032919d9c815adb70872ec54e 100644 (file)
@@ -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> {
index 276be9e6f2c441c53f55821fd671d4d920b6112a..b56478416fef5bddd9c872114c75001e1682e289 100644 (file)
@@ -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;
 }
index 78ef447f8b715cd01f9668c797b783c9d98c9d3a..4e9b534f34c79256faaf3f6a4b807d3d79d8c683 100644 (file)
@@ -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;
 }
 
index 29f4de18cba36571d3f6863bdb81052115738e9f..f112a6edd954aa3872ba2e63266fe84b3f92fd00 100644 (file)
@@ -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;
 }
 
index 0603e1a269bd65ec8ed97c7bcf7880bd6b510792..c55fae9ab8c01064976af8b881ac234e583fedb9 100644 (file)
@@ -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> {
index 80920d1895e5717c8f765e98eb8b291c0e19b392..e47aaf7ac348a56b1db7bd9c6ce0bb2eb390fdb6 100644 (file)
@@ -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;
index 3cd2bbd362c4f09f31bb95a86c06e0b37718ebda..d8b3a9c5075ced20aa4e30b24613cb53e64eb8dd 100644 (file)
@@ -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;
 }
 
index af26325e68a4c20b7ef5a5ed628879cfcd6b3433..4808cc2174147be9f4c54a868f875016cac0a0fa 100644 (file)
@@ -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;
index 349638f97eb5c662e06395d0c96c6ed7b1443b14..3f1795e0b9f36837577998e863239fbfb85520e2 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-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'],
index 83cd304c288a057d96a86783e9e0ea0302f6e5f2..16ff032dbb4d70fe136a48fd275216ae4a8677e0 100644 (file)
@@ -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;
 }
 
index 21777417bec9435992712edc8694d42deb99cb7f..877ea41f70e96abe27d1f6e8c4a792be6a22ec31 100644 (file)
@@ -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;
index 3a2f52bd98f8e575af4e2b1abb96da9e114e115b..52fc3caa4b1effe6e0b97b0fd2d43b3f6ea3aef5 100644 (file)
@@ -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;
index ef78ac7809ee9070306ac2cc4ed177b2c618e18b..f72dd25d0b58aea10804f6625fff0ef36ae18d07 100644 (file)
@@ -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) {
index b28a82613cc70e40ee37d15cfe8d539a1fd25cdc..8efbde6ded041300b963faf064eb720979536630 100644 (file)
@@ -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],
index a94edf14f9941da2a5a2a04c4de9902f92f42fca..6451e98e024e75587014e99f86ec53665e527d39 100644 (file)
@@ -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;
index 57083fa5021b54c68ea51d03ee3dae0048ca5b71..613616375b1b78ea5c7f98518832e0d413f8dc80 100644 (file)
@@ -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;
index fc70715270b87775f95e62a9080243d14a8788d7..e2db1c0bf6bffb5e67d3328fc55146f4f0f48761 100644 (file)
@@ -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;
 
index 632211d2af704f4a586d61ca6b50b442d985c707..8e079deebbe2c7a49e0ab5bbfd2ff773b4b0991a 100644 (file)
@@ -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;
index 5082742f98084b443d0d37c0f43d988b3192bf03..744a1552a6cbfa9a0f8419ded3d8f0baa954ed51 100644 (file)
@@ -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 => {
index add1d6e1cc814f0faeb623008291ce0d760191d3..ba19f5264f835d996528f59efbbab391f62ae6dd 100644 (file)
@@ -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> {
index c1576a95fb0b3739d2a2d55a9d390a48b3a72e2e..02e0da6331d0ae424250c382dd0dd3b4c6ecf4b8 100644 (file)
@@ -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[];
 }
 
index 256fafa9afc510095b78b4b1768a63745143c700..ba6b59c2df95903f7a00df7a7334e75c753412f0 100644 (file)
@@ -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> {
index c210ec54e6eabad052557f303843860649d1a2ea..c605a2bf106bbd06bd212c81fbf6324d6fa50082 100644 (file)
@@ -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> {
index b36e6ac47b46e4dbb946ffe05f0f2fac0ba9215f..92b10e4399d1ba6b497502b48f935590e3c7c229 100644 (file)
@@ -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> {
index 0b77a39c9809ccfaa7fe846adfeee87ac97b1391..1fc34ff91bed63c50e857e0c701158af3688f7b6 100644 (file)
@@ -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> {
index f9bb06a221dcb16a04ab5b19c08f6501de0fc87d..5b3146700348652e383fbabaae2e0f87a30b154a 100644 (file)
@@ -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 {
index 6dadfe235b3857184454fe5c7c4702b66a7af524..5e069b27e14a9fc0985763ec08cdbdf174de952a 100644 (file)
@@ -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'];
index 5ab823fe6a7c2e58c50febc0baab09ea0cb285c7..599b401951a6dca8227f67d183501f1e4470edfd 100644 (file)
@@ -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> {
index b8055caa5ffe2c127d9db781ef55e0fe3c3f8eef..4bd9b25755ab085bfddb56b68ccd1b4a3d3f2c3c 100644 (file)
@@ -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'];
index f401c1ee99ca88e04a42135f0cb0141af2532af2..c40f1889559f2928f56dee26338b3d5f7ea530e8 100644 (file)
@@ -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> {
index cee06f90ec278fe0158322d5326843d12b8dcdb4..534482898a9a55e0c297ba4170db0253ec38aad4 100644 (file)
@@ -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 {
index 07b0087532fad3c79b7ab03cf8164062831580e5..03d6864947a1bb3f4aeeea7edc6d3643c4e76b45 100644 (file)
@@ -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[];
 }
 
index 0b0afc552e02e1780a19315f39c1cf8fe9ff856b..682485997bc743b8124e4f87b0842846d1d98de7 100644 (file)
@@ -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[];
 }
 
index f20673e9341c004c2e4d17b8ad5711e7f57b4e40..f315d310387a3903e2c5e8963dbe557156a3205a 100644 (file)
@@ -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[];
 }
 
index 1f5e3e31e03e112b42f3253e3934666f9d45d225..528be4778af587268e032b8c304418fdb49c6c5d 100644 (file)
@@ -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 => {
index 1bc300691ad5794781a86c9c74f217b15c2b8fa7..fbc68ce2d8f2edb88c025342e2fa46fc76937b49 100644 (file)
@@ -39,7 +39,7 @@ interface Props {
 }
 
 interface State {
-  userGroups?: { [k: string]: UserGroup & { status?: string } };
+  userGroups?: T.Dict<UserGroup & { status?: string }>;
   loading?: boolean;
 }
 
index 431262cd3a95cfd635ed7cead4630f9a80c28ad8..4eab0d0de2b29f9af222e6ba85a0cb3b28278378 100644 (file)
@@ -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;
 }
 
index d2ae576f6362a540f2990319ad5158da4f59fe75..d0b351ff7998493349b8ef7b0a091cda3ee4283f 100644 (file)
@@ -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;
index 214645981c1f7b01aed0673f2985f485cda0052c..3f4bf8d33ce33b9013baeb3df3d79d8572d0d6d2 100644 (file)
@@ -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;
 }
index 5969ecc588f6f93936fa2ccc076cfa82dae5f841..59c6ff4fefd38cd274fa548c5d55706f954a7b95 100644 (file)
@@ -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),
index 37ebc13ca01f719a00d7d7828952f735a6cf8b25..c21b0dc01b859497eb0614821daff4d48b2c1259 100644 (file)
@@ -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;
 }
 
index bcd1bccf8e533286b520ac2975abeb45067c453e..709754c92b08ccc702dd079634902986d44ea69b 100644 (file)
@@ -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;
 }
 
index 808be87db1d843f89e50dadd2ad4e43628333c9e..f5e666d5b879b3612fe24c8499f8fac29136b89f 100644 (file)
@@ -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;
index a0037f4684adfa6219bc029d27adfe8a4b163343..7af63eba6fb5df9de1643a7f6d427ddd696587df 100644 (file)
@@ -33,7 +33,7 @@ interface Props {
 
 type State = {
   loading: boolean;
-  metrics?: { [key: string]: T.Metric };
+  metrics?: T.Dict<T.Metric>;
   projects?: ApplicationProject[];
   status?: string;
 };
index a865777e0abc8a42e450846e683b0dcccaf2ea87..07c44a3474156e23f250a328e5c7b4485d870dea 100644 (file)
@@ -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;
 }
 
index 693d5739e1c7e38929b11e0aea09077fbe6c52d6..c02add35b604622b72b81fbc1d642df6cb6bff90 100644 (file)
@@ -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],
index 05c510aaf58a43d3a3cb7ac5eca4eafa7184d556..5ad0b29ba3bb1d3d4ac1c00c15d06ab17d11915c 100644 (file)
@@ -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: {} };
index d2c1ea6ad750ba57f87f98e338b1fcb75f861d80..4f44cdb3f2598fee3ccb78c8ba91de391a7c998a 100644 (file)
@@ -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,
index 93a9f377231514bad7fdaaa7e7cc5d7cc1f708e7..4e08fb2e46fb0136db630f63b650f58a47901c5d 100644 (file)
@@ -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),
index e53553217eee44ade5afc09e647d226f26b07817..7c18623172a82c530690bcbf52033d5d800dcf26 100644 (file)
@@ -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;
 }
index 3a16b6816764fb49e0ace571eb79cdeaba3def69..29c58da3fea14ccfcf4c80749cf6a17a85c40a8a 100644 (file)
@@ -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) {
index 896e030def6ab7a0d56f106643d0c33ed1cd9d03..fdffce0d3dc2eb574c1f635c73d5906113278ff7 100644 (file)
@@ -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) {
index c1988e2f6892de06e5e81760ab008612e4afdb62..2e2c1893d117f9031f57512d412c418e6cb6e2e0 100644 (file)
@@ -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) {
index e4b9f861d88fda291bfeb075efcec13f08960957..b8101d7f8f9c757ea8096217407d9a822cd1fa06 100644 (file)
@@ -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) {
index 8005fce9b96e485749146d5825518d7e402f7d46..b396276a0033eaa39ee5b2738aab391b7348f9f3 100644 (file)
@@ -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) {
index 96f0daa134b24862023214b3927187c977632fe8..2d9f11e89df0b49c3abbf8e98601b65690f4a4a1 100644 (file)
@@ -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 (
index 45de85de01ff826e6f31e173360af975f656712b..496ed85db50e98a6c28c7160cf9e06dc0f21afd0 100644 (file)
@@ -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;
index 8d219ac5953fe9c21cee6e388d962b0296c49049..f3d76eeab2eb63c055cb2c3d05946cedccc37671 100644 (file)
@@ -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;
   });
index 07a28ff5f70201559bcd7d59e0ed89fe19da3011..c99cb17974132249ceeb28f735603f1df3092f0d 100644 (file)
@@ -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'
index fbb551988d6002c282636a984cba01f3fddb5179..85653d2319d0283476f610330d492e3a7fddecee 100644 (file)
@@ -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;
 }
index c91d412a6a4524f3ef24789eeba275a45863b00c..81fe78f56d6583f672c8029dd26558d23704fbdc 100644 (file)
@@ -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) {
index c5f201a76d9a23c8c86068160222f9249a11b1cd..821257cb266bcc0573dddb5c9159ed9d2b5747b3 100644 (file)
@@ -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) {
index bbaf688eb5f31e26fa5063ba1cc5e455fb3a94af..cc2b9b8683bf8c6894c3eedc6f69f54f4d6e2311 100644 (file)
@@ -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;
 }
 
index dbb7252ef81da52ad130e71c937aef41fa622dd2..d0d16e754edde2feb3e7af31a3064de8409b78c5 100644 (file)
@@ -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;
 }
 
index a1316915e15595505e9f0b527dde859102d9c782..f5d9ddf3a35b64214bfa7940e8f74e66fa636f4d 100644 (file)
@@ -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[];
index 3aeb23e4e66acd63b2dc0ecea13fd21875400f89..71592f4d272842a3c742919dba26b5a0ac25eb22 100644 (file)
@@ -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;
 }
 
index 52be2d5df6b7c758d678669293fdec09a890899f..aeba3067a00261bb19a3c16ac02f64e44c2b6c27 100644 (file)
@@ -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[];
 }
 
index 8ef4a9c93dab651f38d03159c0d32e9a9cba4643..39cfebbc357008d3af3d403d1b66a59eb6b2579e 100644 (file)
@@ -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;
 }
 
index e4abe096478309195d26c9b373f6a2187709a6ef..a3550fa8e7015d812c35370499834edcb217bb82 100644 (file)
@@ -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;
 }
 
index d59f5a75112f2a76e0dcc53defe141b1640deb20..fc4a94a38e8bdf23e514c6f82409efdf4b5280a7 100644 (file)
@@ -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;
 }
 
index e2e00e1d1dc4edd62aca2233279595e023f2a2a6..5646371d4b590bfbc8b6da8ccb1e7baa3e48610a 100644 (file)
@@ -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;
 }
 
index 527592cd4205b4de96f1603fa6a33286d46791b4..a1765c4fee8ca755c8075fe7f09e9bbda6ca4f44 100644 (file)
@@ -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;
 }
 
index 3b8f6c5fff8d78c528d7657f209a976b4ee4014b..7fa456cadc380e220567a825a5e9dfdf749863b5 100644 (file)
@@ -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;
 }
 
index 9236cdeba846d878b589122f507ea364ef06ebf8..a8a0c354fc26653180859d03cb826e49c8d260d7 100644 (file)
@@ -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;
 }
 
index 9b748bfe66ae9289b49ad9ff5620e649c79906c2..1348341fc7f153e0f3f39f9737a9fc442fc6abd3 100644 (file)
@@ -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> {
index a0459e9d8e2c9b388e160c063319d674f6b7a1e2..5c70922ae347745c6c06a52c2c88fdf32ad59cec 100644 (file)
@@ -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;
 }
 
index f3c93b6c251c5362f45dc0bda285554030ed9d14..9b19c58e26a731321b393e3e9a906395792c2beb 100644 (file)
@@ -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;
 }
 
index 18032d0c6c4d8a2d27b6ca1596514812b07ab4e1..2b1be5918cc9bbe904976aa78a85ac26b0f18c38 100644 (file)
@@ -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[];
 }
 
index 68dfdb7a63ea818059e638bd7fadd98665c4d00e..33adc5cd0969d15cc59db5e02deb72d2b1ddc127 100644 (file)
@@ -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',
index d841caf3c968409530d3019e7b9864fc3aa9c426..183106c84e2914164317f6e2248448e68d07a284 100644 (file)
@@ -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[];
index 256c21ef866747046f11e217c265eed33d50e807..3971132c87ff6590030d5f869a7d6e51ec62dfd8 100644 (file)
@@ -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',
index 8d3c81f9e34bbdf1eb0d6a0db07090716b88ad36..153c74fd54b57b9970d33a6696b35139c8dd7644 100644 (file)
@@ -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,
index 6dae3053fc340bee7795f40a6f5fa211acb6a30c..be63b21b25175fd803562361df4e32fa8e26f258 100644 (file)
@@ -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;
index fb9a7580e8ca667580955e65a3a692c486fdd480..614f6ddeceade904a13fe31397729b153ae4a2ec 100644 (file)
@@ -37,7 +37,7 @@ interface OwnProps {
 }
 
 interface StateToProps {
-  metrics: { [key: string]: T.Metric };
+  metrics: T.Dict<T.Metric>;
 }
 
 interface DispatchToProps {
index a6083c473f8881fb29fcae0e40bf06725d29c201..b420ada7a14b3d9180846293400a42d1be46652a 100644 (file)
@@ -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;
index acbb45c981d6b8a555e9e2cd62ebc73b61a348ff..2f27ed4c65d1ec83412bd27312e584fe6722b7e2 100644 (file)
@@ -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) {
index bbb8269caad83baacc872100ddf16bb806a917b1..34a3e6f7f67dacccb534cccb452e4738efe67d77 100644 (file)
@@ -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;
index bb6692db7fe2f1f40dbad1400a09e3e1ade6c84f..b9060b042c0a5fb1c639dfd7077fd09ba70ed452 100644 (file)
@@ -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;
index 3bea7a17198cde1467ba8c94747181a69aed9d1b..b0c46e36abe8f172b9c33ea6a20e5c4fd334e65e 100644 (file)
@@ -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 };
index cb09d54819ab45d48f0a81eb0aa27d34a8c581a0..defe270b574cbd196ab5e96ce554773e27c85161 100644 (file)
@@ -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>;
index ca4b28b4595116ab2c6cb998af6f9e8bdbbad922..9a50bcfca9a6a4b94301ebac6de9c17c6f422cc8 100644 (file)
@@ -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
     );
index 2fdcdb9d80e9544fc7e3a8d1e4eda39eed83b5de..70e522f9bb7b56cae9ace59293b7c4c467043c1c 100644 (file)
@@ -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;
 }
index 61571b8a565ece4b68ce64079623c9617ad78ae6..95dc4630e29f6b4d1a5405ec0c32e597a8246264 100755 (executable)
@@ -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'
     };
index e9394d7edc32cc71c591ccd0445887875c4efddf..023f7f76dbaa98220d1873b603cd9e5d311d09a2 100755 (executable)
@@ -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(
index f0054d4af1743a620eda97ca53103a2720d408ec..4eccf0d7a9a2f092a8c9e7758d66198f1811ad91 100644 (file)
@@ -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 };
index 703da03714a15ac7f29cd9a6647c1bf23ea6084c..cc672c28fb6a0d331e584541f010ecc00736ea0a 100644 (file)
@@ -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) {
index d92ae47d7392ce8bdb02e6c523e6cf774771b9c2..7dfeb996fc17aa771046c26037d38ce56944c78c 100644 (file)
@@ -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;
 }
 
index e52ce100c21b2237d308b50605f8aeae7ff81314..09484304223eecb6646598dd8272e3bbf11def76 100644 (file)
@@ -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];
     }
index bc8d544896669ffba494c0de737392cc0f7e1f60..829c09c02d6ac75076e84555f2a0f96f884343f9 100644 (file)
@@ -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'
index e0b29454704dec56e467c80c49c715db6cf6a8eb..c36574af7d82b512a761378a0c84f778a8b3c9f9 100644 (file)
@@ -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'
index db24f1d0ceb4304f0db3baaf54c2369383fea373..071cdbf65e5b29dc1629c83af30fc86f7b5d5e3d 100644 (file)
@@ -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;
index 295ce16edc75dc83463a44b035209c9d6209ba46..f35ea78319e14f7d7d213bd2c883adb704f91e06 100644 (file)
@@ -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'];
index 389b799d863e383d4ffb420c243f9450445318c6..92c34ad59b64962ea04c21b21ff25951abe2a6b0 100644 (file)
@@ -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} />;
index 42c421c8e72ca6bb7851f08385e5b5b72f22ffce..bc818f68f6992f0cf1f1396c02efbf33ed6eb1ce 100644 (file)
@@ -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 {
index 12b3fb9d05481568e176ecb742a76c7cac719c1e..f2ebad3840f49ed05857be19bad05472320e43e9 100644 (file)
@@ -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>;
index f52b6ab10bccf3c5b5f815cd82ad109ccce1edb3..0845c888738815544fd5de37cd30d6afc6149762 100644 (file)
@@ -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;
 }
 
index 5b4fa09cb07cc3469308727179e60afead1aaf64..84475054e9bb822cc53befffcf6ee7ff4a4e51e8 100644 (file)
@@ -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,
index a08be1b0e3ed804132035fdd8a8eebb19c47bdca..2fc2a95def730305a57a5f16fefd6d0fefa0b557 100644 (file)
@@ -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,
index cf96fe44b3b62fdf5276031d538532136e67eb4a..a4d0e3bfcb9e683b9158bd45040e58eb7f017f1a 100644 (file)
@@ -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,
index 48f7925edbe7599a412f2b18d9a92b5cc3782f5e..eb859471cfbd0a4259aea1a25bbdf9fdf6446ade 100644 (file)
@@ -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,
index 06be324ca14e177568890e20b82ddd68836403d2..d1067cdc40b03eea114e8649dad60ac9517b2018 100644 (file)
@@ -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],
index 2709e650cb9e9151735d2cde8562f345bb045b35..917bed05128bc1cc2575635eeab835c23253a438 100644 (file)
@@ -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) {
index 0d69d1afa7cfd62536de19a93eab3c17d601d171..62a529521468fe2a59079984a1ba94b4b8499132 100644 (file)
@@ -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' })
     };
 
index 6560908b09a0465b9611760910b52c84e82d0c01..159424d0b8c746db11aa3d3deed2d71fed8ab579 100644 (file)
@@ -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;
 }
 
index 4d767b711b8aed5f0b42933c0a96cf081b11169b..f170a2da925f2f5e74f3e9bbc700a03ef475406f 100644 (file)
@@ -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;
index 221480a43027d8cf2be3751a6df5c7c7b62c4609..3a2fe6696a2db3114cfc6dbba6d33f3b18de4e8b 100644 (file)
@@ -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);
index 36bdae7ed38438ef85cb0a9e9ea72d4f3dcd796b..8f6443bb9beaf24009b3903f93a81b6b3c3b4325 100644 (file)
@@ -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,
index 29d4bb7aaffb559bef48d9356bd07fd7481adffc..5834fafbe28596a6f72128c981d477ab0b86239b 100644 (file)
@@ -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);
index 22e17c36b7ffb8987aef71759e146dcfcf855606..27d4222c84d7bd11034ce9b9877c09265452325e 100644 (file)
@@ -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;
index 8ba20a84bfe941543265fabad8396ec7c1e96c25..95e3e96cd4325fa26a06ff8b03ee2eb9f839cefd 100644 (file)
@@ -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') {
index 00709482c26aa5c59a78b3fb828a225a2ce26d9f..e1f870d23bd7468db3a211310b9fbdea3d8fb916 100644 (file)
@@ -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[];
 }
 
index 1a7601256c0b9fba2e631fce2219ec11a75a52b3..3075ff565bd5f42c4bd2920845830fa5df1894d1 100644 (file)
@@ -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;
 }