From bd42d9d22613033b2c9da2bff6b49ea8b2653dbd Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Tue, 29 Oct 2019 10:01:45 +0100 Subject: [PATCH] Bump to the latest version of typescript --- server/sonar-docs/package.json | 4 +- server/sonar-docs/yarn.lock | 80 ++++++--- server/sonar-web/package.json | 4 +- .../src/main/js/app/utils/startReactApp.tsx | 20 +-- .../feedback/downgrade/DowngradeFeedback.css | 80 --------- .../feedback/downgrade/DowngradeFeedback.tsx | 170 ------------------ .../__tests__/DowngradeFeedback-test.tsx | 103 ----------- .../DowngradeFeedback-test.tsx.snap | 129 ------------- .../main/js/apps/issues/components/App.tsx | 10 +- .../components/__tests__/Definition-test.tsx | 6 +- .../__snapshots__/Definition-test.tsx.snap | 8 - .../inputs/__tests__/Input-test.tsx | 2 +- .../SourceViewer/SourceViewerContext.tsx | 8 +- server/sonar-web/src/main/js/types/types.d.ts | 1 + server/sonar-web/yarn.lock | 80 ++++++--- 15 files changed, 139 insertions(+), 566 deletions(-) delete mode 100644 server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.css delete mode 100644 server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.tsx delete mode 100644 server/sonar-web/src/main/js/apps/feedback/downgrade/__tests__/DowngradeFeedback-test.tsx delete mode 100644 server/sonar-web/src/main/js/apps/feedback/downgrade/__tests__/__snapshots__/DowngradeFeedback-test.tsx.snap diff --git a/server/sonar-docs/package.json b/server/sonar-docs/package.json index bff3e07eb5c..b9314c94180 100644 --- a/server/sonar-docs/package.json +++ b/server/sonar-docs/package.json @@ -33,7 +33,7 @@ "@types/react": "16.8.23", "@types/react-dom": "16.8.4", "@types/react-helmet": "5.0.8", - "@typescript-eslint/parser": "1.5.0", + "@typescript-eslint/parser": "2.6.0", "babel-jest": "24.8.0", "enzyme": "3.10.0", "enzyme-adapter-react-16": "1.14.0", @@ -55,7 +55,7 @@ "react-test-renderer": "16.8.5", "remark": "10.0.1", "ts-jest": "24.0.2", - "typescript": "3.3.3333", + "typescript": "3.6.4", "unist-util-visit": "1.4.0" }, "scripts": { diff --git a/server/sonar-docs/yarn.lock b/server/sonar-docs/yarn.lock index 7231aacc01a..9b3027e4877 100644 --- a/server/sonar-docs/yarn.lock +++ b/server/sonar-docs/yarn.lock @@ -1110,6 +1110,11 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha1-HuMNeVRMqE1o1LPNsK9PIFZj3S0= + "@types/events@*": version "3.0.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -1175,6 +1180,11 @@ dependencies: "@types/jest-diff" "*" +"@types/json-schema@^7.0.3": + version "7.0.3" + resolved "https://repox.jfrog.io/repox/api/npm/npm/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" + integrity sha1-vf1p1h5GTcyBslFZwnDXWnPBpjY= + "@types/lodash@4.14.138": version "4.14.138" resolved "https://repox.jfrog.io/repox/api/npm/npm/@types/lodash/-/lodash-4.14.138.tgz#34f52640d7358230308344e579c15b378d91989e" @@ -1289,22 +1299,35 @@ resolved "https://repox.jfrog.io/repox/api/npm/npm/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" integrity sha1-Rd0dBjjoyPFT6H0paQdlkpaHORY= -"@typescript-eslint/parser@1.5.0": - version "1.5.0" - resolved "https://repox.jfrog.io/repox/api/npm/npm/@typescript-eslint/parser/-/parser-1.5.0.tgz#a96114d195dff2a49534e4c4850fb676f905a072" - integrity sha1-qWEU0ZXf8qSVNOTEhQ+2dvkFoHI= +"@typescript-eslint/experimental-utils@2.6.0": + version "2.6.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/@typescript-eslint/experimental-utils/-/experimental-utils-2.6.0.tgz#ed70bef72822bff54031ff0615fc888b9e2b6e8a" + integrity sha1-7XC+9ygiv/VAMf8GFfyIi54rboo= dependencies: - "@typescript-eslint/typescript-estree" "1.5.0" - eslint-scope "^4.0.0" - eslint-visitor-keys "^1.0.0" + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.6.0" + eslint-scope "^5.0.0" -"@typescript-eslint/typescript-estree@1.5.0": - version "1.5.0" - resolved "https://repox.jfrog.io/repox/api/npm/npm/@typescript-eslint/typescript-estree/-/typescript-estree-1.5.0.tgz#986b356ecdf5a0c3bc9889d221802149cf5dbd4e" - integrity sha1-mGs1bs31oMO8mInSIYAhSc9dvU4= +"@typescript-eslint/parser@2.6.0": + version "2.6.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/@typescript-eslint/parser/-/parser-2.6.0.tgz#5106295c6a7056287b4719e24aae8d6293d5af49" + integrity sha1-UQYpXGpwVih7RxniSq6NYpPVr0k= + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.6.0" + "@typescript-eslint/typescript-estree" "2.6.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/typescript-estree@2.6.0": + version "2.6.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/@typescript-eslint/typescript-estree/-/typescript-estree-2.6.0.tgz#d3e9d8e001492e2b9124c4d4bd4e7f03c0fd7254" + integrity sha1-0+nY4AFJLiuRJMTUvU5/A8D9clQ= dependencies: + debug "^4.1.1" + glob "^7.1.4" + is-glob "^4.0.1" lodash.unescape "4.0.1" - semver "5.5.0" + semver "^6.3.0" "@webassemblyjs/ast@1.7.11": version "1.7.11" @@ -4444,6 +4467,14 @@ eslint-scope@^4.0.0, eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^5.0.0: + version "5.0.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" + integrity sha1-6HyIh8c+jR7ITxylkWRcNYv8j7k= + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + eslint-utils@^1.3.1: version "1.3.1" resolved "https://repox.jfrog.io/repox/api/npm/npm/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" @@ -4454,6 +4485,11 @@ eslint-visitor-keys@^1.0.0: resolved "https://repox.jfrog.io/repox/api/npm/npm/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha1-PzGA+y4pEBdxastMnW1bXDSmqB0= +eslint-visitor-keys@^1.1.0: + version "1.1.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + integrity sha1-4qgs6oT/JGrW+1f5veW0ZiFFnsI= + eslint@5.16.0, eslint@^5.6.0: version "5.16.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" @@ -6689,7 +6725,7 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0: +is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.1" resolved "https://repox.jfrog.io/repox/api/npm/npm/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw= @@ -10829,16 +10865,16 @@ semver-diff@^2.0.0: resolved "https://repox.jfrog.io/repox/api/npm/npm/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha1-eQp89v6lRZuslhELKbYEEtyP+Ws= -semver@5.5.0: - version "5.5.0" - resolved "https://repox.jfrog.io/repox/api/npm/npm/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha1-3Eu8emyp2Rbe5dQ1FvAJK1j3uKs= - semver@^6.0.0, semver@^6.1.1: version "6.2.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" integrity sha1-TYE9lZCq+KkZJpPWyFuTRN5ZAds= +semver@^6.3.0: + version "6.3.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0= + send@0.17.1: version "0.17.1" resolved "https://repox.jfrog.io/repox/api/npm/npm/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -11894,10 +11930,10 @@ typedarray@^0.0.6: resolved "https://repox.jfrog.io/repox/api/npm/npm/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.3.3333: - version "3.3.3333" - resolved "https://repox.jfrog.io/repox/api/npm/npm/typescript/-/typescript-3.3.3333.tgz#171b2c5af66c59e9431199117a3bcadc66fdcfd6" - integrity sha1-FxssWvZsWelDEZkRejvK3Gb9z9Y= +typescript@3.6.4: + version "3.6.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/typescript/-/typescript-3.6.4.tgz#b18752bb3792bc1a0281335f7f6ebf1bbfc5b91d" + integrity sha1-sYdSuzeSvBoCgTNff26/G7/FuR0= typography-normalize@^0.16.19: version "0.16.19" diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index 6904b5d3dd9..96f17935a0c 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -73,7 +73,7 @@ "@types/react-virtualized": "9.21.0", "@types/sanitize-html": "1.20.0", "@types/valid-url": "1.0.2", - "@typescript-eslint/parser": "1.5.0", + "@typescript-eslint/parser": "2.6.0", "autoprefixer": "9.5.0", "babel-core": "7.0.0-bridge.0", "babel-jest": "24.8.0", @@ -118,7 +118,7 @@ "style-loader": "0.23.1", "ts-jest": "24.0.2", "ts-loader": "5.3.3", - "typescript": "3.3.3333", + "typescript": "3.6.4", "webpack": "4.29.6", "webpack-bundle-analyzer": "3.3.2", "webpack-dev-server": "3.2.1" diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx index 0e91d2c37fb..22c61102732 100644 --- a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx +++ b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx @@ -194,20 +194,12 @@ export default function startReactApp( {isSonarCloud() && ( - <> - - import('../../apps/create/organization/CreateOrganization') - )} - /> - - import('../../apps/feedback/downgrade/DowngradeFeedback') - )} - /> - + + import('../../apps/create/organization/CreateOrganization') + )} + /> )} diff --git a/server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.css b/server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.css deleted file mode 100644 index c8432987d42..00000000000 --- a/server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.css +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2019 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.billing-downgrade-feedback > .alert { - max-width: 400px; - margin: 30px auto 50px auto; -} - -.billing-downgrade-feedback .boxed-group { - margin-top: 5vh; -} - -.billing-downgrade-feedback .boxed-group-header { - padding-top: 40px; - text-align: center; -} - -.billing-downgrade-feedback .boxed-group-inner { - padding: 50px 50px 40px 50px; -} - -.billing-downgrade-feedback h2 { - font-weight: bold; - font-size: 18px; - margin-bottom: 20px; -} - -.billing-downgrade-feedback .boxed-group-list li { - margin-left: 0; - padding-left: 0; -} - -.billing-downgrade-feedback input[type='radio'] { - margin-right: 1em; -} - -.billing-downgrade-feedback-form-actions { - margin-top: 36px; -} - -.billing-downgrade-feedback-explain-wrapper { - margin-left: 25px; - padding-top: 20px; -} - -.billing-downgrade-feedback-explain-wrapper label { - display: block; - margin-bottom: 4px; - font-weight: bold; -} - -.billing-downgrade-feedback-explain-wrapper label .note { - font-weight: normal; - margin-left: 0.5em; -} - -.billing-downgrade-feedback-explain-wrapper textarea { - display: block; - min-height: 70px; - width: 100%; - padding: 6px 8px; - border: 1px solid #cdcdcd; - border-radius: 2px; -} diff --git a/server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.tsx b/server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.tsx deleted file mode 100644 index d3222a24ed9..00000000000 --- a/server/sonar-web/src/main/js/apps/feedback/downgrade/DowngradeFeedback.tsx +++ /dev/null @@ -1,170 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2019 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { WithRouterProps } from 'react-router'; -import { SubmitButton } from 'sonar-ui-common/components/controls/buttons'; -import Radio from 'sonar-ui-common/components/controls/Radio'; -import { Alert } from 'sonar-ui-common/components/ui/Alert'; -import { translate } from 'sonar-ui-common/helpers/l10n'; -import { getBaseUrl } from 'sonar-ui-common/helpers/urls'; -import { giveDowngradeFeedback } from '../../../api/billing'; -import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage'; -import './DowngradeFeedback.css'; - -enum Reason { - doesntWork = 'did_not_work', - doesntMeetExpectations = 'did_not_match_expectations', - doesntMeetCompanyPolicy = 'company_policy', - onlyTesting = 'just_testing', - other = 'other' -} - -interface State { - additionalFeedback: string; - feedback?: Reason; -} - -export interface LocationState { - confirmationMessage?: string; - organization?: T.Organization; - returnTo?: string; - title: string; -} - -export default class DowngradeFeedback extends React.PureComponent { - state: State = { - additionalFeedback: '' - }; - - handleChange = (event: React.ChangeEvent) => { - this.setState({ - additionalFeedback: event.currentTarget.value - }); - }; - - handleChoice = (value: string) => { - this.setState({ - feedback: value as Reason - }); - }; - - handleSkip = (event: React.MouseEvent) => { - event.preventDefault(); - this.navigateAway(); - }; - - handleSubmit = (event: React.FormEvent) => { - event.preventDefault(); - - const { organization } = this.getLocationState(); - if (!organization) { - return; - } - - giveDowngradeFeedback({ - organization: organization.key, - feedback: this.state.feedback as string, - additionalFeedback: this.state.additionalFeedback - }); - - this.navigateAway(translate('billing.downgrade.thankyou_for_feedback')); - }; - - getLocationState = (): LocationState => { - const { location } = this.props; - return location.state || {}; - }; - - navigateAway = (message?: string) => { - if (message) { - addGlobalSuccessMessage(message); - } - - const { returnTo } = this.getLocationState(); - this.props.router.replace({ - pathname: returnTo || getBaseUrl() - }); - }; - - render() { - const { organization, confirmationMessage, title } = this.getLocationState(); - if (!organization) { - return null; - } - - return ( -
- {confirmationMessage && {confirmationMessage}} -
-
-

{title}

-
{translate('billing.downgrade.reason.explanation')}
-
-
-
-
    - {Object.keys(Reason).map(key => { - const reason = Reason[key as any]; - return ( -
  • - - {translate('billing.downgrade.reason.option', reason, 'label')} - - {this.state.feedback === reason && ( -
    - -