Skip to content

Commit

Permalink
Resolve enumeration value issues with Angular 16 (#84)
Browse files Browse the repository at this point in the history
* Resolve enumeration value issues with Angular 16

Adjusted enumeration values to be compatible with the latest Angular 16 updates.

* Fix e2e tests and add enumValues not chipList values
  • Loading branch information
michelu89 authored Aug 21, 2023
1 parent 1bb5a8a commit bb0cf2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,12 @@ describe('Test migration of common attributes on Constraint/Characteristic type
.then(() => cy.get(SELECTOR_editorSaveButton).click({force: true}))
.then(() => cy.getUpdatedRDF())
.then(rdf => {
expect(rdf).to.contain(
':Characteristic1 a samm-c:State;\n' +
' samm:dataType xsd:string;\n' +
' samm:preferredName "testPreferredName"@en;\n' +
' samm:description "testDescription"@en;\n' +
' samm:see <http://see.de>;\n' +
' samm-c:values ("1" "2" "a" "b" "3" "4");\n' +
' samm-c:defaultValue "testState".'
);
expect(rdf).contain(':Characteristic1 a samm-c:State');
expect(rdf).contain('samm:dataType xsd:string');
expect(rdf).contain('samm:preferredName "testPreferredName"@en');
expect(rdf).contain('samm:description "testDescription"@en');
expect(rdf).contain('samm:see <http://see.de>');
expect(rdf).contain('samm-c:values ("1" "2" "a" "b" "3" "4")');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class CharacteristicModelService extends BaseModelService {
this.updateComplexEnumeration(metaModelElement, form);
} else if (metaModelElement instanceof DefaultEnumeration) {
// simple enumeration
metaModelElement.values = form.chipList.map(chip => chip.name) || null;
metaModelElement.values = form.enumValues.map(value => value.name) || null;
} else if (metaModelElement instanceof DefaultCollection) {
metaModelElement.elementCharacteristic = form.elementCharacteristic;
if (form.elementCharacteristic) {
Expand Down

0 comments on commit bb0cf2d

Please sign in to comment.