From: Grégoire Aubert Date: Fri, 13 Oct 2017 12:58:52 +0000 (+0200) Subject: SONAR-9863 Drop web app licenses and server id code X-Git-Tag: 6.7-RC1~267 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7a42a7c80528cf1f8867d8df3f7d8c12f36a1704;p=sonarqube.git SONAR-9863 Drop web app licenses and server id code --- diff --git a/server/sonar-web/src/main/js/api/licenses.ts b/server/sonar-web/src/main/js/api/licenses.ts deleted file mode 100644 index 8df37f10ed1..00000000000 --- a/server/sonar-web/src/main/js/api/licenses.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 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 { getJSON, post } from '../helpers/request'; - -export function getLicenses(): Promise { - return getJSON('/api/licenses/list').then(r => r.licenses); -} - -export function setLicense(key: string, value: string): Promise { - const url = '/api/settings/set'; - const data = { key, value }; - return post(url, data); -} - -export function resetLicense(key: string): Promise { - const url = '/api/settings/reset'; - const data = { keys: key }; - return post(url, data); -} diff --git a/server/sonar-web/src/main/js/api/settings.ts b/server/sonar-web/src/main/js/api/settings.ts index dd257cea597..c388e4eb32a 100644 --- a/server/sonar-web/src/main/js/api/settings.ts +++ b/server/sonar-web/src/main/js/api/settings.ts @@ -93,11 +93,3 @@ export function generateSecretKey(): Promise { export function encryptValue(value: string): Promise { return postJSON('/api/settings/encrypt', { value }); } - -export function getServerId(): Promise { - return getJSON('/api/server_id/show'); -} - -export function generateServerId(organization: string, ip: string): Promise { - return postJSON('/api/server_id/generate', { organization, ip }); -} diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js index 36a74fdef7a..6f2c84d6e6e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js @@ -99,21 +99,11 @@ class SettingsNav extends React.PureComponent { {translate('settings.page')} -
  • - - {translate('property.category.licenses')} - -
  • {translate('property.category.security.encryption')}
  • -
  • - - {translate('property.category.server_id')} - -
  • {translate('custom_metrics.page')} diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap index ca0145b11c8..d70451a6f1d 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap +++ b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap @@ -39,14 +39,6 @@ exports[`should work with extensions 1`] = ` settings.page
  • -
  • - - property.category.licenses - -
  • -
  • - - property.category.server_id - -
  • { - - diff --git a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseChangeForm.js b/server/sonar-web/src/main/js/apps/settings/licenses/LicenseChangeForm.js deleted file mode 100644 index afea2682e97..00000000000 --- a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseChangeForm.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 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 React from 'react'; -import PropTypes from 'prop-types'; -import Modal from 'react-modal'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; - -export default class LicenseChangeForm extends React.PureComponent { - static propTypes = { - license: PropTypes.object.isRequired, - onChange: PropTypes.func.isRequired - }; - - state = { - loading: false, - modalOpen: false - }; - - onClick(e) { - e.preventDefault(); - e.target.blur(); - this.setState({ modalOpen: true }); - } - - closeModal = () => this.setState({ modalOpen: false }); - - handleSubmit = event => { - event.preventDefault(); - if (this.textarea) { - const { value } = this.textarea; - this.setState({ loading: true }); - this.props - .onChange(value) - .then( - () => this.setState({ loading: false, modalOpen: false }), - () => this.setState({ loading: false }) - ); - } - }; - - handleCancelClick = event => { - event.preventDefault(); - this.closeModal(); - }; - - render() { - const { license } = this.props; - const productName = license.name || license.key; - - return ( -