Skip to content

Commit

Permalink
20721 - Add feature flag - enable-payment-change-from-eft (bcgov#2970)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jxio authored Aug 16, 2024
1 parent c7d125b commit 0368f3d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
20 changes: 16 additions & 4 deletions auth-web/src/components/auth/common/PaymentMethods.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
depressed
color="primary"
width="120"
class="font-weight-bold ml-auto"
:outlined="!isPaymentSelected(payment)"
:class="['font-weight-bold', 'ml-auto', { 'disabled': !isChangeFromEFTEnabled() }]"
:outlined="!isPaymentSelected(payment) && isChangeFromEFTEnabled()"
:aria-label="'Select' + ' ' + payment.title"
:data-test="`btn-payment-${payment.type}`"
:disabled="!isChangeFromEFTEnabled()"
@click="paymentMethodSelected(payment)"
>
<span>{{ (isPaymentSelected(payment)) ? 'SELECTED' : 'SELECT' }}</span>
Expand Down Expand Up @@ -178,13 +179,14 @@
</template>

<script lang="ts">
import { Pages, PaymentTypes } from '@/util/constants'
import { LDFlags, Pages, PaymentTypes } from '@/util/constants'
import { computed, defineComponent, onMounted, reactive, ref, toRefs } from '@vue/composition-api'
import { BcolProfile } from '@/models/bcol'
import CommonUtils from '@/util/common-util'
import ConfigHelper from '@/util/config-helper'
import DocumentService from '@/services/document.services'
import GLPaymentForm from '@/components/auth/common/GLPaymentForm.vue'
import LaunchDarklyService from 'sbc-common-components/src/services/launchdarkly.services'
import LinkedBCOLBanner from '@/components/auth/common/LinkedBCOLBanner.vue'
import ModalDialog from '@/components/auth/common/ModalDialog.vue'
import PADInfoForm from '@/components/auth/common/PADInfoForm.vue'
Expand Down Expand Up @@ -399,6 +401,11 @@ export default defineComponent({
selectedPaymentMethod.value = ''
}
const isChangeFromEFTEnabled = () => {
const enableEFTPaymentMethod: boolean = LaunchDarklyService.getFlag(LDFlags.EnablePaymentChangeFromEFT, false)
return props.currentOrgPaymentType !== PaymentTypes.EFT || enableEFTPaymentMethod
}
const continueModal = async () => {
const hasOutstandingBalance = await hasBalanceOwing()
const isFromEFT = props.currentOrgPaymentType === PaymentTypes.EFT
Expand Down Expand Up @@ -441,7 +448,8 @@ export default defineComponent({
bcOnlineDialog,
cancelModal,
continueModal,
isGLInfoValid
isGLInfoValid,
isChangeFromEFTEnabled
}
}
})
Expand Down Expand Up @@ -518,4 +526,8 @@ export default defineComponent({
font-size: 14px;
}
.disabled {
pointer-events: none;
}
</style>
1 change: 1 addition & 0 deletions auth-web/src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ export enum LDFlags {
EnableBusinessNrSearch = 'enable-business-nr-search',
EnableDetailsFilter = 'enable-transactions-detail-filter',
EnableEFTPaymentMethod = 'enable-eft-payment-method',
EnablePaymentChangeFromEFT = 'enable-payment-change-from-eft',
EnableInvoluntaryDissolution = 'enable-involuntary-dissolution',
IaSupportedEntities = 'ia-supported-entities',
ProductBCAStatus = 'product-BCA-status',
Expand Down

0 comments on commit 0368f3d

Please sign in to comment.