Browse Source

fix: show shared view url based on current browser url

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/642/head
Pranav C 3 years ago
parent
commit
4f4c36c94a
  1. 2
      packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue
  2. 6
      packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
  3. 3
      packages/nc-gui/mixins/device.js
  4. 2
      packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts
  5. 2
      packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts

2
packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue

@ -19,7 +19,7 @@
<tr v-for="link of viewsList" :key="link.id">
<td class="caption">
<nuxt-link :to="`/nc/${link.view_type || 'view'}/${link.view_id}`">
{{ `${origin}/dashboard#/xc/${link.view_type || 'view'}/${link.view_id}` }}
{{ `${dashboardUrl}#/nc/${link.view_type || 'view'}/${link.view_id}` }}
</nuxt-link>
</td>
<td class="caption">

6
packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

@ -434,9 +434,9 @@
<!-- People with private link can only see cells visible in this view -->
</p>
<div style="border-radius: 4px" class="share-link-box body-2 pa-2 d-flex align-center">
{{ shareLink.url }}
{{ `${dashboardUrl}#/nc/${shareLink.view_type || 'view'}/${shareLink.view_id}` }}
<v-spacer />
<a :href="shareLink.url" style="text-decoration: none" target="_blank">
<a :href=" `${dashboardUrl}#/nc/${shareLink.view_type || 'view'}/${shareLink.view_id}`" style="text-decoration: none" target="_blank">
<v-icon small class="mx-2">mdi-open-in-new</v-icon>
</a>
<v-icon
@ -791,7 +791,7 @@ export default {
this.$toast.info('Copied to clipboard').goAway(1000)
},
copyShareUrlToClipboard() {
this.clipboard(this.shareLink.url)
this.clipboard(`${this.dashboardUrl}#/nc/${this.shareLink.view_type || 'view'}/${this.shareLink.view_id}`)
this.clipboardSuccessHandler()
}
}

3
packages/nc-gui/mixins/device.js

@ -9,6 +9,9 @@ export default {
}
},
computed: {
dashboardUrl() {
return `${location.origin}${location.path || ''}`
},
isDark() {
return this.$vuetify && this.$vuetify.theme && this.$vuetify.theme.dark
},

2
packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts

@ -3318,7 +3318,7 @@ export default class NcMetaMgr {
this.getDbAlias(args),
'nc_shared_views',
insertData,
['id', 'view_id']
['id', 'view_id', 'view_type']
);
res.url = `${req.ncSiteUrl}${this.config.dashboardPath}#/nc/view/${res.view_id}`;
Tele.emit('evt', { evt_type: 'sharedView:generated-link' });

2
packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts

@ -202,7 +202,7 @@ export default class NcMetaMgrEE extends NcMetaMgr {
this.getDbAlias(args),
'nc_shared_views',
insertData,
['id', 'view_id']
['id', 'view_id', 'view_type']
);
if (args.args.show_as === 'form') {
res.url = `${req.ncSiteUrl}${this.config.dashboardPath}#/nc/form/${res.view_id}`;

Loading…
Cancel
Save