Skip to content

Commit a38fdd8

Browse files
authored
Add property filtering to get a better overview (#70)
* Add property filtering to get a better overview
1 parent 26e8751 commit a38fdd8

File tree

361 files changed

+7329
-5593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+7329
-5593
lines changed

core/.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd core
5+
npm run format:write -- --uncommited && npm run affected:lint -- --uncommited --parallel
6+

core/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/coverage
55
/.vscode
66
/assembly
7+
/.angular

core/angular.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,28 @@
272272
}
273273
}
274274
},
275+
"loader-filters": {
276+
"projectType": "library",
277+
"root": "libs/loader-filters",
278+
"sourceRoot": "libs/loader-filters/src",
279+
"prefix": "ame",
280+
"architect": {
281+
"test": {
282+
"builder": "@nrwl/jest:jest",
283+
"outputs": ["coverage/libs/loader-filters"],
284+
"options": {
285+
"jestConfig": "libs/loader-filters/jest.config.js",
286+
"passWithNoTests": true
287+
}
288+
},
289+
"lint": {
290+
"builder": "@nrwl/linter:eslint",
291+
"options": {
292+
"lintFilePatterns": ["libs/loader-filters/src/**/*.ts", "libs/loader-filters/src/**/*.html"]
293+
}
294+
}
295+
}
296+
},
275297
"meta-model": {
276298
"projectType": "library",
277299
"root": "libs/meta-model",
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for
4+
# additional information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> .
14+
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> .
15+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> .
16+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
17+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
18+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
19+
@prefix : <urn:samm:org.eclipse.digitaltwin:1.0.0#> .
20+
21+
:PredefinedAndCustomCharacteristicsSameName a samm:Aspect;
22+
samm:properties (
23+
:withCustomBoolean
24+
:withPredefinedBoolean
25+
:withCustomLanguage
26+
:withPredefinedLanguage
27+
:withCustomLocale
28+
:withPredefinedLocale
29+
:withCustomMultiLanguageText
30+
:withPredefinedMultiLanguageText
31+
:withCustomMimeType
32+
:withPredefinedMimeType
33+
:withCustomResourcePath
34+
:withPredefinedResourcePath
35+
:withCustomText
36+
:withPredefinedText
37+
:withCustomTimestamp
38+
:withPredefinedTimestamp
39+
);
40+
samm:operations ();
41+
samm:events ().
42+
43+
:withCustomBoolean a samm:Property ;
44+
samm:characteristic :Boolean .
45+
46+
:withPredefinedBoolean a samm:Property ;
47+
samm:characteristic samm-c:Boolean .
48+
49+
:withCustomLanguage a samm:Property ;
50+
samm:characteristic :Language .
51+
52+
:withPredefinedLanguage a samm:Property ;
53+
samm:characteristic samm-c:Language .
54+
55+
:withCustomLocale a samm:Property ;
56+
samm:characteristic :Locale .
57+
58+
:withPredefinedLocale a samm:Property ;
59+
samm:characteristic samm-c:Locale .
60+
61+
:withCustomMultiLanguageText a samm:Property ;
62+
samm:characteristic :MultiLanguageText .
63+
64+
:withPredefinedMultiLanguageText a samm:Property ;
65+
samm:characteristic samm-c:MultiLanguageText .
66+
67+
:withCustomMimeType a samm:Property ;
68+
samm:characteristic :MimeType .
69+
70+
:withPredefinedMimeType a samm:Property ;
71+
samm:characteristic samm-c:MimeType .
72+
73+
:withCustomResourcePath a samm:Property ;
74+
samm:characteristic :ResourcePath .
75+
76+
:withPredefinedResourcePath a samm:Property ;
77+
samm:characteristic samm-c:ResourcePath .
78+
79+
:withCustomText a samm:Property ;
80+
samm:characteristic :Text .
81+
82+
:withPredefinedText a samm:Property ;
83+
samm:characteristic samm-c:Text .
84+
85+
:withCustomTimestamp a samm:Property ;
86+
samm:characteristic :Timestamp .
87+
88+
:withPredefinedTimestamp a samm:Property ;
89+
samm:characteristic samm-c:Timestamp .
90+
91+
:Boolean a samm:Characteristic;
92+
samm:description "Custom 'Boolean' characteristic."@en ;
93+
samm:dataType xsd:boolean .
94+
95+
:Language a samm:Characteristic;
96+
samm:description "Custom 'Language' characteristic."@en ;
97+
samm:dataType xsd:string .
98+
99+
:Locale a samm:Characteristic;
100+
samm:description "Custom 'Locale' characteristic."@en ;
101+
samm:dataType xsd:string .
102+
103+
:MultiLanguageText a samm:Characteristic;
104+
samm:description "Custom 'MultiLanguageText' characteristic."@en ;
105+
samm:dataType rdf:langString .
106+
107+
:MimeType a samm:Characteristic;
108+
samm:description "Custom 'MimeType' characteristic."@en ;
109+
samm:dataType xsd:string .
110+
111+
:ResourcePath a samm:Characteristic;
112+
samm:description "Custom 'ResourcePath' characteristic."@en ;
113+
samm:dataType xsd:anyURI .
114+
115+
:Text a samm:Characteristic;
116+
samm:description "Custom 'Text' characteristic."@en ;
117+
samm:dataType xsd:string .
118+
119+
:Timestamp a samm:Characteristic;
120+
samm:description "Custom 'Timestamp' characteristic."@en ;
121+
samm:dataType xsd:dateTime .

core/apps/ame-e2e/src/integration/editor/change-class-behavior.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ describe('Constraint', () => {
6262
for (const field of fields) {
6363
describe(`${field.name} Field`, () => {
6464
it('should create and rename Constraint', () => {
65+
cy.intercept('GET', 'http://localhost:9091/ame/api/models/namespaces?shouldRefresh=true', {});
6566
cy.visitDefault();
6667
cy.startModelling()
6768
.then(() => cy.get('ame-loading-screen', {timeout: 15000}).should('not.exist'))
@@ -77,6 +78,7 @@ describe('Constraint', () => {
7778
.click({force: true})
7879
.get(`mat-option[cy-value="${classType}"]`)
7980
.click({force: true})
81+
.wait(250)
8082
.then(() => cy.get(field.selector).should('have.value', field.value));
8183
});
8284
}
@@ -88,6 +90,7 @@ describe('Characteristic', () => {
8890
for (const field of fields) {
8991
describe(`${field.name} Field`, () => {
9092
it('should create and rename Characteristic', () => {
93+
cy.intercept('GET', 'http://localhost:9091/ame/api/models/namespaces?shouldRefresh=true', {});
9194
cy.visitDefault();
9295
cy.startModelling()
9396
.then(() => cy.shapeExists('AspectDefault'))

core/apps/ame-e2e/src/integration/editor/edit-abstract-property.spec.ts

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@ import {
2121
SELECTOR_ecAbstractProperty,
2222
SELECTOR_editorSaveButton,
2323
SELECTOR_tbLoadButton,
24+
SELECTOR_ecAbstractEntity,
25+
SELECTOR_ecProperty,
26+
SELECTOR_ecEntity,
27+
SELECTOR_editorCancelButton,
2428
} from '../../support/constants';
2529

2630
describe('Create and Edit Abstract Property', () => {
2731
describe('Property -> Abstract Property', () => {
2832
it('should create', () => {
2933
cy.visitDefault();
30-
cy.startModelling().then(() => cy.dragElement(SELECTOR_ecAbstractProperty, 350, 300).then(() => cy.clickShape('abstractProperty1')));
34+
cy.startModelling().then(() => {
35+
cy.dragElement(SELECTOR_ecAbstractProperty, 350, 300).then(() => cy.clickShape('abstractProperty1'));
36+
cy.dragElement(SELECTOR_ecAbstractEntity, 350, 300).then(() => cy.clickShape('AbstractEntity1'));
37+
});
3138
});
3239

3340
it('should edit', () => {
@@ -38,6 +45,7 @@ describe('Create and Edit Abstract Property', () => {
3845
.then(() => cy.get(SELECTOR_editorSaveButton).click({force: true}))
3946
.then(() => cy.clickAddShapePlusIcon('Characteristic1'))
4047
.then(() => cy.clickAddShapePlusIcon('Entity1'))
48+
.then(() => cy.clickConnectShapes('AbstractEntity1', 'abstractProperty1'))
4149
.then(() => cy.clickConnectShapes('abstractProperty1', 'property2'))
4250
.then(() => cy.getCellLabel('[abstractProperty1]', 'preferredName').should('eq', 'Inherited\npreferredName = Preferred Name @en'))
4351
.then(() => cy.getCellLabel('[abstractProperty1]', 'description').should('eq', 'Inherited\ndescription = Description @en'))
@@ -80,12 +88,18 @@ describe('Create and Edit Abstract Property', () => {
8088
describe('Abstract Property export', () => {
8189
it('should create model', () => {
8290
cy.visitDefault();
83-
cy.startModelling();
91+
cy.startModelling().then(() => {
92+
cy.dragElement(SELECTOR_ecAbstractEntity, 350, 300).then(() => cy.clickShape('AbstractEntity1'));
93+
});
8494
cy.clickAddShapePlusIcon('Characteristic1')
8595
.then(() => cy.clickAddShapePlusIcon('Entity1'))
8696
.then(() => cy.clickAddShapePlusIcon('Entity1'))
8797
.then(() => cy.dragElement(SELECTOR_ecAbstractProperty, 350, 300).then(() => cy.clickShape('abstractProperty1')))
8898
.then(() => cy.dragElement(SELECTOR_ecAbstractProperty, 350, 300).then(() => cy.clickShape('abstractProperty2')))
99+
100+
.then(() => cy.clickConnectShapes('AbstractEntity1', 'abstractProperty1'))
101+
.then(() => cy.clickConnectShapes('AbstractEntity1', 'abstractProperty2'))
102+
89103
.then(() => cy.clickConnectShapes('property2', 'abstractProperty1'))
90104
.then(() => cy.clickConnectShapes('property3', 'abstractProperty2'))
91105

@@ -125,4 +139,47 @@ describe('Create and Edit Abstract Property', () => {
125139
});
126140
});
127141
});
142+
143+
describe('Abstract Property can be connected to another shape only if it is connected to AbstractEntity', () => {
144+
it('should not be able to connect abstract property to a property', () => {
145+
cy.visitDefault();
146+
cy.startModelling().then(() => {
147+
cy.dragElement(SELECTOR_ecAbstractProperty, 350, 300).then(() => cy.clickShape('abstractProperty1'));
148+
});
149+
150+
cy.dragElement(SELECTOR_ecProperty, 350, 300)
151+
.then(() => cy.clickShape('property1'))
152+
.then(() => cy.clickConnectShapes('property1', 'abstractProperty1'))
153+
.then(() => cy.getUpdatedRDF())
154+
.then(rdf => {
155+
expect(rdf).not.contain('samm:extends :abstractProperty1');
156+
});
157+
});
158+
159+
it('should be able to connect abstract property to a property, if abstract property belongs to abstract entity', () => {
160+
cy.dragElement(SELECTOR_ecAbstractEntity, 350, 300)
161+
.then(() => cy.clickShape('AbstractEntity1'))
162+
.then(() => cy.clickConnectShapes('abstractProperty1', 'AbstractEntity1'))
163+
.then(() => cy.getUpdatedRDF())
164+
.then(rdf => {
165+
expect(rdf).contain(':abstractProperty1 a samm:AbstractProperty');
166+
})
167+
.then(() => cy.clickShape('property1'));
168+
169+
cy.dragElement(SELECTOR_ecEntity, 350, 300)
170+
.then(() => cy.clickShape('Entity1'))
171+
.then(() => cy.clickConnectShapes('property1', 'Entity1'))
172+
.then(() => cy.getUpdatedRDF())
173+
.then(rdf => {
174+
expect(rdf).contain('Entity1 a samm:Entity');
175+
});
176+
177+
cy.clickConnectShapes('AbstractEntity1', 'Entity1')
178+
.then(() => cy.dbClickShape('AbstractEntity1'))
179+
.then(() => cy.getUpdatedRDF())
180+
.then(rdf => {
181+
expect(rdf).contain('extends :abstractProperty1');
182+
});
183+
});
184+
});
128185
});

core/apps/ame-e2e/src/integration/editor/edit-property.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,15 @@ describe('Test edit property', () => {
236236
.then(() => cy.get(SELECTOR_editorSaveButton).focus().click({force: true}))
237237
.then(() => cy.getUpdatedRDF())
238238
.then(rdf => {
239+
expect(rdf).to.contain(':property1 a samm:Property.');
240+
expect(rdf).to.contain(':Characteristic1 a samm:Characteristic;\n' + ' samm:dataType xsd:string.\n');
239241
expect(rdf).to.contain(
240-
':property1 a samm:Property.\n' +
241-
':Characteristic1 a samm:Characteristic;\n' +
242-
' samm:dataType xsd:string.\n' +
243-
':NewAspect a samm:Aspect;\n' +
242+
':NewAspect a samm:Aspect;\n' +
244243
' samm:properties (:newProperty :property1);\n' +
245244
' samm:operations ();\n' +
246-
' samm:events ().\n' +
247-
':newProperty a samm:Property;\n' +
248-
' samm:characteristic :Characteristic1.'
245+
' samm:events ().\n'
249246
);
247+
expect(rdf).to.contain(':newProperty a samm:Property;\n' + ' samm:characteristic :Characteristic1.');
250248
});
251249
});
252250

core/apps/ame-e2e/src/integration/editor/edit-unit.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ describe('Test editing Unit', () => {
241241
});
242242
});
243243

244-
it('can filter predefined units', () => {
244+
it.skip('can filter predefined units', () => {
245245
cy.visitDefault();
246246
cy.startModelling()
247247
.then(() => cy.dbClickShape('Characteristic1'))

0 commit comments

Comments
 (0)