Skip to content

Commit

Permalink
Show SHACL tab even if no examples are present
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Nov 18, 2024
1 parent c77da33 commit 9a56647
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions src/components/BuildingBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
value="validation"
:transition="false"
:reverse-transition="false"
v-if="bblock.shaclRules"
v-if="shaclRules?.length"
>
<p class="mb-2">
The following sets of SHACL rules are used to validate this building block:
Expand Down Expand Up @@ -494,41 +494,41 @@ export default {
this.languageTabs.sort((a, b) =>
a.order === b.order ? a.label.localeCompare(b.label) : a.order - b.order
);
}
// ShaclRules
this.shaclRules = null;
if (Array.isArray(data.shaclRules)) {
// Legacy shaclRules
if (data.shaclRules.length) {
this.shaclRules = [{
id: this.bblockId,
name: data.name,
rules: data.shaclRules,
}];
}
} else if (data.shaclRules && Object.keys(data.shaclRules).length) {
this.shaclRules = [];
if (data.shaclRules[this.bblockId]) {
this.shaclRules.push({
id: this.bblockId,
name: data.name,
rules: data.shaclRules[this.bblockId],
});
}
bblockService.getBBlocks(true)
.then(allBBlocks => {
for (const [id, rules] of Object.entries(data.shaclRules)) {
if (id !== this.bblockId) {
const name = allBBlocks?.[id]?.name || id;
this.shaclRules.push({
id,
name,
rules,
});
}
}
});
// ShaclRules
this.shaclRules = null;
if (Array.isArray(data.shaclRules)) {
// Legacy shaclRules
if (data.shaclRules.length) {
this.shaclRules = [{
id: this.bblockId,
name: data.name,
rules: data.shaclRules,
}];
}
} else if (data.shaclRules && Object.keys(data.shaclRules).length) {
this.shaclRules = [];
if (data.shaclRules[this.bblockId]) {
this.shaclRules.push({
id: this.bblockId,
name: data.name,
rules: data.shaclRules[this.bblockId],
});
}
bblockService.getBBlocks(true)
.then(allBBlocks => {
for (const [id, rules] of Object.entries(data.shaclRules)) {
if (id !== this.bblockId) {
const name = allBBlocks?.[id]?.name || id;
this.shaclRules.push({
id,
name,
rules,
});
}
}
});
}
this.bblock = data;
Expand Down

0 comments on commit 9a56647

Please sign in to comment.