From 487534bde5172b27b9cd89507390e578095e91ba Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Sat, 26 Oct 2024 06:59:54 +0000 Subject: [PATCH] fix(nc-gui): encode share view url except search params --- .../components/dlg/share-and-collaborate/SharePage.vue | 8 +++----- packages/nc-gui/composables/useSharedFormViewStore.ts | 6 +----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue b/packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue index 996d6320ef..f644852665 100644 --- a/packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue +++ b/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 () => { diff --git a/packages/nc-gui/composables/useSharedFormViewStore.ts b/packages/nc-gui/composables/useSharedFormViewStore.ts index d64612aad8..3dad11c6cd 100644 --- a/packages/nc-gui/composables/useSharedFormViewStore.ts +++ b/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 ||