From: Grégoire Aubert Date: Thu, 19 Oct 2017 08:26:51 +0000 (+0200) Subject: SONAR-9954 Add serverId and nloc query to the request license url X-Git-Tag: 6.7-RC1~62 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1dc612122fde774d7f8e3781b6020b535722ee32;p=sonarqube.git SONAR-9954 Add serverId and nloc query to the request license url --- diff --git a/server/sonar-web/src/main/js/api/marketplace.ts b/server/sonar-web/src/main/js/api/marketplace.ts index 30c801ae0f2..57ee9128883 100644 --- a/server/sonar-web/src/main/js/api/marketplace.ts +++ b/server/sonar-web/src/main/js/api/marketplace.ts @@ -65,6 +65,10 @@ export function getLicensePreview(data: { return postJSON('/api/editions/preview', data).catch(throwGlobalError); } +export function getFormData(): Promise<{ serverId: string; ncloc: number }> { + return getJSON('/api/editions/form_data').catch(throwGlobalError); +} + export function applyLicense(data: { license: string }): Promise { return postJSON('/api/editions/apply_license', data).catch(throwGlobalError); } 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 857a40e4058..6971889135c 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 @@ -32,13 +32,13 @@ export interface Props { interface State { license: string; - loading: boolean; status?: string; + submitting: boolean; } export default class LicenseEditionForm extends React.PureComponent { mounted: boolean; - state: State = { license: '', loading: false }; + state: State = { license: '', submitting: false }; componentDidMount() { this.mounted = true; @@ -63,7 +63,7 @@ export default class LicenseEditionForm extends React.PureComponent { this.props.updateEditionStatus(editionStatus); @@ -71,7 +71,7 @@ export default class LicenseEditionForm extends React.PureComponent { if (this.mounted) { - this.setState({ loading: false }); + this.setState({ submitting: false }); } } ); @@ -80,7 +80,7 @@ export default class LicenseEditionForm extends React.PureComponent