Skip to content

Commit

Permalink
feat: Fill configuration 'consistent' attribute from configurator OCC (
Browse files Browse the repository at this point in the history
…#13344)

The 'consistent' attribute of the configuration was not taken over into the SPA model. This caused no issues for the current configurator implementation, but the attribute can be useful for extension scenarios.

closes #13308
  • Loading branch information
ChristophHi authored Aug 4, 2021
1 parent ca8f107 commit 594ad25
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function takeOverChanges(
const content = { ...action.payload };
const groups = content.groups.length > 0 ? content.groups : state.groups;

const result = {
const result: Configurator.Configuration = {
...state,
...content,
groups: groups,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ const attributeMSIWithValue: Configurator.Attribute = {
const configuration: OccConfigurator.Configuration = {
configId: configId,
complete: true,
consistent: true,
rootProduct: 'CONF_PRODUCT',
groups: [
{
Expand Down Expand Up @@ -286,9 +287,10 @@ describe('OccConfiguratorVariantNormalizer', () => {
expect(occConfiguratorVariantNormalizer).toBeTruthy();
});

it('should convert a configuration', () => {
it('should convert a configuration and support "complete" and "consistent" attribute', () => {
const result = occConfiguratorVariantNormalizer.convert(configuration);
expect(result.complete).toBe(true);
expect(result.consistent).toBe(true);
});

it('should not touch isRequiredCartUpdate and isCartEntryUpdatePending when converting a configuration', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class OccConfiguratorVariantNormalizer
interactionState: target?.interactionState ?? {},
configId: source.configId,
complete: source.complete,
consistent: source.consistent,
totalNumberOfIssues: source.totalNumberOfIssues,
productCode: source.rootProduct,
groups: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export namespace OccConfigurator {
* @member {boolean} [complete]
*/
complete?: boolean;

/**
* Configuration is consistent, meaning it does not contain conflicts
*
* @member {boolean}
*/
consistent?: boolean;
totalNumberOfIssues?: number;
groups?: Group[];
rootProduct?: string;
Expand Down

0 comments on commit 594ad25

Please sign in to comment.