Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@bimdata/design-system": "^0.3.4",
"@bimdata/typescript-fetch-api-client": "^6.12.0",
"@bimdata/typescript-fetch-api-client": "^6.12.1",
"@bimdata/viewer": "^1.6.2",
"@uppy/core": "^1.18.1",
"@uppy/xhr-upload": "^1.7.2",
Expand Down
23 changes: 17 additions & 6 deletions src/views/model-viewer/ModelViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,28 @@ export default {

merge(pluginsConfig, spacePluginsConfig);

// Extract space specific plugins urls
const pluginUrls = currentSpace.value.features
// Extract space specific plugins urls from deprecated features
const featurePlugins = currentSpace.value.features
.filter(feature => feature.name.startsWith("viewer-plugin-"))
.map(feature => feature.name.split("viewer-plugin-")[1])
.map(pluginName => availablePlugins[pluginName])
.filter(Boolean); // keep only existing plugins

// Extract space specific plugins urls from marketplace
const appPlugins = currentSpace.value.marketplaceApps
.filter(app => app.viewerPluginsUrls && app.viewerPluginsUrls.length)
.map(app => app.viewerPluginsUrls)
.reduce((urls, acc) => {
urls.forEach(url => {
acc.push(url);
});
return acc;
}, []);

const pluginUrls = featurePlugins.concat(appPlugins);

let unwatchAccessToken;
let unwatchLocale;

onMounted(async () => {
const bimdataViewer = makeBIMDataViewer({
api: {
Expand All @@ -99,12 +111,11 @@ export default {
});

const viewer = bimdataViewer.mount("#viewer", window);

unwatchAccessToken = watch(accessToken, token => {
viewer.setAccessToken(token);
bimdataViewer.setAccessToken(token);
});
unwatchLocale = watch(locale, lang => {
viewer.$i18n.locale = lang;
bimdataViewer.setLocale(lang);
});
});

Expand Down