Skip to content

Commit

Permalink
Add check for available SME in SMC für jumping to SME in SMC
Browse files Browse the repository at this point in the history
  • Loading branch information
seicke committed Dec 17, 2024
1 parent a82adb5 commit edfeb0a
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion aas-web-ui/src/mixins/SubmodelElementHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ export default defineComponent({
if (reference.keys[index - 1].type == 'SubmodelElementList') {
// check in which position of the list the element is (list needs to be requested to get the position)
const smRepoPath = smRepoUrl;
const smRepoContext = 'retrieving SubmodelElementList';
const smRepoContext = 'retrieving SML';
const disableMessage = false;
try {
const smRepoResponse = await this.getRequest(
Expand All @@ -707,6 +707,34 @@ export default defineComponent({
} catch {
resolve();
}
} else if (reference.keys[index - 1].type == 'SubmodelElementCollection') {
// check in which position of the list the element is (list needs to be requested to get the position)
const smRepoPath = smRepoUrl;
const smRepoContext = 'retrieving SMC';
const disableMessage = false;
try {
const smRepoResponse = await this.getRequest(
smRepoPath,
smRepoContext,
disableMessage
);
if (
smRepoResponse?.success &&
smRepoResponse?.data &&
Object.keys(smRepoResponse?.data).length > 0
) {
const smc = smRepoResponse.data;
const sme = smc.value.find((sme: any) =>
this.checkIdShort(sme, smeKey.value, false, true)
);
if (sme && Object.keys(sme).length > 0) {
smRepoUrl += '.' + smeKey.value;
}
}
resolve();
} catch {
resolve();
}
} else {
smRepoUrl += '.' + smeKey.value;
}
Expand Down

0 comments on commit edfeb0a

Please sign in to comment.