Browse Source

feat(nc-gui): pass groupingFieldColumn to share view

pull/4848/head
Wing-Kam Wong 2 years ago
parent
commit
01df8ec6f7
  1. 11
      packages/nc-gui/components/smartsheet/toolbar/ShareView.vue

11
packages/nc-gui/components/smartsheet/toolbar/ShareView.vue

@ -86,10 +86,17 @@ const genShareLink = async () => {
if (!view.value?.id) return if (!view.value?.id) return
const response = (await $api.dbViewShare.create(view.value.id)) as SharedView const response = (await $api.dbViewShare.create(view.value.id)) as SharedView
const meta = isString(response.meta) ? JSON.parse(response.meta) : response.meta const meta = isString(response.meta) ? JSON.parse(response.meta) : response.meta
shared.value = { ...response, meta } shared.value = { ...response, meta }
if (shared.value.type === ViewTypes.KANBAN) {
const { groupingFieldColumn } = useKanbanViewStoreOrThrow()
shared.value.meta = { ...shared.value.meta, groupingFieldColumn: groupingFieldColumn.value }
await updateSharedViewMeta(true)
}
passwordProtected.value = !!shared.value.password && shared.value.password !== '' passwordProtected.value = !!shared.value.password && shared.value.password !== ''
showShareModel = true showShareModel = true
@ -133,7 +140,7 @@ async function saveTheme() {
// const saveTransitionDuration = useDebounceFn(updateSharedViewMeta, 1000, { maxWait: 2000 }) // const saveTransitionDuration = useDebounceFn(updateSharedViewMeta, 1000, { maxWait: 2000 })
async function updateSharedViewMeta() { async function updateSharedViewMeta(silentMessage = false) {
try { try {
const meta = shared.value.meta && isString(shared.value.meta) ? JSON.parse(shared.value.meta) : shared.value.meta const meta = shared.value.meta && isString(shared.value.meta) ? JSON.parse(shared.value.meta) : shared.value.meta
@ -141,7 +148,7 @@ async function updateSharedViewMeta() {
meta, meta,
}) })
message.success(t('msg.success.updated')) if (!silentMessage) message.success(t('msg.success.updated'))
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} }

Loading…
Cancel
Save