aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-02-13 17:18:58 +0100
committerGitHub <noreply@github.com>2018-02-13 17:18:58 +0100
commitc4bd5d2945a387070615b27f8c5da139f55a8693 (patch)
treef78d370997fbb896692adba82260dcfd125c80e5 /server
parentd5d5fbb4cd90b6c6419bd2940281fd1fd6e29d93 (diff)
downloadsonarqube-c4bd5d2945a387070615b27f8c5da139f55a8693.tar.gz
sonarqube-c4bd5d2945a387070615b27f8c5da139f55a8693.zip
update typescript to 2.7 (#3054)
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/.eslintrc1
-rw-r--r--server/sonar-web/package.json6
-rw-r--r--server/sonar-web/src/main/js/app/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/app/components/ComponentContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/app/components/LocalizationContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/app/components/SimpleContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Component.tsx18
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Search.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx18
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleButton.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsTagsPopup.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx18
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/components/CreateButton.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/components/EditButton.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/components/Form.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/custom-metrics/components/CreateButton.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/custom-metrics/components/EditButton.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/groups/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/groups/components/EditGroup.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/groups/components/Header.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/ModuleFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.js4
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx6
-rw-r--r--server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/Report.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/portfolio/components/Subscription.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/BranchRow.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPattern.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DeleteConditionForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/components/CopyProfileForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/components/RenameProfileForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx58
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/sessions/components/EmailAlreadyExists.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/system/__tests__/utils-test.ts2
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/UsersApp.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/common/BubblePopupHelper.tsx24
-rw-r--r--server/sonar-web/src/main/js/components/common/MultiSelect.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/common/ScreenPositionHelper.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/common/__tests__/BranchStatus-test.tsx23
-rw-r--r--server/sonar-web/src/main/js/components/controls/ClipboardButton.tsx6
-rw-r--r--server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/controls/DateInput.tsx10
-rw-r--r--server/sonar-web/src/main/js/components/controls/FavoriteBase.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/controls/SearchBox.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/controls/SearchSelect.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/controls/SimpleModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/lazyLoad.tsx2
-rw-r--r--server/sonar-web/src/main/js/helpers/request.ts4
-rw-r--r--server/sonar-web/yarn.lock26
148 files changed, 274 insertions, 250 deletions
diff --git a/server/sonar-web/.eslintrc b/server/sonar-web/.eslintrc
index d03895d0134..9ca9ff7e900 100644
--- a/server/sonar-web/.eslintrc
+++ b/server/sonar-web/.eslintrc
@@ -172,6 +172,7 @@
{
"order": [
"type-annotations",
+ "instance-variables",
"static-methods",
"lifecycle",
"everything-else",
diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json
index 8e3b92e3116..da0674593e1 100644
--- a/server/sonar-web/package.json
+++ b/server/sonar-web/package.json
@@ -52,7 +52,7 @@
"@types/jest": "22.0.1",
"@types/jquery": "3.2.11",
"@types/keymaster": "1.6.28",
- "@types/lodash": "4.14.80",
+ "@types/lodash": "4.14.102",
"@types/prop-types": "15.5.2",
"@types/react": "16.0.29",
"@types/react-dom": "16.0.3",
@@ -103,8 +103,8 @@
"rimraf": "2.6.2",
"style-loader": "0.19.0",
"ts-jest": "22.0.1",
- "typescript": "2.6.2",
- "typescript-eslint-parser": "12.0.0",
+ "typescript": "2.7.1",
+ "typescript-eslint-parser": "13.0.0",
"webpack": "3.8.1",
"webpack-bundle-analyzer": "2.9.0",
"webpack-dev-server": "2.9.3"
diff --git a/server/sonar-web/src/main/js/app/components/App.tsx b/server/sonar-web/src/main/js/app/components/App.tsx
index 0b7375c9c93..845d6b880c0 100644
--- a/server/sonar-web/src/main/js/app/components/App.tsx
+++ b/server/sonar-web/src/main/js/app/components/App.tsx
@@ -42,7 +42,7 @@ interface State {
}
class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static childContextTypes = {
branchesEnabled: PropTypes.bool.isRequired,
diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
index 75d48a09dff..af04b9229fb 100644
--- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
+++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
@@ -49,7 +49,7 @@ interface State {
}
export class ComponentContainer extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
organizationsEnabled: PropTypes.bool
diff --git a/server/sonar-web/src/main/js/app/components/LocalizationContainer.tsx b/server/sonar-web/src/main/js/app/components/LocalizationContainer.tsx
index a9e02214954..dc6cea9cf58 100644
--- a/server/sonar-web/src/main/js/app/components/LocalizationContainer.tsx
+++ b/server/sonar-web/src/main/js/app/components/LocalizationContainer.tsx
@@ -32,7 +32,7 @@ interface State {
}
export default class LocalizationContainer extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
diff --git a/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx b/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx
index b14e0475b70..728d654579f 100644
--- a/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx
+++ b/server/sonar-web/src/main/js/app/components/SimpleContainer.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class SimpleContainer extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static childContextTypes = {
onSonarCloud: PropTypes.bool
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
index f906af392f6..71380876edf 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
@@ -41,7 +41,7 @@ interface Props {
}
export default class ComponentNav extends React.PureComponent<Props> {
- mounted: boolean;
+ mounted = false;
componentDidMount() {
this.populateRecentHistory();
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx
index e20aaf1b9c3..8c600143589 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx
@@ -46,7 +46,7 @@ interface State {
}
export default class ComponentNavBranch extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
branchesEnabled: PropTypes.bool.isRequired,
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
index 1ac0cc50ae9..b46da2bf13d 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
@@ -46,7 +46,7 @@ interface State {
}
export default class ComponentNavBranchesMenu extends React.PureComponent<Props, State> {
- private node: HTMLElement | null;
+ private node?: HTMLElement | null;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.tsx b/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.tsx
index c716ac0ec06..53117d71a12 100644
--- a/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.tsx
+++ b/server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.tsx
@@ -46,7 +46,7 @@ interface State {
}
class CreateOrganizationForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx
index 30895a4147e..6ec85e94b43 100644
--- a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx
+++ b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx
@@ -45,7 +45,7 @@ interface State {
}
class UserOrganizations extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { createOrganization: false, loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx b/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx
index 23c2d326199..923c7c9acb8 100644
--- a/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx
@@ -32,7 +32,7 @@ interface State {
}
export default class ProjectsContainer extends React.PureComponent<{}, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
loading: true,
page: 1,
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx
index 46184a58a66..45f653857b0 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx
@@ -33,7 +33,7 @@ interface State {
}
export default class ScannerContext extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {};
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx
index a9694360204..1ea9befbc89 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx
@@ -34,7 +34,7 @@ interface State {
}
export default class Stacktrace extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx
index 7b1adf819c6..24f084cd739 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx
@@ -37,7 +37,7 @@ interface State {
}
export default class Workers extends React.PureComponent<{}, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
canSetWorkerCount: false,
formOpen: false,
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx
index 3c6382818c9..91c5b7d3747 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx
@@ -37,7 +37,7 @@ interface State {
}
export default class WorkersForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/code/components/App.tsx b/server/sonar-web/src/main/js/apps/code/components/App.tsx
index 08ceee43e65..b6941e56388 100644
--- a/server/sonar-web/src/main/js/apps/code/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/code/components/App.tsx
@@ -53,7 +53,7 @@ interface State {
}
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
loading: true,
breadcrumbs: [],
diff --git a/server/sonar-web/src/main/js/apps/code/components/Component.tsx b/server/sonar-web/src/main/js/apps/code/components/Component.tsx
index 6ba67258835..841d96baee7 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Component.tsx
+++ b/server/sonar-web/src/main/js/apps/code/components/Component.tsx
@@ -38,7 +38,7 @@ interface Props {
}
export default class Component extends React.PureComponent<Props> {
- node: HTMLElement;
+ node?: HTMLElement | null;
componentDidMount() {
this.handleUpdate();
@@ -60,12 +60,14 @@ export default class Component extends React.PureComponent<Props> {
}
handleScroll() {
- const position = this.node.getBoundingClientRect();
- const { top, bottom } = position;
- if (bottom > window.innerHeight - BOTTOM_OFFSET) {
- window.scrollTo(0, bottom - window.innerHeight + window.pageYOffset + BOTTOM_OFFSET);
- } else if (top < TOP_OFFSET) {
- window.scrollTo(0, top + window.pageYOffset - TOP_OFFSET);
+ if (this.node) {
+ const position = this.node.getBoundingClientRect();
+ const { top, bottom } = position;
+ if (bottom > window.innerHeight - BOTTOM_OFFSET) {
+ window.scrollTo(0, bottom - window.innerHeight + window.pageYOffset + BOTTOM_OFFSET);
+ } else if (top < TOP_OFFSET) {
+ window.scrollTo(0, top + window.pageYOffset - TOP_OFFSET);
+ }
}
}
@@ -113,7 +115,7 @@ export default class Component extends React.PureComponent<Props> {
].filter(Boolean) as Array<{ metric: string; type: string }>);
return (
- <tr className={classNames({ selected })} ref={node => (this.node = node as HTMLElement)}>
+ <tr className={classNames({ selected })} ref={node => (this.node = node)}>
<td className="thin nowrap">
<span className="spacer-right">{componentAction}</span>
</td>
diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.tsx b/server/sonar-web/src/main/js/apps/code/components/Search.tsx
index 002db15bf21..4a5536ed3de 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Search.tsx
+++ b/server/sonar-web/src/main/js/apps/code/components/Search.tsx
@@ -43,7 +43,7 @@ interface State {
}
export default class Search extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object.isRequired
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx
index b96a2513843..97ae4439f34 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class ActivationButton extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
index 2fcc083b688..c410a105cae 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
@@ -47,7 +47,7 @@ interface State {
}
export default class ActivationFormModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
index 2dfe9096b12..eac010a98df 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
@@ -80,7 +80,7 @@ interface State {
// TODO redirect to default organization's rules page
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
organizationsEnabled: PropTypes.bool,
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
index 37efe2e266e..5b4d9e3c665 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class BulkChange extends React.PureComponent<Props, State> {
- closeDropdown: () => void;
+ closeDropdown?: () => void;
state: State = { modal: false };
getSelectedProfile = () => {
@@ -52,28 +52,36 @@ export default class BulkChange extends React.PureComponent<Props, State> {
handleActivateClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
this.setState({ action: 'activate', modal: true, profile: undefined });
};
handleActivateInProfileClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
this.setState({ action: 'activate', modal: true, profile: this.getSelectedProfile() });
};
handleDeactivateClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
this.setState({ action: 'deactivate', modal: true, profile: undefined });
};
handleDeactivateInProfileClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
this.setState({ action: 'deactivate', modal: true, profile: this.getSelectedProfile() });
};
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
index 54368071b6b..f7981285692 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
@@ -50,7 +50,7 @@ interface State {
}
export default class BulkChangeModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleButton.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleButton.tsx
index b2e9c8d5eb6..5882d70b307 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleButton.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleButton.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class CustomRuleButton extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
index b650c27fd43..426c180a43a 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
@@ -52,7 +52,7 @@ interface State {
}
export default class CustomRuleFormModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
index 752c317cb50..331e1c908e2 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
@@ -54,7 +54,7 @@ interface State {
}
export default class RuleDetails extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx
index 2804fbde9e9..d080327593f 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx
@@ -41,7 +41,7 @@ interface State {
}
export default class RuleDetailsCustomRules extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx
index c5e31bcb5a5..b21425fa10a 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class RuleDetailsDescription extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
description: '',
descriptionForm: false,
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx
index 78b71bb74e7..6f953ba6bb7 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx
@@ -44,7 +44,7 @@ interface State {
}
export default class RuleDetailsIssues extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
index 16286383865..551b6d1402a 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
@@ -46,7 +46,7 @@ interface State {
}
export default class RuleDetailsProfiles extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
componentDidMount() {
this.mounted = true;
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsTagsPopup.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsTagsPopup.tsx
index 895ab60771f..d6064752070 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsTagsPopup.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsTagsPopup.tsx
@@ -38,7 +38,7 @@ interface State {
const LIST_SIZE = 10;
export default class RuleDetailsTagsPopup extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { searchResult: [] };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx
index ea93d9559a1..8340279f3ad 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx
@@ -31,26 +31,32 @@ interface Props {
}
export default class SimilarRulesFilter extends React.PureComponent<Props> {
- closeDropdown: () => void;
+ closeDropdown?: () => void;
handleLanguageClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
this.props.onFilterChange({ languages: [this.props.rule.lang] });
};
handleTypeClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
this.props.onFilterChange({ types: [this.props.rule.type] });
};
handleSeverityClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
if (this.props.rule.severity) {
this.props.onFilterChange({ severities: [this.props.rule.severity] });
}
@@ -59,7 +65,9 @@ export default class SimilarRulesFilter extends React.PureComponent<Props> {
handleTagClick = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
event.currentTarget.blur();
- this.closeDropdown();
+ if (this.closeDropdown) {
+ this.closeDropdown();
+ }
const { tag } = event.currentTarget.dataset;
if (tag) {
this.props.onFilterChange({ tags: [tag] });
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx b/server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx
index 10ad59e53d8..79e4a5e5d67 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx
@@ -44,7 +44,7 @@ interface State {
const PAGE_SIZE = 50;
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/components/CreateButton.tsx b/server/sonar-web/src/main/js/apps/custom-measures/components/CreateButton.tsx
index ed9e536e3f1..feea67a5ab4 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/components/CreateButton.tsx
+++ b/server/sonar-web/src/main/js/apps/custom-measures/components/CreateButton.tsx
@@ -31,7 +31,7 @@ interface State {
}
export default class CreateButton extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/components/EditButton.tsx b/server/sonar-web/src/main/js/apps/custom-measures/components/EditButton.tsx
index ac0bef49808..655b02b6eaf 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/components/EditButton.tsx
+++ b/server/sonar-web/src/main/js/apps/custom-measures/components/EditButton.tsx
@@ -33,7 +33,7 @@ interface State {
}
export default class EditButton extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/components/Form.tsx b/server/sonar-web/src/main/js/apps/custom-measures/components/Form.tsx
index 97aceef43da..6b814dd735a 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/components/Form.tsx
+++ b/server/sonar-web/src/main/js/apps/custom-measures/components/Form.tsx
@@ -43,7 +43,7 @@ interface State {
}
export default class Form extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx b/server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx
index a616a996a85..f802bc704f8 100644
--- a/server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx
@@ -48,7 +48,7 @@ interface State {
const PAGE_SIZE = 50;
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/custom-metrics/components/CreateButton.tsx b/server/sonar-web/src/main/js/apps/custom-metrics/components/CreateButton.tsx
index fffca99bfda..e3b67e82d84 100644
--- a/server/sonar-web/src/main/js/apps/custom-metrics/components/CreateButton.tsx
+++ b/server/sonar-web/src/main/js/apps/custom-metrics/components/CreateButton.tsx
@@ -32,7 +32,7 @@ interface State {
}
export default class CreateButton extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/custom-metrics/components/EditButton.tsx b/server/sonar-web/src/main/js/apps/custom-metrics/components/EditButton.tsx
index 6257f2ad92d..d0870fa8c06 100644
--- a/server/sonar-web/src/main/js/apps/custom-metrics/components/EditButton.tsx
+++ b/server/sonar-web/src/main/js/apps/custom-metrics/components/EditButton.tsx
@@ -35,7 +35,7 @@ interface State {
}
export default class EditButton extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/groups/components/App.tsx b/server/sonar-web/src/main/js/apps/groups/components/App.tsx
index 5aebe166132..dac3048bf49 100644
--- a/server/sonar-web/src/main/js/apps/groups/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/groups/components/App.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true, query: '' };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/groups/components/EditGroup.tsx b/server/sonar-web/src/main/js/apps/groups/components/EditGroup.tsx
index 8cf6bf7f8d2..2de9ded54a1 100644
--- a/server/sonar-web/src/main/js/apps/groups/components/EditGroup.tsx
+++ b/server/sonar-web/src/main/js/apps/groups/components/EditGroup.tsx
@@ -34,7 +34,7 @@ interface State {
}
export default class EditGroup extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx b/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx
index 6ab1d85fd0a..a83ee573e55 100644
--- a/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx
+++ b/server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx
@@ -39,7 +39,7 @@ interface State {
export default class EditMembers extends React.PureComponent<Props, State> {
container?: HTMLElement | null;
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/groups/components/Header.tsx b/server/sonar-web/src/main/js/apps/groups/components/Header.tsx
index 973ccb981dd..36f13bad647 100644
--- a/server/sonar-web/src/main/js/apps/groups/components/Header.tsx
+++ b/server/sonar-web/src/main/js/apps/groups/components/Header.tsx
@@ -32,7 +32,7 @@ interface State {
}
export default class Header extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { createModal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.js
index f48516ee94f..a2d1685f607 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.js
@@ -48,12 +48,12 @@ type Props = {|
export default class AssigneeFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'assignees';
+
static defaultProps = {
open: true
};
- property = 'assignees';
-
handleItemClick = (itemValue /*: string */) => {
if (itemValue === '') {
// unassigned
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.js
index 734a9f23699..7b5c4764226 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.js
@@ -41,12 +41,12 @@ type Props = {|
export default class AuthorFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'authors';
+
static defaultProps = {
open: true
};
- property = 'authors';
-
handleItemClick = (itemValue /*: string */) => {
const { authors } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js
index b3488fdb975..e4ecafbf742 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js
@@ -53,6 +53,8 @@ type Props = {|
export default class CreationDateFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'createdAt';
+
static defaultProps = {
open: true
};
@@ -61,8 +63,6 @@ export default class CreationDateFacet extends React.PureComponent {
intl: intlShape
};
- property = 'createdAt';
-
hasValue = () =>
this.props.createdAfter.length > 0 ||
this.props.createdAt.length > 0 ||
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.js
index 83926732bf2..519eb6ddfbe 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.js
@@ -45,12 +45,12 @@ type Props = {|
export default class DirectoryFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'directories';
+
static defaultProps = {
open: true
};
- property = 'directories';
-
handleItemClick = (itemValue /*: string */) => {
const { directories } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.js
index 9d2587536a3..187916efc77 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.js
@@ -45,12 +45,12 @@ type Props = {|
export default class FileFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'files';
+
static defaultProps = {
open: true
};
- property = 'files';
-
handleItemClick = (itemValue /*: string */) => {
const { files } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.js
index 1ccd0307689..b89269c9446 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.js
@@ -44,12 +44,12 @@ type Props = {|
export default class LanguageFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'languages';
+
static defaultProps = {
open: true
};
- property = 'languages';
-
handleItemClick = (itemValue /*: string */) => {
const { languages } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ModuleFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/ModuleFacet.js
index 8a9a9a7cc8e..234949ace26 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/ModuleFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ModuleFacet.js
@@ -44,12 +44,12 @@ type Props = {|
export default class ModuleFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'modules';
+
static defaultProps = {
open: true
};
- property = 'modules';
-
handleItemClick = (itemValue /*: string */) => {
const { modules } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js
index e93c288fbfe..fba2560cc83 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js
@@ -49,12 +49,12 @@ type Props = {|
export default class ProjectFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'projects';
+
static defaultProps = {
open: true
};
- property = 'projects';
-
handleItemClick = (itemValue /*: string */) => {
const { projects } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.js
index bd59288b278..cc9064b41de 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.js
@@ -42,12 +42,12 @@ type Props = {|
export default class ResolutionFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'resolutions';
+
static defaultProps = {
open: true
};
- property = 'resolutions';
-
handleItemClick = (itemValue /*: string */) => {
if (itemValue === '') {
// unresolved
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.js
index daf05e65b58..18704e1f4ff 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.js
@@ -46,12 +46,12 @@ type Props = {|
export default class RuleFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'rules';
+
static defaultProps = {
open: true
};
- property = 'rules';
-
handleItemClick = (itemValue /*: string */) => {
const { rules } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.js
index a1ec5af4071..6106d9ed240 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.js
@@ -42,12 +42,12 @@ type Props = {|
export default class SeverityFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'severities';
+
static defaultProps = {
open: true
};
- property = 'severities';
-
handleItemClick = (itemValue /*: string */) => {
const { severities } = this.props;
const newValue = orderBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.js
index d11062c7cc2..affd8c29c69 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.js
@@ -41,12 +41,12 @@ type Props = {|
export default class StatusFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'statuses';
+
static defaultProps = {
open: true
};
- property = 'statuses';
-
handleItemClick = (itemValue /*: string */) => {
const { statuses } = this.props;
const newValue = orderBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.js
index 66164f9c8ab..51df80106cc 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.js
@@ -46,12 +46,12 @@ type Props = {|
export default class TagFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'tags';
+
static defaultProps = {
open: true
};
- property = 'tags';
-
handleItemClick = (itemValue /*: string */) => {
const { tags } = this.props;
const newValue = sortBy(
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.js
index e02ea9f64cb..7bfd6dccc72 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.js
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.js
@@ -42,12 +42,12 @@ type Props = {|
export default class TypeFacet extends React.PureComponent {
/*:: props: Props; */
+ property = 'types';
+
static defaultProps = {
open: true
};
- property = 'types';
-
handleItemClick = (itemValue /*: string */) => {
const { types } = this.props;
const newValue = orderBy(
diff --git a/server/sonar-web/src/main/js/apps/marketplace/App.tsx b/server/sonar-web/src/main/js/apps/marketplace/App.tsx
index 9615d5f844e..c7256e53075 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx
@@ -63,7 +63,7 @@ interface State {
}
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object.isRequired
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx
index 9a38b96b108..fb609f9e30a 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx
@@ -38,7 +38,7 @@ interface State {
}
export default class LicenseEditionForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { license: '', submitting: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx
index 0c9d4382bf4..6be68c1aa31 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx
@@ -48,7 +48,7 @@ interface State {
}
export default class LicenseEditionSet extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx
index 324f3d9d34a..9a54b4f26a0 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class PluginActions extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { acceptTerms: false, loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx
index f6817b6749d..ad79e2a31d2 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx
@@ -34,7 +34,7 @@ interface State {
}
export default class UninstallEditionForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx b/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
index 17e3da5f7eb..6c5a6613d61 100644
--- a/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
@@ -37,7 +37,7 @@ interface State {
}
export default class BadgeParams extends React.PureComponent<Props> {
- mounted: boolean;
+ mounted = false;
state: State = { badgeMetrics: [] };
diff --git a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
index 4e7dd8c57b5..a9bba4a81bc 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
@@ -67,7 +67,7 @@ interface State {
}
export class OverviewApp extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true, measures: [] };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx b/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
index 6984424fa8f..8380a53b0a5 100644
--- a/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
@@ -42,7 +42,7 @@ interface State {
const PAGE_SIZE = 3;
export default class AnalysesList extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { analyses: [], loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.tsx
index 907d76a3877..ed778b4cef7 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.tsx
@@ -33,7 +33,7 @@ interface State {
}
export default class MetaLinks extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {};
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
index c9648810b85..d55ad3cc822 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
@@ -42,7 +42,7 @@ interface State {
}
class MetaQualityProfiles extends React.PureComponent<StateProps & OwnProps, State> {
- mounted: boolean;
+ mounted = false;
state: State = { deprecatedByKey: {} };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx
index 209b8a97880..07365b26330 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx
@@ -36,9 +36,9 @@ interface State {
}
export default class MetaTags extends React.PureComponent<Props, State> {
- card: HTMLDivElement | null;
- tagsList: HTMLButtonElement | null;
- tagsSelector: HTMLDivElement | null;
+ card?: HTMLDivElement | null;
+ tagsList?: HTMLButtonElement | null;
+ tagsSelector?: HTMLDivElement | null;
state: State = { popupOpen: false, popupPosition: { top: 0, right: 0 } };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
index 3d8202f0d9d..600499f9038 100644
--- a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
@@ -37,7 +37,7 @@ type State = {
};
export default class ApplicationQualityGate extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
index b90026b8524..ddba951e313 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class Activity extends React.PureComponent<Props> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
index 84ba6bbbf0a..27d4e2d957b 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
@@ -59,7 +59,7 @@ interface State {
}
export class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/Report.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/Report.tsx
index e562f829b1c..478cd3d8608 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/Report.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/Report.tsx
@@ -32,7 +32,7 @@ interface State {
}
export default class Report extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/Subscription.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/Subscription.tsx
index a229a365b83..98282a76287 100644
--- a/server/sonar-web/src/main/js/apps/portfolio/components/Subscription.tsx
+++ b/server/sonar-web/src/main/js/apps/portfolio/components/Subscription.tsx
@@ -33,7 +33,7 @@ interface State {
}
export default class Subscription extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx
index 2341dfc62f5..e4c886668fd 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx
@@ -43,7 +43,7 @@ interface State {
const BRANCH_LIFETIME_SETTING = 'sonar.dbcleaner.daysBeforeDeletingInactiveShortLivingBranches';
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchRow.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchRow.tsx
index b103ded575f..723998c7049 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchRow.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchRow.tsx
@@ -46,7 +46,7 @@ interface State {
}
export default class BranchRow extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { changingLeak: false, deleting: false, renaming: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx
index 2a268362655..4760621d29c 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx
@@ -35,7 +35,7 @@ interface State {
}
export default class DeleteBranchModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx
index 9c6507341ef..71d4deaa53f 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx
@@ -39,7 +39,7 @@ interface State {
const LEAK_PERIOD = 'sonar.leak.period';
export default class LeakPeriodForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true, submitting: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPattern.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPattern.tsx
index 83fe9f9ed33..e6d8b31d0f2 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPattern.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPattern.tsx
@@ -35,7 +35,7 @@ interface State {
export const LONG_BRANCH_PATTERN = 'sonar.branch.longLivedBranches.regex';
export default class LongBranchesPattern extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { formOpen: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx
index d319516a31b..67a7656fe0a 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class RenameBranchModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx
index f20efd74170..e862b2b7f8c 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx
@@ -35,7 +35,7 @@ interface State {
}
export default class SettingForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx
index b2d9aa3abfd..e22b327bbc1 100644
--- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx
+++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx
@@ -25,7 +25,7 @@ jest.mock('../../../../api/settings', () => ({
import * as React from 'react';
import { mount, shallow } from 'enzyme';
import App from '../App';
-import { Branch, BranchType } from '../../../../app/types';
+import { BranchType, MainBranch, LongLivingBranch, ShortLivingBranch } from '../../../../app/types';
const getValues = require('../../../../api/settings').getValues as jest.Mock<any>;
@@ -34,7 +34,7 @@ beforeEach(() => {
});
it('renders sorted list of branches', () => {
- const branches: Branch[] = [
+ const branches: [MainBranch, LongLivingBranch, ShortLivingBranch] = [
{ isMain: true, name: 'master' },
{ isMain: false, name: 'branch-1.0', type: BranchType.LONG },
{ isMain: false, name: 'branch-1.0', mergeBranch: 'master', type: BranchType.SHORT }
diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx
index 84739d05865..4b6c1615d89 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx
@@ -45,7 +45,7 @@ interface State {
}
export default class App extends React.PureComponent<Props> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx
index be13bfb1a6c..3a826687096 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx
@@ -39,7 +39,7 @@ interface Option {
}
export default class Form extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx
index eea2e1f38a2..a1f5ed8163a 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx
@@ -43,7 +43,7 @@ interface State {
}
export default class QualityProfiles extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx
index 5f97f52583a..d430f983921 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx
@@ -33,7 +33,7 @@ interface State {
}
export default class ProfileRow extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
index 3dd862df042..b0f995c2846 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
@@ -56,7 +56,7 @@ interface State {
}
export default class AllProjects extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object.isRequired
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
index 963333ba5c1..e8337514883 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
@@ -47,7 +47,7 @@ interface State {
const LIST_SIZE = 10;
export default class TagsFilter extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx
index 5b6131ac59a..71376df4a74 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx
@@ -52,7 +52,7 @@ interface State {
}
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx
index ca1e967a91c..726b4f69709 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx
@@ -48,7 +48,7 @@ interface State {
}
export default class BulkApplyTemplateModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { done: false, loading: true, submitting: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx
index 7b314f00fde..b43aadab9c7 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx
@@ -47,8 +47,8 @@ interface State {
}
export default class CreateProjectForm extends React.PureComponent<Props, State> {
- closeButton: HTMLElement | null;
- mounted: boolean;
+ closeButton?: HTMLElement | null;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx
index df34b89388d..a9b45bb2a52 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx
@@ -40,7 +40,7 @@ interface State {
}
export default class DeleteModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx
index 9dd13893baf..7f188592892 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class ProjectRowActions extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false, restoreAccessModal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx
index 74d5e6c2e43..d936fafa1e9 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class RestoreAccessModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx
index d7f7a252a17..6e3fa3d02ac 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx
@@ -57,8 +57,7 @@ interface State {
}
export default class Search extends React.PureComponent<Props, State> {
- input: HTMLInputElement;
- mounted: boolean;
+ mounted = false;
state: State = { bulkApplyTemplateModal: false, deleteModal: false };
getQualifierOptions = () => {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
index 0355ff8e57f..4c16c04184c 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
@@ -37,7 +37,7 @@ interface State {
}
export default class CopyQualityGateForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx
index bfc05396ec6..cb228fd06ad 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class CreateQualityGateForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteConditionForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteConditionForm.tsx
index 78e1e2be3eb..c8f041fef39 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteConditionForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteConditionForm.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class DeleteConditionForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
index 617385a0303..b37e21d0b5d 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class DeleteQualityGateForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
index b336ad6a1f1..964f160ad40 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
@@ -35,7 +35,7 @@ interface State {
}
export default class RenameQualityGateForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx
index 814c6f15fe9..114807dd0f9 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx
@@ -46,7 +46,7 @@ interface State {
}
export default class ChangelogContainer extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx
index 42c39724794..f461c668672 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx
@@ -49,7 +49,7 @@ interface State {
}
export default class ComparisonContainer extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx
index cadc9f2e47e..a831d023512 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx
@@ -40,7 +40,7 @@ interface State {
}
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/CopyProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/CopyProfileForm.tsx
index d2c78120663..7d04a1f3809 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/components/CopyProfileForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/CopyProfileForm.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class CopyProfileForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false, name: null };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx
index b114ee70cf4..1b564ec9be0 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class DeleteProfileForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false, name: null };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/RenameProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/RenameProfileForm.tsx
index 5868a2f3dc9..34b610bc7d8 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/components/RenameProfileForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/RenameProfileForm.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class RenameProfileForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false, name: null };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx
index fc750493c2a..b1978c6d310 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class ChangeParentForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
loading: false,
selected: null
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx
index f0734adc6cb..8eb09c52072 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx
@@ -31,7 +31,7 @@ interface Props {
}
export default class ChangeProjectsForm extends React.PureComponent<Props> {
- container: HTMLElement;
+ container?: HTMLElement | null;
handleCloseClick = (event: React.SyntheticEvent<HTMLElement>) => {
event.preventDefault();
@@ -39,34 +39,36 @@ export default class ChangeProjectsForm extends React.PureComponent<Props> {
};
renderSelectList = () => {
- const { key } = this.props.profile;
+ if (this.container) {
+ const { key } = this.props.profile;
- const searchUrl =
- (window as any).baseUrl + '/api/qualityprofiles/projects?key=' + encodeURIComponent(key);
+ const searchUrl =
+ (window as any).baseUrl + '/api/qualityprofiles/projects?key=' + encodeURIComponent(key);
- new (SelectList as any)({
- searchUrl,
- el: this.container,
- width: '100%',
- readOnly: false,
- focusSearch: false,
- dangerouslyUnescapedHtmlFormat: (item: { name: string }) => escapeHtml(item.name),
- selectUrl: (window as any).baseUrl + '/api/qualityprofiles/add_project',
- deselectUrl: (window as any).baseUrl + '/api/qualityprofiles/remove_project',
- extra: { profileKey: key },
- selectParameter: 'projectUuid',
- selectParameterValue: 'uuid',
- labels: {
- selected: translate('quality_gates.projects.with'),
- deselected: translate('quality_gates.projects.without'),
- all: translate('quality_gates.projects.all'),
- noResults: translate('quality_gates.projects.noResults')
- },
- tooltips: {
- select: translate('quality_profiles.projects.select_hint'),
- deselect: translate('quality_profiles.projects.deselect_hint')
- }
- });
+ new SelectList({
+ searchUrl,
+ el: this.container,
+ width: '100%',
+ readOnly: false,
+ focusSearch: false,
+ dangerouslyUnescapedHtmlFormat: (item: { name: string }) => escapeHtml(item.name),
+ selectUrl: (window as any).baseUrl + '/api/qualityprofiles/add_project',
+ deselectUrl: (window as any).baseUrl + '/api/qualityprofiles/remove_project',
+ extra: { profileKey: key },
+ selectParameter: 'projectUuid',
+ selectParameterValue: 'uuid',
+ labels: {
+ selected: translate('quality_gates.projects.with'),
+ deselected: translate('quality_gates.projects.without'),
+ all: translate('quality_gates.projects.all'),
+ noResults: translate('quality_gates.projects.noResults')
+ },
+ tooltips: {
+ select: translate('quality_profiles.projects.select_hint'),
+ deselect: translate('quality_profiles.projects.deselect_hint')
+ }
+ });
+ }
};
render() {
@@ -82,7 +84,7 @@ export default class ChangeProjectsForm extends React.PureComponent<Props> {
</div>
<div className="modal-body">
- <div id="profile-projects" ref={node => (this.container = node as HTMLElement)} />
+ <div id="profile-projects" ref={node => (this.container = node)} />
</div>
<div className="modal-foot">
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx
index 41413fad4d4..2786757c0f3 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx
@@ -51,7 +51,7 @@ interface State {
}
export default class ProfileInheritance extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
formOpen: false,
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx
index e81978aa22f..e77208909df 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx
@@ -52,7 +52,7 @@ interface State {
}
export default class ProfilePermissions extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { addUserForm: false, loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx
index ba7c7957ea5..06fc7c571da 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx
@@ -44,7 +44,7 @@ interface State {
}
export default class ProfilePermissionsForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { submitting: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx
index c6882c84dbf..b853c1e8de3 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx
@@ -41,7 +41,7 @@ interface State {
}
export default class ProfilePermissionsFormSelect extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx
index 8b780f3bd43..2dbb0885ee2 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx
@@ -38,7 +38,7 @@ interface State {
}
export default class ProfilePermissionsGroup extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { deleteModal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx
index e757ba7db28..d2c2094cd62 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx
@@ -38,7 +38,7 @@ interface State {
}
export default class ProfilePermissionsUser extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { deleteModal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
index 3ede46fe205..84fd60c40fa 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class ProfileProjects extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
formOpen: false,
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
index 93bad2515b0..a3a73a80a9f 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
@@ -52,7 +52,7 @@ interface State {
}
export default class ProfileRules extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
activatedTotal: null,
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx
index 52450e53483..d60ab75b1d2 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx
@@ -41,8 +41,7 @@ interface State {
}
export default class CreateProfileForm extends React.PureComponent<Props, State> {
- /*:: form: HTMLFormElement; */
- mounted: boolean;
+ mounted = false;
state: State = { importers: [], loading: false, name: '', preloading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
index d4b1df5a548..dac9e1a71be 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
@@ -54,7 +54,7 @@ interface State {
export default class EvolutionRules extends React.PureComponent<Props, State> {
periodStartDate: string;
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx
index e3a42fb47b8..d964ff019ee 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx
@@ -37,7 +37,7 @@ interface State {
}
export default class RestoreProfileForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/EmailAlreadyExists.tsx b/server/sonar-web/src/main/js/apps/sessions/components/EmailAlreadyExists.tsx
index fd9ece71a57..baf38997a15 100644
--- a/server/sonar-web/src/main/js/apps/sessions/components/EmailAlreadyExists.tsx
+++ b/server/sonar-web/src/main/js/apps/sessions/components/EmailAlreadyExists.tsx
@@ -44,7 +44,7 @@ interface State {
}
export default class EmailAlreadyExists extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { identityProviders: [], loading: true };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.tsx b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.tsx
index c1b706544b0..f8056a41dd5 100644
--- a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.tsx
@@ -36,7 +36,7 @@ interface State {
}
class LoginFormContainer extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
onSonarCloud: PropTypes.bool
diff --git a/server/sonar-web/src/main/js/apps/system/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/system/__tests__/utils-test.ts
index ba68020a55b..1bad72054f3 100644
--- a/server/sonar-web/src/main/js/apps/system/__tests__/utils-test.ts
+++ b/server/sonar-web/src/main/js/apps/system/__tests__/utils-test.ts
@@ -79,7 +79,7 @@ describe('getSystemLogsLevel', () => {
u.getSystemLogsLevel({
System: { 'High Availability': true },
'Application Nodes': [{ 'Compute Engine Logging': {} }, { Name: 'App 2' }]
- } as ClusterSysInfo)
+ } as any)
).toBe('INFO');
expect(u.getSystemLogsLevel({ System: {} } as SysInfo)).toBe('INFO');
});
diff --git a/server/sonar-web/src/main/js/apps/system/components/App.tsx b/server/sonar-web/src/main/js/apps/system/components/App.tsx
index 7c3c01adf5c..07ce3c1d325 100644
--- a/server/sonar-web/src/main/js/apps/system/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/system/components/App.tsx
@@ -47,7 +47,7 @@ interface State {
}
export default class App extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object
diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx
index 674d2f05d53..a39c44965b3 100644
--- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx
+++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx
@@ -29,7 +29,7 @@ interface State {
}
export default class SystemUpgradeNotif extends React.PureComponent<{}, State> {
- mounted: boolean;
+ mounted = false;
state: State = { openSystemUpgradeForm: false, systemUpgrades: [] };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx
index f66cabe81ac..1cf4ee7e669 100644
--- a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx
+++ b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx
@@ -44,7 +44,7 @@ interface State {
}
export default class UsersApp extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object.isRequired
diff --git a/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx b/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx
index a6ad6f8372d..7b34c4c3fc8 100644
--- a/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx
@@ -34,7 +34,7 @@ interface State {
}
export default class DeactivateForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { submitting: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx b/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx
index fd6cc251dba..a15eac7f596 100644
--- a/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx
@@ -32,7 +32,7 @@ interface Props {
}
export default class GroupsForm extends React.PureComponent<Props> {
- container: HTMLDivElement | null;
+ container?: HTMLDivElement | null;
handleCloseClick = (event: React.SyntheticEvent<HTMLElement>) => {
event.preventDefault();
diff --git a/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx b/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx
index 1caef1c894a..675b42761ce 100644
--- a/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx
@@ -41,7 +41,7 @@ interface State {
}
export default class PasswordForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
confirmPassword: '',
newPassword: '',
diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx
index 6bdca5c19d6..0869b13fbaf 100644
--- a/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx
@@ -38,7 +38,7 @@ interface State {
}
export default class TokensForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {
generating: false,
loading: true,
diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx
index 34dd611f125..ab1a4902aa7 100644
--- a/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx
@@ -37,7 +37,7 @@ interface State {
}
export default class TokensFormItem extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { deleting: false, loading: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
index 2cb241d0b1a..6aae2138038 100644
--- a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
@@ -44,7 +44,7 @@ interface State {
}
export default class UserForm extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx b/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx
index 2d54fee167c..fa62338bcbc 100644
--- a/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx
@@ -48,7 +48,7 @@ const LIST_SIZE = 10;
const AVATAR_SIZE = 16;
export default class UsersSelectSearch extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.tsx b/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.tsx
index 49f8cd2e379..e83c62e4185 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.tsx
+++ b/server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.tsx
@@ -35,7 +35,7 @@ interface State {
}
export default class ResponseExample extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = {};
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx
index ad9c009475d..cb2b5e5f4d2 100644
--- a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx
+++ b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx
@@ -43,7 +43,7 @@ interface State {
}
export default class WebApiApp extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
static contextTypes = {
router: PropTypes.object.isRequired
diff --git a/server/sonar-web/src/main/js/components/common/BubblePopupHelper.tsx b/server/sonar-web/src/main/js/components/common/BubblePopupHelper.tsx
index 8dd7237cbdf..2cfb88cee4c 100644
--- a/server/sonar-web/src/main/js/components/common/BubblePopupHelper.tsx
+++ b/server/sonar-web/src/main/js/components/common/BubblePopupHelper.tsx
@@ -35,8 +35,8 @@ interface State {
}
export default class BubblePopupHelper extends React.PureComponent<Props, State> {
- container: HTMLElement;
- popupContainer: HTMLElement | null;
+ container?: HTMLElement | null;
+ popupContainer?: HTMLElement | null;
state: State = {
position: { top: 0, right: 0 }
};
@@ -73,14 +73,18 @@ export default class BubblePopupHelper extends React.PureComponent<Props, State>
}
getPosition(props: Props) {
- const containerPos = this.container.getBoundingClientRect();
- const { position } = props;
- const offset = props.offset || { vertical: 0, horizontal: 0 };
- if (position === 'bottomleft') {
- return { top: containerPos.height + offset.vertical, left: offset.horizontal };
+ if (this.container) {
+ const containerPos = this.container.getBoundingClientRect();
+ const { position } = props;
+ const offset = props.offset || { vertical: 0, horizontal: 0 };
+ if (position === 'bottomleft') {
+ return { top: containerPos.height + offset.vertical, left: offset.horizontal };
+ } else {
+ // if (position === 'bottomright')
+ return { top: containerPos.height + offset.vertical, right: offset.horizontal };
+ }
} else {
- // if (position === 'bottomright')
- return { top: containerPos.height + offset.vertical, right: offset.horizontal };
+ return { top: 0, right: 0 };
}
}
@@ -88,7 +92,7 @@ export default class BubblePopupHelper extends React.PureComponent<Props, State>
return (
<div
className={classNames(this.props.className, 'bubble-popup-helper')}
- ref={container => (this.container = container as HTMLElement)}
+ ref={container => (this.container = container)}
onClick={this.handleClick}
tabIndex={0}
role="tooltip">
diff --git a/server/sonar-web/src/main/js/components/common/MultiSelect.tsx b/server/sonar-web/src/main/js/components/common/MultiSelect.tsx
index b88ccd430cf..8fe2519b558 100644
--- a/server/sonar-web/src/main/js/components/common/MultiSelect.tsx
+++ b/server/sonar-web/src/main/js/components/common/MultiSelect.tsx
@@ -48,8 +48,8 @@ interface DefaultProps {
type PropsWithDefault = Props & DefaultProps;
export default class MultiSelect extends React.PureComponent<Props, State> {
- container: HTMLDivElement | null;
- searchInput: HTMLInputElement | null;
+ container?: HTMLDivElement | null;
+ searchInput?: HTMLInputElement | null;
static defaultProps: DefaultProps = {
listSize: 10,
diff --git a/server/sonar-web/src/main/js/components/common/ScreenPositionHelper.tsx b/server/sonar-web/src/main/js/components/common/ScreenPositionHelper.tsx
index 5ead24f5611..304b46b061c 100644
--- a/server/sonar-web/src/main/js/components/common/ScreenPositionHelper.tsx
+++ b/server/sonar-web/src/main/js/components/common/ScreenPositionHelper.tsx
@@ -26,7 +26,7 @@ interface Props {
}
export default class ScreenPositionHelper extends React.PureComponent<Props> {
- container: HTMLDivElement;
+ container?: HTMLDivElement;
debouncedOnResize: () => void;
constructor(props: Props) {
diff --git a/server/sonar-web/src/main/js/components/common/__tests__/BranchStatus-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/BranchStatus-test.tsx
index c0221647154..3db595c0a2d 100644
--- a/server/sonar-web/src/main/js/components/common/__tests__/BranchStatus-test.tsx
+++ b/server/sonar-web/src/main/js/components/common/__tests__/BranchStatus-test.tsx
@@ -20,7 +20,7 @@
import * as React from 'react';
import { shallow } from 'enzyme';
import BranchStatus from '../BranchStatus';
-import { BranchType, LongLivingBranch } from '../../../app/types';
+import { BranchType, LongLivingBranch, ShortLivingBranch } from '../../../app/types';
it('renders status of short-living branches', () => {
checkShort(0, 0, 0);
@@ -28,19 +28,14 @@ it('renders status of short-living branches', () => {
checkShort(7, 3, 6);
function checkShort(bugs: number, codeSmells: number, vulnerabilities: number) {
- expect(
- shallow(
- <BranchStatus
- branch={{
- isMain: false,
- mergeBranch: 'master',
- name: 'foo',
- status: { bugs, codeSmells, vulnerabilities },
- type: BranchType.SHORT
- }}
- />
- )
- ).toMatchSnapshot();
+ const branch: ShortLivingBranch = {
+ isMain: false,
+ mergeBranch: 'master',
+ name: 'foo',
+ status: { bugs, codeSmells, vulnerabilities },
+ type: BranchType.SHORT
+ };
+ expect(shallow(<BranchStatus branch={branch} />)).toMatchSnapshot();
}
});
diff --git a/server/sonar-web/src/main/js/components/controls/ClipboardButton.tsx b/server/sonar-web/src/main/js/components/controls/ClipboardButton.tsx
index 021c390dd1e..e7d0ed049f9 100644
--- a/server/sonar-web/src/main/js/components/controls/ClipboardButton.tsx
+++ b/server/sonar-web/src/main/js/components/controls/ClipboardButton.tsx
@@ -34,9 +34,9 @@ interface State {
}
export default class ClipboardButton extends React.PureComponent<Props, State> {
- clipboard: Clipboard;
- copyButton: HTMLButtonElement | null;
- mounted: boolean;
+ clipboard?: Clipboard;
+ copyButton?: HTMLButtonElement | null;
+ mounted = false;
state: State = { tooltipShown: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx b/server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx
index 777c576eee6..54934d9e8ac 100644
--- a/server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx
+++ b/server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class ConfirmButton extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { modal: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/components/controls/DateInput.tsx b/server/sonar-web/src/main/js/components/controls/DateInput.tsx
index 87f87c5dd4d..7c1523338f7 100644
--- a/server/sonar-web/src/main/js/components/controls/DateInput.tsx
+++ b/server/sonar-web/src/main/js/components/controls/DateInput.tsx
@@ -40,7 +40,7 @@ interface Props {
}
export default class DateInput extends React.PureComponent<Props> {
- input: HTMLInputElement;
+ input?: HTMLInputElement | null;
static defaultProps = {
format: 'yy-mm-dd',
@@ -63,8 +63,10 @@ export default class DateInput extends React.PureComponent<Props> {
}
handleChange = () => {
- const { value } = this.input;
- this.props.onChange(value);
+ if (this.input) {
+ const { value } = this.input;
+ this.props.onChange(value);
+ }
};
handleResetClick = () => {
@@ -98,7 +100,7 @@ export default class DateInput extends React.PureComponent<Props> {
className={classNames('date-input-control-input', this.props.inputClassName)}
onChange={this.handleChange}
readOnly={true}
- ref={node => (this.input = node!)}
+ ref={node => (this.input = node)}
type="text"
value={this.props.value || ''}
{...inputProps}
diff --git a/server/sonar-web/src/main/js/components/controls/FavoriteBase.tsx b/server/sonar-web/src/main/js/components/controls/FavoriteBase.tsx
index db0402f888d..fd628fc3762 100644
--- a/server/sonar-web/src/main/js/components/controls/FavoriteBase.tsx
+++ b/server/sonar-web/src/main/js/components/controls/FavoriteBase.tsx
@@ -36,7 +36,7 @@ interface State {
}
export default class FavoriteBase extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/components/controls/SearchBox.tsx b/server/sonar-web/src/main/js/components/controls/SearchBox.tsx
index a4bb8196492..b5b29941883 100644
--- a/server/sonar-web/src/main/js/components/controls/SearchBox.tsx
+++ b/server/sonar-web/src/main/js/components/controls/SearchBox.tsx
@@ -47,7 +47,7 @@ interface State {
export default class SearchBox extends React.PureComponent<Props, State> {
debouncedOnChange: ((query: string) => void) & Cancelable;
- input: HTMLInputElement | null;
+ input?: HTMLInputElement | null;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/components/controls/SearchSelect.tsx b/server/sonar-web/src/main/js/components/controls/SearchSelect.tsx
index 6d6403c41c2..22b1630f1a0 100644
--- a/server/sonar-web/src/main/js/components/controls/SearchSelect.tsx
+++ b/server/sonar-web/src/main/js/components/controls/SearchSelect.tsx
@@ -45,7 +45,7 @@ interface State {
}
export default class SearchSelect extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
constructor(props: Props) {
super(props);
diff --git a/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx b/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx
index 1359c584e8a..b277510245d 100644
--- a/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx
+++ b/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx
@@ -39,7 +39,7 @@ interface State {
}
export default class SimpleModal extends React.PureComponent<Props, State> {
- mounted: boolean;
+ mounted = false;
state: State = { submitting: false };
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/components/lazyLoad.tsx b/server/sonar-web/src/main/js/components/lazyLoad.tsx
index 952f9da83bf..f12b4734b6f 100644
--- a/server/sonar-web/src/main/js/components/lazyLoad.tsx
+++ b/server/sonar-web/src/main/js/components/lazyLoad.tsx
@@ -31,7 +31,7 @@ export function lazyLoad(loader: Loader) {
// use `React.Component`, not `React.PureComponent` to always re-render
// and let the child component decide if it needs to change
return class LazyLoader extends React.Component<any, State> {
- mounted: boolean;
+ mounted = false;
state: State = {};
componentDidMount() {
diff --git a/server/sonar-web/src/main/js/helpers/request.ts b/server/sonar-web/src/main/js/helpers/request.ts
index 274222ed192..e37923337ee 100644
--- a/server/sonar-web/src/main/js/helpers/request.ts
+++ b/server/sonar-web/src/main/js/helpers/request.ts
@@ -75,12 +75,12 @@ const DEFAULT_HEADERS = {
* Request
*/
class Request {
- private data: RequestData;
+ private data?: RequestData;
constructor(private url: string, private options: { method?: string } = {}) {}
getSubmitData(customHeaders: any = {}): { url: string; options: RequestInit } {
- let url = this.url;
+ let { url } = this;
const options: RequestInit = { ...DEFAULT_OPTIONS, ...this.options };
if (this.data) {
diff --git a/server/sonar-web/yarn.lock b/server/sonar-web/yarn.lock
index 550e6492815..7be3c394b57 100644
--- a/server/sonar-web/yarn.lock
+++ b/server/sonar-web/yarn.lock
@@ -63,9 +63,9 @@
version "1.6.28"
resolved "https://registry.yarnpkg.com/@types/keymaster/-/keymaster-1.6.28.tgz#093fc6fe49deff4ee17d36935a49230edb1c935f"
-"@types/lodash@4.14.80":
- version "4.14.80"
- resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.80.tgz#a6b8b7900e6a7dcbc2e90d9b6dfbe3f6a7f69951"
+"@types/lodash@4.14.102":
+ version "4.14.102"
+ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.102.tgz#586a3e22385fc79b07cef9c5a1c8a5387986fbc8"
"@types/node@*":
version "8.0.47"
@@ -6853,10 +6853,14 @@ selfsigned@^1.9.1:
dependencies:
node-forge "0.6.33"
-"semver@2 || 3 || 4 || 5", semver@5.4.1, semver@^5.3.0:
+"semver@2 || 3 || 4 || 5", semver@^5.3.0:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
+semver@5.5.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
+
send@0.16.1:
version "0.16.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3"
@@ -7550,16 +7554,16 @@ typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
-typescript-eslint-parser@12.0.0:
- version "12.0.0"
- resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-12.0.0.tgz#caea4b4e89e83f25765b310b924a03ba95a6dd19"
+typescript-eslint-parser@13.0.0:
+ version "13.0.0"
+ resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-13.0.0.tgz#57f9be603d0fad7c26da76c2be67c0779d23362c"
dependencies:
lodash.unescape "4.0.1"
- semver "5.4.1"
+ semver "5.5.0"
-typescript@2.6.2:
- version "2.6.2"
- resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
+typescript@2.7.1:
+ version "2.7.1"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.1.tgz#bb3682c2c791ac90e7c6210b26478a8da085c359"
ua-parser-js@^0.7.9:
version "0.7.17"