Skip to content

Commit

Permalink
git merge EP-2525.
Browse files Browse the repository at this point in the history
  • Loading branch information
wjames111 committed Dec 18, 2024
2 parents 2a9c4c3 + aaa0a93 commit 4aa30f6
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 57 deletions.
2 changes: 1 addition & 1 deletion branded-checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</head>
<body>

<branded-checkout designation-number="2294554" show-cover-fees="true" ng-cloak hide-spouse-details="true" hide-annual="true" hide-quarterly="true"></branded-checkout>
<branded-checkout designation-number="2294554" show-cover-fees="true" ng-cloak hide-spouse-details="true" hide-annual="true" hide-quarterly="true" use-v3="true"></branded-checkout>
<script src="branded-checkout.v2.js"></script>

</body>
Expand Down
3 changes: 2 additions & 1 deletion src/app/branded/branded-checkout.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default angular
showCoverFees: '@',
hideSpouseDetails: '@',
hideAnnual: '@',
hideQuarterly: '@'
hideQuarterly: '@',
useV3: '@'
}
})
3 changes: 2 additions & 1 deletion src/app/branded/branded-checkout.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
item-config="$ctrl.itemConfig"
hide-spouse-details="$ctrl.hideSpouseDetails"
hide-quarterly="$ctrl.hideQuarterly"
hide-annual="$ctrl.hideAnnual">
hide-annual="$ctrl.hideAnnual"
use-v3="$ctrl.useV3">
</branded-checkout-step-1>
<branded-checkout-step-2
ng-if="$ctrl.checkoutStep === 'review'"
Expand Down
3 changes: 2 additions & 1 deletion src/app/branded/step-1/branded-checkout-step-1.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export default angular
itemConfig: '=',
hideSpouseDetails: '<',
hideAnnual: '<',
hideQuarterly: '<'
hideQuarterly: '<',
useV3: '<'
}
})
7 changes: 5 additions & 2 deletions src/app/branded/step-1/branded-checkout-step-1.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
hide-annual="$ctrl.hideAnnual"
on-state-change="$ctrl.onGiftConfigStateChange(state)"
disable-session-restart="true"
ng-if="!$ctrl.loadingProductConfig && !$ctrl.errorLoadingProductConfig">
ng-if="!$ctrl.loadingProductConfig && !$ctrl.errorLoadingProductConfig"
use-v3="$ctrl.useV3"
>
</product-config-form>
<div ng-if="$ctrl.errorLoadingProductConfig" class="alert alert-danger" role="alert">
<p translate='LOADING_ERROR' translate-values="{loadData: '$ctrl.loadData()'}" translate-compile></p>
Expand All @@ -29,7 +31,8 @@ <h3 class="panel-name" translate>{{'YOUR_INFORMATION'}}</h3>
on-submit="$ctrl.onContactInfoSubmit(success)"
donor-details="$ctrl.donorDetails"
radio-station-api-url="$ctrl.radioStationApiUrl"
hide-spouse-details="$ctrl.hideSpouseDetails">
hide-spouse-details="$ctrl.hideSpouseDetails"
use-v3="$ctrl.useV3">
</contact-info>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ export default angular
submitted: '<',
onStateChange: '&',
hideAnnual: '<',
hideQuarterly: '<'
hideQuarterly: '<',
useV3: '<'
}
})
142 changes: 104 additions & 38 deletions src/app/productConfig/productConfigForm/productConfigForm.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,24 @@ <h4 class="panel-title border-bottom-small" translate>
</div>

<div ng-if="!$ctrl.loading && !$ctrl.errorLoading && !$ctrl.showGivingLinks">
<div class="panel panel-default panel-plain mt">
<div ng-if="$ctrl.errorChangingFrequency" class="alert alert-danger" role="alert">
<p translate>{{'FREQUENCY_ERROR'}}</p>
</div>
<div ng-class="{'give-selection-reverse-order': ($ctrl.useV3 === 'true')}">
<div class="panel panel-default panel-plain mt">

<div ng-if="$ctrl.errorSavingGeneric" role="alert" class="alert alert-danger">
<p translate>{{'ADDING_CART_ERROR'}}</p>
</div>
<div ng-if="$ctrl.errorChangingFrequency" class="alert alert-danger" role="alert">
<p translate>{{'FREQUENCY_ERROR'}}</p>
</div>

<div ng-if="$ctrl.amountFormatError" role="alert" class="alert alert-danger">
<p translate>{{$ctrl.amountFormatError}}</p>
</div>
<div ng-if="$ctrl.errorSavingGeneric" role="alert" class="alert alert-danger">
<p translate>{{'ADDING_CART_ERROR'}}</p>
</div>

<div ng-if="$ctrl.errorAlreadyInCart" class="alert alert-warning" role="alert">
<p translate>{{'GIFT_IN_CART_ERROR'}}</p>
</div>
<div ng-if="$ctrl.amountFormatError" role="alert" class="alert alert-danger">
<p translate>{{$ctrl.amountFormatError}}</p>
</div>

<div ng-if="$ctrl.errorAlreadyInCart" class="alert alert-warning" role="alert">
<p translate>{{'GIFT_IN_CART_ERROR'}}</p>
</div>

<div ng-if="$ctrl.errorForcedUserToLogout" class="alert alert-warning" role="alert">
<p translate>{{'FORCED_USER_TO_LOGOUT'}}</p>
Expand Down Expand Up @@ -166,31 +168,30 @@ <h4 class="panel-title border-bottom-small" translate>
</fieldset>
</div><!-- // panel-body -->
</div><!-- // panel -->
<div class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt" translate>
{{'GIFT_FREQUENCY'}}
</h4>
<div class="panel-body">
<div data-toggle="buttons">
<label class="btn btn-radio btn-wide"
ng-repeat-start="f in $ctrl.productData.frequencies | orderBy: $ctrl.frequencyOrder track by $index"
ng-if="f.name !== 'SEMIANNUAL'"
ng-class="{'active': f.name === $ctrl.productData.frequency}"
ng-click="$ctrl.changeFrequency(f)">
<span class="giftsum-about giftsum-title" ng-switch="f.name">
<span ng-switch-when="NA" translate>{{'SINGLE_GIFT'}}</span>
<span ng-switch-default>{{f.display}}</span>
</span>
</label>
<span ng-repeat-end></span>
</div>
<loading inline="true" ng-if="$ctrl.changingFrequency" class="mt-- text-center">
<translate>{{'CHANGING_FREQUENCY'}}</translate>
</loading>
</div><!-- // panel-body -->
</div><!-- // panel -->
<div ng-if="$ctrl.productData.frequency !== 'NA'">
<div class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt" translate>
{{'GIFT_FREQUENCY'}}
</h4>
<div class="panel-body">
<div data-toggle="buttons">
<label class="btn btn-radio btn-wide"
ng-repeat-start="f in $ctrl.productData.frequencies | orderBy: $ctrl.frequencyOrder track by $index"
ng-if="f.name !== 'SEMIANNUAL'"
ng-class="{'active': f.name === $ctrl.productData.frequency}"
ng-click="$ctrl.changeFrequency(f)">
<span class="giftsum-about giftsum-title" ng-switch="f.name">
<span ng-switch-when="NA" translate>{{'SINGLE_GIFT'}}</span>
<span ng-switch-default>{{f.display}}</span>
</span>
</label>
<span ng-repeat-end></span>
</div>
<loading inline="true" ng-if="$ctrl.changingFrequency" class="mt-- text-center">
<translate>{{'CHANGING_FREQUENCY'}}</translate>
</loading>
</div><!-- // panel-body -->
</div><!-- // panel -->
<div ng-if="$ctrl.productData.frequency !== 'NA'" class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt0 pt-" translate>
{{'RECURRING_START'}}
</h4>
Expand Down Expand Up @@ -228,11 +229,76 @@ <h4 class="panel-title border-bottom-small mt0 pt-" translate>
</div>
</div>
</div>
</div><!-- // panel -->
</div>
<div class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt" translate>
{{'GIFT_FREQUENCY'}}
</h4>
<div class="panel-body">
<div data-toggle="buttons">
<label class="btn btn-radio btn-wide"
ng-repeat-start="f in $ctrl.productData.frequencies | orderBy: $ctrl.frequencyOrder track by $index"
ng-if="f.name !== 'SEMIANNUAL'"
ng-class="{'active': f.name === $ctrl.productData.frequency}"
ng-click="$ctrl.changeFrequency(f)">
<span class="giftsum-about giftsum-title" ng-switch="f.name">
<span ng-switch-when="NA" translate>{{'SINGLE_GIFT'}}</span>
<span ng-switch-default>{{f.display}}</span>
</span>
</label>
<span ng-repeat-end></span>
</div>
<loading inline="true" ng-if="$ctrl.changingFrequency" class="mt-- text-center">
<translate>{{'CHANGING_FREQUENCY'}}</translate>
</loading>
</div><!-- // panel-body -->
</div><!-- // panel -->
<div ng-if="$ctrl.productData.frequency !== 'NA'">
<div class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt0 pt-" translate>
{{'RECURRING_START'}}
</h4>
<div class="panel-body pt0">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<label>
<span translate>{{'MONTH'}}</span>
<select class="form-control form-control-subtle"
ng-model="$ctrl.itemConfig['RECURRING_START_MONTH']"
ng-options="(m | date:'MM') as (m | date:'MMMM, yyyy') for m in $ctrl.possibleTransactionMonths($ctrl.nextDrawDate)"
ng-change="$ctrl.changeStartDay($ctrl.itemConfig['RECURRING_DAY_OF_MONTH'], $ctrl.itemConfig['RECURRING_START_MONTH'])">
</select>
</label>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label>
<span translate>{{'DAY'}}</span>
<select class="form-control form-control-subtle"
ng-model="$ctrl.itemConfig['RECURRING_DAY_OF_MONTH']"
ng-options="o as (o | ordinal) for o in $ctrl.possibleTransactionDays($ctrl.itemConfig['RECURRING_START_MONTH'], $ctrl.nextDrawDate)"
ng-change="$ctrl.changeStartDay($ctrl.itemConfig['RECURRING_DAY_OF_MONTH'], $ctrl.itemConfig['RECURRING_START_MONTH'])">
</select>
</label>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label translate>{{'GIFT_START_DATE'}}</label>
<div class="form-group">
{{$ctrl.startMonth( $ctrl.itemConfig['RECURRING_DAY_OF_MONTH'], $ctrl.itemConfig['RECURRING_START_MONTH'], $ctrl.nextDrawDate ).format('ll')}}
</div>
</div>
</div>
</div>
</div><!-- // panel-body -->
</div><!-- // panel -->
</div>
</div>
<div class="panel panel-default give-modal-panel">
<div ng-if="$ctrl.useV3 !== 'true'" class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt" translate>
{{'OPTIONAL'}}
</h4>
Expand Down
8 changes: 5 additions & 3 deletions src/assets/scss/_gift-config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ label.custom-amount {
width: auto;
}



.radio,
.checkbox {
label {
Expand Down Expand Up @@ -217,6 +215,11 @@ label.btn.btn-default-form.active {
}
}

.give-selection-reverse-order {
display: flex;
flex-direction: column-reverse;
}

@media (max-width: 549px) {
.give-modal-recipient {
margin-top: 5px;
Expand Down Expand Up @@ -349,4 +352,3 @@ label.btn.btn-default-form.active {
}
}
}

3 changes: 2 additions & 1 deletion src/common/components/contactInfo/contactInfo.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export default angular
onSubmit: '&',
radioStationApiUrl: '<',
hideSpouseDetails: '<',
compactAddress: '<'
compactAddress: '<',
useV3: '<'
}
})
15 changes: 7 additions & 8 deletions src/common/components/contactInfo/contactInfo.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<form novalidate ng-keyup="$event.key === 'Enter' && $ctrl.submitDetails()" name="$ctrl.detailsForm">
<div class="name mb">
<h4 class="panel-title border-bottom-small visible" translate>{{'YOUR_INFORMATION'}}</h4>
<h4 ng-if="$ctrl.useV3 !== 'true'" class="panel-title border-bottom-small visible" translate>{{'YOUR_INFORMATION'}}</h4>
<div class="row">
<div ng-class="{'col-sm-3': $ctrl.hideSpouseDetails, 'col-sm-4': !$ctrl.hideSpouseDetails}">
<div class="form-group is-required" ng-class="{'has-error': ($ctrl.detailsForm.nameGivenName | showErrors)}">
Expand All @@ -65,7 +65,7 @@ <h4 class="panel-title border-bottom-small visible" translate>{{'YOUR_INFORMAT
</div>
</div>
</div>
<div ng-class="{'col-sm-1': $ctrl.hideSpouseDetails, 'col-sm-2': !$ctrl.hideSpouseDetails}">
<div ng-if="$ctrl.useV3 !== 'true'" ng-class="{'col-sm-1': $ctrl.hideSpouseDetails, 'col-sm-2': !$ctrl.hideSpouseDetails}">
<div class="form-group" ng-class="{'has-error': ($ctrl.detailsForm.nameMiddleInitial | showErrors)}">
<label>
<span translate>{{'MIDDLE_ABBREV'}}</span>
Expand Down Expand Up @@ -99,7 +99,7 @@ <h4 class="panel-title border-bottom-small visible" translate>{{'YOUR_INFORMAT
</div>
</div>
</div>
<div class="col-sm-2">
<div ng-if="$ctrl.useV3 !== 'true'" class="col-sm-2">
<div class="form-group">
<label>
<span translate>{{'SUFFIX'}}</span>
Expand Down Expand Up @@ -139,7 +139,7 @@ <h4 class="panel-title border-bottom-small visible" translate>{{'YOUR_INFORMAT

</div>

<h4 class="panel-title border-bottom-small visible" ng-if="$ctrl.donorDetails['donor-type'] === 'Household'" translate>{{'SPOUSE_NAME'}}</h4>
<h4 class="panel-title border-bottom-small visible" ng-if="($ctrl.donorDetails['donor-type'] === 'Household' || $ctrl.useV3 !== 'true')" translate>{{'SPOUSE_NAME'}}</h4>

<div class="row">
<div class="col-xs-12">
Expand All @@ -154,7 +154,7 @@ <h4 class="panel-title border-bottom-small visible" ng-if="$ctrl.donorDetails[
</div>
</div>

<div class="row" ng-if="$ctrl.donorDetails['donor-type'] === 'Household' && $ctrl.showSpouseFields">
<div class="row" ng-if="($ctrl.donorDetails['donor-type'] === 'Household' && $ctrl.showSpouseFields) || $ctrl.useV3 !== 'true'">
<div class="col-sm-4">
<div class="form-group" ng-class="{'has-error': ($ctrl.detailsForm.spouseGivenName | showErrors)}">
<label>
Expand Down Expand Up @@ -252,8 +252,7 @@ <h4 class="panel-title border-bottom-small visible" translate>{{'MAILING_ADDRE
parent-form="$ctrl.detailsForm"
on-address-changed="$ctrl.loadRadioStations()"
address-disabled="$ctrl.donorDetails.staff"
compact-address="$ctrl.compactAddress"
>
compact-address="$ctrl.compactAddress">
</address-form>
</div>

Expand All @@ -273,7 +272,7 @@ <h4 class="panel-title border-bottom-small visible" translate>{{'CONTACT_INFO'
</div>
</div>
</div>
<div class="col-sm-6">
<div ng-if="$ctrl.useV3 !== 'true'" class="col-sm-6">
<div class="form-group" ng-class="{'has-error': ($ctrl.detailsForm.phoneNumber | showErrors)}">
<label>
<span translate>{{'PHONE'}}</span>
Expand Down

0 comments on commit 4aa30f6

Please sign in to comment.