Browse Source

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

pull/9720/head
Ramesh Mane 1 month 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}` dashboardUrl1 = `${baseUrl}${appInfo.value?.dashboardPath}`
} }
return encodeURI( return `${encodeURI(`${dashboardUrl1}#/nc/${viewType}/${activeView.value.uuid}${surveyMode.value ? '/survey' : ''}`)}${
`${dashboardUrl1}#/nc/${viewType}/${activeView.value.uuid}${surveyMode.value ? '/survey' : ''}${ viewStore.preFillFormSearchParams && formPreFill.value.preFillEnabled ? `?${viewStore.preFillFormSearchParams}` : ''
viewStore.preFillFormSearchParams && formPreFill.value.preFillEnabled ? `?${viewStore.preFillFormSearchParams}` : '' }`
}`,
)
} }
const toggleViewShare = async () => { const toggleViewShare = async () => {

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

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

Loading…
Cancel
Save