Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

feat: use readable slug for scripts and dashboards as well

Ramesh Mane3001df65685d
diff --git a/packages/nc-gui/composables/useGlobal/actions.ts b/packages/nc-gui/composables/useGlobal/actions.ts
index a45aa5f821..f73ecf2b63 100644
--- a/packages/nc-gui/composables/useGlobal/actions.ts
+++ b/packages/nc-gui/composables/useGlobal/actions.ts
@@ -141,7 +141,9 @@ export function useGlobalActions(state: State, _getters: Getters): Actions {
baseId,
query,
tableId,
+ tableTitle,
viewId,
+ viewTitle,
replace = false,
newTab = false,
}: {
@@ -149,11 +151,20 @@ export function useGlobalActions(state: State, _getters: Getters): Actions {
baseId?: string
query?: any
tableId?: string
+ tableTitle?: string
viewId?: string
+ viewTitle?: string
replace?: boolean
newTab?: boolean
}) => {
- const tablePath = tableId ? `/${tableId}${viewId ? `/${viewId}` : ''}` : ''
+ const tablePath = tableId
+ ? `/${tableId}${
+ viewId
+ ? `/${viewId}${toReadableUrlSlug([tableTitle, viewTitle]) ? `/${toReadableUrlSlug([tableTitle, viewTitle])}` : ''}`
+ : ''
+ }`
+ : ''
+
const workspaceId = _workspaceId || 'nc'
let path: string
diff --git a/packages/nc-gui/composables/useGlobal/types.ts b/packages/nc-gui/composables/useGlobal/types.ts
index 00b22ffa0f..56a25a6586 100644
--- a/packages/nc-gui/composables/useGlobal/types.ts
+++ b/packages/nc-gui/composables/useGlobal/types.ts
@@ -107,15 +107,22 @@ export interface Actions {
loadAppInfo: () => void
setIsMobileMode: (isMobileMode: boolean) => void
navigateToProject: (params: { workspaceId?: string; baseId?: string; query?: any }) => void
+ /**
+ * params `tableTitle, viewTitle, automationTitle,dashboardTitle` will be used for readable url slug
+ */
ncNavigateTo: (params: {
workspaceId?: string
baseId?: string
query?: any
tableId?: string
+ tableTitle?: string
viewId?: string
+ viewTitle?: string
automationId?: string
+ automationTitle?: string
replace?: boolean
dashboardId?: string
+ dashboardTitle?: string
newTab?: boolean
}) => void
getBaseUrl: (workspaceId: string) => string | undefined