Skip to content

Commit

Permalink
Merge branch 'develop' into feature/CXSPA-8197
Browse files Browse the repository at this point in the history
  • Loading branch information
uroslates authored Oct 31, 2024
2 parents 99d8e29 + aa02ff8 commit 6dcb1d2
Show file tree
Hide file tree
Showing 98 changed files with 1,715 additions and 990 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/update-cloud-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,33 @@ on:
description: 'Enter your npm token'
required: true
secret: true
repo_url:
description: 'Enter the repository URL (default will be used if empty)'
required: false
secret: true

env:
CONFIG_DIR: scripts/install
REPO_URL: https://${{secrets.GH_TEMPORARY_TOKEN}}@github.com/SAP-samples/cloud-commerce-sample-setup.git
NPM_REPO_URL: https://73554900100900004337.dev.npmsrv.base.repositories.cloud.sap/
OCC_BACKEND_URL: OCC_BACKEND_BASE_URL_VALUE

jobs:
run_script:
runs-on: ubuntu-latest
steps:
- name: Set REPO_URL
run: |
if [ -z "${{ inputs.repo_url }}" ]; then
REPO_URL="https://${{ secrets.GH_TEMPORARY_TOKEN }}@github.com/SAP-samples/cloud-commerce-sample-setup.git"
else
REPO_URL="${{ inputs.repo_url }}"
fi
echo "REPO_URL=$REPO_URL" >> $GITHUB_ENV
- name: Extract REPO_NAME from REPO_URL
id: extract-repo-name
run: |
REPO_NAME=$(echo $REPO_URL | sed -E 's|.*/(.*)\.git|\1|')
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v2
- name: Create storefronts
Expand Down Expand Up @@ -116,8 +132,8 @@ jobs:
- name: Commit changes
run: |
function clone_and_setup_repo() {
git clone $REPO_URL
cd cloud-commerce-sample-setup
git clone ${{ env.REPO_URL }}
cd ${{ env.REPO_NAME }}
# Get the current date and time
timestamp=$(date +%Y%m%d%H%M%S)
Expand All @@ -137,7 +153,7 @@ jobs:
git add .
git commit -m "Updated content of js-storefront/b2bspastore"
git push -u $REPO_URL
git push -u ${{ env.REPO_URL }}
}
clone_and_setup_repo
Expand All @@ -147,7 +163,7 @@ jobs:
- name: Create Pull Request
run: |
curl -X POST -H "Authorization: token ${{ secrets.GH_TEMPORARY_TOKEN }}" -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/SAP-samples/cloud-commerce-sample-setup/pulls \
https://api.github.com/repos/SAP-samples/${{ env.REPO_NAME}}/pulls \
-d '{
"title": "Update js-storefronts content",
"body": "This PR updates the content of the js-storefronts.",
Expand Down
1 change: 1 addition & 0 deletions feature-libs/asm/assets/translations/en/asm.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"row": {
"id": "ID",
"qty": "Qty",
"qtyFull": "Quantity",
"total": "Total"
},
"actions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ <h2 id="asm-save-cart-dialog-title" class="title modal-title">
</div>
<div class="cx-dialog-row row">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-dialog-item col-sm-6 col-md-6 text-right item-left-text"
>
{{ 'asm.saveCart.dialog.row.qtyFull' | cxTranslate }}
</div>
<div
*cxFeature="'!a11yQTY2Quantity'"
class="cx-dialog-item col-sm-6 col-md-6 text-right item-left-text"
>
{{ 'asm.saveCart.dialog.row.qty' | cxTranslate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { Component, OnInit } from '@angular/core';
import { Cart } from '@spartacus/cart/base/root';
import { SavedCartFacade } from '@spartacus/cart/saved-cart/root';
import { GlobalMessageType } from '@spartacus/core';
import { GlobalMessageType, useFeatureStyles } from '@spartacus/core';
import { FocusConfig, LaunchDialogService } from '@spartacus/storefront';
import { BehaviorSubject } from 'rxjs';
import { take } from 'rxjs/operators';
Expand Down Expand Up @@ -38,7 +38,9 @@ export class AsmSaveCartDialogComponent implements OnInit {
constructor(
protected launchDialogService: LaunchDialogService,
protected savedCartFacade: SavedCartFacade
) {}
) {
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
this.launchDialogService.data$.pipe(take(1)).subscribe((data: Cart) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { useFeatureStyles } from '@spartacus/core';

@Component({
selector: 'cx-csagent-login-form',
Expand All @@ -24,7 +25,9 @@ export class CSAgentLoginFormComponent implements OnInit {
@Output()
submitEvent = new EventEmitter<{ userId: string; password: string }>();

constructor(protected fb: UntypedFormBuilder) {}
constructor(protected fb: UntypedFormBuilder) {
useFeatureStyles('a11yPasswordVisibliltyBtnValueOverflow');
}

ngOnInit(): void {
this.csAgentLoginForm = this.fb.group({
Expand Down
1 change: 1 addition & 0 deletions feature-libs/cart/base/assets/translations/en/cart.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"item": "Item",
"itemPrice": "Item price",
"quantity": "Qty",
"quantityFull": "Quantity",
"quantityTitle": "The quantity represents the total number of this item in your cart.",
"total": "Total",
"actions": "Actions",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<form *ngIf="productCode" [formGroup]="addToCartForm" (submit)="addToCart()">
<div class="quantity" *ngIf="showQuantity">
<label>{{ 'addToCart.quantity' | cxTranslate }}</label>
<label *cxFeature="'a11yQTY2Quantity'">{{
'addToCart.quantityFull' | cxTranslate
}}</label>
<label *cxFeature="'!a11yQTY2Quantity'">{{
'addToCart.quantity' | cxTranslate
}}</label>
<div class="cx-counter-stock">
<cx-item-counter
*ngIf="hasStock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
FeatureConfigService,
Product,
isNotNullable,
useFeatureStyles,
} from '@spartacus/core';
import {
CmsComponentData,
Expand Down Expand Up @@ -112,7 +113,9 @@ export class AddToCartComponent implements OnInit, OnDestroy {
protected component: CmsComponentData<CmsAddToCartComponent>,
protected eventService: EventService,
@Optional() protected productListItemContext?: ProductListItemContext
) {}
) {
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit() {
if (this.product) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { CmsConfig, I18nModule, provideDefaultConfig } from '@spartacus/core';
import {
CmsConfig,
FeaturesConfigModule,
I18nModule,
provideDefaultConfig,
} from '@spartacus/core';
import {
IconModule,
ItemCounterModule,
Expand All @@ -23,6 +28,7 @@ import { AddToCartComponent } from './add-to-cart.component';
IconModule,
ItemCounterModule,
OutletModule,
FeaturesConfigModule,
],
providers: [
provideDefaultConfig(<CmsConfig>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@
<!-- Item Quantity -->
<td role="cell" class="cx-quantity">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-mobile-header"
placement="left"
title="{{ 'cartItems.quantityTitle' | cxTranslate }}"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</div>
<div
*cxFeature="'!a11yQTY2Quantity'"
class="cx-mobile-header"
placement="left"
title="{{ 'cartItems.quantityTitle' | cxTranslate }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { Component, inject } from '@angular/core';
import { CartItemContext } from '@spartacus/cart/base/root';
import { useFeatureStyles } from '@spartacus/core';
import { CartItemComponent } from '../cart-item/cart-item.component';
import { CartItemContextSource } from '../cart-item/model/cart-item-context-source.model';
import { CartItemListComponentService } from './cart-item-list-row.component.service';
Expand All @@ -23,5 +24,6 @@ export class CartItemListRowComponent extends CartItemComponent {
isFlagQuote = this.componentService.showBasePriceWithDiscount();
constructor(cartItemContextSource: CartItemContextSource) {
super(cartItemContextSource);
useFeatureStyles('a11yQTY2Quantity');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@
[cxOutlet]="CartOutlets.CPQ_QUOTE_HEADING"
[cxOutletContext]="items"
></ng-template>
<th role="columnheader" class="cx-item-list-qty">
<th
*cxFeature="'a11yQTY2Quantity'"
role="columnheader"
class="cx-item-list-qty"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</th>
<th
*cxFeature="'!a11yQTY2Quantity'"
role="columnheader"
class="cx-item-list-qty"
>
{{ 'cartItems.quantity' | cxTranslate }}
</th>
<ng-container *ngIf="options.isSaveForLater; else totalHeader">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import {
ActiveCartFacade,
CartItemComponentOptions,
CartOutlets,
ConsignmentEntry,
MultiCartFacade,
OrderEntry,
PromotionLocation,
SelectiveCartFacade,
CartOutlets,
} from '@spartacus/cart/base/root';
import {
FeatureConfigService,
Expand Down Expand Up @@ -99,6 +99,7 @@ export class CartItemListComponent implements OnInit, OnDestroy {
@Optional() protected outlet?: OutletContextData<ItemListContext>
) {
useFeatureStyles('a11yPreventHorizontalScroll');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@
<!-- Item Quantity -->
<div class="cx-quantity" [ngClass]="compact ? '' : ' col-3'">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-label"
[ngClass]="compact ? '' : ' d-block d-md-none d-lg-none d-xl-none'"
placement="left"
title="{{ 'cartItems.quantityTitle' | cxTranslate }}"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</div>
<div
*cxFeature="'!a11yQTY2Quantity'"
class="cx-label"
[ngClass]="compact ? '' : ' d-block d-md-none d-lg-none d-xl-none'"
placement="left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
OrderEntry,
PromotionLocation,
} from '@spartacus/cart/base/root';
import { useFeatureStyles } from '@spartacus/core';
import { ICON_TYPE } from '@spartacus/storefront';
import { CartItemContextSource } from './model/cart-item-context-source.model';
import { useFeatureStyles } from '@spartacus/core';

@Component({
selector: 'cx-cart-item',
Expand Down Expand Up @@ -45,6 +45,7 @@ export class CartItemComponent implements OnChanges {

constructor(protected cartItemContextSource: CartItemContextSource) {
useFeatureStyles('a11yCartItemsLinksStyles');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnChanges(changes?: SimpleChanges) {
Expand Down
3 changes: 3 additions & 0 deletions feature-libs/cart/base/styles/components/_cart-item-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

.cx-item-list-qty {
text-transform: uppercase;
@include forFeature('a11yQTY2Quantity') {
text-transform: none;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"product": "Product",
"products": "Products",
"productCodeLabel": "Product ID",
"quantityLabel": "Qty"
"quantityLabel": "Qty",
"quantityFullLabel": "Quantity"
},
"quickOrderForm": {
"placeholder": "Enter Product name or SKU",
Expand Down Expand Up @@ -65,6 +66,7 @@
"id": "ID",
"price": "Price",
"quantity": "QTY",
"quantityFull": "Quantity",
"itemPrice": "Item price",
"qty": "Qty",
"actions": "Actions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@
</span>

<span class="cx-cart-quick-order-form-qty">
<label class="cx-cart-quick-order-form-label">
<label
*cxFeature="'a11yQTY2Quantity'"
class="cx-cart-quick-order-form-label"
>
{{ 'quickOrderCartForm.quantityFullLabel' | cxTranslate }}
</label>

<label
*cxFeature="'!a11yQTY2Quantity'"
class="cx-cart-quick-order-form-label"
>
{{ 'quickOrderCartForm.quantityLabel' | cxTranslate }}
</label>

Expand Down Expand Up @@ -156,7 +166,7 @@
<cx-form-errors
*cxFeature="'formErrorsDescriptiveMessages'"
[translationParams]="{
label: 'quickOrderCartForm.quantityLabel' | cxTranslate,
label: 'quickOrderCartForm.quantityFullLabel' | cxTranslate,
}"
[control]="quickOrderForm.get('quantity')"
></cx-form-errors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
FeatureConfigService,
GlobalMessageService,
GlobalMessageType,
useFeatureStyles,
} from '@spartacus/core';
import { Observable, Subscription } from 'rxjs';
import { first, map } from 'rxjs/operators';
Expand Down Expand Up @@ -55,7 +56,9 @@ export class CartQuickOrderFormComponent implements OnInit, OnDestroy {
protected eventService: EventService,
protected formBuilder: UntypedFormBuilder,
protected globalMessageService: GlobalMessageService
) {}
) {
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
this.buildForm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
</td>

<td role="cell" class="cx-quantity">
<div class="cx-mobile-header">
<div *cxFeature="'a11yQTY2Quantity'" class="cx-mobile-header">
{{ 'quickOrderTable.quantityFull' | cxTranslate }}
</div>
<div *cxFeature="'!a11yQTY2Quantity'" class="cx-mobile-header">
{{ 'quickOrderTable.qty' | cxTranslate }}
</div>
<div class="cx-value">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class QuickOrderItemComponent implements OnInit, OnDestroy {
protected quickOrderService: QuickOrderFacade
) {
useFeatureStyles('a11yCartItemsLinksStyles');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
Expand Down
Loading

0 comments on commit 6dcb1d2

Please sign in to comment.