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

Prepare group menu for a11y #12348

Merged
merged 84 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
e873170
Prepare group menu for a11y
Larisa-Staroverova May 7, 2021
467c8d9
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 11, 2021
afea6c1
Define group menu service that cointains all event handling logic
Larisa-Staroverova May 11, 2021
47c3d31
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 12, 2021
304b3d4
Enhance test coverage
Larisa-Staroverova May 12, 2021
2d5fd7f
Enhance corresponding cypress tests
Larisa-Staroverova May 12, 2021
42a9cc4
Refactoring
Larisa-Staroverova May 12, 2021
c29a8e0
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 12, 2021
87a0e46
Fix lint issue
Larisa-Staroverova May 12, 2021
5e3f8a8
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 17, 2021
dbba158
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 18, 2021
d6ded25
Add update schematics for first 4 constructor changes
ChristophHi May 18, 2021
795db30
Also update documentation
ChristophHi May 18, 2021
a3543af
Provide upgrade schematics (product-configurator) for method deprecat…
Larisa-Staroverova May 19, 2021
6b47a97
Incomplete
ChristophHi May 19, 2021
b6c8739
Park
ChristophHi May 19, 2021
0f1412d
Add deprecation section
ChristophHi May 20, 2021
05e3a4e
Fix migration for checkbox list component
ChristophHi May 20, 2021
518937f
Revert change to standard test
ChristophHi May 20, 2021
22cc0a2
Remove test artifact
ChristophHi May 20, 2021
e85e0f3
Remove whitespace
ChristophHi May 20, 2021
6a21e83
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 20, 2021
65efb62
Fix imports for migrations
ChristophHi May 20, 2021
70a33f1
Adjust icons verical alignment
Larisa-Staroverova May 20, 2021
7f51078
Add documentation
ChristophHi May 20, 2021
a1f82cf
Merge branch 'develop' into feature/GH-12198-update-schematics-constr…
ChristophHi May 20, 2021
85492cb
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 25, 2021
cbd1914
Merge branch 'develop' into feature/GH-12198-update-schematics-constr…
ChristophHi May 25, 2021
1f0cf3c
Merge branch 'develop' into feature/GH-12199
ChristophHi May 25, 2021
3841fdb
Remove obsolete code and add further migration
ChristophHi May 25, 2021
77daa57
Fix utils service migration after unit test
ChristophHi May 25, 2021
de20be6
Add missing documentation
ChristophHi May 25, 2021
5bc78c2
Add 4.0 script to migrations
ChristophHi May 25, 2021
53552cf
Remove obsolete methods and add migration
ChristophHi May 26, 2021
fcdddc1
Merge branch 'feature/GH-12199' of https://github.com/SAP/spartacus i…
ChristophHi May 26, 2021
a766ab5
Merge branch 'develop' into feature/GH-12199
ChristophHi May 26, 2021
5972a45
Remove obsolete tests and version checks in views
ChristophHi May 26, 2021
01cae16
Review feedback I
Larisa-Staroverova May 26, 2021
e32e6b6
Review feedback II
Larisa-Staroverova May 26, 2021
43bbfd3
Review feedback III
Larisa-Staroverova May 26, 2021
b321563
document styling changes I
Larisa-Staroverova May 27, 2021
6a16f16
document styling changes II
Larisa-Staroverova May 27, 2021
0aeda96
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
ChristophHi May 27, 2021
574dd81
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 31, 2021
c8fb64a
Merge branch 'feature/GH-12089_a11y_group_menu' of https://github.com…
Larisa-Staroverova May 31, 2021
8360d0c
Merge branch 'feature/GH-11681_styling_changes' into feature/GH-12089…
Larisa-Staroverova May 31, 2021
59ed51f
Document styling changes
Larisa-Staroverova May 31, 2021
571cfca
Merge branch 'feature/GH-12199' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 31, 2021
713519f
Merge branch 'feature/GH-12199' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova May 31, 2021
fb2e94b
Introduce schematics for deprecated methods
Larisa-Staroverova May 31, 2021
3d1b4b1
Merge branch 'feature/GH-12198-update-schematics-constructor' into fe…
Larisa-Staroverova May 31, 2021
a464a6d
Introduce schematics for constructor deprecation
Larisa-Staroverova May 31, 2021
2f15c9d
Merge branch 'develop' into feature/GH-12199
ChristophHi May 31, 2021
491586e
Strick mode issues
Larisa-Staroverova May 31, 2021
966e239
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 1, 2021
de22a63
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
ChristophHi Jun 1, 2021
2ae394f
Fix strict mode issues in new service and its tests
ChristophHi Jun 1, 2021
0d02756
Take review feedback into account
Larisa-Staroverova Jun 1, 2021
e5d67cf
Implement review feedback regarding @ViewChildren
Larisa-Staroverova Jun 1, 2021
07a51c6
review feedback: remove deprecated method
Larisa-Staroverova Jun 1, 2021
6b4da92
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 1, 2021
f72aa25
Merge branch 'develop' into feature/GH-12199
ChristophHi Jun 2, 2021
1aa32ab
Review feedback
Larisa-Staroverova Jun 2, 2021
850d3f7
Remove generated file
Larisa-Staroverova Jun 2, 2021
bc2fc96
Add missing deprecated params
Larisa-Staroverova Jun 2, 2021
ead7ccd
Merge branch 'develop' into feature/GH-12199
ChristophHi Jun 2, 2021
b68bf21
Fix import
Larisa-Staroverova Jun 2, 2021
ad1bb83
Refactor updateCurrentGroupIndex method & add some tests
Larisa-Staroverova Jun 2, 2021
64d55b7
Review feedback: use WindowRef instead
Larisa-Staroverova Jun 2, 2021
0aa1119
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 2, 2021
1d5df42
Merge branch 'develop' into feature/GH-12199
ChristophHi Jun 7, 2021
3432e6c
Fix prettier issue
ChristophHi Jun 7, 2021
14cf575
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 7, 2021
064edac
Fix strict mode issues
ChristophHi Jun 7, 2021
bbae41c
Review feedback
Larisa-Staroverova Jun 7, 2021
995378e
Merge branch 'feature/GH-12199' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 7, 2021
0b7a6ef
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 7, 2021
b0ab174
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 9, 2021
8446546
Add removed by merge line into 4_0.md
Larisa-Staroverova Jun 9, 2021
526b1a6
Review feedback regarding schematics I
Larisa-Staroverova Jun 9, 2021
be4a36e
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 9, 2021
acf20a8
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
Larisa-Staroverova Jun 10, 2021
a66669e
Fix schematics issue: add missing constructor parameters
Larisa-Staroverova Jun 10, 2021
42abc14
Merge branch 'develop' into feature/GH-12089_a11y_group_menu
ChristophHi Jun 11, 2021
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
28 changes: 28 additions & 0 deletions docs/migration/4_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,31 @@ What was removed:
- core of the mechanism (reducer)
- configuration (`storageSync` from `StateConfig`)
- default config and default keys (`defaultStateConfig`, `DEFAULT_LOCAL_STORAGE_KEY` and `DEFAULT_SESSION_STORAGE_KEY`)

`ConfiguratorAttributeCheckboxListComponent` now also requires `ConfiguratorAttributeQuantityService`.
`ConfiguratorAttributeDropDownComponent` now also requires `ConfiguratorAttributeQuantityService`.
`ConfiguratorAttributeRadiButtonComponent` now also requires `ConfiguratorAttributeQuantityService`.
`ConfiguratorCartEntryInfoComponent` now also requires `CommonConfiguratorUtilsService`.
`ConfiguratorStorefrontUtilsService` now also requires `WindowRef` and `KeyboardFocusService`.
`ConfiguratorFormComponent` now also requires `ConfiguratorStorefrontUtilsService`.

### ConfiguratorAttributeDropDownComponent

Method `onSelect` has been removed, it is no longer used. Use `onSelect` from super class which takes the value as argument

### ConfiguratorAttributeNumericInputFieldComponent

Method `createEventFromInput` has been removed, it is no longer used

### ConfiguratorAttributeRadioButtonComponent

Method `onDeselect` has been removed, it is no longer used

### ConfiguratorProductTitleComponent

Methods `getProductImageURL`, `getProductImageAlt` and `clickOnEnter` have been removed, there are no longer used

### ConfiguratorGroupMenuComponent

Methods `clickOnEnter` and `navigateUpOnEnter` have been removed, there are no longer used

84 changes: 84 additions & 0 deletions docs/migration/css-changes-in-version-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,87 @@ title: Changes to Styles in 4.0
## Changes in Checkout Components

* `cx-product-variants` selector has been moved to corresponding feature-lib `@spartacus/product`.

## Change in Configurator Attribute Type Components

* `cx-quantity` selector has been added to align its padding to the corresponding attribute type.

## Changes in Configurator Product Title Component

* `width` set to 80% on `%cx-configurator-product-title` to use only 80% of the configuration product title width.

* `button` instead of the anchor link on `%cx-configurator-product-title`.

* `padding` set to 16px/ 32px on `%cx-configurator-product-title` for `cx-details` selector to align spacing depending on the screen size.

* `cx-configurator-image` mixin has been defined on `%cx-configurator-product-title` for `cx-details-image` selector to define the unique styling.

* `cx-configurator-truncate-content` mixin has been added on `%cx-configurator-product-title` for `cx-detail-title`, `cx-code` and `cx-description` selectors to enable the truncation for the small widgets.

## Changes in Configurator Group Menu Component

* `cx-group-menu` class replace `ul` element on `%cx-configurator-group-menu`.

* `cx-configurator-truncate-content` mixin has been added on `%cx-configurator-group-menu` for `span` selector to enable the configuration group title truncation for the small widgets.

## Changes in Configurator Form Component

* `width` set to 100% on `%cx-configurator-form` to use the whole width of the configuration form.

* `padding` set to 16px on `%cx-configurator-form` for `cx-group-attribute` to align the spacing between the configuration group attributes.

## Changes in Configurator Attribute Header Component

* `margin` set to 17px on `%cx-configurator-attribute-header` to align the spacing to the attribute header to the attribute type.

* `padding` set to 0px and `margin` to 17px on `%cx-configurator-attribute-type` to align the spacing between the configuration attribute types.

## Change in Configurator Attribute Drop-Down Component

* `padding` set to 1rem on `%cx-configurator-attribute-drop-down` for `cx-configurator-attribute-quantity` selector to define the spacing between the drop-down attribute type, and the quantity counter.

## Change in Configurator Attribute Checkbox List Component

* `padding` set to 1rem on `%cx-configurator-attribute-checkbox-list` to define the spacing between the checkbox-list attribute type, and the quantity counter.

## Change in Configurator Attribute Radio Button Component

* `padding` set to 1rem on `%cx-configurator-attribute-radio-button` to define the spacing between the radio-button attribute type, and the quantity counter.

## Change in Configurator Previous Next Button Component

* `padding` set to 16px on `%cx-configurator-previous-next-buttons` to align the spacing between the configuration form and the bottom of the configuration.

## Change in Configurator Price Summary Component

* `padding` set to 16px on `%cx-configurator-price-summary` for cx-total-summary selector to align the spacing.

## Change in Configurator Footer Container Mixin

* `padding` set to 16px on `%cx-configurator-footer-container` mixin to align the spacing between the price summary and add-to-cart button.

## Change in Configurator Required Error Message Mixin

* `padding` set to 5px on `%cx-configurator-required-error-msg` mixin to add the spacing at the end of the cx-icon selector.

## Changes in Configurator Overview Form Component

* `padding` set to 0px on `%cx-configurator-overview-form` to prevent adding any spacing to the configuration overview form.

* `padding` set to 20px and `margin` to 0px on `%cx-configurator-overview-form` for `cx-group` selector to align spacing between the configuration overview groups.

* `padding` set to 32px/16px on `%cx-configurator-overview-form` for `h2` selector to align spacing around the configuration overview group titles.

* `cx-configurator-truncate-content` mixin has been added on `%cx-configurator-overview-form` for `span` selector to enable the overview group title truncation for the small widgets.

* `padding` set to 32px on `%cx-configurator-overview-form` for `cx-attribute-value-pair` selector to align spacing between the configuration overview attribute value pairs.

* `display` set to `none / inline` and `visibility` to `hidden` on `%cx-configurator-overview-form` for `cx-attribute-value-pair` selector to define the visibility for the configuration overview attribute value label.

* `padding` set to 20px on `%cx-configurator-overview-form` for `cx-no-attribute-value-pair` selector to align spacing between the configuration overview no attribute value pairs.

## Changes in Configurator Overview Attribute Component

* `width` set to 40% on `%cx-configurator-overview-attribute` for `cx-attribute-value` selector to use only 40% of the width for the small widgets.

* `width` set to 60% on `%cx-configurator-overview-attribute` for `cx-attribute-label` selector to use only 60% of the width for the small widgets.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Optional } from '@angular/core';
import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { OrderEntry } from '@spartacus/core';
import { CartItemContext } from '@spartacus/storefront';
Expand All @@ -10,28 +10,9 @@ import { CommonConfiguratorUtilsService } from '../../shared/utils/common-config
templateUrl: './configurator-cart-entry-info.component.html',
})
export class ConfiguratorCartEntryInfoComponent {
// TODO(#11681): make commonConfigUtilsService a required dependency and remove deprecated constructor
/**
* Default constructor
*
* @param {CartItemContext} cartItemContext
* @param {CommonConfiguratorUtilsService} commonConfigUtilsService
*/
constructor(
cartItemContext: CartItemContext,
// eslint-disable-next-line @typescript-eslint/unified-signatures
commonConfigUtilsService: CommonConfiguratorUtilsService
);
/**
* @deprecated since 3.3
*/
constructor(cartItemContext: CartItemContext);

constructor(
// TODO(#10946): make CartItemContext a required dependency and drop fallbacks to `?? EMPTY`.
@Optional() protected cartItemContext?: CartItemContext,
@Optional()
protected commonConfigUtilsService?: CommonConfiguratorUtilsService
protected cartItemContext: CartItemContext,
protected commonConfigUtilsService: CommonConfiguratorUtilsService
) {}

readonly orderEntry$: Observable<OrderEntry> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,9 @@ export class ConfiguratorAttributeCheckBoxListComponent

@Input() group: string;

// TODO(#11681): make quantityService a required dependency and remove deprecated constructor
/**
* default constructor
* @param {ConfiguratorStorefrontUtilsService} configUtilsService
* @param {ConfiguratorAttributeQuantityService} quantityService
*/
constructor(
// eslint-disable-next-line @typescript-eslint/unified-signatures
configUtilsService: ConfiguratorStorefrontUtilsService,
// eslint-disable-next-line @typescript-eslint/unified-signatures
quantityService: ConfiguratorAttributeQuantityService
);

/**
* @deprecated since 3.3
*/
constructor(configUtilsService: ConfiguratorStorefrontUtilsService);

constructor(
protected configUtilsService: ConfiguratorStorefrontUtilsService,
protected quantityService?: ConfiguratorAttributeQuantityService
protected quantityService: ConfiguratorAttributeQuantityService
) {
super(quantityService);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,14 @@ export class ConfiguratorAttributeDropDownComponent
attributeDropDownForm = new FormControl('');
@Input() group: string;

// TODO(#11681): make quantityService a required dependency
/**
* default constructor
* @param {ConfiguratorAttributeQuantityService} quantityService
*/
// eslint-disable-next-line @typescript-eslint/unified-signatures
constructor(quantityService: ConfiguratorAttributeQuantityService);

/**
* @deprecated since 3.3
*/
constructor();

constructor(
protected quantityService?: ConfiguratorAttributeQuantityService
) {
constructor(protected quantityService: ConfiguratorAttributeQuantityService) {
super();
}

ngOnInit() {
this.attributeDropDownForm.setValue(this.attribute?.selectedSingleValue);
}

/**
* @deprecated since 3.3
* Better use onSelect(this.attributeDropDownForm.value)
*/
onSelect(): void {
super.onSelect(this.attributeDropDownForm?.value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,7 @@ export class ConfiguratorAttributeInputFieldComponent
*/
protected readonly FALLBACK_DEBOUNCE_TIME = 500;

// TODO(#11681): make config a required dependency
/**
* @param {ConfiguratorUISettingsConfig} config Optional configuration for debounce time,
* if omitted {@link FALLBACK_DEBOUNCE_TIME} is used instead.
*/
// eslint-disable-next-line @typescript-eslint/unified-signatures
constructor(config: ConfiguratorUISettingsConfig);

/**
* @deprecated since 3.3
*/
constructor();

constructor(protected config?: ConfiguratorUISettingsConfig) {
constructor(protected config: ConfiguratorUISettingsConfig) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { FormControl } from '@angular/forms';
import { timer } from 'rxjs';
import { debounce } from 'rxjs/operators';
import { ConfiguratorUISettingsConfig } from '../../../config/configurator-ui-settings.config';
import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event';
import { ConfiguratorAttributeInputFieldComponent } from '../input-field/configurator-attribute-input-field.component';
import { ConfiguratorAttributeNumericInputFieldService } from './configurator-attribute-numeric-input-field.component.service';

Expand All @@ -28,29 +27,9 @@ export class ConfiguratorAttributeNumericInputFieldComponent

@Input() language: string;

// TODO(#11681): make config a required dependency
/**
* @param {ConfiguratorAttributeNumericInputFieldService} configAttributeNumericInputFieldService Service for numeric formatting and validation.
* @param {ConfiguratorUISettingsConfig} config Optional configuration for debounce time,
* if omitted {@link FALLBACK_DEBOUNCE_TIME} is used instead.
*/
constructor(
// eslint-disable-next-line @typescript-eslint/unified-signatures
configAttributeNumericInputFieldService: ConfiguratorAttributeNumericInputFieldService,
// eslint-disable-next-line @typescript-eslint/unified-signatures
config?: ConfiguratorUISettingsConfig
);

/**
* @deprecated since 3.3
*/
constructor(
configAttributeNumericInputFieldService: ConfiguratorAttributeNumericInputFieldService
);

constructor(
protected configAttributeNumericInputFieldService: ConfiguratorAttributeNumericInputFieldService,
protected config?: ConfiguratorUISettingsConfig
protected config: ConfiguratorUISettingsConfig
) {
super(config);
}
Expand Down Expand Up @@ -105,20 +84,6 @@ export class ConfiguratorAttributeNumericInputFieldComponent
super.ngOnDestroy();
}

/**
* @deprecated since 3.3
* This method should be removed because there is no use for this method.
*/
protected createEventFromInput(): ConfigFormUpdateEvent {
return {
ownerKey: this.ownerKey,
changedAttribute: {
...this.attribute,
userInput: this.attributeInputForm.value,
},
};
}

protected getInstalledLocale(locale: string): string {
try {
getLocaleId(locale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,11 @@ export class ConfiguratorAttributeRadioButtonComponent
implements OnInit {
attributeRadioButtonForm = new FormControl('');

// TODO(#11681): make quantityService a required dependency
/**
* default constructor
* @param {ConfiguratorAttributeQuantityService} quantityService
*/
// eslint-disable-next-line @typescript-eslint/unified-signatures
constructor(quantityService: ConfiguratorAttributeQuantityService);

/**
* @deprecated since 3.3
*/
constructor();

constructor(
protected quantityService?: ConfiguratorAttributeQuantityService
) {
constructor(protected quantityService: ConfiguratorAttributeQuantityService) {
super();
}

ngOnInit(): void {
this.attributeRadioButtonForm.setValue(this.attribute.selectedSingleValue);
}

/**
* @deprecated since 3.3
* This method should be removed because there is no deselect possible for radio buttons
*/
onDeselect(): void {
this.onSelect('');
}
}
Loading