Browse Source

chore(nc-gui): pass correct prop and rename fn

pull/4031/head
braks 2 years ago
parent
commit
d54ee0005b
  1. 8
      packages/nc-gui/components/dlg/ViewCreate.vue
  2. 7
      packages/nc-gui/components/smartsheet/sidebar/index.vue

8
packages/nc-gui/components/dlg/ViewCreate.vue

@ -42,7 +42,7 @@ interface Form {
fk_grp_col_id: string | null
}
const { views = [], meta, selectedViewId, ...props } = defineProps<Props>()
const { views = [], meta, selectedViewId, groupingFieldColumnId, ...props } = defineProps<Props>()
const emits = defineEmits<Emits>()
@ -122,9 +122,9 @@ function init() {
}
})
if (props.groupingFieldColumnId) {
if (groupingFieldColumnId) {
// take from the one from copy view
form.fk_grp_col_id = props.groupingFieldColumnId
form.fk_grp_col_id = groupingFieldColumnId
} else {
// take the first option
form.fk_grp_col_id = singleSelectFieldOptions.value?.[0]?.value as string
@ -202,7 +202,7 @@ async function onSubmit() {
v-model:value="form.fk_grp_col_id"
class="w-full nc-kanban-grouping-field-select"
:options="singleSelectFieldOptions"
:disabled="props.groupingFieldColumnId"
:disabled="groupingFieldColumnId"
placeholder="Select a Grouping Field"
not-found-content="No Single Select Field can be found. Please create one first."
/>

7
packages/nc-gui/components/smartsheet/sidebar/index.vue

@ -72,7 +72,7 @@ watch(
)
/** Open delete modal */
function openCreateDialog({
function onOpenModal({
title = '',
type,
copyViewId,
@ -83,6 +83,7 @@ function openCreateDialog({
copyViewId?: string
groupingFieldColumnId?: string
}) {
console.log(type)
const isOpen = ref(true)
const { close } = useDialog(resolveComponent('DlgViewCreate'), {
@ -134,12 +135,12 @@ function openCreateDialog({
</div>
</GeneralOverlay>
<LazySmartsheetSidebarMenuTop :views="views" @open-modal="openCreateDialog" @deleted="loadViews" />
<LazySmartsheetSidebarMenuTop :views="views" @open-modal="onOpenModal" @deleted="loadViews" />
<template v-if="isUIAllowed('virtualViewsCreateOrEdit')">
<div class="!my-3 w-full border-b-1" />
<LazySmartsheetSidebarMenuBottom @open-modal="openCreateDialog" />
<LazySmartsheetSidebarMenuBottom @open-modal="onOpenModal" />
</template>
</div>
</a-layout-sider>

Loading…
Cancel
Save