Skip to content

Commit bb0cf2d

Browse files
authored
Resolve enumeration value issues with Angular 16 (#84)
* 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
1 parent 1bb5a8a commit bb0cf2d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

core/apps/ame-e2e/src/integration/editor/migrate-common-attributes.spec.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,12 @@ describe('Test migration of common attributes on Constraint/Characteristic type
201201
.then(() => cy.get(SELECTOR_editorSaveButton).click({force: true}))
202202
.then(() => cy.getUpdatedRDF())
203203
.then(rdf => {
204-
expect(rdf).to.contain(
205-
':Characteristic1 a samm-c:State;\n' +
206-
' samm:dataType xsd:string;\n' +
207-
' samm:preferredName "testPreferredName"@en;\n' +
208-
' samm:description "testDescription"@en;\n' +
209-
' samm:see <http://see.de>;\n' +
210-
' samm-c:values ("1" "2" "a" "b" "3" "4");\n' +
211-
' samm-c:defaultValue "testState".'
212-
);
204+
expect(rdf).contain(':Characteristic1 a samm-c:State');
205+
expect(rdf).contain('samm:dataType xsd:string');
206+
expect(rdf).contain('samm:preferredName "testPreferredName"@en');
207+
expect(rdf).contain('samm:description "testDescription"@en');
208+
expect(rdf).contain('samm:see <http://see.de>');
209+
expect(rdf).contain('samm-c:values ("1" "2" "a" "b" "3" "4")');
213210
});
214211
});
215212

core/libs/meta-model/src/lib/element-service/characteristic-model.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export class CharacteristicModelService extends BaseModelService {
220220
this.updateComplexEnumeration(metaModelElement, form);
221221
} else if (metaModelElement instanceof DefaultEnumeration) {
222222
// simple enumeration
223-
metaModelElement.values = form.chipList.map(chip => chip.name) || null;
223+
metaModelElement.values = form.enumValues.map(value => value.name) || null;
224224
} else if (metaModelElement instanceof DefaultCollection) {
225225
metaModelElement.elementCharacteristic = form.elementCharacteristic;
226226
if (form.elementCharacteristic) {

0 commit comments

Comments
 (0)