Browse Source

fix: shared view url correction

nc-feat/amplify
Pranav C 1 year ago
parent
commit
d2767f9a9e
  1. 2
      packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue
  2. 12
      packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue
  3. 2
      packages/nc-gui/middleware/auth.global.ts

2
packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue

@ -37,9 +37,11 @@ const workspaceStore = useWorkspace()
const url = computed(() => { const url = computed(() => {
if (!sharedBase.value || !sharedBase.value.uuid) return '' if (!sharedBase.value || !sharedBase.value.uuid) return ''
// get base url for workspace
const baseUrl = getBaseUrl(workspaceStore.activeWorkspaceId) const baseUrl = getBaseUrl(workspaceStore.activeWorkspaceId)
let dashboardUrl1 = dashboardUrl.value let dashboardUrl1 = dashboardUrl.value
if (baseUrl) { if (baseUrl) {
dashboardUrl1 = `${baseUrl}${appInfo.value?.dashboardPath}` dashboardUrl1 = `${baseUrl}${appInfo.value?.dashboardPath}`
} }

12
packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue

@ -165,9 +165,15 @@ function sharedViewUrl() {
viewType = 'view' viewType = 'view'
} }
return encodeURI( // get base url for workspace
`${getBaseUrl(workspaceStore.activeWorkspaceId)}${appInfo.value?.dashboardPath}#/nc/${viewType}/${activeView.value.uuid}`, const baseUrl = getBaseUrl(workspaceStore.activeWorkspaceId)
)
let dashboardUrl1 = dashboardUrl.value
if (baseUrl) {
dashboardUrl1 = `${baseUrl}${appInfo.value?.dashboardPath}`
}
return encodeURI(`${dashboardUrl1}#/nc/${viewType}/${activeView.value.uuid}`)
} }
const toggleViewShare = async () => { const toggleViewShare = async () => {

2
packages/nc-gui/middleware/auth.global.ts

@ -1,6 +1,6 @@
import type { Api } from 'nocodb-sdk' import type { Api } from 'nocodb-sdk'
import type { Actions } from '~/composables/useGlobal/types' import type { Actions } from '~/composables/useGlobal/types'
import { defineNuxtRouteMiddleware, extractSdkResponseErrorMsg, message, navigateTo, useApi, useGlobal, useRoles } from '#imports' import { defineNuxtRouteMiddleware, message, navigateTo, useApi, useGlobal, useRoles } from '#imports'
/** /**
* Global auth middleware * Global auth middleware

Loading…
Cancel
Save