π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
Revert "Nc fix(nc-gui): always show baselist sidebar if we are navigating from different page"
Ramesh Manec8602fa0d463
diff --git a/packages/nc-gui/assets/nc-icons-v2/support-agent.svg b/packages/nc-gui/assets/nc-icons-v2/support-agent.svgdeleted file mode 100644index fbc94ad184..0000000000--- a/packages/nc-gui/assets/nc-icons-v2/support-agent.svg+++ /dev/null@@ -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>diff --git a/packages/nc-gui/components/dashboard/MiniSidebar.vue b/packages/nc-gui/components/dashboard/MiniSidebar.vueindex d54fd798de..060f090958 100644--- a/packages/nc-gui/components/dashboard/MiniSidebar.vue+++ b/packages/nc-gui/components/dashboard/MiniSidebar.vue@@ -16,7 +16,7 @@ const { activeWorkspaceId, isWorkspaceSettingsPageOpened, isIntegrationsPageOpenconst { 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}diff --git a/packages/nc-gui/components/dashboard/TreeView/Project/List.vue b/packages/nc-gui/components/dashboard/TreeView/Project/List.vueindex 49a6baa1d6..2b0e937a89 100644--- a/packages/nc-gui/components/dashboard/TreeView/Project/List.vue+++ b/packages/nc-gui/components/dashboard/TreeView/Project/List.vue@@ -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><divv-if="showProjectList"key="project-list"diff --git a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vueindex f32ae968b7..9ee337e715 100644--- a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue+++ b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue@@ -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, showSourceSeleconCloseCallback: () => {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, togglconst cmdOrCtrl = isMac() ? metaKey.value : control.valueif (!cmdOrCtrl && activeProjectId.value === base.id) {- forceShowBaseList.value = falseshowProjectList.value = falsereturn}@@ -301,7 +296,6 @@ const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, togglupdatedProject.isLoading = false}- forceShowBaseList.value = falseshowProjectList.value = false}diff --git a/packages/nc-gui/pages/index.vue b/packages/nc-gui/pages/index.vueindex b6048cc6e3..367867f316 100644--- a/packages/nc-gui/pages/index.vue+++ b/packages/nc-gui/pages/index.vue@@ -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.currentRouteconst { 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 stringif (routeName !== 'index-typeOrId' && routeName !== 'index') {returndiff --git a/packages/nc-gui/pages/signup/[[token]].vue b/packages/nc-gui/pages/signup/[[token]].vueindex d10374d1a6..c3e96e0a05 100644--- a/packages/nc-gui/pages/signup/[[token]].vue+++ b/packages/nc-gui/pages/signup/[[token]].vue@@ -111,7 +111,6 @@ async function signUp() {baseId: base.id,tableId: table.id,workspaceId: 'nc',- resetForceShowBaseList: false,})}} catch (e) {diff --git a/packages/nc-gui/store/bases.ts b/packages/nc-gui/store/bases.tsindex bb91bb6845..a0756b7391 100644--- a/packages/nc-gui/store/bases.ts+++ b/packages/nc-gui/store/bases.ts@@ -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-- /**- * 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- },- )+ 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++ 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,diff --git a/packages/nc-gui/store/tables.ts b/packages/nc-gui/store/tables.tsindex bf6b3804af..29dc67ed43 100644--- a/packages/nc-gui/store/tables.ts+++ b/packages/nc-gui/store/tables.ts@@ -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?: stringtableId: stringviewTitle?: stringworkspaceId?: string- resetForceShowBaseList?: boolean}) => {const workspaceIdOrType = workspaceId ?? workspaceStore.activeWorkspaceIdconst 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) returnconst 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,diff --git a/packages/nc-gui/utils/iconUtils.ts b/packages/nc-gui/utils/iconUtils.tsindex 191871bd49..59eae77f7a 100644--- a/packages/nc-gui/utils/iconUtils.ts+++ b/packages/nc-gui/utils/iconUtils.ts@@ -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) => {diff --git a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts b/tests/playwright/pages/Dashboard/ViewSidebar/index.tsindex 8e391d2b41..fc7febbd61 100644--- a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts+++ b/tests/playwright/pages/Dashboard/ViewSidebar/index.ts@@ -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 loadingawait this.get().locator('[data-testid="view-item"]')diff --git a/tests/playwright/tests/db/features/keyboardShortcuts.spec.ts b/tests/playwright/tests/db/features/keyboardShortcuts.spec.tsindex aaabe699ab..d10c7d854e 100644--- a/tests/playwright/tests/db/features/keyboardShortcuts.spec.ts+++ b/tests/playwright/tests/db/features/keyboardShortcuts.spec.ts@@ -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 rowawait grid.column.clickColumnHeader({ title: 'Title' });diff --git a/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.ts b/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.tsindex a04f958db6..ade7bdc818 100644--- a/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.ts+++ b/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.ts@@ -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,});});});