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

feat/CXSPA-7301: Allow Billing Address + Guest checkout - in Digital Payments #18892

Merged
merged 37 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8eadf0b
code changes - part 1
anjana-bl Apr 3, 2024
7ac7ae9
code changes
anjana-bl May 19, 2024
3c9d613
code changes
anjana-bl May 19, 2024
94eb8f4
Update feature-toggles.ts
anjana-bl May 20, 2024
b638aa2
Merge branch 'develop' into feature/dp-guest-checkout
anjana-bl May 20, 2024
6e42279
Add license header
github-actions[bot] May 20, 2024
a1cf21b
code changes
anjana-bl May 20, 2024
92bc601
Update occ-digital-payments.adapter.ts
anjana-bl May 20, 2024
94c7c5a
code changes
anjana-bl May 20, 2024
36f8d56
code changes
anjana-bl May 20, 2024
d368382
Update occ-digital-payments.adapter.ts
anjana-bl May 20, 2024
b93aacf
Update dp-checkout-payment.service.ts
anjana-bl May 21, 2024
ee2ef38
configurable occ query params
anjana-bl May 21, 2024
c6a876c
feat: introducing feature toggle for billing address
anjana-bl May 28, 2024
28c5ae2
Merge branch 'develop' into feature/dp-guest-checkout
anjana-bl May 28, 2024
996c402
Add license header
github-actions[bot] May 28, 2024
c88d84b
chore: restructuring code
anjana-bl May 28, 2024
0e13f17
chore: restructuring code
anjana-bl May 28, 2024
9c495ef
chore: sonar issue fix + linting + unit test cases
anjana-bl May 29, 2024
0d5e585
Merge branch 'develop' into feature/dp-guest-checkout
anjana-bl May 29, 2024
2fff4a1
chore: unit test case + sonar issue
anjana-bl May 29, 2024
6b793ec
chore: adding back button
anjana-bl Jun 4, 2024
5a9735d
chore: unit test case
anjana-bl Jun 4, 2024
81dcf6c
code changes
anjana-bl Jun 4, 2024
b708c2c
Merge branch 'develop' into feature/dp-guest-checkout
anjana-bl Jun 4, 2024
099acf0
chore: code changes
anjana-bl Jun 6, 2024
cf378e1
Merge branch 'develop' into feature/dp-guest-checkout
anjana-bl Jun 7, 2024
98b78f8
Update digital-payments-with-billing-address.core-e2e.cy.ts
anjana-bl Jun 7, 2024
e579201
Merge branch 'feature/dp-guest-checkout' of https://github.com/SAP/sp…
anjana-bl Jun 7, 2024
3f88d64
Update dp-confirmation-dialog.component.ts
anjana-bl Jun 7, 2024
593bddd
Update digital-payments-with-billing-address.core-e2e.cy.ts
anjana-bl Jun 7, 2024
cea6421
chore: unit tests
anjana-bl Jun 11, 2024
5db07e5
Merge branch 'develop' into feature/dp-guest-checkout
anjana-bl Jun 11, 2024
7d229d4
Update occ-digital-payments.adapter.ts
anjana-bl Jun 11, 2024
6256219
Merge branch 'feature/dp-guest-checkout' of https://github.com/SAP/sp…
anjana-bl Jun 11, 2024
a7c3510
Merge branch 'develop' into feature/dp-guest-checkout
RadhepS Jun 11, 2024
c8b069e
Merge branch 'develop' into feature/dp-guest-checkout
anjana-bl Jun 12, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
<!-- BILLING -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to test this feature from a customer perspective:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<div class="cx-payment-form-billing">
<div class="cx-payment-form-billing-address">
{{ 'paymentForm.billingAddress' | cxTranslate }}
</div>

<!-- SAME AS SHIPPING CHECKBOX -->
<ng-container *ngIf="showSameAsDeliveryAddressCheckbox$ | async">
<div class="form-group">
<div class="form-check">
<label>
<input
type="checkbox"
class="form-check-input"
[checked]="sameAsDeliveryAddress"
(change)="toggleSameAsDeliveryAddress()"
[attr.aria-label]="
'paymentForm.billingAddressSameAsShipping' | cxTranslate
"
/>
<span class="form-check-label">{{
'paymentForm.sameAsDeliveryAddress' | cxTranslate
}}</span>
</label>
</div>
</div>
</ng-container>

<!-- BILLING INFO COMPONENT -->
<ng-container
*ngIf="
sameAsDeliveryAddress && (deliveryAddress$ | async) as deliveryAddress;
else billingAddress
"
>
<cx-card [content]="getAddressCardContent(deliveryAddress)"></cx-card>
</ng-container>

<!-- TODO:#future-checkout do we really want this? We can always pass more inputs to the copied address form component to make it more modular -->
<ng-template #billingAddress>
<div [formGroup]="billingAddressForm">
<div class="form-group" formGroupName="country">
<ng-container *ngIf="countries$ | async as countries">
<div *ngIf="countries.length !== 0">
<label>
<span class="label-content required">{{
'addressForm.country' | cxTranslate
}}</span>
<ng-select
[inputAttrs]="{ required: 'true' }"
[searchable]="true"
[clearable]="false"
[items]="countries"
bindLabel="name"
bindValue="isocode"
placeholder="{{ 'addressForm.selectOne' | cxTranslate }}"
(change)="countrySelected($event)"
formControlName="isocode"
id="country-payment-select"
[cxNgSelectA11y]="{
ariaLabel: 'addressForm.country' | cxTranslate
}"
>
</ng-select>
<cx-form-errors
[control]="billingAddressForm.get('country.isocode')"
></cx-form-errors>
</label>
</div>
</ng-container>
</div>
<div class="form-group">
<label>
<span class="label-content required">{{
'addressForm.firstName.label' | cxTranslate
}}</span>
<input
required="true"
class="form-control"
type="text"
placeholder="{{
'addressForm.firstName.placeholder' | cxTranslate
}}"
formControlName="firstName"
/>
<cx-form-errors
[control]="billingAddressForm.get('firstName')"
></cx-form-errors>
</label>
</div>
<div class="form-group">
<label>
<span class="label-content required">{{
'addressForm.lastName.label' | cxTranslate
}}</span>
<input
required="true"
type="text"
class="form-control"
placeholder="{{ 'addressForm.lastName.placeholder' | cxTranslate }}"
formControlName="lastName"
/>
<cx-form-errors
[control]="billingAddressForm.get('lastName')"
></cx-form-errors>
</label>
</div>
<div class="form-group">
<label>
<span class="label-content required">{{
'addressForm.address1' | cxTranslate
}}</span>
<input
required="true"
type="text"
class="form-control"
placeholder="{{ 'addressForm.streetAddress' | cxTranslate }}"
formControlName="line1"
/>
<cx-form-errors
[control]="billingAddressForm.get('line1')"
></cx-form-errors>
</label>
</div>
<div class="form-group">
<label>
<span class="label-content">{{
'addressForm.address2' | cxTranslate
}}</span>
<input
type="text"
class="form-control"
placeholder="{{ 'addressForm.aptSuite' | cxTranslate }}"
formControlName="line2"
/>
</label>
</div>
<div class="row">
<div class="form-group col-md-6">
<label>
<span class="label-content required">{{
'addressForm.city.label' | cxTranslate
}}</span>
<input
required="true"
type="text"
class="form-control"
placeholder="{{ 'addressForm.city.placeholder' | cxTranslate }}"
formControlName="town"
/>
<cx-form-errors
[control]="billingAddressForm.get('town')"
></cx-form-errors>
</label>
</div>
<div class="form-group col-md-6">
<label>
<span class="label-content required">{{
'addressForm.zipCode.label' | cxTranslate
}}</span>
<input
required="true"
type="text"
class="form-control"
placeholder="{{
'addressForm.zipCode.placeholder' | cxTranslate
}}"
formControlName="postalCode"
/>
<cx-form-errors
[control]="billingAddressForm.get('postalCode')"
></cx-form-errors>
</label>
</div>
<ng-container
*ngIf="regions$ | async as regions"
formGroupName="region"
>
<ng-container *ngIf="regions.length !== 0">
<div class="form-group col-md-6">
<label>
<span class="label-content required">{{
'addressForm.state' | cxTranslate
}}</span>
<ng-select
[inputAttrs]="{ required: 'true' }"
class="region-select"
formControlName="isocodeShort"
[searchable]="true"
[clearable]="false"
[items]="regions"
bindLabel="{{ regions[0].name ? 'name' : 'isocodeShort' }}"
bindValue="{{ regions[0].name ? 'isocodeShort' : 'region' }}"
placeholder="{{ 'addressForm.selectOne' | cxTranslate }}"
id="region-select"
[cxNgSelectA11y]="{
ariaLabel: 'addressForm.state' | cxTranslate
}"
>
</ng-select>
<cx-form-errors
[control]="billingAddressForm.get('region.isocodeShort')"
></cx-form-errors>
</label>
</div>
</ng-container>
</ng-container>
</div>
</div>
</ng-template>
</div>
Loading
Loading