From ee1670d6978a027812952d8a7c106046f2d71522 Mon Sep 17 00:00:00 2001 From: Rafik Adiche Date: Thu, 10 Aug 2023 13:37:32 +0200 Subject: [PATCH] feat(projects.new): implement the checkbox fof legal agreement ref: TAPC-150 Signed-off-by: Rafik Adiche --- .../new/payment/components/add/controller.js | 24 +++++++++++++ .../new/payment/components/add/index.html | 15 ++++++-- .../pci/src/projects/new/payment/constants.js | 9 +++++ .../src/projects/new/payment/controller.js | 35 +++++++++++++++++-- .../pci/src/projects/new/payment/index.html | 10 +++--- .../pci/src/projects/new/payment/index.js | 1 + .../pci/src/projects/new/payment/index.scss | 5 +++ 7 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 packages/manager/modules/pci/src/projects/new/payment/constants.js create mode 100644 packages/manager/modules/pci/src/projects/new/payment/index.scss diff --git a/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js b/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js index 6d974af30aeb..4254c9ec9057 100644 --- a/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js +++ b/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js @@ -150,6 +150,30 @@ export default class PciProjectNewPaymentMethodAddCtrl { }); } + resetLegalAgreements() { + this.model.legalAgreements = { + credit: false, + payPal: false, + bankAccount: false, + }; + return null; + } + + onCreditCardAgreementCheckboxChange(modelValue) { + this.resetLegalAgreements(); + this.model.legalAgreements.credit = modelValue; + } + + onBankAccountAgreementCheckboxChange(modelValue) { + this.resetLegalAgreements(); + this.model.legalAgreements.bankAccount = modelValue; + } + + onPaypalAgreementCheckboxChange(modelValue) { + this.resetLegalAgreements(); + this.model.legalAgreements.paypal = modelValue; + } + showSpecificCrossBorderSentenceForCardPayment() { return ( this.hasSpecificCrossBorderSentenceForCardPayment && diff --git a/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html b/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html index 1c8a15ccd454..de33722ae32b 100644 --- a/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html +++ b/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html @@ -42,7 +42,10 @@

- +

- +

- +
data-on-submit="$ctrl.onIntegrationSubmit.bind($ctrl)" data-on-submit-error="$ctrl.onIntegrationSubmitError.bind($ctrl)" data-on-submit-success="$ctrl.onIntegrationSubmitSuccess.bind($ctrl)" - data-ng-if="[ - $ctrl.OVH_PAYMENT_METHOD_INTEGRATION_TYPE.REDIRECT, - $ctrl.OVH_PAYMENT_METHOD_INTEGRATION_TYPE.IN_CONTEXT - ].includes($ctrl.model.paymentMethod.integration)" + data-ng-if="$ctrl.displayCreateProjectButton()" >
@@ -174,7 +171,7 @@

variant="primary" type="button" on-click="$ctrl.initComponentInitialParams()" - data-ng-if="$ctrl.model.paymentMethod.isHandleByComponent() && !$ctrl.componentInitialParams && !$ctrl.isCheckingPaymentMethod" + data-ng-if="$ctrl.model.paymentMethod.isHandleByComponent() && !$ctrl.componentInitialParams && !$ctrl.isCheckingPaymentMethod && $ctrl.model.legalAgreements.credit" disabled="$ctrl.globalLoading.finalize" >