]> source.dussan.org Git - sonarqube.git/commitdiff
update typescript to 2.7 (#3054)
authorStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 13 Feb 2018 16:18:58 +0000 (17:18 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2018 16:18:58 +0000 (17:18 +0100)
148 files changed:
server/sonar-web/.eslintrc
server/sonar-web/package.json
server/sonar-web/src/main/js/app/components/App.tsx
server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
server/sonar-web/src/main/js/app/components/LocalizationContainer.tsx
server/sonar-web/src/main/js/app/components/SimpleContainer.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx
server/sonar-web/src/main/js/apps/account/organizations/CreateOrganizationForm.tsx
server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx
server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.tsx
server/sonar-web/src/main/js/apps/code/components/App.tsx
server/sonar-web/src/main/js/apps/code/components/Component.tsx
server/sonar-web/src/main/js/apps/code/components/Search.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationButton.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleButton.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsTagsPopup.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx
server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx
server/sonar-web/src/main/js/apps/custom-measures/components/CreateButton.tsx
server/sonar-web/src/main/js/apps/custom-measures/components/EditButton.tsx
server/sonar-web/src/main/js/apps/custom-measures/components/Form.tsx
server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx
server/sonar-web/src/main/js/apps/custom-metrics/components/CreateButton.tsx
server/sonar-web/src/main/js/apps/custom-metrics/components/EditButton.tsx
server/sonar-web/src/main/js/apps/groups/components/App.tsx
server/sonar-web/src/main/js/apps/groups/components/EditGroup.tsx
server/sonar-web/src/main/js/apps/groups/components/EditMembers.tsx
server/sonar-web/src/main/js/apps/groups/components/Header.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/AssigneeFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/LanguageFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/ModuleFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/RuleFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.js
server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.js
server/sonar-web/src/main/js/apps/marketplace/App.tsx
server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx
server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx
server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx
server/sonar-web/src/main/js/apps/overview/badges/BadgeParams.tsx
server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx
server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.tsx
server/sonar-web/src/main/js/apps/overview/meta/MetaQualityProfiles.tsx
server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx
server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx
server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
server/sonar-web/src/main/js/apps/portfolio/components/App.tsx
server/sonar-web/src/main/js/apps/portfolio/components/Report.tsx
server/sonar-web/src/main/js/apps/portfolio/components/Subscription.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchRow.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPattern.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx
server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx
server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx
server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx
server/sonar-web/src/main/js/apps/projectQualityProfiles/ProfileRow.tsx
server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.tsx
server/sonar-web/src/main/js/apps/projectsManagement/App.tsx
server/sonar-web/src/main/js/apps/projectsManagement/BulkApplyTemplateModal.tsx
server/sonar-web/src/main/js/apps/projectsManagement/CreateProjectForm.tsx
server/sonar-web/src/main/js/apps/projectsManagement/DeleteModal.tsx
server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx
server/sonar-web/src/main/js/apps/projectsManagement/RestoreAccessModal.tsx
server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/CopyQualityGateForm.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/CreateQualityGateForm.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/DeleteConditionForm.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/RenameQualityGateForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.tsx
server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/App.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/CopyProfileForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/DeleteProfileForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/RenameProfileForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissions.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsGroup.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsUser.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/CreateProfileForm.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx
server/sonar-web/src/main/js/apps/sessions/components/EmailAlreadyExists.tsx
server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.tsx
server/sonar-web/src/main/js/apps/system/__tests__/utils-test.ts
server/sonar-web/src/main/js/apps/system/components/App.tsx
server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeNotif.tsx
server/sonar-web/src/main/js/apps/users/UsersApp.tsx
server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx
server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx
server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx
server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx
server/sonar-web/src/main/js/apps/users/components/TokensFormItem.tsx
server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
server/sonar-web/src/main/js/apps/users/components/UsersSelectSearch.tsx
server/sonar-web/src/main/js/apps/web-api/components/ResponseExample.tsx
server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx
server/sonar-web/src/main/js/components/common/BubblePopupHelper.tsx
server/sonar-web/src/main/js/components/common/MultiSelect.tsx
server/sonar-web/src/main/js/components/common/ScreenPositionHelper.tsx
server/sonar-web/src/main/js/components/common/__tests__/BranchStatus-test.tsx
server/sonar-web/src/main/js/components/controls/ClipboardButton.tsx
server/sonar-web/src/main/js/components/controls/ConfirmButton.tsx
server/sonar-web/src/main/js/components/controls/DateInput.tsx
server/sonar-web/src/main/js/components/controls/FavoriteBase.tsx
server/sonar-web/src/main/js/components/controls/SearchBox.tsx
server/sonar-web/src/main/js/components/controls/SearchSelect.tsx
server/sonar-web/src/main/js/components/controls/SimpleModal.tsx
server/sonar-web/src/main/js/components/lazyLoad.tsx
server/sonar-web/src/main/js/helpers/request.ts
server/sonar-web/yarn.lock

index d03895d0134356332b9e1d04f29059ff8c3700d0..9ca9ff7e9009cb7dc1929e02bfc69635646c9419 100644 (file)
       {
         "order": [
           "type-annotations",
+          "instance-variables",
           "static-methods",
           "lifecycle",
           "everything-else",
index 8e3b92e311629636979300ea3e2626c93138c557..da0674593e14bc669585a063b2fb4967a1d5a320 100644 (file)
@@ -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",
     "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"
index 0b7375c9c93c32b5be6d2d6af056dd92c8e34647..845d6b880c0b1ae95f4eaef35668225267cc7e5b 100644 (file)
@@ -42,7 +42,7 @@ interface State {
 }
 
 class App extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static childContextTypes = {
     branchesEnabled: PropTypes.bool.isRequired,
index 75d48a09dffc53afc698a6da1d426a5fee6e0d1a..af04b9229fbfcbd1cf2507ac2bab90bc57932836 100644 (file)
@@ -49,7 +49,7 @@ interface State {
 }
 
 export class ComponentContainer extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     organizationsEnabled: PropTypes.bool
index a9e02214954243347125f455d87cc1ee5d93f55b..dc6cea9cf5811dcddd733630c71a1bbbedb7cf2a 100644 (file)
@@ -32,7 +32,7 @@ interface State {
 }
 
 export default class LocalizationContainer extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   state: State = { loading: true };
 
index b14e0475b70515a8287e2eff2b67456cca0a8009..728d654579f670303bf4a0258c31891f264c383b 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class SimpleContainer extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static childContextTypes = {
     onSonarCloud: PropTypes.bool
index f906af392f625af4dfcaf0cabb01ce8f0b3c3fc5..71380876edf214f884113b40d4ecadb8893f8214 100644 (file)
@@ -41,7 +41,7 @@ interface Props {
 }
 
 export default class ComponentNav extends React.PureComponent<Props> {
-  mounted: boolean;
+  mounted = false;
 
   componentDidMount() {
     this.populateRecentHistory();
index e20aaf1b9c3bac09e1548429f17132d63ca25769..8c600143589f6743240d8d6e5d645e9ef99e0089 100644 (file)
@@ -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,
index 1ac0cc50ae903bf1abc5a9462426b57184109da4..b46da2bf13db3e9daa4a1ccb44b84e0c4d0a4247 100644 (file)
@@ -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
index c716ac0ec06fead74c4d2e3b514dc0f5644d8a83..53117d71a120209d00052cd0bf0f57481b0ec453 100644 (file)
@@ -46,7 +46,7 @@ interface State {
 }
 
 class CreateOrganizationForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     router: PropTypes.object
index 30895a4147ec67e45ebe7460eb01a7cec7d21df4..6ec85e94b4308d0c1ea5ae960945adc53ffe2f41 100644 (file)
@@ -45,7 +45,7 @@ interface State {
 }
 
 class UserOrganizations extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { createOrganization: false, loading: true };
 
   componentDidMount() {
index 23c2d3261996c4a9209e7b28fbc19a25d777854e..923c7c9acb8d518864e80bcad970af1ad1fa1980 100644 (file)
@@ -32,7 +32,7 @@ interface State {
 }
 
 export default class ProjectsContainer extends React.PureComponent<{}, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {
     loading: true,
     page: 1,
index 46184a58a669c646d3391bff1ebd0b55f7b6427c..45f653857b0a165a8c91ba6ac25be83aa54a64f4 100644 (file)
@@ -33,7 +33,7 @@ interface State {
 }
 
 export default class ScannerContext extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {};
 
   componentDidMount() {
index a96943602040d495bcfac918c1f1c95452dd31d5..1ea9befbc891b24d80d3faa842f83649daebf374 100644 (file)
@@ -34,7 +34,7 @@ interface State {
 }
 
 export default class Stacktrace extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index 7b1adf819c6a6982710401a4a3115e066fd32cb4..24f084cd739e3cf292209ae986dfd5b4191e3165 100644 (file)
@@ -37,7 +37,7 @@ interface State {
 }
 
 export default class Workers extends React.PureComponent<{}, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {
     canSetWorkerCount: false,
     formOpen: false,
index 3c6382818c988efa82bb2a932bcb2aa6cf406291..91c5b7d3747a8c341f30369fdcf47852066520f3 100644 (file)
@@ -37,7 +37,7 @@ interface State {
 }
 
 export default class WorkersForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 08ceee43e656f967b85c792d603eafd1031a3500..b6941e5638863529ec50104f326af4be50a81ede 100644 (file)
@@ -53,7 +53,7 @@ interface State {
 }
 
 export default class App extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {
     loading: true,
     breadcrumbs: [],
index 6ba67258835892984b7ed4d5179e4f9729cb099c..841d96baee72ed94add813975c091b0272de3ec8 100644 (file)
@@ -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>
index 002db15bf21ca207c0a700bd4128e0821944a708..4a5536ed3de0434507576fa33994f59f61ff8fdd 100644 (file)
@@ -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
index b96a25138436ebe15464ad28c6986d897273af72..97ae4439f34c66d72debd05d23366d5157f61a63 100644 (file)
@@ -39,7 +39,7 @@ interface State {
 }
 
 export default class ActivationButton extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index 2fcc083b6882480d2fd3a0074d77ddb5ee05d5e6..c410a105cae8d95c837e41c0882a14bca4cf5c1d 100644 (file)
@@ -47,7 +47,7 @@ interface State {
 }
 
 export default class ActivationFormModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 2dfe9096b12fffa7e858f36c98980496d87c8766..eac010a98dfb82381af6154370d9d2ce938c3dcd 100644 (file)
@@ -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,
index 37efe2e266eba8853efcf6d591e3c6b27bbb28d3..5b4d9e3c66531c70a9f5c0c0a19861cf7156194a 100644 (file)
@@ -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() });
   };
 
index 54368071b6bd0692fe322fc2deafc58168770b0b..f798128569293ab448192f37c30664fc336ab75e 100644 (file)
@@ -50,7 +50,7 @@ interface State {
 }
 
 export default class BulkChangeModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index b2e9c8d5eb6283116f3806162dca6bd0c2f5e682..5882d70b307a717f32e91f7ce1e9cde96415de59 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class CustomRuleButton extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index b650c27fd435f28b9563f598c1627d259b790678..426c180a43a408ecc571eeea2571d000e3ec226c 100644 (file)
@@ -52,7 +52,7 @@ interface State {
 }
 
 export default class CustomRuleFormModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 752c317cb5081b740962208ad5743b8a8e382656..331e1c908e2da3f42948d8e38569d2e9e10f60cd 100644 (file)
@@ -54,7 +54,7 @@ interface State {
 }
 
 export default class RuleDetails extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index 2804fbde9e9eb6c9e8f31da0a14c74ae789f1362..d080327593f7401dc9638e8a6be4af294de980bc 100644 (file)
@@ -41,7 +41,7 @@ interface State {
 }
 
 export default class RuleDetailsCustomRules extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index c5e31bcb5a56e976dab074eb5e898edc87eafc49..b21425fa10a5fea71c1516d1c35cb2a03079515d 100644 (file)
@@ -39,7 +39,7 @@ interface State {
 }
 
 export default class RuleDetailsDescription extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {
     description: '',
     descriptionForm: false,
index 78b71bb74e77cc20a315aafc28611ef199111f5a..6f953ba6bb713977f0b8fc3c2d8bd92807e7e24e 100644 (file)
@@ -44,7 +44,7 @@ interface State {
 }
 
 export default class RuleDetailsIssues extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index 162863838656912d2eeca4b830aebdb9f198424d..551b6d1402a5b15635c4faab9e94e51c73b38b9b 100644 (file)
@@ -46,7 +46,7 @@ interface State {
 }
 
 export default class RuleDetailsProfiles extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   componentDidMount() {
     this.mounted = true;
index 895ab60771fff48509025fdfe235be53fb5dc85b..d60647520709a1472b88fd68a527826e82fcff97 100644 (file)
@@ -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() {
index ea93d9559a1eaf8c1b90e4ff9a20d52232485552..8340279f3adda8e2ef76bfdf11cc14f47a967148 100644 (file)
@@ -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] });
index 10ad59e53d82bc31683e817416b67613fa1c89fe..79e4a5e5d671a5ca3ae82bc742ab5fa9c73ad3a3 100644 (file)
@@ -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() {
index ed9e536e3f10e36a3e8ce71251a6dbce707a3e77..feea67a5ab4f87fc19bcbddd6c91c59e4c781f78 100644 (file)
@@ -31,7 +31,7 @@ interface State {
 }
 
 export default class CreateButton extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index ac0bef498084e7252b189b7de640025faa0e1206..655b02b6eaf178ae8673d14f97046e0c463e8c02 100644 (file)
@@ -33,7 +33,7 @@ interface State {
 }
 
 export default class EditButton extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index 97aceef43dac60ba48f278f3598e5332b114ad61..6b814dd735a8408c8e87b11961d92c0a71140d13 100644 (file)
@@ -43,7 +43,7 @@ interface State {
 }
 
 export default class Form extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index a616a996a858dc2234a08b906698ae2ed5ac3da2..f802bc704f812db3309ea8e0d39d388a2c34b8de 100644 (file)
@@ -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() {
index fffca99bfda54292f2152c70c67a9fa1411dab84..e3b67e82d845dbc23394fbb64509ee7dfbaee07c 100644 (file)
@@ -32,7 +32,7 @@ interface State {
 }
 
 export default class CreateButton extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index 6257f2ad92d33db3271bfe844df9d8584b94015c..d0870fa8c061dabba21563233786871f3aa142e5 100644 (file)
@@ -35,7 +35,7 @@ interface State {
 }
 
 export default class EditButton extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index 5aebe1661320e277afa67a2102357aaaa47e5bfc..dac3048bf4995e7763e86bb83d181dd4dd6e1693 100644 (file)
@@ -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() {
index 8cf6bf7f8d2ac7fdcd0fcc7d067f6527e1f47744..2de9ded54a11e84f26214811f4359b07422541c9 100644 (file)
@@ -34,7 +34,7 @@ interface State {
 }
 
 export default class EditGroup extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index 6ab1d85fd0abe3e3df1b9726014e7dc9863b4f56..a83ee573e559e6df76d3bb7c93c51b766a057613 100644 (file)
@@ -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() {
index 973ccb981ddae2f6c09944d5e085ecb4060d40f4..36f13bad6471917c4998d0dc5ef7025eace4d267 100644 (file)
@@ -32,7 +32,7 @@ interface State {
 }
 
 export default class Header extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { createModal: false };
 
   componentDidMount() {
index f48516ee94f1110d2745851853e17387e7968f36..a2d1685f607324f6eaf0299d6e3d89ecfc276a15 100644 (file)
@@ -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
index 734a9f23699bd82b55160b66b691ef6a7b7d3fcc..7b5c4764226153cf5c5713324d775bfd647ab3fc 100644 (file)
@@ -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(
index b3488fdb9750725c51ea42013ebe0e4e52055c3d..e4ecafbf742fa89c2df7501c9483563917fc272b 100644 (file)
@@ -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 ||
index 83926732bf2cd963a19e94ec0a5df29a2fdcbbe0..519eb6ddfbe51573e7965b6ac019f2d034301700 100644 (file)
@@ -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(
index 9d2587536a30614178fd747500b0717ef371748d..187916efc774257de6483d53562c08732b7a8f54 100644 (file)
@@ -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(
index 1ccd0307689a9dd83611e978ab2cc988ce0da9e7..b89269c9446eeb7498d7747b4026e558e0e1c567 100644 (file)
@@ -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(
index 8a9a9a7cc8efe20a6785bf2a9ebbee0a2662c08f..234949ace26f76b36085f4e06e6818da0d552e18 100644 (file)
@@ -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(
index e93c288fbfe6230a32fab949ccf3c1ef92e10c91..fba2560cc8353a4f8c36af66eb095926b590b13c 100644 (file)
@@ -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(
index bd59288b2780cc88b17ec79851e7873053217f9a..cc9064b41dec0d688450dcedba4cfab04e1823f4 100644 (file)
@@ -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
index daf05e65b5826c2632b02d436cfdbbc238e6eb6d..18704e1f4ff78bc7b1ba48e22bd6db63608661e2 100644 (file)
@@ -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(
index a1ec5af4071aa7f2933289904adbe79ac405967e..6106d9ed2408f3b837f925c6a43a66306605fe43 100644 (file)
@@ -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(
index d11062c7cc256240358a5692c730012a1f76c66f..affd8c29c6975310a3e776eacdc4a2daf01a07fa 100644 (file)
@@ -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(
index 66164f9c8ab1d71789c7951b839d120483088d4c..51df80106ccabee11bdd31d0a09360d52453141b 100644 (file)
@@ -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(
index e02ea9f64cbcbdcdb5152b4253270120088cbdb0..7bfd6dccc72967bef3b50b0b8af82d0b9ad55980 100644 (file)
@@ -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(
index 9615d5f844e4b2bbf1f7d73ae96d63e08546bdac..c7256e530750d0a3706c67c190f16a5ed5455f72 100644 (file)
@@ -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
index 9a38b96b1080a05f17fdb43b49d1b63452f03c7a..fb609f9e30a6ab0a1bf5c06d8a634a0c6dcb8b3b 100644 (file)
@@ -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() {
index 0c9d4382bf464bff224d6c901b0872723a140632..6be68c1aa3194ca32973bf91f036f7854e18d819 100644 (file)
@@ -48,7 +48,7 @@ interface State {
 }
 
 export default class LicenseEditionSet extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 324f3d9d34afb4a8b9685d2ba4f927fba4117dfe..9a54b4f26a0a040034734971b08378013559958e 100644 (file)
@@ -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() {
index f6817b6749d4a44cf98e7d4a3bed198b3f06b393..ad79e2a31d2fbb3babb00f11f5c19789d2d16588 100644 (file)
@@ -34,7 +34,7 @@ interface State {
 }
 
 export default class UninstallEditionForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index 17e3da5f7ebe1be58e817cd30da492e4f7f19ef0..6c5a6613d61aee28365a5621c33f2789a20ff7dc 100644 (file)
@@ -37,7 +37,7 @@ interface State {
 }
 
 export default class BadgeParams extends React.PureComponent<Props> {
-  mounted: boolean;
+  mounted = false;
 
   state: State = { badgeMetrics: [] };
 
index 4e7dd8c57b5741552edd87ae7b7919bc83ca46c2..a9bba4a81bc432bdd2b3ec74788e39fe8ca88630 100644 (file)
@@ -67,7 +67,7 @@ interface State {
 }
 
 export class OverviewApp extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true, measures: [] };
 
   componentDidMount() {
index 6984424fa8feb9d4f57652de22da63eef0521ef9..8380a53b0a5dbbbdb3bc58534159c6ff14fd3bd4 100644 (file)
@@ -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() {
index 907d76a3877957eff061c8de9b622e859985b13e..ed778b4cef73eeff551a9414031491a0995db7a9 100644 (file)
@@ -33,7 +33,7 @@ interface State {
 }
 
 export default class MetaLinks extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {};
 
   componentDidMount() {
index c9648810b856036d081ca25ccaf7d192eafec4ed..d55ad3cc8229eb796a147fed0f52273e60b347b0 100644 (file)
@@ -42,7 +42,7 @@ interface State {
 }
 
 class MetaQualityProfiles extends React.PureComponent<StateProps & OwnProps, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { deprecatedByKey: {} };
 
   componentDidMount() {
index 209b8a978805b0d1853d52fc923f80d9ac1aac71..07365b2633069adb94b0de548c348c6c07eabfc9 100644 (file)
@@ -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() {
index 3d8202f0d9db057ba4c8ef3a44f7692f22eaa0b8..600499f90385f9aa42fbce11d60927bb4477d37d 100644 (file)
@@ -37,7 +37,7 @@ type State = {
 };
 
 export default class ApplicationQualityGate extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index b90026b85241a16f0e45742d9aac5cb3d95ef287..ddba951e31320022c63ea2626a7b9fb7659ef5a0 100644 (file)
@@ -39,7 +39,7 @@ interface State {
 }
 
 export default class Activity extends React.PureComponent<Props> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index 84ba6bbbf0a917a92e6592e4b058933d4572039e..27d4e2d957b38e9dae7d52358012178316806751 100644 (file)
@@ -59,7 +59,7 @@ interface State {
 }
 
 export class App extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index e562f829b1c79d431aab5fd03d970f960c77e3d9..478cd3d86088c31cb29d54fce810a4abfe8a9b2b 100644 (file)
@@ -32,7 +32,7 @@ interface State {
 }
 
 export default class Report extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index a229a365b83bd03e8d1e5b26c41286b5bf3d598e..98282a76287e0bdf0031db765c09c902d696920a 100644 (file)
@@ -33,7 +33,7 @@ interface State {
 }
 
 export default class Subscription extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 2341dfc62f5743fa8899ce4825aa76339295a2e5..e4c886668fd91dc7d9d880c888823904f8f79cba 100644 (file)
@@ -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() {
index b103ded575f4a61faa8c1bf198643f0557a1a003..723998c70493b1e98d16905cfcc9453dd97a8d5d 100644 (file)
@@ -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() {
index 2a268362655d0c7f09560efa78c092307866edfc..4760621d29cbd908820e35651adebb9b0a23c821 100644 (file)
@@ -35,7 +35,7 @@ interface State {
 }
 
 export default class DeleteBranchModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index 9c6507341ef68b80d7a97555b1a5991f53444e09..71d4deaa53f0a5778e8143b74994e9a52b2072a0 100644 (file)
@@ -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() {
index 83fe9f9ed33b4c5c1b12f7f66a74437e4d7793fa..e6d8b31d0f23328af0aad431348d4dee046f19e4 100644 (file)
@@ -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() {
index d319516a31b0b02c3c5f1e09cae68847513d0b37..67a7656fe0a98bcf94d5eae890a48f389cf9486e 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class RenameBranchModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index f20efd74170cdf34402cad71572a76d985fda13b..e862b2b7f8c8d5d4115835cc18e44d09a6030d0c 100644 (file)
@@ -35,7 +35,7 @@ interface State {
 }
 
 export default class SettingForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index b2d9aa3abfdb73e57dcb534836f3fcaa005d4a34..e22b327bbc1582002a1c3c7560be7ac92e4d8806 100644 (file)
@@ -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 }
index 84739d0586518e1f9b087b9d5fdbe4072af70c0c..4b6c1615d89e69639e5b17d010030138fcaaf8a8 100644 (file)
@@ -45,7 +45,7 @@ interface State {
 }
 
 export default class App extends React.PureComponent<Props> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index be13bfb1a6c9272187ccc942069debfb1299350c..3a826687096578d5023aae72dbd0babc7216bd13 100644 (file)
@@ -39,7 +39,7 @@ interface Option {
 }
 
 export default class Form extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index eea2e1f38a2205df1085723373febab01a8cd305..a1f5ed8163a5e574b102814d0d4c458c993b13cc 100644 (file)
@@ -43,7 +43,7 @@ interface State {
 }
 
 export default class QualityProfiles extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index 5f97f52583a3177fad93f5f4e87c6882361e6a24..d430f983921f577cf60f00a5aeff6ce628e2706c 100644 (file)
@@ -33,7 +33,7 @@ interface State {
 }
 
 export default class ProfileRow extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index 3dd862df04279a45ebf49479822e6c5bac96f81f..b0f995c28466e84b220efca101c9a12cc05259a2 100644 (file)
@@ -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
index 963333ba5c1ada0bcf7a4c8fdd2c7eff386eb14d..e833751488327db90d6af1d5520e0e7bb80153e8 100644 (file)
@@ -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);
index 5b6131ac59a9d6bd8fde97d706beee995dc38702..71376df4a741697b5c4a8cc979132738e3e2718a 100644 (file)
@@ -52,7 +52,7 @@ interface State {
 }
 
 export default class App extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index ca1e967a91c0a3b4f8d412b8a35d43f780fcc793..726b4f697092fe0c768c349401f7cc213fe7126c 100644 (file)
@@ -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() {
index 7b314f00fde09bb2660c1d6fb8c3b2b0b73cf231..b43aadab9c78a19f4334904c69e58ea7a18c1922 100644 (file)
@@ -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);
index df34b89388d5f96b35365a6a44fa3c3e249283d7..a9b45bb2a52a8e32474a1af43d0b5de76f8eedde 100644 (file)
@@ -40,7 +40,7 @@ interface State {
 }
 
 export default class DeleteModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index 9dd13893bafe1b3e6d2d02aa4a94a92c3f3b7bd4..7f188592892c907700f5a699535e6e7b10e749ba 100644 (file)
@@ -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() {
index 74d5e6c2e434bdea43be7fb2d52749bd5f652621..d936fafa1e981e4383c9cf199bdc9f3ce09d6216 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class RestoreAccessModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index d7f7a252a177cd22ba34a46371a366530b155c3c..6e3fa3d02ac62e042ca2e09b0b3bfc709459e78a 100644 (file)
@@ -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 = () => {
index 0355ff8e57f50680958c36f49100cf7d3afb0936..4c16c04184c61c62d7a9d9cbd4cc964e5defe10d 100644 (file)
@@ -37,7 +37,7 @@ interface State {
 }
 
 export default class CopyQualityGateForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     router: PropTypes.object
index bfc05396ec6c6a9974629d2be028e8c00b2189db..cb228fd06adbeadee502a6bb3ebe268c8ddf6645 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class CreateQualityGateForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     router: PropTypes.object
index 78e1e2be3ebe70990c310d7ccc66ab72a6eee19b..c8f041fef39f70a719db513b4050675807eb68a8 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class DeleteConditionForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index 617385a0303d0030ed88ce46d562b2a52caf0dd1..b37e21d0b5d97b9e0acc590eb9d05d838fb0e831 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class DeleteQualityGateForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     router: PropTypes.object
index b336ad6a1f1475e0e3236fb580b26a36c5d74a3c..964f160ad4023e2f160784f51dda6c4da87a1a2f 100644 (file)
@@ -35,7 +35,7 @@ interface State {
 }
 
 export default class RenameQualityGateForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 814c6f15fe96bc74d5274cfaf864959ead513b31..114807dd0f9bb2c282b202812ca6491bfe3e1cef 100644 (file)
@@ -46,7 +46,7 @@ interface State {
 }
 
 export default class ChangelogContainer extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     router: PropTypes.object
index 42c39724794de361ddf17f1bc5fc6c4ac7fb3243..f461c668672a3c6d5469af4aeccafe7c2bb7f61b 100644 (file)
@@ -49,7 +49,7 @@ interface State {
 }
 
 export default class ComparisonContainer extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     router: PropTypes.object
index cadc9f2e47efb53c62ddcca929c9b193b038038f..a831d023512e5caf587515a1f773f77420b622e5 100644 (file)
@@ -40,7 +40,7 @@ interface State {
 }
 
 export default class App extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: true };
 
   componentDidMount() {
index d2c78120663cfd2bc1c5448963c36c3e2f0319fd..7d04a1f3809866287705bedf489c150ffda1b078 100644 (file)
@@ -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() {
index b114ee70cf4dd63b10ca40258e1ccaffeb4dce11..1b564ec9be0812d414a41c2e75b21185f5e8196d 100644 (file)
@@ -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() {
index 5868a2f3dc903c14743fe87163d4eea1ce54d5a2..34b610bc7d8e04416e228e927ca8369445a7923a 100644 (file)
@@ -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() {
index fc750493c2a158f6b90b4cce3e4c7fc137dcb06b..b1978c6d310572706bb4fc045b9ea461cf977535 100644 (file)
@@ -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
index f0734adc6cb390b590bbfd2f0cd78633d3c150e3..8eb09c52072a3fb7ac8975a67c7b72c91ddcbb06 100644 (file)
@@ -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">
index 41413fad4d476b2fe507822a5f50c1c459131d09..2786757c0f3e051f3b22a66261ed762e50416fe0 100644 (file)
@@ -51,7 +51,7 @@ interface State {
 }
 
 export default class ProfileInheritance extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   state: State = {
     formOpen: false,
index e81978aa22f7e2109de70452a48e30aa7804d3fb..e77208909df9136144c0d7fa00ff58d29f66e86b 100644 (file)
@@ -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() {
index ba7c7957ea588ce49b98c591c21c55dcf5402c4f..06fc7c571da6b114aba4c10104451a146d8a9b86 100644 (file)
@@ -44,7 +44,7 @@ interface State {
 }
 
 export default class ProfilePermissionsForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { submitting: false };
 
   componentDidMount() {
index c6882c84dbf8da8b4ee6a8d68bd35cb4869b3280..b853c1e8de34047954f8a0237925a689f8092b85 100644 (file)
@@ -41,7 +41,7 @@ interface State {
 }
 
 export default class ProfilePermissionsFormSelect extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 8b780f3bd43f9ede834e7d64a1124e311bdce848..2dbb0885ee2ae7d4164202f4f48cd732c02c1631 100644 (file)
@@ -38,7 +38,7 @@ interface State {
 }
 
 export default class ProfilePermissionsGroup extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { deleteModal: false };
 
   componentDidMount() {
index e757ba7db284f55467467347ebf0352f1bed23c2..d2c2094cd6272d64240746e6d8220065a0589423 100644 (file)
@@ -38,7 +38,7 @@ interface State {
 }
 
 export default class ProfilePermissionsUser extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { deleteModal: false };
 
   componentDidMount() {
index 3ede46fe2057cced7ed784483d90ca5fcecbe432..84fd60c40fa09917a579ece8b8fa24bf96abbe61 100644 (file)
@@ -39,7 +39,7 @@ interface State {
 }
 
 export default class ProfileProjects extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   state: State = {
     formOpen: false,
index 93bad2515b0da8ba4525120104220179802646d9..a3a73a80a9fba2632a1bbf5124838e93421a6725 100644 (file)
@@ -52,7 +52,7 @@ interface State {
 }
 
 export default class ProfileRules extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   state: State = {
     activatedTotal: null,
index 52450e534834dae95a9730c5bb51cc12ec428ee6..d60ab75b1d229d4fb30cd5b8bd5484da93457636 100644 (file)
@@ -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() {
index d4b1df5a548de1a8e636df355816f9fbfda612a8..dac9e1a71be377991b0cf7a8bfd7fe4107d16e7f 100644 (file)
@@ -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);
index e3a42fb47b898fb61c04d7e9d47d37a84937c961..d964ff019ee93b1836788314ca9b9348268d9338 100644 (file)
@@ -37,7 +37,7 @@ interface State {
 }
 
 export default class RestoreProfileForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { loading: false };
 
   componentDidMount() {
index fd9ece71a5760ec88cd311df504f2fd1c9f057c2..baf38997a155e05a63d5fd1e01b676325b7ebd3d 100644 (file)
@@ -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() {
index c1b706544b0f5e3cf65491e39f0e505ef8e55d80..f8056a41dd576e2f2842965a15669ae95476cad6 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 class LoginFormContainer extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     onSonarCloud: PropTypes.bool
index ba68020a55b241f21512f31687267a01081be9ce..1bad72054f37ae337a16fadb3a45fdff4e9a626b 100644 (file)
@@ -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');
   });
index 7c3c01adf5c1efac959fb5ba21092ca97146b6af..07ce3c1d3254bbcfa8749fe90f1ac22b3996ab32 100644 (file)
@@ -47,7 +47,7 @@ interface State {
 }
 
 export default class App extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   static contextTypes = {
     router: PropTypes.object
index 674d2f05d530f0b0d2d0db72757222074fb6502c..a39c44965b341189bef6187952a7953877f7aa2b 100644 (file)
@@ -29,7 +29,7 @@ interface State {
 }
 
 export default class SystemUpgradeNotif extends React.PureComponent<{}, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { openSystemUpgradeForm: false, systemUpgrades: [] };
 
   componentDidMount() {
index f66cabe81ac057426013172dc62226d80d3a88ae..1cf4ee7e669979bc06178b887c9cb6de657f2812 100644 (file)
@@ -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
index a6ad6f8372d5f6614a27c7105d20c8212f01d47f..7b34c4c3fc89db0ae4b4b3a6bc3977b6efc4f220 100644 (file)
@@ -34,7 +34,7 @@ interface State {
 }
 
 export default class DeactivateForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { submitting: false };
 
   componentDidMount() {
index fd6cc251dba3856c6b3490f743734a159c123433..a15eac7f596adf2e92910eb7a0f3a74f89bd2e67 100644 (file)
@@ -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();
index 1caef1c894a05a898a44adb6eae4a4493e49b8b6..675b42761ced337afaf21ccb84c751965e301844 100644 (file)
@@ -41,7 +41,7 @@ interface State {
 }
 
 export default class PasswordForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {
     confirmPassword: '',
     newPassword: '',
index 6bdca5c19d6444d02382be48395fd66114021e0f..0869b13fbaf4c09262a669024bdf7e6b2350ced8 100644 (file)
@@ -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,
index 34dd611f125edabe0690982270a232824d6270c2..ab1a4902aa77b31ed6bc4b06fee9414294a33bde 100644 (file)
@@ -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() {
index 2cb241d0b1a7c3302f745385b34df7b089528b80..6aae213803869f4299d5f1f7b9e0cde785d481ce 100644 (file)
@@ -44,7 +44,7 @@ interface State {
 }
 
 export default class UserForm extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 2d54fee167ca5a562b6cd416504e8d210b8695a4..fa62338bcbc9537782d9372a75a7b3169db29327 100644 (file)
@@ -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);
index 49f8cd2e379f9f99193dc31e7ffcc285be3eef93..e83c62e418562d427617c2c1d811d541447d44a7 100644 (file)
@@ -35,7 +35,7 @@ interface State {
 }
 
 export default class ResponseExample extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = {};
 
   componentDidMount() {
index ad9c009475dc13004994c323eceb94bf37e731c6..cb2b5e5f4d2e50567af7077a2ea3e157848f3870 100644 (file)
@@ -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
index 8dd7237cbdfd8cc2d9c341ef24a3ed74b21502d9..2cfb88cee4c36b902dcae26f62fcafcac7de6855 100644 (file)
@@ -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">
index b88ccd430cffd1f964944f70d2934f1fae5f650a..8fe2519b5582c0ede83b944c88bec2576db627ef 100644 (file)
@@ -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,
index 5ead24f5611df2d164828b947a57ffc80b953a1d..304b46b061c135c2b6ebe3fe72ca76563d181434 100644 (file)
@@ -26,7 +26,7 @@ interface Props {
 }
 
 export default class ScreenPositionHelper extends React.PureComponent<Props> {
-  container: HTMLDivElement;
+  container?: HTMLDivElement;
   debouncedOnResize: () => void;
 
   constructor(props: Props) {
index c0221647154c0028f9e8157301857974ad9de49d..3db595c0a2d3767cb488703262c8d031b1641937 100644 (file)
@@ -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();
   }
 });
 
index 021c390dd1e3e2903fc89800e96cfef03829f6d6..e7d0ed049f9110ea3b63aaddf7307f80c59d7a5b 100644 (file)
@@ -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() {
index 777c576eee6b888a578a6691aaa368379cd01472..54934d9e8ac5ff5e53daac7bc5cceb31b79359c9 100644 (file)
@@ -39,7 +39,7 @@ interface State {
 }
 
 export default class ConfirmButton extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { modal: false };
 
   componentDidMount() {
index 87f87c5dd4d2e6cd394a7c156182cbb86ffd520f..7c1523338f7765146b5bc91f303b2e809e7c7d6c 100644 (file)
@@ -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}
index db0402f888df3df8fe33daafc7dc6e7e999147e4..fd628fc376254298466ed4ec7564e2615a086d57 100644 (file)
@@ -36,7 +36,7 @@ interface State {
 }
 
 export default class FavoriteBase extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index a4bb8196492c916e880d304275cfecd2d81d4082..b5b29941883a8fbb5db6df659159924791d733be 100644 (file)
@@ -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);
index 6d6403c41c243f342392bdc35308c46a5d27cccf..22b1630f1a071cb5898b8bb94431d8e99393961b 100644 (file)
@@ -45,7 +45,7 @@ interface State {
 }
 
 export default class SearchSelect extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
 
   constructor(props: Props) {
     super(props);
index 1359c584e8abc3c88f2c9b30010fc7f0ece34549..b277510245d4ef5c76ff20f6583a8ff0ed807109 100644 (file)
@@ -39,7 +39,7 @@ interface State {
 }
 
 export default class SimpleModal extends React.PureComponent<Props, State> {
-  mounted: boolean;
+  mounted = false;
   state: State = { submitting: false };
 
   componentDidMount() {
index 952f9da83bf57da47240d4f55b67e7ab0805fadf..f12b4734b6fa7b87a5b265ef86574eca92232152 100644 (file)
@@ -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() {
index 274222ed1923a67ae3a51721de18d8497425c93b..e37923337ee6d48d37f4de396fa915ca6239321b 100644 (file)
@@ -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) {
index 550e6492815290a13cdc4c6491bef21f7e03437b..7be3c394b578fae6715fcb9091c1143a2701ec1a 100644 (file)
@@ -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"