π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): don't show onboarding flow in shared view or base page
Ramesh Mane60bf2ca03dd4
diff --git a/packages/nc-gui/composables/useOnboardingFlow.ts b/packages/nc-gui/composables/useOnboardingFlow.tsindex 0b254c6854..07bf6e3a38 100644--- a/packages/nc-gui/composables/useOnboardingFlow.ts+++ b/packages/nc-gui/composables/useOnboardingFlow.ts@@ -103,12 +103,21 @@ export const useOnboardingFlow = createSharedComposable(() => {const route = router.currentRoute- const { appInfo, user } = useGlobal()+ const { appInfo, user, signedIn } = useGlobal()++ const { isSharedBase, isSharedErd } = storeToRefs(useBase())const { updateUserProfile } = useUsers()const isEnabledOnboardingFlow = computed(() => {- return !ncIsPlaywright()+ return (+ !ncIsPlaywright() &&+ signedIn.value &&+ !isSharedBase.value &&+ !isSharedErd.value &&+ !isSharedViewRoute(route.value) &&+ !isSharedFormViewRoute(route.value)+ )})/**diff --git a/packages/nc-gui/pages/index.vue b/packages/nc-gui/pages/index.vueindex de1a9ca18c..06f31735ce 100644--- a/packages/nc-gui/pages/index.vue+++ b/packages/nc-gui/pages/index.vue@@ -40,19 +40,11 @@ const autoNavigateToProject = async () => {}const isSharedView = computed(() => {- const routeName = (route.value.name as string) || ''-- // check route is not base page by route name- return (- !routeName.startsWith('index-typeOrId-baseId-') &&- !['index', 'index-typeOrId', 'index-typeOrId-feed', 'index-typeOrId-integrations'].includes(routeName)- )+ return isSharedViewRoute(route.value)})const isSharedFormView = computed(() => {- const routeName = (route.value.name as string) || ''- // check route is shared form view route- return routeName.startsWith('index-typeOrId-form-viewId')+ return isSharedFormViewRoute(route.value)})const { sharedBaseId } = useCopySharedBase()diff --git a/packages/nc-gui/utils/routeUtils.ts b/packages/nc-gui/utils/routeUtils.tsnew file mode 100644index 0000000000..08d16d5e4e--- /dev/null+++ b/packages/nc-gui/utils/routeUtils.ts@@ -0,0 +1,32 @@+import { type RouteLocationNormalizedLoadedGeneric } from 'vue-router'++/**+ * Check if the route is a shared view route+ * @param route - The route to check+ * @returns true if the route is a shared view route, false otherwise+ */+export const isSharedViewRoute = (route: RouteLocationNormalizedLoadedGeneric) => {+ if (!route) return false++ const routeName = (route.name as string) || ''++ // check route is not base page by route name+ return (+ !routeName.startsWith('index-typeOrId-baseId-') &&+ !['index', 'index-typeOrId', 'index-typeOrId-feed', 'index-typeOrId-integrations'].includes(routeName)+ )+}++/**+ * Check if the route is a shared form view route+ * @param route - The route to check+ * @returns true if the route is a shared form view route, false otherwise+ */+export const isSharedFormViewRoute = (route: RouteLocationNormalizedLoadedGeneric) => {+ if (!route) return false++ const routeName = (route.name as string) || ''++ // check route is shared form view route+ return routeName.startsWith('index-typeOrId-form-viewId')+}