Skip to content

Commit

Permalink
Merge pull request #1133 from CruGlobal/EP-2560-QA-2
Browse files Browse the repository at this point in the history
EP-2560-QA-2
  • Loading branch information
wjames111 authored Jan 14, 2025
2 parents 806d875 + 015c7fa commit 53cf9d1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 31 deletions.
22 changes: 11 additions & 11 deletions src/app/branded/step-1/branded-checkout-step-1.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
<loading ng-if="$ctrl.loadingProductConfig">
<translate>Loading gift details...</translate>
</loading>
<product-config-form code="$ctrl.code"
is-edit="$ctrl.isEdit"
item-config="$ctrl.itemConfig"
default-frequency="$ctrl.defaultFrequency"
uri="$ctrl.item.uri"
submitted="$ctrl.submitted"
on-state-change="$ctrl.onGiftConfigStateChange(state)"
disable-session-restart="true"
ng-if="!$ctrl.loadingProductConfig && !$ctrl.errorLoadingProductConfig"
use-v3="$ctrl.useV3"
>
<product-config-form
code="$ctrl.code"
is-edit="$ctrl.isEdit"
item-config="$ctrl.itemConfig"
default-frequency="$ctrl.defaultFrequency"
uri="$ctrl.item.uri"
submitted="$ctrl.submitted"
on-state-change="$ctrl.onGiftConfigStateChange(state)"
disable-session-restart="true"
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 Down
6 changes: 4 additions & 2 deletions src/common/components/contactInfo/contactInfo.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ class Step1Controller {
}

addCustomValidators () {
this.detailsForm.phoneNumber.$validators.phone = number => {
return !number || phoneNumberRegex.test(number)
if (this.useV3 !== 'true') {
this.detailsForm.phoneNumber.$validators.phone = number => {
return !number || phoneNumberRegex.test(number)
}
}
}

Expand Down
19 changes: 10 additions & 9 deletions src/common/components/contactInfo/contactInfo.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@
<h4 ng-if="$ctrl.useV3 !== 'true'" 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>{{'CONTACT_INFO'}}</h4>
<div class="row">
<div class="col-sm-4">
<div ng-class="{'col-sm-4': $ctrl.useV3 !== 'true', 'col-sm-6': $ctrl.useV3 === 'true'}">
<div class="form-group is-required" ng-class="{'has-error': ($ctrl.detailsForm.nameGivenName | showErrors)}">
<label>
<span translate>{{'FIRST_NAME'}}</span>
<input type="text"
class="form-control form-control-subtle"
name="nameGivenName"
ng-model="$ctrl.donorDetails['name']['given-name']"
required
ng-maxlength="50"
ng-disabled="$ctrl.nameFieldsDisabled">
<input
type="text"
class="form-control form-control-subtle"
name="nameGivenName"
ng-model="$ctrl.donorDetails['name']['given-name']"
required
ng-maxlength="50"
ng-disabled="$ctrl.nameFieldsDisabled">
</label>
<div role="alert" ng-messages="$ctrl.detailsForm.nameGivenName.$error" ng-if="($ctrl.detailsForm.nameGivenName | showErrors)">
<div class="help-block" ng-message="required" translate>{{'FIRST_NAME_ERROR'}}</div>
Expand All @@ -82,7 +83,7 @@ <h4 ng-if="$ctrl.useV3 === 'true'" class="panel-title border-bottom-small visi
</div>
</div>
</div>
<div class="col-sm-4">
<div ng-class="{'col-sm-4': $ctrl.useV3 !== 'true', 'col-sm-6': $ctrl.useV3 === 'true'}">
<div class="form-group is-required" ng-class="{'has-error': ($ctrl.detailsForm.nameFamilyName | showErrors)}">
<label>
<span translate>{{'LAST_NAME'}}</span>
Expand Down
18 changes: 9 additions & 9 deletions src/common/components/contactInfo/emailField/emailField.tpl.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="form-group is-required" ng-class="{'has-error': ($ctrl.detailsForm.email | showErrors)}">
<label>
<span translate>{{'EMAIL'}}</span>
<input type="email" class="form-control form-control-subtle" name="email" ng-model="$ctrl.donorDetails['email']" required ng-maxlength="100" ng-disabled="$ctrl.donorDetails.staff">
</label>
<div role="alert" ng-messages="$ctrl.detailsForm.email.$error" ng-if="($ctrl.detailsForm.email | showErrors)">
<div class="help-block" ng-message="required" translate>{{'EMAIL_MISSING_ERROR'}}</div>
<div class="help-block" ng-message="email" translate>{{'EMAIL_INVALID_ERROR'}}</div>
<div class="help-block" ng-message="maxlength" translate>{{'EMAIL_LENGTH_ERROR'}}</div>
</div>
<label>
<span translate>{{'EMAIL'}}</span>
<input type="email" class="form-control form-control-subtle" name="email" ng-model="$ctrl.donorDetails['email']" required ng-maxlength="100" ng-disabled="$ctrl.donorDetails.staff">
</label>
<div role="alert" ng-messages="$ctrl.detailsForm.email.$error" ng-if="($ctrl.detailsForm.email | showErrors)">
<div class="help-block" ng-message="required" translate>{{'EMAIL_MISSING_ERROR'}}</div>
<div class="help-block" ng-message="email" translate>{{'EMAIL_INVALID_ERROR'}}</div>
<div class="help-block" ng-message="maxlength" translate>{{'EMAIL_LENGTH_ERROR'}}</div>
</div>
</div>

0 comments on commit 53cf9d1

Please sign in to comment.