Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EP-2560-QA-2 #1133

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>