@@ -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; |
@@ -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; |
@@ -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[]; |
@@ -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) { |
@@ -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; | |||
} | |||
@@ -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; |
@@ -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; |
@@ -55,7 +55,7 @@ interface Props { | |||
} | |||
interface State { | |||
issueTypes?: { [key: string]: { count: number } }; | |||
issueTypes?: T.Dict<{ count: number }>; | |||
loading: boolean; | |||
projectsCount: number; | |||
} |
@@ -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[]; |
@@ -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; |
@@ -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 { |
@@ -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; | |||
} |
@@ -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 || ''; |
@@ -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; | |||
} |
@@ -29,7 +29,7 @@ interface Props { | |||
languages: T.Languages; | |||
organization: string | undefined; | |||
query: Query; | |||
referencedProfiles: { [profile: string]: Profile }; | |||
referencedProfiles: T.Dict<Profile>; | |||
total: number; | |||
} | |||
@@ -34,7 +34,7 @@ interface Props { | |||
organization: string | undefined; | |||
profile?: Profile; | |||
query: Query; | |||
referencedProfiles: { [profile: string]: Profile }; | |||
referencedProfiles: T.Dict<Profile>; | |||
total: number; | |||
} | |||
@@ -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 || ''; |
@@ -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[]; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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> { |
@@ -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; | |||
} |
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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> { |
@@ -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; |
@@ -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; | |||
} | |||
@@ -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; |
@@ -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'], |
@@ -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; | |||
} | |||
@@ -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; |
@@ -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; |
@@ -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) { |
@@ -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], |
@@ -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; |
@@ -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; |
@@ -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; | |||
@@ -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; |
@@ -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 => { |
@@ -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> { |
@@ -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[]; | |||
} | |||
@@ -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> { |
@@ -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> { |
@@ -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> { |
@@ -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> { |
@@ -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 { |
@@ -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']; |
@@ -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> { |
@@ -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']; |
@@ -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> { |
@@ -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 { |
@@ -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[]; | |||
} | |||
@@ -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[]; | |||
} | |||
@@ -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[]; | |||
} | |||
@@ -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 => { |
@@ -39,7 +39,7 @@ interface Props { | |||
} | |||
interface State { | |||
userGroups?: { [k: string]: UserGroup & { status?: string } }; | |||
userGroups?: T.Dict<UserGroup & { status?: string }>; | |||
loading?: boolean; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; |
@@ -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; | |||
} |
@@ -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), |
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; |
@@ -33,7 +33,7 @@ interface Props { | |||
type State = { | |||
loading: boolean; | |||
metrics?: { [key: string]: T.Metric }; | |||
metrics?: T.Dict<T.Metric>; | |||
projects?: ApplicationProject[]; | |||
status?: string; | |||
}; |
@@ -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; | |||
} | |||
@@ -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], |
@@ -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: {} }; |
@@ -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, |
@@ -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), |
@@ -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; | |||
} |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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 ( |
@@ -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; |
@@ -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; | |||
}); |
@@ -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' |
@@ -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; | |||
} |
@@ -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) { |
@@ -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) { |
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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[]; |
@@ -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; | |||
} | |||
@@ -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[]; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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> { |
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
@@ -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[]; | |||
} | |||
@@ -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', |