Skip to content

Commit

Permalink
Handle public links urls
Browse files Browse the repository at this point in the history
  • Loading branch information
diocas committed Oct 23, 2022
1 parent 029ac43 commit 273ce68
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions ifc-js/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default {
const filePath = `/${this.$route.params.filePath
.split('/')
.filter(Boolean)
.slice(isPublic ? 1 : 0)
.join('/')}`
const url = getFileUrl(this.$client, isPublic, filePath)
ifcLoader.load(url, (ifcModel) => {
Expand Down
18 changes: 7 additions & 11 deletions jupyter/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
<oc-spinner size="xlarge" />
<p v-translate class="oc-invisible">Loading app</p>
</div>
<oc-notifications position="top-center">
<oc-notification-message
v-if="lastError"
:message="lastError"
title="Error"
status="danger"
@close="clearLastError"
/>
</oc-notifications>
<div class="oc-position-center" v-if="lastError">
<oc-icon size="xxlarge" name="error-warning" fill-type="line" />
<p v-if="message" class="oc-text-lead">{{ lastError }}</p>
</div>
<div class="oc-container oc-width-1-1" v-if="!isLoading">
<!-- eslint-disable-next-line vue/no-v-html -->
<div id="notebook">
Expand All @@ -32,11 +27,12 @@ export default {
...mapGetters('Jupyter Viewer', ['isLoading', 'renderedNotebook', 'lastError'])
},
mounted() {
const filePath = `/${this.$route.params.filePath.split('/').filter(Boolean).join('/')}`
const isPublic = this.$route.query["contextRouteName"] === 'files-public-files'
const filePath = `/${this.$route.params.filePath.split('/').filter(Boolean).slice(isPublic ? 1 : 0).join('/')}`
this.loadFile({
filePath: filePath,
client: this.$client,
public: this.$route.query["contextRouteName"] === 'files-public-files',
public: isPublic,
publicLinkPassword: this.publicLinkPassword
})
},
Expand Down
4 changes: 2 additions & 2 deletions rootjs/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="oc-position-center" v-if="error">
<oc-icon size="xxlarge" name="error-warning" fill-type="line" />
</div>
<div class="oc-flex root-viewer" v-if="!loading">
<div class="oc-flex root-viewer">
<div id="web-nav-sidebar" class="root-sidebar app-navigation oc-app-navigation-expanded">
<select id="mode-select" v-model="viewMode" @change="renderViewer">
<option v-for="item in items" :key="item" :value="item">
Expand Down Expand Up @@ -50,7 +50,7 @@ export default {
},
created() {
this.isPublic = this.$route.query["contextRouteName"] === 'files-public-files'
const filePath = `/${this.$route.params.filePath.split('/').filter(Boolean).join('/')}`
const filePath = `/${this.$route.params.filePath.split('/').filter(Boolean).slice(this.isPublic ? 1 : 0).join('/')}`
this.url = getFileUrl(this.$client, this.isPublic, filePath)
this.viewMode = this.items[0]
},
Expand Down

0 comments on commit 273ce68

Please sign in to comment.