Browse Source

fix(nc-gui): encode share view url except search params

pull/9720/head
Ramesh Mane 2 months ago
parent
commit
487534bde5
  1. 8
      packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue
  2. 6
      packages/nc-gui/composables/useSharedFormViewStore.ts

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

@ -211,11 +211,9 @@ function sharedViewUrl() {
dashboardUrl1 = `${baseUrl}${appInfo.value?.dashboardPath}`
}
return encodeURI(
`${dashboardUrl1}#/nc/${viewType}/${activeView.value.uuid}${surveyMode.value ? '/survey' : ''}${
viewStore.preFillFormSearchParams && formPreFill.value.preFillEnabled ? `?${viewStore.preFillFormSearchParams}` : ''
}`,
)
return `${encodeURI(`${dashboardUrl1}#/nc/${viewType}/${activeView.value.uuid}${surveyMode.value ? '/survey' : ''}`)}${
viewStore.preFillFormSearchParams && formPreFill.value.preFillEnabled ? `?${viewStore.preFillFormSearchParams}` : ''
}`
}
const toggleViewShare = async () => {

6
packages/nc-gui/composables/useSharedFormViewStore.ts

@ -442,14 +442,10 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
async function handlePreFillForm() {
if (Object.keys(route.query || {}).length) {
// Decode query parameter keys
const decodedQuery = Object.fromEntries(Object.entries(route.query).map(([key, value]) => [decodeURIComponent(key), value]))
columns.value = await Promise.all(
(columns.value || []).map(async (c) => {
const queryParam =
route.query[c.title as string] ||
route.query[encodeURIComponent(c.title as string)] ||
decodedQuery[c.title as string]
const queryParam = route.query[c.title as string] || route.query[encodeURIComponent(c.title as string)]
if (
!c.title ||

Loading…
Cancel
Save