From 64c9e2a152d7df168b443c9a371a9e52127204aa Mon Sep 17 00:00:00 2001 From: Kevin Silva Date: Tue, 17 Oct 2023 12:33:56 +0200 Subject: [PATCH] SONAR-20769 - Add design system modal for onboarding DevOps platform --- .../AlmBindingDefinitionFormRenderer.tsx | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx index f6df013c699..873275c6990 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx @@ -17,11 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { ButtonPrimary, FlagMessage, Modal, Spinner } from 'design-system'; import * as React from 'react'; -import Modal from '../../../../components/controls/Modal'; -import { ResetButtonLink, SubmitButton } from '../../../../components/controls/buttons'; -import { Alert } from '../../../../components/ui/Alert'; -import Spinner from '../../../../components/ui/Spinner'; import { translate } from '../../../../helpers/l10n'; import { AlmBindingDefinition, @@ -99,47 +96,50 @@ export default class AlmBindingDefinitionFormRenderer extends React.PureComponen render() { const { isUpdate, canSubmit, submitting, validationError } = this.props; const header = translate('settings.almintegration.form.header', isUpdate ? 'edit' : 'create'); + const FORM_ID = `settings.almintegration.form.${isUpdate ? 'edit' : 'create'}`; const handleSubmit = (event: React.SyntheticEvent) => { event.preventDefault(); this.props.onSubmit(); }; + const formBody = ( +
+ {this.renderForm()} + {validationError && !canSubmit && ( + +
+

{translate('settings.almintegration.configuration_invalid')}

+
    +
  • {validationError}
  • +
+
+
+ )} +
+ ); + return ( -
-
-

{header}

-
- -
- {this.renderForm()} - {validationError && !canSubmit && ( - -

- {translate('settings.almintegration.configuration_invalid')} -

-
    -
  • {validationError}
  • -
-
- )} -
- -
- + headerTitle={header} + isScrollable + onClose={this.props.onCancel} + body={formBody} + primaryButton={ + <> + + {translate('settings.almintegration.form.save')} - - - {translate('cancel')} -
-
-
+ + + } + secondaryButtonLabel={translate('cancel')} + /> ); } } -- 2.39.5