mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-02 02:47:29 +00:00
Revert "Nc fix(nc-gui): always show baselist sidebar if we are navigating from different page"
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.54666 14.5V13.3529H12.9311C12.9925 13.3529 13.0457 13.3333 13.0907 13.2941C13.1355 13.2549 13.1579 13.2035 13.1579 13.1398V7.79124C13.1579 6.32937 12.6539 5.09871 11.6459 4.09924C10.638 3.09977 9.42272 2.60003 8 2.60003C6.57728 2.60003 5.36198 3.09977 4.3541 4.09924C3.3461 5.09871 2.84211 6.32937 2.84211 7.79124V12.294H2.28947C1.93616 12.294 1.63295 12.1664 1.37984 11.9111C1.12661 11.6557 1 11.3446 1 10.978V9.49271C1 9.24469 1.06804 9.01744 1.20411 8.81097C1.34018 8.60463 1.51775 8.43875 1.73684 8.31334L1.77092 7.33681C1.83134 6.50443 2.03962 5.73335 2.39576 5.02357C2.7519 4.3138 3.20862 3.69592 3.76592 3.16993C4.32334 2.64394 4.96667 2.23412 5.69589 1.94047C6.42525 1.64682 7.19328 1.5 8 1.5C8.80672 1.5 9.57285 1.64682 10.2984 1.94047C11.0239 2.23412 11.6673 2.64196 12.2284 3.164C12.7895 3.68604 13.2462 4.30195 13.5985 5.01172C13.9509 5.72162 14.161 6.4927 14.2291 7.32496L14.2632 8.28237C14.4776 8.38726 14.654 8.53727 14.7924 8.7324C14.9308 8.92752 15 9.14515 15 9.38526V11.0927C15 11.3328 14.9308 11.5504 14.7924 11.7455C14.654 11.9407 14.4776 12.0907 14.2632 12.1956V13.1398C14.2632 13.5161 14.133 13.8369 13.8728 14.1022C13.6125 14.3674 13.2986 14.5 12.9311 14.5H7.54666ZM5.93113 9.35296C5.75073 9.35296 5.59697 9.28948 5.46987 9.16254C5.34289 9.0356 5.27939 8.87846 5.27939 8.6911C5.27939 8.50388 5.34289 8.34558 5.46987 8.21622C5.59697 8.08673 5.75073 8.02199 5.93113 8.02199C6.11166 8.02199 6.26541 8.08673 6.39239 8.21622C6.5195 8.34558 6.58305 8.50388 6.58305 8.6911C6.58305 8.87846 6.5195 9.0356 6.39239 9.16254C6.26541 9.28948 6.11166 9.35296 5.93113 9.35296ZM10.0689 9.35296C9.88834 9.35296 9.73459 9.28948 9.6076 9.16254C9.4805 9.0356 9.41695 8.87846 9.41695 8.6911C9.41695 8.50388 9.4805 8.34558 9.6076 8.21622C9.73459 8.08673 9.88834 8.02199 10.0689 8.02199C10.2493 8.02199 10.403 8.08673 10.5301 8.21622C10.6571 8.34558 10.7206 8.50388 10.7206 8.6911C10.7206 8.87846 10.6571 9.0356 10.5301 9.16254C10.403 9.28948 10.2493 9.35296 10.0689 9.35296ZM3.8525 8.15294C3.77599 6.90494 4.15006 5.83703 4.97471 4.94921C5.79936 4.06151 6.82007 3.61766 8.03684 3.61766C9.05896 3.61766 9.96086 3.94585 10.7425 4.60222C11.5243 5.25859 11.9988 6.10831 12.1659 7.15137C11.1192 7.13862 10.1521 6.85339 9.26461 6.29566C8.37708 5.73781 7.69575 4.9731 7.2206 4.00154C7.03357 4.95246 6.64157 5.79312 6.04461 6.52354C5.44752 7.25397 4.71682 7.7971 3.8525 8.15294Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -16,7 +16,7 @@ const { activeWorkspaceId, isWorkspaceSettingsPageOpened, isIntegrationsPageOpen
|
||||
|
||||
const { navigateToWorkspaceSettings, navigateToIntegrations: _navigateToIntegrations } = workspaceStore
|
||||
|
||||
const { basesList, showProjectList, forceShowBaseList } = storeToRefs(useBases())
|
||||
const { basesList, showProjectList } = storeToRefs(useBases())
|
||||
|
||||
const { isSharedBase } = storeToRefs(useBase())
|
||||
|
||||
@@ -45,10 +45,6 @@ const navigateToProjectPage = () => {
|
||||
if (route.value.name?.startsWith('index-typeOrId-baseId-')) {
|
||||
showProjectList.value = !showProjectList.value
|
||||
|
||||
if (forceShowBaseList.value) {
|
||||
forceShowBaseList.value = false
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ const basesStore = useBases()
|
||||
|
||||
const { createProject: _createProject, updateProject } = basesStore
|
||||
|
||||
const { bases, basesList, activeProjectId, showProjectList, isProjectsLoaded, forceShowBaseList } = storeToRefs(basesStore)
|
||||
const { bases, basesList, activeProjectId, showProjectList, isProjectsLoaded } = storeToRefs(basesStore)
|
||||
|
||||
const { isWorkspaceLoading, activeWorkspaceId } = storeToRefs(useWorkspace())
|
||||
|
||||
@@ -442,7 +442,7 @@ watch(isProjectsLoaded, () => {
|
||||
<DashboardTreeViewProjectListSkeleton v-if="isLoadingSidebar" />
|
||||
|
||||
<template v-else>
|
||||
<Transition :name="forceShowBaseList ? undefined : transitionName" appear>
|
||||
<Transition :name="transitionName" appear>
|
||||
<div
|
||||
v-if="showProjectList"
|
||||
key="project-list"
|
||||
|
||||
@@ -34,7 +34,7 @@ const { isMobileMode, user } = useGlobal()
|
||||
|
||||
const { createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore
|
||||
|
||||
const { bases, basesUser, showProjectList, forceShowBaseList } = storeToRefs(basesStore)
|
||||
const { bases, basesUser, showProjectList } = storeToRefs(basesStore)
|
||||
|
||||
const collaborators = computed(() => {
|
||||
return (basesUser.value.get(base.value?.id) || []).map((user: any) => {
|
||||
@@ -199,10 +199,6 @@ function openTableCreateDialog(sourceIndex?: number | undefined, showSourceSelec
|
||||
onCloseCallback: () => {
|
||||
base.value.isExpanded = true
|
||||
|
||||
if (forceShowBaseList.value) {
|
||||
forceShowBaseList.value = false
|
||||
}
|
||||
|
||||
if (!activeKey.value || !activeKey.value.includes(`collapse-${sourceId}`)) {
|
||||
activeKey.value.push(`collapse-${sourceId}`)
|
||||
}
|
||||
@@ -245,7 +241,6 @@ const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, toggl
|
||||
const cmdOrCtrl = isMac() ? metaKey.value : control.value
|
||||
|
||||
if (!cmdOrCtrl && activeProjectId.value === base.id) {
|
||||
forceShowBaseList.value = false
|
||||
showProjectList.value = false
|
||||
return
|
||||
}
|
||||
@@ -301,7 +296,6 @@ const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, toggl
|
||||
updatedProject.isLoading = false
|
||||
}
|
||||
|
||||
forceShowBaseList.value = false
|
||||
showProjectList.value = false
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ const { isSharedBase, isSharedErd } = storeToRefs(useBase())
|
||||
|
||||
const basesStore = useBases()
|
||||
|
||||
const { forceShowBaseList } = storeToRefs(basesStore)
|
||||
|
||||
const { populateWorkspace } = useWorkspace()
|
||||
|
||||
const { signedIn } = useGlobal()
|
||||
@@ -25,9 +23,6 @@ const route = router.currentRoute
|
||||
const { basesList } = storeToRefs(basesStore)
|
||||
|
||||
const autoNavigateToProject = async () => {
|
||||
// If it is auto navigate to project that means we have to show base list sidebar instead of directly showing active base sidebar
|
||||
forceShowBaseList.value = true
|
||||
|
||||
const routeName = route.value.name as string
|
||||
if (routeName !== 'index-typeOrId' && routeName !== 'index') {
|
||||
return
|
||||
|
||||
@@ -111,7 +111,6 @@ async function signUp() {
|
||||
baseId: base.id,
|
||||
tableId: table.id,
|
||||
workspaceId: 'nc',
|
||||
resetForceShowBaseList: false,
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -39,8 +39,6 @@ export const useBases = defineStore('basesStore', () => {
|
||||
return route.value.params.baseId as string | undefined
|
||||
})
|
||||
|
||||
const forceShowBaseList = ref(false)
|
||||
|
||||
const showProjectList = ref<boolean>(route.value.params.typeOrId === 'base' ? false : !route.value.params.baseId)
|
||||
|
||||
const baseHomeSearchQuery = ref<string>('')
|
||||
@@ -398,32 +396,8 @@ export const useBases = defineStore('basesStore', () => {
|
||||
|
||||
watch(
|
||||
() => route.value.params.baseId,
|
||||
(newBaseId, oldBaseId) => {
|
||||
() => {
|
||||
baseHomeSearchQuery.value = ''
|
||||
|
||||
if (newBaseId) {
|
||||
if (!forceShowBaseList.value) return
|
||||
|
||||
/**
|
||||
* If oldBaseId is present that means we are navigation from one base to another base
|
||||
* In that case we have to set forceShowBaseList to false
|
||||
* */
|
||||
if (oldBaseId) {
|
||||
forceShowBaseList.value = false
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* If base id is undefined that means are navigated to different page,
|
||||
* So in that case set forceShowBaseList to true so that on returning to bases we can show baseList sidebar
|
||||
* @note - Manually we have to set to false on click any base or on toggle from minisidebar
|
||||
* */
|
||||
forceShowBaseList.value = true
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -433,9 +407,11 @@ export const useBases = defineStore('basesStore', () => {
|
||||
watch(
|
||||
[() => route.value.params.baseId, () => route.value.params.viewId, () => route.value.params.viewTitle],
|
||||
([newBaseId, newTableId, newViewId], [oldBaseId, oldTableId, oldViewId]) => {
|
||||
const shouldShowProjectList =
|
||||
forceShowBaseList.value ||
|
||||
!((newBaseId && newBaseId !== oldBaseId) || newTableId !== oldTableId || newViewId !== oldViewId)
|
||||
const shouldShowProjectList = !(
|
||||
(newBaseId && newBaseId !== oldBaseId) ||
|
||||
newTableId !== oldTableId ||
|
||||
newViewId !== oldViewId
|
||||
)
|
||||
|
||||
if (showProjectList.value === shouldShowProjectList) return
|
||||
|
||||
@@ -443,19 +419,16 @@ export const useBases = defineStore('basesStore', () => {
|
||||
},
|
||||
)
|
||||
|
||||
watch(
|
||||
() => route.value.params.baseId,
|
||||
(newBaseId) => {
|
||||
if (newBaseId) return
|
||||
watch([() => basesList.value.length, () => isProjectsLoaded.value], ([baseListLength, newIsProjectsLoaded]) => {
|
||||
/**
|
||||
* Use case:
|
||||
* If project list is empty and showProjectList is false,
|
||||
* then we have to show project list else it will stuck in loading state (blank sidebar state)
|
||||
*/
|
||||
if (baseListLength || !newIsProjectsLoaded || showProjectList.value) return
|
||||
|
||||
/**
|
||||
* If base id is undefined that means are navigated to different page,
|
||||
* So in that case set forceShowBaseList to true so that on returning to bases we can show baseList sidebar
|
||||
* @note - Manually we have to set to false on click any base or on toggle from minisidebar
|
||||
* */
|
||||
forceShowBaseList.value = true
|
||||
},
|
||||
)
|
||||
showProjectList.value = true
|
||||
})
|
||||
|
||||
watch(activeProjectId, () => {
|
||||
ncLastVisitedBase().set(activeProjectId.value)
|
||||
@@ -495,7 +468,6 @@ export const useBases = defineStore('basesStore', () => {
|
||||
basesUser,
|
||||
clearBasesUser,
|
||||
isDataSourceLimitReached,
|
||||
forceShowBaseList,
|
||||
showProjectList,
|
||||
baseHomeSearchQuery,
|
||||
getBaseRoles,
|
||||
|
||||
@@ -15,7 +15,6 @@ export const useTablesStore = defineStore('tablesStore', () => {
|
||||
|
||||
const baseTables = ref<Map<string, SidebarTableNode[]>>(new Map())
|
||||
const basesStore = useBases()
|
||||
const { forceShowBaseList } = storeToRefs(basesStore)
|
||||
// const baseStore = useBase()
|
||||
|
||||
const workspaceStore = useWorkspace()
|
||||
@@ -94,13 +93,11 @@ export const useTablesStore = defineStore('tablesStore', () => {
|
||||
tableId,
|
||||
viewTitle,
|
||||
workspaceId,
|
||||
resetForceShowBaseList = true,
|
||||
}: {
|
||||
baseId?: string
|
||||
tableId: string
|
||||
viewTitle?: string
|
||||
workspaceId?: string
|
||||
resetForceShowBaseList?: boolean
|
||||
}) => {
|
||||
const workspaceIdOrType = workspaceId ?? workspaceStore.activeWorkspaceId
|
||||
const baseIdOrBaseId = baseId ?? basesStore.activeProjectId
|
||||
@@ -113,11 +110,6 @@ export const useTablesStore = defineStore('tablesStore', () => {
|
||||
query = route.value.query
|
||||
}
|
||||
|
||||
// If baselist is visible and we are navigating to a table, we need to reset the baselist to false
|
||||
if (resetForceShowBaseList && forceShowBaseList.value) {
|
||||
forceShowBaseList.value = false
|
||||
}
|
||||
|
||||
await ncNavigateTo({
|
||||
workspaceId: workspaceIdOrType,
|
||||
baseId: baseIdOrBaseId,
|
||||
@@ -127,7 +119,7 @@ export const useTablesStore = defineStore('tablesStore', () => {
|
||||
})
|
||||
}
|
||||
|
||||
const openTable = async (table: TableType, replace = false, query?: any, resetForceShowBaseList = true) => {
|
||||
const openTable = async (table: TableType, replace = false, query?: any) => {
|
||||
if (!table.base_id) return
|
||||
|
||||
const bases = basesStore.bases
|
||||
@@ -160,10 +152,6 @@ export const useTablesStore = defineStore('tablesStore', () => {
|
||||
baseIdOrBaseId = route.value.params.baseId as string
|
||||
}
|
||||
|
||||
if (resetForceShowBaseList && forceShowBaseList.value) {
|
||||
forceShowBaseList.value = false
|
||||
}
|
||||
|
||||
ncNavigateTo({
|
||||
workspaceId: workspaceIdOrType,
|
||||
baseId: baseIdOrBaseId,
|
||||
|
||||
@@ -797,7 +797,6 @@ import NcCrown from '~icons/nc-icons-v2/crown'
|
||||
import NcMultiCircle from '~icons/nc-icons-v2/multi-circle'
|
||||
import NcChatwoot from '~icons/nc-icons-v2/chatwoot'
|
||||
import NcGraduationCap from '~icons/nc-icons-v2/graduation-cap'
|
||||
import NcSupportAgent from '~icons/nc-icons-v2/support-agent'
|
||||
|
||||
// keep it for reference
|
||||
// todo: remove it after all icons are migrated
|
||||
@@ -1802,7 +1801,6 @@ export const iconMap = {
|
||||
'ncChartPie': h(NcChartPie, { stroke: 'transparent' }),
|
||||
'ncSun': NcSun,
|
||||
'ncGraduationCap': NcGraduationCap,
|
||||
'ncSupportAgent': h(NcSupportAgent, { stroke: 'transparent' }),
|
||||
}
|
||||
|
||||
export const getMdiIcon = (type: string): any => {
|
||||
@@ -4578,10 +4576,6 @@ export const searchableMap = {
|
||||
icon: NcGraduationCap,
|
||||
keywords: ['graduation', 'cap', 'school', 'education', 'academic'],
|
||||
},
|
||||
ncSupportAgent: {
|
||||
icon: h(NcSupportAgent, { stroke: 'transparent' }),
|
||||
keywords: ['support', 'agent', 'help', 'customer', 'service'],
|
||||
},
|
||||
}
|
||||
|
||||
export const searchIcons = (searchTerm: string) => {
|
||||
|
||||
@@ -90,27 +90,7 @@ export class ViewSidebarPage extends BasePage {
|
||||
}
|
||||
|
||||
// Todo: Make selection better
|
||||
async verifyView({
|
||||
title,
|
||||
index,
|
||||
baseTitle,
|
||||
sourceTitle,
|
||||
}: {
|
||||
title: string;
|
||||
index: number;
|
||||
baseTitle?: string;
|
||||
sourceTitle?: string;
|
||||
}) {
|
||||
await this.dashboard.leftSidebar.verifyBaseListOpen(!!baseTitle);
|
||||
|
||||
if (baseTitle) {
|
||||
await this.dashboard.sidebar.baseNode.verifyActiveProject({ baseTitle, open: true });
|
||||
}
|
||||
|
||||
if (sourceTitle) {
|
||||
await this.dashboard.treeView.openSource({ title: sourceTitle });
|
||||
}
|
||||
|
||||
async verifyView({ title, index }: { title: string; index: number }) {
|
||||
// flicker while page loading
|
||||
await this.get()
|
||||
.locator('[data-testid="view-item"]')
|
||||
|
||||
@@ -59,7 +59,7 @@ test.describe('Verify shortcuts', () => {
|
||||
skipOpeningModal: true,
|
||||
baseTitle: context.base.title,
|
||||
});
|
||||
await dashboard.treeView.verifyTable({ title: 'New Table', baseTitle: context.base.title });
|
||||
await dashboard.treeView.verifyTable({ title: 'New Table' });
|
||||
|
||||
// create new row
|
||||
await grid.column.clickColumnHeader({ title: 'Title' });
|
||||
|
||||
@@ -123,17 +123,14 @@ test.describe('Preview Mode', () => {
|
||||
await dashboard.treeView.verifyTable({
|
||||
title: 'Actor',
|
||||
exists: true,
|
||||
baseTitle: context.base.title,
|
||||
});
|
||||
await dashboard.treeView.verifyTable({
|
||||
title: 'Language',
|
||||
exists: false,
|
||||
baseTitle: context.base.title,
|
||||
});
|
||||
await dashboard.treeView.verifyTable({
|
||||
title: 'CustomerList',
|
||||
exists: false,
|
||||
baseTitle: context.base.title,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user