diff --git a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue index 235a751640..93287875ee 100644 --- a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue @@ -57,7 +57,7 @@ const basesStore = useBases() const { isMobileMode } = useGlobal() -const { loadProjects, createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore +const { createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore const { bases } = storeToRefs(basesStore) @@ -65,7 +65,7 @@ const { loadProjectTables } = useTablesStore() const { activeTable } = storeToRefs(useTablesStore()) -const { appInfo, navigateToProject } = useGlobal() +const { appInfo } = useGlobal() const { orgRoles, isUIAllowed } = useRoles() @@ -351,46 +351,6 @@ const duplicateProject = (base: BaseType) => { selectedProjectToDuplicate.value = base isDuplicateDlgOpen.value = true } -const { $poller } = useNuxtApp() - -const DlgProjectDuplicateOnOk = async (jobData: { id: string; base_id: string }) => { - await loadProjects('workspace') - - $poller.subscribe( - { id: jobData.id }, - async (data: { - id: string - status?: string - data?: { - error?: { - message: string - } - message?: string - result?: any - } - }) => { - if (data.status !== 'close') { - if (data.status === JobStatus.COMPLETED) { - await loadProjects('workspace') - - const base = bases.value.get(jobData.base_id) - - // open base after duplication - if (base) { - await navigateToProject({ - baseId: base.id, - type: base.type, - }) - } - } else if (data.status === JobStatus.FAILED) { - message.error('Failed to duplicate base') - await loadProjects('workspace') - } - } - }, - ) - $e('a:base:duplicate') -} const tableDelete = () => { isTableDeleteDialogVisible.value = true @@ -791,12 +751,7 @@ const projectDelete = () => { :base-id="base?.id" /> - +
diff --git a/packages/nc-gui/components/dlg/ProjectDuplicate.vue b/packages/nc-gui/components/dlg/ProjectDuplicate.vue index fbf172943e..ffb159ad15 100644 --- a/packages/nc-gui/components/dlg/ProjectDuplicate.vue +++ b/packages/nc-gui/components/dlg/ProjectDuplicate.vue @@ -6,7 +6,6 @@ import { isEeUI, useVModel } from '#imports' const props = defineProps<{ modelValue: boolean base: BaseType - onOk: (jobData: { name: string; id: string }) => Promise }>() const emit = defineEmits(['update:modelValue']) diff --git a/packages/nc-gui/components/dlg/SharedBaseDuplicate.vue b/packages/nc-gui/components/dlg/SharedBaseDuplicate.vue index 17147b0cbc..bf4d93066c 100644 --- a/packages/nc-gui/components/dlg/SharedBaseDuplicate.vue +++ b/packages/nc-gui/components/dlg/SharedBaseDuplicate.vue @@ -4,7 +4,6 @@ import { isEeUI, useApi, useVModel, useWorkspace } from '#imports' const props = defineProps<{ modelValue: boolean - onOk: (jobData: { name: string; id: string }) => Promise }>() const emit = defineEmits(['update:modelValue']) diff --git a/packages/nc-gui/components/dlg/TableDuplicate.vue b/packages/nc-gui/components/dlg/TableDuplicate.vue index c6879ef320..d89e2fdee2 100644 --- a/packages/nc-gui/components/dlg/TableDuplicate.vue +++ b/packages/nc-gui/components/dlg/TableDuplicate.vue @@ -7,7 +7,6 @@ import type { TabType } from '#imports' const props = defineProps<{ modelValue: boolean table: TableType - onOk: (jobData: { name: string; id: string }) => Promise }>() const emit = defineEmits(['update:modelValue']) diff --git a/packages/nc-gui/components/nc/Pagination.vue b/packages/nc-gui/components/nc/Pagination.vue index 7aa78dfcc5..caf622827b 100644 --- a/packages/nc-gui/components/nc/Pagination.vue +++ b/packages/nc-gui/components/nc/Pagination.vue @@ -4,7 +4,7 @@ const props = defineProps<{ total: number pageSize: number entityName?: string - mode: 'simple' | 'full' + mode?: 'simple' | 'full' }>() const emits = defineEmits(['update:current', 'update:pageSize']) diff --git a/packages/nc-gui/components/workspace/ProjectList.vue b/packages/nc-gui/components/workspace/ProjectList.vue index 9a36beb69b..1eef444c20 100644 --- a/packages/nc-gui/components/workspace/ProjectList.vue +++ b/packages/nc-gui/components/workspace/ProjectList.vue @@ -11,19 +11,16 @@ const { updateProjectTitle } = workspaceStore const { activePage } = storeToRefs(workspaceStore) const basesStore = useBases() -const { loadProjects } = basesStore const { basesList, isProjectsLoading } = storeToRefs(basesStore) const { navigateToProject } = useGlobal() // const filteredProjects = computed(() => bases.value?.filter((p) => !p.deleted) || []) -const { $e, $poller } = useNuxtApp() +const { $e } = useNuxtApp() const { isUIAllowed } = useRoles() -const { refreshCommandPalette } = useCommandPalette() - const showProjectDeleteModal = ref(false) const toBeDeletedProjectId = ref() @@ -142,37 +139,6 @@ const workspaceMoveProjectOnSuccess = async (workspaceId: string) => { const isDuplicateDlgOpen = ref(false) const selectedProjectToDuplicate = ref() -const DlgProjectDuplicateOnOk = async (jobData: { id: string }) => { - await loadProjects('workspace') - - $poller.subscribe( - { id: jobData.id }, - async (data: { - id: string - status?: string - data?: { - error?: { - message: string - } - message?: string - result?: any - } - }) => { - if (data.status !== 'close') { - if (data.status === JobStatus.COMPLETED) { - await loadProjects('workspace') - refreshCommandPalette() - } else if (data.status === JobStatus.FAILED) { - message.error('Failed to duplicate base') - await loadProjects('workspace') - } - } - }, - ) - - $e('a:base:duplicate') -} - const duplicateProject = (base: BaseType) => { selectedProjectToDuplicate.value = base isDuplicateDlgOpen.value = true @@ -404,12 +370,7 @@ const setIcon = async (icon: string, base: BaseType) => { :base="selectedProjectToMove" @success="workspaceMoveProjectOnSuccess" /> - +
diff --git a/packages/nc-gui/store/config.ts b/packages/nc-gui/store/config.ts index 0e5fa92867..5c8cbcaa9b 100644 --- a/packages/nc-gui/store/config.ts +++ b/packages/nc-gui/store/config.ts @@ -7,7 +7,9 @@ export const useConfigStore = defineStore('configStore', () => { const sidebarStore = useSidebarStore() const viewsStore = useViewsStore() + const { activeViewTitleOrId } = storeToRefs(viewsStore) const tablesStore = useTablesStore() + const { activeTableId } = storeToRefs(tablesStore) const isViewPortMobile = () => width.value < MAX_WIDTH_FOR_MOBILE_MODE @@ -47,7 +49,7 @@ export const useConfigStore = defineStore('configStore', () => { const handleSidebarOpenOnMobileForNonViews = () => { if (!isViewPortMobile()) return - if (!viewsStore.activeViewTitleOrId && !tablesStore.activeTableId) { + if (!activeViewTitleOrId && !activeTableId) { nextTick(() => { sidebarStore.isLeftSidebarOpen = true }) @@ -56,7 +58,7 @@ export const useConfigStore = defineStore('configStore', () => { } } - watch([viewsStore.activeViewTitleOrId, tablesStore.activeTableId], () => { + watch([activeViewTitleOrId, activeTableId], () => { handleSidebarOpenOnMobileForNonViews() })