Skip to content

Commit 297561a

Browse files
committed
Use bblocks navigation for opening profile targets
1 parent 663387f commit 297561a

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

src/components/bblock/ExampleViewer.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,20 +381,13 @@ function canOpenProfile(profileId) {
381381
function getProfileUrl(profileId) {
382382
const bblock = profileBBlocks.value[profileId];
383383
if (!bblock) return undefined;
384-
if (bblockService.isShown(bblock)) {
385-
return router.resolve({ name: 'BuildingBlock', params: { id: bblock.itemIdentifier } }).href;
386-
}
387-
return bblock.documentation?.['bblocks-viewer']?.url;
384+
return getBBlockUrl(bblock);
388385
}
389386
390387
function openProfile(profileId) {
391388
const bblock = profileBBlocks.value[profileId];
392389
if (!bblock) return;
393-
if (bblockService.isShown(bblock)) {
394-
router.push({ name: 'BuildingBlock', params: { id: bblock.itemIdentifier } });
395-
} else if (bblock.documentation?.['bblocks-viewer']) {
396-
window.open(bblock.documentation['bblocks-viewer'].url);
397-
}
390+
openBBlock(bblock);
398391
}
399392
400393
const getMediaTypeLabel = (mt) => {

src/services/bblock.service.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ class BBlockService {
150150
}
151151
}
152152
if (bblock.openAPIDocument) {
153-
console.log('adding', bblock.openAPIDocument)
154153
this.resourceMappings[bblock.openAPIDocument] = bblock.itemIdentifier;
155154
if (bblock.sourceOpenAPIDocument) {
156155
this.resourceMappings[bblock.sourceOpenAPIDocument] = bblock.itemIdentifier;

0 commit comments

Comments
 (0)