Skip to content

Commit

Permalink
Merge branch 'develop' into epic/ssr-error-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelfras authored Sep 10, 2024
2 parents f129911 + 9134e71 commit e85a748
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"importProductsNewSavedCartSubtitle": "Add products by importing a .CSV file and creating a new saved cart.",
"importProductFileDetails": "Text file should contain list of products with required columns separated by comma: SKU and quantity.",
"selectFile": "Select File",
"selectedSuccessfully": "CSV file has been successfully selected.",
"savedCartName": "Saved Cart Name",
"savedCartDescription": "Saved Cart Description",
"optional": "optional",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
[formGroup]="form"
(submit)="formSubmitSubject$.next(undefined)"
>
<ng-container *cxFeature="'a11yCartImportConfirmationMessage'">
<div aria-live="assertive" aria-atomic="true">
<cx-message
*ngIf="form.get('file')?.value && form.get('file')?.valid"
[text]="'importEntriesDialog.selectedSuccessfully' | cxTranslate"
[type]="globalMessageType.MSG_TYPE_CONFIRMATION"
[isVisibleCloseButton]="false"
[cxFocus]="{ autofocus: '.cx-message' }"
></cx-message>
</div>
</ng-container>
<p class="cx-import-entries-subtitle">
{{ 'importEntriesDialog.importProductsSubtitle' | cxTranslate }}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
import { of, Subject } from 'rxjs';
import { filter, startWith, switchMap, take, tap } from 'rxjs/operators';
import { ImportProductsFromCsvService } from '../../import-products-from-csv.service';
import { GlobalMessageType } from '@spartacus/core';

@Component({
selector: 'cx-import-entries-form',
Expand All @@ -38,6 +39,7 @@ export class ImportEntriesFormComponent implements OnInit {
form: UntypedFormGroup;
loadedFile: string[][] | null;
formSubmitSubject$ = new Subject();
globalMessageType = GlobalMessageType;

@Output()
submitEvent = new EventEmitter<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
[formGroup]="form"
(submit)="formSubmitSubject$.next(undefined)"
>
<ng-container *cxFeature="'a11yCartImportConfirmationMessage'">
<div aria-live="assertive" aria-atomic="true">
<cx-message
*ngIf="form.get('file')?.value && form.get('file')?.valid"
[text]="'importEntriesDialog.selectedSuccessfully' | cxTranslate"
[type]="globalMessageType.MSG_TYPE_CONFIRMATION"
[isVisibleCloseButton]="false"
[cxFocus]="{ autofocus: '.cx-message' }"
></cx-message>
</div>
</ng-container>
<p class="cx-import-entries-subtitle">
{{ 'importEntriesDialog.importProductsNewSavedCartSubtitle' | cxTranslate }}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
FormErrorsModule,
IconModule,
KeyboardFocusModule,
MessageComponentModule,
} from '@spartacus/storefront';
import { defaultImportEntriesLayoutConfig } from './default-import-entries-layout.config';
import { ImportEntriesDialogComponent } from './import-entries-dialog/import-entries-dialog.component';
Expand All @@ -37,6 +38,8 @@ import { ImportOrderEntriesComponent } from './import-entries/import-order-entri
KeyboardFocusModule,
FileUploadModule,
I18nModule,
MessageComponentModule,
FeaturesConfigModule,
ConfigModule.withConfig(<CmsConfig>{
cmsComponents: {
ImportOrderEntriesComponent: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ export interface FeatureTogglesInterface {
*/
a11yOrganizationListHeadingOrder?: boolean;

/**
* In `ImportToNewSavedCartFormComponent`,`ImportEntriesFormComponent` after selecting a file
* confirmation message is displayed and read out
*/
a11yCartImportConfirmationMessage?: boolean;

/**
* Changes 'order days' check list into a fieldset inside of 'CheckoutScheduleReplenishmentOrderComponent'.
*/
Expand Down Expand Up @@ -558,6 +564,7 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
a11yMobileVisibleFocus: false,
a11yOrganizationsBanner: false,
a11yOrganizationListHeadingOrder: false,
a11yCartImportConfirmationMessage: false,
a11yReplenishmentOrderFieldset: false,
a11yListOversizedFocus: false,
a11yStoreFinderOverflow: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ if (environment.cpq) {
a11yMobileVisibleFocus: true,
a11yOrganizationsBanner: true,
a11yOrganizationListHeadingOrder: true,
a11yCartImportConfirmationMessage: true,
a11yReplenishmentOrderFieldset: true,
a11yListOversizedFocus: true,
a11yStoreFinderOverflow: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ import { ReactiveFormsModule } from '@angular/forms';
import { I18nModule } from '@spartacus/core';
import { FormErrorsModule } from '../form-errors/form-errors.module';
import { FileUploadComponent } from './file-upload.component';
import { KeyboardFocusModule } from '../../../../layout/a11y';

@NgModule({
imports: [CommonModule, ReactiveFormsModule, FormErrorsModule, I18nModule],
imports: [
CommonModule,
ReactiveFormsModule,
FormErrorsModule,
I18nModule,
KeyboardFocusModule,
],
declarations: [FileUploadComponent],
exports: [FileUploadComponent],
})
Expand Down

0 comments on commit e85a748

Please sign in to comment.