Skip to content

Commit 994aef6

Browse files
author
Gilberto Alvarado
authored
Merge branch 'develop' into feature/GH-1765
2 parents c229dab + 90dcbbd commit 994aef6

File tree

13 files changed

+158
-128
lines changed

13 files changed

+158
-128
lines changed

projects/storefrontapp-e2e-cypress/cypress/helpers/checkout-as-persistent-user.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function selectShippingAddress() {
7676
.first()
7777
.find('.cx-summary-amount')
7878
.should('not.be.empty');
79-
cy.get('.cx-card-body__title').contains(' Default Shipping Address ');
79+
cy.get('.cx-card-title').contains(' Default Shipping Address ');
8080
cy.getByText(/Ship to this address/i).click();
8181
cy.get('.card-header').should('contain', ' SELECTED ');
8282
cy.get('button.btn-primary').click();
@@ -93,7 +93,7 @@ export function selectPaymentMethod() {
9393
cy.get('cx-order-summary .cx-summary-partials .cx-summary-total')
9494
.find('.cx-summary-amount')
9595
.should('not.be.empty');
96-
cy.get('.cx-card-body__title').contains(' Default Payment Method ');
96+
cy.get('.cx-card-title').contains(' Default Payment Method ');
9797
cy.getByText(/Use this payment/i).click();
9898
cy.get('.card-header').should('contain', ' SELECTED ');
9999
cy.get('button.btn-primary').click();
@@ -103,11 +103,11 @@ export function verifyAndPlaceOrder() {
103103
cy.get('.cx-review-title').should('contain', 'Review');
104104
cy.get('.cx-review-summary-card')
105105
.contains('cx-card', 'Ship To')
106-
.find('.cx-card-body__container')
106+
.find('.cx-card-container')
107107
.should('not.be.empty');
108108
cy.get('.cx-review-summary-card')
109109
.contains('cx-card', 'Shipping Method')
110-
.find('.cx-card-body__container')
110+
.find('.cx-card-container')
111111
.within(() => {
112112
cy.getByText('standard-gross');
113113
});

projects/storefrontapp-e2e-cypress/cypress/helpers/checkout-flow.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ export function placeOrder() {
7575
cy.get('.cx-review-title').should('contain', 'Review');
7676
cy.get('.cx-review-summary-card')
7777
.contains('cx-card', 'Ship To')
78-
.find('.cx-card-body__container')
78+
.find('.cx-card-container')
7979
.within(() => {
8080
cy.getByText(user.fullName);
8181
cy.getByText(user.address.line1);
8282
cy.getByText(user.address.line2);
8383
});
8484
cy.get('.cx-review-summary-card')
8585
.contains('cx-card', 'Shipping Method')
86-
.find('.cx-card-body__container')
86+
.find('.cx-card-container')
8787
.within(() => {
8888
cy.getByText('standard-gross');
8989
});

projects/storefrontlib/src/lib/checkout/components/multi-step-checkout/container/multi-step-checkout.component.scss

+14-12
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
.cx-nav {
1010
@include type('4', 'semi');
11-
margin-bottom: 0;
11+
margin: var(--cx-margin, 0);
1212

1313
.cx-list {
1414
display: var(--cx-display, flex);
1515
flex-direction: var(--cx-flex-direction, row);
1616
list-style: var(--cx-list-style, none);
1717
padding: var(--cx-padding, 0);
18-
margin-bottom: 0;
18+
margin: var(--cx-margin, 0);
1919
}
2020

2121
.cx-item {
@@ -44,11 +44,11 @@
4444

4545
.cx-link,
4646
.cx-link:hover {
47-
cursor: pointer;
47+
cursor: var(--cx-cursor, pointer);
4848

4949
&.is-disabled {
5050
color: var(--cx-color, var(--cx-g-color-light));
51-
cursor: not-allowed;
51+
cursor: var(--cx-cursor, not-allowed);
5252
}
5353

5454
&.is-active {
@@ -62,26 +62,28 @@
6262
.cx-media {
6363
@include media-breakpoint-down(md) {
6464
& > :last-child {
65-
border-bottom: 1px solid;
65+
border-width: var(--cx-border-width, 0 0 1px 0);
66+
border-style: var(--cx-border-style, solid);
6667
border-color: var(--cx-border-color, var(--cx-g-color-light));
6768
}
6869
}
6970

7071
.cx-list-media {
7172
display: var(--cx-display, none);
7273
@include type('3');
73-
text-transform: var(--cx-text-transform, uppercase);
74+
text-transform: var(--cx-text-transform, capitalize);
7475
justify-content: var(--cx-justify-content, space-between);
7576
align-items: var(--cx-align-items, center);
7677
line-height: var(--cx-line-height, 4.75rem);
77-
min-width: var(--cx-min-widt, 100%);
78-
border-top: 1px solid;
78+
min-width: var(--cx-min-width, 100%);
79+
border-width: var(--cx-border-width, 1px 0 0 0);
80+
border-style: var(--cx-border-style, solid);
7981
border-color: var(--cx-border-color, var(--cx-g-color-light));
80-
margin-bottom: 0;
82+
margin: var(--cx-margin, 0);
8183

8284
button {
83-
text-transform: var(--cx-text-transform, uppercase);
84-
font-weight: $font-weight-bold;
85+
text-transform: var(--cx-text-transform, capitalize);
86+
font-weight: var(--cx-font-weight, var(--cx-g-font-weight-semi));
8587
}
8688

8789
@include media-breakpoint-down(md) {
@@ -107,7 +109,7 @@
107109
}
108110

109111
button {
110-
margin-top: 1.25rem;
112+
margin: var(--cx-margin, 1.25rem 0 0);
111113
}
112114
}
113115

projects/storefrontlib/src/lib/checkout/components/multi-step-checkout/payment-method/payment-method.component.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ <h3 class="cx-checkout-title d-none d-lg-block d-xl-block">Payment</h3>
2323

2424
<div class="cx-checkout-body row">
2525
<div
26-
class="col-md-12 col-lg-6"
26+
class="cx-payment-card col-md-12 col-lg-6"
2727
*ngFor="let method of existingPaymentMethods; let i = index"
2828
>
29-
<div class="cx-payment-card">
29+
<div class="cx-payment-card-inner">
3030
<cx-card
3131
[border]="true"
32+
[fitToContainer]="true"
3233
[content]="cards[i]"
3334
(sendCard)="paymentMethodSelected(method, i)"
3435
></cx-card>

projects/storefrontlib/src/lib/checkout/components/multi-step-checkout/payment-method/payment-method.component.scss

+54
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,62 @@
22

33
@include checkout-media-style();
44

5+
.cx-payment {
6+
&.container {
7+
padding: var(--cx-padding, 0);
8+
}
9+
}
10+
511
.cx-payment-card {
12+
padding-bottom: var(--cxpadding, 30px);
13+
}
14+
15+
.cx-payment-card-inner {
16+
height: var(--cx-height, 100%);
17+
background-color: var(--cx-background-color, var(--cx-g-color-inverse));
18+
cursor: pointer;
19+
620
@include media-breakpoint-down(md) {
721
background-color: var(--cx-background-color, var(--cx-g-color-inverse));
822
}
923
}
24+
25+
.cx-checkout-title {
26+
text-transform: var(--cx-text-transform, uppercase);
27+
margin: var(--cx-margin, 0 auto);
28+
padding: var(--cx-padding, 2.375rem 0 1.75rem 0);
29+
}
30+
31+
.cx-checkout-text {
32+
@include media-breakpoint-down(md) {
33+
padding-left: var(--cx-padding, 3.5rem);
34+
}
35+
@include media-breakpoint-down(sm) {
36+
padding-left: var(--cx-padding, 1.5rem);
37+
}
38+
}
39+
40+
.cx-checkout-btns {
41+
padding-bottom: var(--cx-padding, 1rem);
42+
43+
@include media-breakpoint-down(md) {
44+
padding: var(--cx-padding, 1.25rem 0);
45+
}
46+
47+
.btn-action {
48+
@include media-breakpoint-down(sm) {
49+
margin-bottom: var(--cx-margin, 1rem);
50+
}
51+
}
52+
}
53+
54+
.cx-checkout-body {
55+
display: var(--cx-display, flex);
56+
align-items: var(--cx-align-items, stretch);
57+
58+
&.row {
59+
@include media-breakpoint-down(md) {
60+
padding: var(--cx-padding, 0);
61+
}
62+
}
63+
}

projects/storefrontlib/src/lib/checkout/components/multi-step-checkout/payment-method/payment-method.component.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class MockCardComponent {
6363
@Input()
6464
border: boolean;
6565
@Input()
66+
fitToContainer: boolean;
67+
@Input()
6668
content: Card;
6769
}
6870

projects/storefrontlib/src/lib/checkout/components/multi-step-checkout/shipping-address/shipping-address.component.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@include checkout-media-style();
44

55
.cx-shipping-address-card {
6-
padding-bottom: var(--cxpadding, 30px);
6+
padding-bottom: var(--cx-padding, 30px);
77

88
.cx-shipping-address-card-inner {
99
height: var(--cx-height, 100%);

projects/storefrontlib/src/lib/my-account/order/order-details/order-details.component.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ describe('OrderDetailsComponent', () => {
189189

190190
it('should order details display "ship to" data', () => {
191191
fixture.detectChanges();
192-
const element: DebugElement = el.query(
193-
By.css('.cx-card-body__label-container')
194-
);
192+
const element: DebugElement = el.query(By.css('.cx-card-label-container'));
195193
expect(element.nativeElement.textContent).toContain(
196194
mockOrder.deliveryAddress.firstName &&
197195
mockOrder.deliveryAddress.lastName &&

projects/storefrontlib/src/lib/my-account/payment-methods/components/payment-methods.component.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ describe('PaymentMethodsComponent', () => {
130130
.textContent;
131131
}
132132
function getTextBold(elem: DebugElement): string {
133-
return elem.query(By.css('cx-card .card__label--bold')).nativeElement
133+
return elem.query(By.css('cx-card .cx-card-label-bold')).nativeElement
134134
.textContent;
135135
}
136136
function getCardNumber(elem: DebugElement): string {
137-
return elem.queryAll(By.css('cx-card .card__label'))[0].nativeElement
137+
return elem.queryAll(By.css('cx-card .cx-card-label'))[0].nativeElement
138138
.textContent;
139139
}
140140
function getExpiration(elem: DebugElement): string {
141-
return elem.queryAll(By.css('cx-card .card__label'))[1].nativeElement
141+
return elem.queryAll(By.css('cx-card .cx-card-label'))[1].nativeElement
142142
.textContent;
143143
}
144144
component.ngOnInit();
@@ -155,8 +155,8 @@ describe('PaymentMethodsComponent', () => {
155155
spyOn(userService, 'getPaymentMethodsLoading').and.returnValue(of(false));
156156

157157
function getDeleteMsg(elem: DebugElement): string {
158-
return elem.query(By.css('cx-card .cx-card-body__delete-msg'))
159-
.nativeElement.textContent;
158+
return elem.query(By.css('cx-card .cx-card-delete-msg')).nativeElement
159+
.textContent;
160160
}
161161
function getDeleteButton(elem: DebugElement): any {
162162
return elem.query(By.css('cx-card .card-link')).nativeElement;

projects/storefrontlib/src/lib/ui/components/card/card.component.html

+15-18
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
<div
22
*ngIf="content"
33
class="cx-card"
4-
[class.cx-card--border]="border"
5-
[class.cx-card--fit-to-container]="fitToContainer"
4+
[class.cx-card-border]="border"
5+
[class.cx-card-fit-to-container]="fitToContainer"
66
>
77
<!-- Card Header -->
88
<div *ngIf="content.header && !editMode" class="card-header">
99
{{ content.header }}
1010
</div>
1111
<!-- Card Body -->
12-
<div class="card-body cx-card-body" [class.cx-card--delete-mode]="editMode">
12+
<div class="card-body cx-card-body" [class.cx-card-delete]="editMode">
1313
<!-- Edit message -->
14-
<div *ngIf="editMode" class="cx-card-body__delete-msg">
14+
<div *ngIf="editMode" class="cx-card-delete-msg">
1515
{{ content.deleteMsg }}
1616
</div>
1717
<!-- Card title -->
18-
<h4 *ngIf="content.title" class="cx-card-body__title">
18+
<h4 *ngIf="content.title" class="cx-card-title">
1919
{{ content.title }}
2020
</h4>
2121
<!-- Card Content -->
22-
<div class="cx-card-body__container">
22+
<div class="cx-card-container">
2323
<!-- Card Label -->
24-
<div class="cx-card-body__label-container">
25-
<div *ngIf="content.textBold" class="card__label--bold">
24+
<div class="cx-card-label-container">
25+
<div *ngIf="content.textBold" class="cx-card-label-bold">
2626
{{ content.textBold }}
2727
</div>
2828
<div *ngFor="let line of content.text">
29-
<div class="card__label">{{ line }}</div>
29+
<div class="cx-card-label">{{ line }}</div>
3030
</div>
3131
</div>
3232
<!-- Image -->
33-
<div *ngIf="content.img" class="cx-card-body__img-container">
33+
<div *ngIf="content.img" class="cx-card-img-container">
3434
<img src="{{ content.img }}" alt="" />
3535
</div>
3636
</div>
3737
<!-- Edit Mode Actions -->
38-
<div *ngIf="editMode" class="row cx-card-body__delete">
38+
<div *ngIf="editMode" class="row cx-card-body-delete">
3939
<div class="col-md-6">
4040
<button class="btn btn-block btn-secondary" (click)="cancelEdit()">
4141
cancel
@@ -48,27 +48,24 @@ <h4 *ngIf="content.title" class="cx-card-body__title">
4848
</div>
4949
</div>
5050
<!-- Actions -->
51-
<div
52-
*ngIf="content.actions && !editMode"
53-
class="cx-card-body__actions-container"
54-
>
51+
<div *ngIf="content.actions && !editMode" class="cx-card-actions">
5552
<div *ngFor="let action of content.actions">
5653
<div [ngSwitch]="action.event">
5754
<a
5855
*ngSwitchCase="'delete'"
59-
class="card-link btn-link"
56+
class="cx-card-link card-link btn-link"
6057
(click)="delete()"
6158
>{{ action.name }}</a
6259
>
6360
<a
6461
*ngSwitchCase="'default'"
65-
class="card-link btn-link"
62+
class="cx-card-link card-link btn-link"
6663
(click)="setDefault()"
6764
>{{ action.name }}</a
6865
>
6966
<a
7067
*ngSwitchCase="'send'"
71-
class="card-link btn-link"
68+
class="cx-card-link card-link btn-link"
7269
(click)="send()"
7370
>{{ action.name }}</a
7471
>

0 commit comments

Comments
 (0)