Bladeren bron

Introduce new T.Dict<T> type constructor

tags/7.8
Wouter Admiraal 5 jaren geleden
bovenliggende
commit
10cb25f0f8
100 gewijzigde bestanden met toevoegingen van 164 en 174 verwijderingen
  1. 3
    3
      server/sonar-web/src/main/js/api/quality-profiles.ts
  2. 1
    1
      server/sonar-web/src/main/js/api/rules.ts
  3. 1
    3
      server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx
  4. 3
    3
      server/sonar-web/src/main/js/app/components/search/Search.tsx
  5. 2
    2
      server/sonar-web/src/main/js/app/components/search/SearchResult.tsx
  6. 6
    6
      server/sonar-web/src/main/js/app/types.d.ts
  7. 1
    1
      server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts
  8. 1
    1
      server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx
  9. 1
    1
      server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx
  10. 7
    9
      server/sonar-web/src/main/js/apps/code/bucket.ts
  11. 1
    1
      server/sonar-web/src/main/js/apps/code/components/App.tsx
  12. 1
    1
      server/sonar-web/src/main/js/apps/code/components/Components.tsx
  13. 2
    2
      server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
  14. 4
    4
      server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
  15. 1
    1
      server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
  16. 1
    1
      server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
  17. 2
    2
      server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
  18. 2
    2
      server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx
  19. 2
    2
      server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
  20. 1
    1
      server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx
  21. 2
    2
      server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx
  22. 2
    2
      server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
  23. 1
    1
      server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx
  24. 1
    1
      server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
  25. 1
    1
      server/sonar-web/src/main/js/apps/component-measures/components/App.tsx
  26. 1
    1
      server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
  27. 2
    2
      server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
  28. 1
    1
      server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx
  29. 1
    1
      server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts
  30. 1
    1
      server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx
  31. 1
    1
      server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx
  32. 1
    1
      server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx
  33. 2
    5
      server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx
  34. 3
    6
      server/sonar-web/src/main/js/apps/component-measures/utils.ts
  35. 1
    1
      server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx
  36. 1
    1
      server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx
  37. 1
    1
      server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx
  38. 8
    8
      server/sonar-web/src/main/js/apps/issues/components/App.tsx
  39. 1
    1
      server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx
  40. 2
    2
      server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx
  41. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx
  42. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx
  43. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx
  44. 2
    2
      server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx
  45. 2
    2
      server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx
  46. 2
    2
      server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx
  47. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx
  48. 2
    2
      server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx
  49. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
  50. 8
    8
      server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
  51. 3
    3
      server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx
  52. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx
  53. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx
  54. 1
    1
      server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx
  55. 4
    4
      server/sonar-web/src/main/js/apps/issues/utils.ts
  56. 1
    1
      server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx
  57. 1
    1
      server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx
  58. 1
    1
      server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
  59. 1
    1
      server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx
  60. 2
    2
      server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
  61. 1
    1
      server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
  62. 1
    1
      server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx
  63. 2
    2
      server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
  64. 1
    1
      server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
  65. 1
    1
      server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx
  66. 3
    3
      server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx
  67. 1
    1
      server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx
  68. 1
    1
      server/sonar-web/src/main/js/apps/permissions/utils.ts
  69. 2
    2
      server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
  70. 2
    2
      server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
  71. 1
    1
      server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx
  72. 1
    1
      server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx
  73. 1
    1
      server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx
  74. 1
    1
      server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx
  75. 1
    1
      server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx
  76. 2
    2
      server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx
  77. 1
    1
      server/sonar-web/src/main/js/apps/portfolio/types.ts
  78. 2
    2
      server/sonar-web/src/main/js/apps/portfolio/utils.ts
  79. 1
    1
      server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx
  80. 5
    5
      server/sonar-web/src/main/js/apps/projectActivity/utils.ts
  81. 1
    1
      server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx
  82. 1
    1
      server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx
  83. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx
  84. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx
  85. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx
  86. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx
  87. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx
  88. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx
  89. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx
  90. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx
  91. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx
  92. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx
  93. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx
  94. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx
  95. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx
  96. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx
  97. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx
  98. 1
    1
      server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
  99. 1
    1
      server/sonar-web/src/main/js/apps/projects/query.ts
  100. 0
    0
      server/sonar-web/src/main/js/apps/projects/types.ts

+ 3
- 3
server/sonar-web/src/main/js/api/quality-profiles.ts Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/api/rules.ts Bestand weergeven

@@ -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;

+ 1
- 3
server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx Bestand weergeven

@@ -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[];

+ 3
- 3
server/sonar-web/src/main/js/app/components/search/Search.tsx Bestand weergeven

@@ -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) {

+ 2
- 2
server/sonar-web/src/main/js/app/components/search/SearchResult.tsx Bestand weergeven

@@ -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;
}


+ 6
- 6
server/sonar-web/src/main/js/app/types.d.ts Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/app/utils/installExtensionsHandler.ts Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx Bestand weergeven

@@ -55,7 +55,7 @@ interface Props {
}

interface State {
issueTypes?: { [key: string]: { count: number } };
issueTypes?: T.Dict<{ count: number }>;
loading: boolean;
projectsCount: number;
}

+ 1
- 1
server/sonar-web/src/main/js/apps/account/notifications/Projects.tsx Bestand weergeven

@@ -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[];

+ 7
- 9
server/sonar-web/src/main/js/apps/code/bucket.ts Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/code/components/App.tsx Bestand weergeven

@@ -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 {

+ 1
- 1
server/sonar-web/src/main/js/apps/code/components/Components.tsx Bestand weergeven

@@ -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;
}

+ 2
- 2
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx Bestand weergeven

@@ -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 || '';

+ 4
- 4
server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx Bestand weergeven

@@ -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;
}

+ 1
- 1
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx Bestand weergeven

@@ -29,7 +29,7 @@ interface Props {
languages: T.Languages;
organization: string | undefined;
query: Query;
referencedProfiles: { [profile: string]: Profile };
referencedProfiles: T.Dict<Profile>;
total: number;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx Bestand weergeven

@@ -34,7 +34,7 @@ interface Props {
organization: string | undefined;
profile?: Profile;
query: Query;
referencedProfiles: { [profile: string]: Profile };
referencedProfiles: T.Dict<Profile>;
total: number;
}


+ 2
- 2
server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx Bestand weergeven

@@ -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 || '';

+ 2
- 2
server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx Bestand weergeven

@@ -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[];
}


+ 2
- 2
server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx Bestand weergeven

@@ -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;
}


+ 2
- 2
server/sonar-web/src/main/js/apps/coding-rules/components/RepositoryFacet.tsx Bestand weergeven

@@ -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> {

+ 2
- 2
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx Bestand weergeven

@@ -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;
}

+ 1
- 1
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/component-measures/components/App.tsx Bestand weergeven

@@ -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> {

+ 1
- 1
server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx Bestand weergeven

@@ -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;

+ 2
- 2
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts Bestand weergeven

@@ -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'],

+ 1
- 1
server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentsList.tsx Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx Bestand weergeven

@@ -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;

+ 2
- 5
server/sonar-web/src/main/js/apps/component-measures/sidebar/Sidebar.tsx Bestand weergeven

@@ -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) {

+ 3
- 6
server/sonar-web/src/main/js/apps/component-measures/utils.ts Bestand weergeven

@@ -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],

+ 1
- 1
server/sonar-web/src/main/js/apps/create/project/RemoteRepositories.tsx Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/documentation/components/SearchResults.tsx Bestand weergeven

@@ -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;


+ 8
- 8
server/sonar-web/src/main/js/apps/issues/components/App.tsx Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx Bestand weergeven

@@ -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 => {

+ 2
- 2
server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.tsx Bestand weergeven

@@ -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> {

+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx Bestand weergeven

@@ -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[];
}


+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx Bestand weergeven

@@ -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> {

+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx Bestand weergeven

@@ -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> {

+ 2
- 2
server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx Bestand weergeven

@@ -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> {

+ 2
- 2
server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.tsx Bestand weergeven

@@ -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> {

+ 2
- 2
server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx Bestand weergeven

@@ -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 {

+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx Bestand weergeven

@@ -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'];

+ 2
- 2
server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.tsx Bestand weergeven

@@ -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> {

+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx Bestand weergeven

@@ -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'];

+ 8
- 8
server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx Bestand weergeven

@@ -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> {

+ 3
- 3
server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx Bestand weergeven

@@ -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 {

+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx Bestand weergeven

@@ -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[];
}


+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx Bestand weergeven

@@ -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[];
}


+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx Bestand weergeven

@@ -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[];
}


+ 4
- 4
server/sonar-web/src/main/js/apps/issues/utils.ts Bestand weergeven

@@ -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 => {

+ 1
- 1
server/sonar-web/src/main/js/apps/organizationMembers/ManageMemberGroupsForm.tsx Bestand weergeven

@@ -39,7 +39,7 @@ interface Props {
}

interface State {
userGroups?: { [k: string]: UserGroup & { status?: string } };
userGroups?: T.Dict<UserGroup & { status?: string }>;
loading?: boolean;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/organizations/components/OrganizationProjects.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx Bestand weergeven

@@ -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;
}

+ 2
- 2
server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx Bestand weergeven

@@ -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),

+ 1
- 1
server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/overview/meta/MetaContainer.tsx Bestand weergeven

@@ -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;
}


+ 2
- 2
server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx Bestand weergeven

@@ -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;

+ 1
- 1
server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx Bestand weergeven

@@ -33,7 +33,7 @@ interface Props {

type State = {
loading: boolean;
metrics?: { [key: string]: T.Metric };
metrics?: T.Dict<T.Metric>;
projects?: ApplicationProject[];
status?: string;
};

+ 1
- 1
server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGateProject.tsx Bestand weergeven

@@ -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;
}


+ 3
- 3
server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.tsx Bestand weergeven

@@ -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],

+ 1
- 1
server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.tsx Bestand weergeven

@@ -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: {} };

+ 1
- 1
server/sonar-web/src/main/js/apps/permissions/utils.ts Bestand weergeven

@@ -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,

+ 2
- 2
server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx Bestand weergeven

@@ -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),

+ 2
- 2
server/sonar-web/src/main/js/apps/portfolio/components/App.tsx Bestand weergeven

@@ -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;
}

+ 1
- 1
server/sonar-web/src/main/js/apps/portfolio/components/MaintainabilityBox.tsx Bestand weergeven

@@ -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) {

+ 1
- 1
server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx Bestand weergeven

@@ -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) {

+ 1
- 1
server/sonar-web/src/main/js/apps/portfolio/components/ReliabilityBox.tsx Bestand weergeven

@@ -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) {

+ 1
- 1
server/sonar-web/src/main/js/apps/portfolio/components/SecurityBox.tsx Bestand weergeven

@@ -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) {

+ 1
- 1
server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx Bestand weergeven

@@ -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) {

+ 2
- 2
server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx Bestand weergeven

@@ -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 (

+ 1
- 1
server/sonar-web/src/main/js/apps/portfolio/types.ts Bestand weergeven

@@ -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;

+ 2
- 2
server/sonar-web/src/main/js/apps/portfolio/utils.ts Bestand weergeven

@@ -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;
});

+ 1
- 1
server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.tsx Bestand weergeven

@@ -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'

+ 5
- 5
server/sonar-web/src/main/js/apps/projectActivity/utils.ts Bestand weergeven

@@ -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;
}

+ 1
- 1
server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeakMeasures.tsx Bestand weergeven

@@ -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) {

+ 1
- 1
server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverallMeasures.tsx Bestand weergeven

@@ -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) {

+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/Filter.tsx Bestand weergeven

@@ -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[];

+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.tsx Bestand weergeven

@@ -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[];
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/MaintainabilityFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/NewMaintainabilityFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/NewReliabilityFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/NewSecurityFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/ReliabilityFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.tsx Bestand weergeven

@@ -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> {

+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/SecurityFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.tsx Bestand weergeven

@@ -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;
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx Bestand weergeven

@@ -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[];
}


+ 1
- 1
server/sonar-web/src/main/js/apps/projects/query.ts Bestand weergeven

@@ -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',

+ 0
- 0
server/sonar-web/src/main/js/apps/projects/types.ts Bestand weergeven


Some files were not shown because too many files changed in this diff

Laden…
Annuleren
Opslaan