"postcss-calc": "6.0.1",
"postcss-custom-properties": "6.2.0",
"postcss-loader": "2.0.8",
- "prettier": "1.7.4",
+ "prettier": "1.9.2",
"react-error-overlay": "1.0.7",
"react-test-renderer": "16.2.0",
"rimraf": "2.6.2",
"style-loader": "0.19.0",
"ts-jest": "21.1.4",
- "typescript": "2.5.3",
- "typescript-eslint-parser": "8.0.1",
+ "typescript": "2.6.2",
+ "typescript-eslint-parser": "11.0.0",
"webpack": "3.8.1",
"webpack-bundle-analyzer": "2.9.0",
"webpack-dev-server": "2.9.3"
if (!updates) {
return [];
}
- const lastUpdate = [
- 'COMPATIBLE',
- 'REQUIRES_SYSTEM_UPGRADE',
- 'DEPS_REQUIRE_SYSTEM_UPGRADE'
- ].map(status => {
- const index = findLastIndex(updates, update => update.status === status);
- return index > -1 ? updates[index] : undefined;
- });
+ const lastUpdate = ['COMPATIBLE', 'REQUIRES_SYSTEM_UPGRADE', 'DEPS_REQUIRE_SYSTEM_UPGRADE'].map(
+ status => {
+ const index = findLastIndex(updates, update => update.status === status);
+ return index > -1 ? updates[index] : undefined;
+ }
+ );
return lastUpdate.filter(Boolean) as Update[];
}
}
};
- Promise.all([
- getComponentNavigation(id, branch),
- getComponentData(id, branch)
- ]).then(([nav, data]) => {
- const component = this.addQualifier({ ...nav, ...data });
-
- if (this.props.organizationsEnabled) {
- this.props.fetchOrganizations([component.organization]);
- }
+ Promise.all([getComponentNavigation(id, branch), getComponentData(id, branch)]).then(
+ ([nav, data]) => {
+ const component = this.addQualifier({ ...nav, ...data });
- this.fetchBranches(component).then(branches => {
- if (this.mounted) {
- this.setState({ loading: false, branches, component });
+ if (this.props.organizationsEnabled) {
+ this.props.fetchOrganizations([component.organization]);
}
- }, onError);
- }, onError);
+
+ this.fetchBranches(component).then(branches => {
+ if (this.mounted) {
+ this.setState({ loading: false, branches, component });
+ }
+ }, onError);
+ },
+ onError
+ );
}
fetchBranches = (component: Component) => {
- const project = component.breadcrumbs.find((c: Component) => c.qualifier === 'TRK');
+ const project = component.breadcrumbs.find(({ qualifier }) => qualifier === 'TRK');
return project ? getBranches(project.key) : Promise.resolve([]);
};
}
loadStatus = () => {
- getTasksForComponent(
- this.props.component.key
- ).then((r: { queue: PendingTask[]; current: Task }) => {
- if (this.mounted) {
- this.setState({
- currentTask: r.current,
- isInProgress: r.queue.some(task => task.status === STATUSES.IN_PROGRESS),
- isPending: r.queue.some(task => task.status === STATUSES.PENDING)
- });
+ getTasksForComponent(this.props.component.key).then(
+ (r: { queue: PendingTask[]; current: Task }) => {
+ if (this.mounted) {
+ this.setState({
+ currentTask: r.current,
+ isInProgress: r.queue.some(task => task.status === STATUSES.IN_PROGRESS),
+ isPending: r.queue.some(task => task.status === STATUSES.PENDING)
+ });
+ }
}
- });
+ );
};
populateRecentHistory = () => {
<Route
getComponent={() =>
- import('../components/ComponentContainer').then(i => i.default)}>
+ import('../components/ComponentContainer').then(i => i.default)
+ }>
<Route path="code" childRoutes={codeRoutes} />
<Route path="component_measures" childRoutes={componentMeasuresRoutes} />
<Route path="dashboard" childRoutes={overviewRoutes} />
export default function OrganizationsList(props /*: Props */) {
return (
<ul className="account-projects-list">
- {sortBy(props.organizations, organization =>
- organization.name.toLocaleLowerCase()
- ).map(organization => (
- <li key={organization.key}>
- <OrganizationCard organization={organization} />
- </li>
- ))}
+ {sortBy(props.organizations, organization => organization.name.toLocaleLowerCase()).map(
+ organization => (
+ <li key={organization.key}>
+ <OrganizationCard organization={organization} />
+ </li>
+ )
+ )}
</ul>
);
}
{ metric: 'sqale_rating', type: 'RATING' },
{ metric: 'ncloc', type: 'SHORT_INT' }
]
- : [
+ : ([
isApplication && { metric: 'alert_status', type: 'LEVEL' },
{ metric: 'ncloc', type: 'SHORT_INT' },
{ metric: 'bugs', type: 'SHORT_INT' },
{ metric: 'code_smells', type: 'SHORT_INT' },
{ metric: 'coverage', type: 'PERCENT' },
{ metric: 'duplicated_lines_density', type: 'PERCENT' }
- ].filter(Boolean) as Array<{ metric: string; type: string }>;
+ ].filter(Boolean) as Array<{ metric: string; type: string }>);
return (
<tr className={classNames({ selected })} ref={node => (this.node = node as HTMLElement)}>
translate('metric_domain.Maintainability'),
translate('metric', 'ncloc', 'name')
]
- : [
+ : ([
isApplication && translate('metric.alert_status.name'),
translate('metric', 'ncloc', 'name'),
translate('metric', 'bugs', 'name'),
translate('metric', 'code_smells', 'name'),
translate('metric', 'coverage', 'name'),
translate('metric', 'duplicated_lines_density', 'short_name')
- ].filter(Boolean) as string[];
+ ].filter(Boolean) as string[]);
return (
<thead>
fetchAllPlugins = () => {
this.setState({ loadingPlugins: true });
- Promise.all([
- getInstalledPluginsWithUpdates(),
- getAvailablePlugins()
- ]).then(([installed, available]) => {
- if (this.mounted) {
- this.setState({
- loadingPlugins: false,
- plugins: sortBy(uniqBy([...installed, ...available.plugins], 'key'), 'name')
- });
- }
- }, this.stopLoadingPlugins);
+ Promise.all([getInstalledPluginsWithUpdates(), getAvailablePlugins()]).then(
+ ([installed, available]) => {
+ if (this.mounted) {
+ this.setState({
+ loadingPlugins: false,
+ plugins: sortBy(uniqBy([...installed, ...available.plugins], 'key'), 'name')
+ });
+ }
+ },
+ this.stopLoadingPlugins
+ );
};
fetchUpdatesOnly = () => {
removeEventButtonText={
'project_activity.' + (isVersion ? 'remove_version' : 'remove_custom_event')
}
- removeEventQuestion={`project_activity.${isVersion
- ? 'remove_version'
- : 'remove_custom_event'}.question`}
+ removeEventQuestion={`project_activity.${
+ isVersion ? 'remove_version' : 'remove_custom_event'
+ }.question`}
/>
)}
</div>
</div>
<QualityGateFilter {...facetProps} facet={facets && facets.gate} value={query.gate} />
{!isLeakView && (
- <React.Fragment>
+ <>
<ReliabilityFilter
{...facetProps}
facet={facets && facets.reliability}
value={query.duplications}
/>
<SizeFilter {...facetProps} facet={facets && facets.size} value={query.size} />
- </React.Fragment>
+ </>
)}
{isLeakView && (
- <React.Fragment>
+ <>
<NewReliabilityFilter
{...facetProps}
facet={facets && facets.new_reliability}
facet={facets && facets.new_lines}
value={query.new_lines}
/>
- </React.Fragment>
+ </>
)}
<LanguagesFilterContainer
{...facetProps}
getOptions = () => {
const sortMetrics = this.props.view === 'leak' ? SORTING_LEAK_METRICS : SORTING_METRICS;
- return sortBy(
- sortMetrics,
- option => (option.value === this.props.defaultOption ? 0 : 1)
- ).map(option => ({
- value: option.value,
- label: translate('projects.sorting', option.value),
- class: option.class
- }));
+ return sortBy(sortMetrics, option => (option.value === this.props.defaultOption ? 0 : 1)).map(
+ option => ({
+ value: option.value,
+ label: translate('projects.sorting', option.value),
+ class: option.class
+ })
+ );
};
handleDescToggle = () => {
import ChangesList from '../ChangesList';
import { ProfileChangelogEvent } from '../../types';
-function createEvent(overrides?: { [p: string]: any }): ProfileChangelogEvent {
+function createEvent(overrides?: Partial<ProfileChangelogEvent>): ProfileChangelogEvent {
return {
date: '2016-01-01',
authorName: 'John',
ruleKey: 'squid1234',
ruleName: 'Do not do this',
params: {},
- organization: null,
...overrides
};
}
return null;
}
return (
- <React.Fragment>
+ <>
<tr>
<td>
<h6>
<td> </td>
</tr>
))}
- </React.Fragment>
+ </>
);
}
return null;
}
return (
- <React.Fragment>
+ <>
<tr>
<td> </td>
<td>
<td>{this.renderRule(rule, rule.severity)}</td>
</tr>
))}
- </React.Fragment>
+ </>
);
}
return null;
}
return (
- <React.Fragment>
+ <>
<tr>
<td colSpan={2} className="text-center">
<h6>
</td>
</tr>
))}
- </React.Fragment>
+ </>
);
}
qualityProfile: profile.name,
selected: 'deselected'
};
- return Promise.all([
- searchUsers(parameters),
- searchGroups(parameters)
- ]).then(([usersResponse, groupsResponse]) => [
- ...usersResponse.users,
- ...groupsResponse.groups
- ]);
+ return Promise.all([searchUsers(parameters), searchGroups(parameters)]).then(
+ ([usersResponse, groupsResponse]) => [...usersResponse.users, ...groupsResponse.groups]
+ );
};
handleValueChange = (selected: User | Group) => {
componentDidMount() {
this.mounted = true;
- Promise.all([
- getIdentityProviders(),
- tryGetGlobalNavigation()
- ]).then(([identityProvidersResponse, appState]) => {
- if (this.mounted) {
- this.setState({
- onSonarCloud:
- appState.settings && appState.settings['sonar.sonarcloud.enabled'] === 'true',
- identityProviders: identityProvidersResponse.identityProviders
- });
+ Promise.all([getIdentityProviders(), tryGetGlobalNavigation()]).then(
+ ([identityProvidersResponse, appState]) => {
+ if (this.mounted) {
+ this.setState({
+ onSonarCloud:
+ appState.settings && appState.settings['sonar.sonarcloud.enabled'] === 'true',
+ identityProviders: identityProvidersResponse.identityProviders
+ });
+ }
}
- });
+ );
}
componentWillUnmount() {
const { isCurrentUser, onUpdateUsers, user } = this.props;
return (
- <React.Fragment>
+ <>
{this.renderActions()}
{openForm === 'deactivate' && (
<DeactivateForm
{openForm === 'update' && (
<UserForm onClose={this.handleCloseForm} onUpdateUsers={onUpdateUsers} user={user} />
)}
- </React.Fragment>
+ </>
);
}
}
return response.json();
}
-/**
+/**
* Parse response of failed request
*/
export function parseError(error: { response: Response }): Promise<string> {
"noUnusedParameters": true,
"noImplicitAny": true,
"strict": true,
+ "strictFunctionTypes": false,
"target": "es5",
"jsx": "react",
"lib": ["es2017", "dom"],
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
-prettier@1.7.4:
- version "1.7.4"
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa"
+prettier@1.9.2:
+ version "1.9.2"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.2.tgz#96bc2132f7a32338e6078aeb29727178c6335827"
pretty-error@^2.0.2:
version "2.1.1"
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
-typescript-eslint-parser@8.0.1:
- version "8.0.1"
- resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-8.0.1.tgz#e8cac537d996e16c3dbb0d7c4d509799e67afe0c"
+typescript-eslint-parser@11.0.0:
+ version "11.0.0"
+ resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-11.0.0.tgz#37dba6a0130dd307504aa4b4b21b0d3dc7d4e9f2"
dependencies:
lodash.unescape "4.0.1"
semver "5.4.1"
-typescript@2.5.3:
- version "2.5.3"
- resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.5.3.tgz#df3dcdc38f3beb800d4bc322646b04a3f6ca7f0d"
+typescript@2.6.2:
+ version "2.6.2"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
ua-parser-js@^0.7.9:
version "0.7.17"