aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/marketplace
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-10-26 22:44:08 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-30 09:20:37 +0100
commit771c15c18356cfe02bad535bdd08ffb1c148d016 (patch)
treeb571242282f8127542e9b6757729d8f12c854232 /server/sonar-web/src/main/js/apps/marketplace
parent9c99df922c0a21065f1e3764c77ae1973698da96 (diff)
downloadsonarqube-771c15c18356cfe02bad535bdd08ffb1c148d016.tar.gz
sonarqube-771c15c18356cfe02bad535bdd08ffb1c148d016.zip
wrap react-modal and react-select in own components (#2759)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/marketplace')
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx9
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx9
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap11
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap11
4 files changed, 4 insertions, 36 deletions
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx
index ee86ac11596..414a768e485 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx
@@ -18,9 +18,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import * as Modal from 'react-modal';
import LicenseEditionSet from './LicenseEditionSet';
import { Edition, EditionStatus, applyLicense } from '../../../api/marketplace';
+import Modal from '../../../components/controls/Modal';
import { translate, translateWithParameters } from '../../../helpers/l10n';
export interface Props {
@@ -87,12 +87,7 @@ export default class LicenseEditionForm extends React.PureComponent<Props, State
? translateWithParameters('marketplace.downgrade_to_x', edition.name)
: translateWithParameters('marketplace.upgrade_to_x', edition.name);
return (
- <Modal
- isOpen={true}
- contentLabel={header}
- className="modal"
- overlayClassName="modal-overlay"
- onRequestClose={this.props.onClose}>
+ <Modal contentLabel={header} onRequestClose={this.props.onClose}>
<header className="modal-head">
<h2>{header}</h2>
</header>
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx
index 1af1ee86295..c2bd0bf7711 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx
@@ -18,8 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import * as Modal from 'react-modal';
import { Edition, EditionStatus, uninstallEdition } from '../../../api/marketplace';
+import Modal from '../../../components/controls/Modal';
import { translate, translateWithParameters } from '../../../helpers/l10n';
export interface Props {
@@ -75,12 +75,7 @@ export default class UninstallEditionForm extends React.PureComponent<Props, Sta
const currentEdition = edition ? edition.name : translate('marketplace.commercial_edition');
const header = translateWithParameters('marketplace.uninstall_x', currentEdition);
return (
- <Modal
- isOpen={true}
- contentLabel={header}
- className="modal"
- overlayClassName="modal-overlay"
- onRequestClose={this.props.onClose}>
+ <Modal contentLabel={header} onRequestClose={this.props.onClose}>
<header className="modal-head">
<h2>{header}</h2>
</header>
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap
index bd4aa78eb6a..85de7c934df 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap
@@ -32,19 +32,8 @@ exports[`should correctly change the button based on the status 3`] = `
exports[`should display correctly 1`] = `
<Modal
- ariaHideApp={true}
- bodyOpenClassName="ReactModal__Body--open"
- className="modal"
- closeTimeoutMS={0}
contentLabel="marketplace.upgrade_to_x.Foo"
- isOpen={true}
onRequestClose={[Function]}
- overlayClassName="modal-overlay"
- parentSelector={[Function]}
- portalClassName="ReactModalPortal"
- shouldCloseOnEsc={true}
- shouldCloseOnOverlayClick={true}
- shouldFocusAfterRender={true}
>
<header
className="modal-head"
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap
index 05cefbe37c2..0b3ad80dd5c 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap
@@ -2,19 +2,8 @@
exports[`should display correctly 1`] = `
<Modal
- ariaHideApp={true}
- bodyOpenClassName="ReactModal__Body--open"
- className="modal"
- closeTimeoutMS={0}
contentLabel="marketplace.uninstall_x.Foo"
- isOpen={true}
onRequestClose={[Function]}
- overlayClassName="modal-overlay"
- parentSelector={[Function]}
- portalClassName="ReactModalPortal"
- shouldCloseOnEsc={true}
- shouldCloseOnOverlayClick={true}
- shouldFocusAfterRender={true}
>
<header
className="modal-head"