|
|
@ -51,8 +51,6 @@ const { loadViews: _loadViews, navigateToView } = useViewsStore() |
|
|
|
const { activeView, activeViewTitleOrId, viewsByTable } = storeToRefs(useViewsStore()) |
|
|
|
const { activeView, activeViewTitleOrId, viewsByTable } = storeToRefs(useViewsStore()) |
|
|
|
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore()) |
|
|
|
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore()) |
|
|
|
|
|
|
|
|
|
|
|
const views = computed(() => viewsByTable.value.get(table.value.id!)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { refreshCommandPalette } = useCommandPalette() |
|
|
|
const { refreshCommandPalette } = useCommandPalette() |
|
|
|
|
|
|
|
|
|
|
|
// todo: temp |
|
|
|
// todo: temp |
|
|
@ -214,18 +212,21 @@ const deleteTable = () => { |
|
|
|
function onDuplicate() { |
|
|
|
function onDuplicate() { |
|
|
|
isOptionsOpen.value = false |
|
|
|
isOptionsOpen.value = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const views = viewsByTable.value.get(table.value.id as string) |
|
|
|
|
|
|
|
const defaultView = views?.find((v) => v.is_default) || views?.[0] |
|
|
|
|
|
|
|
|
|
|
|
const isOpen = ref(true) |
|
|
|
const isOpen = ref(true) |
|
|
|
|
|
|
|
|
|
|
|
const { close } = useDialog(resolveComponent('DlgViewCreate'), { |
|
|
|
const { close } = useDialog(resolveComponent('DlgViewCreate'), { |
|
|
|
'modelValue': isOpen, |
|
|
|
'modelValue': isOpen, |
|
|
|
'title': activeView.value!.title, |
|
|
|
'title': defaultView!.title, |
|
|
|
'type': activeView.value!.type as ViewTypes, |
|
|
|
'type': defaultView!.type as ViewTypes, |
|
|
|
'tableId': table.value!.id, |
|
|
|
'tableId': table.value!.id, |
|
|
|
'selectedViewId': activeView.value!.id, |
|
|
|
'selectedViewId': defaultView!.id, |
|
|
|
'groupingFieldColumnId': activeView.value!.view!.fk_grp_col_id, |
|
|
|
'groupingFieldColumnId': defaultView!.view!.fk_grp_col_id, |
|
|
|
'views': views, |
|
|
|
'views': views, |
|
|
|
'calendarRange': activeView.value!.view!.calendar_range, |
|
|
|
'calendarRange': defaultView!.view!.calendar_range, |
|
|
|
'coverImageColumnId': activeView.value!.view!.fk_cover_image_col_id, |
|
|
|
'coverImageColumnId': defaultView!.view!.fk_cover_image_col_id, |
|
|
|
'onUpdate:modelValue': closeDialog, |
|
|
|
'onUpdate:modelValue': closeDialog, |
|
|
|
'onCreated': async (view: ViewType) => { |
|
|
|
'onCreated': async (view: ViewType) => { |
|
|
|
closeDialog() |
|
|
|
closeDialog() |
|
|
|