Browse Source

fix(nc-gui): incorrect shared form logic

pull/5697/head
Wing-Kam Wong 2 years ago
parent
commit
7629363050
  1. 12
      packages/nc-gui/composables/useSharedFormViewStore.ts

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

@ -101,18 +101,10 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
{} as Record<string, FormColumnType>, {} as Record<string, FormColumnType>,
) )
let order = 1 columns.value = viewMeta.model?.columns?.map((c) => ({
columns.value = meta?.value?.columns
?.map((c: Record<string, any>) => ({
...c, ...c,
fk_column_id: c.id, description: fieldById[c.id].description,
fk_view_id: viewMeta.id,
...(fieldById[c.id] ? fieldById[c.id] : {}),
order: (fieldById[c.id] && fieldById[c.id].order) || order++,
id: fieldById[c.id] && fieldById[c.id].id,
})) }))
.sort((a: Record<string, any>, b: Record<string, any>) => a.order - b.order) as Record<string, any>[]
const _sharedViewMeta = (viewMeta as any).meta const _sharedViewMeta = (viewMeta as any).meta
sharedViewMeta.value = isString(_sharedViewMeta) ? JSON.parse(_sharedViewMeta) : _sharedViewMeta sharedViewMeta.value = isString(_sharedViewMeta) ? JSON.parse(_sharedViewMeta) : _sharedViewMeta

Loading…
Cancel
Save