π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): account setup page access ui error
Ramesh Manee9475eaee2f6
diff --git a/packages/nc-gui/components/nc/NuxtLoadingIndicator.vue b/packages/nc-gui/components/nc/NuxtLoadingIndicator.vueindex 493f595705..047b4e4650 100644--- a/packages/nc-gui/components/nc/NuxtLoadingIndicator.vue+++ b/packages/nc-gui/components/nc/NuxtLoadingIndicator.vue@@ -25,7 +25,7 @@ const route = router.currentRoutewatch([() => route.value.params.viewTitle, () => route.value.params.slugs, () => route.value.query],async ([viewTitle, slugs]) => {- if (!viewTitle && ncIsUndefined(slugs)) return+ if (!viewTitle && ncIsUndefined(slugs) && route.value.name !== 'account-index-setup-nestedPage-app') returnawait until(() => !!nuxtLoadingIndicatorRef.value).toBeTruthy()diff --git a/packages/nc-gui/composables/useAccountSetupStore.ts b/packages/nc-gui/composables/useAccountSetupStore.tsindex dede839584..c592de982c 100644--- a/packages/nc-gui/composables/useAccountSetupStore.ts+++ b/packages/nc-gui/composables/useAccountSetupStore.ts@@ -168,7 +168,14 @@ export { useProvideAccountSetupStore }export function useAccountSetupStoreOrThrow() {const columnCreateStore = useAccountSetupStore()- if (columnCreateStore == null) throw new Error('Please call `useProvideAccountSetupStore` on the appropriate parent component')+ /**+ * Instead of throwing error we are returning the provide function,+ * as `[[nestedPage]]` is also getting rendered in `pages/index` which is dashboard layout. and there we don't have account setup store+ * Todo: Figure out a better way to handle this.+ *+ * This is a temporary fix to avoid UI Error issue.+ */+ if (columnCreateStore == null) return useProvideAccountSetupStore()return columnCreateStore}diff --git a/packages/nc-gui/pages/account/index.vue b/packages/nc-gui/pages/account/index.vueindex c5aa36bfe0..405515442c 100644--- a/packages/nc-gui/pages/account/index.vue+++ b/packages/nc-gui/pages/account/index.vue@@ -3,6 +3,8 @@ definePageMeta({hideHeader: true,})+const { emailConfigured, storageConfigured, loadSetupApps } = useProvideAccountSetupStore()+const { isUIAllowed } = useRoles()const $route = useRoute()@@ -27,8 +29,6 @@ const logout = async () => {const isSetupPageAllowed = computed(() => isUIAllowed('superAdminSetup') && (!isEeUI || appInfo.value.isOnPrem))-const { emailConfigured, storageConfigured, loadSetupApps } = useProvideAccountSetupStore()-watchEffect(() => {if (isSetupPageAllowed.value) {loadSetupApps()diff --git a/packages/nc-gui/pages/account/index/setup/[[nestedPage]].vue b/packages/nc-gui/pages/account/index/setup/[[nestedPage]].vueindex d8479fa5cd..df381e7e0f 100644--- a/packages/nc-gui/pages/account/index/setup/[[nestedPage]].vue+++ b/packages/nc-gui/pages/account/index/setup/[[nestedPage]].vue@@ -1,14 +1,14 @@<script setup lang="ts">const { categorizeApps, loadSetupApps } = useAccountSetupStoreOrThrow()-const $route = useRoute()+const route = useRoute()onMounted(async () => {await loadSetupApps()})const activeAppId = computed(- () => categorizeApps.value?.[$route.params.nestedPage?.toLowerCase()]?.find((app) => app.title === $route.params.app)?.id,+ () => categorizeApps.value?.[route.params.nestedPage?.toLowerCase()]?.find((app) => app.title === route.params.app)?.id,)</script>