diff --git a/client/web/compose/src/components/Namespaces/NamespaceSidebar.vue b/client/web/compose/src/components/Namespaces/NamespaceSidebar.vue index 855fb1f95..9eee93660 100644 --- a/client/web/compose/src/components/Namespaces/NamespaceSidebar.vue +++ b/client/web/compose/src/components/Namespaces/NamespaceSidebar.vue @@ -41,7 +41,7 @@ data-test-id="button-public" variant="light" class="w-100 mb-2" - :to="{ name: 'pages', params: { slug: namespace.slug } }" + :to="{ name: 'pages', params: { slug: namespace.slug || namespace.namespaceID } }" > {{ $t('publicPages') }} @@ -51,7 +51,7 @@ data-test-id="button-admin" variant="light" class="w-100 mb-2" - :to="{ name: 'admin.modules', params: { slug: namespace.slug } }" + :to="{ name: 'admin.modules', params: { slug: namespace.slug || namespace.namespaceID } }" > {{ $t('adminPanel') }} @@ -310,14 +310,14 @@ export default { '$route.params.slug': { immediate: true, handler (slug = '') { - this.namespace = slug ? this.namespaces.find(n => n.slug === slug) : undefined this.query = '' + this.namespace = this.$store.getters['namespace/getByUrlPart'](slug) }, }, }, methods: { - namespaceSelected ({ canManageNamespace, slug = '' }) { + namespaceSelected ({ namespaceID, canManageNamespace, slug = '' }) { let { name, params } = this.$route // Try to match page, otherwise redirect to pages root @@ -331,7 +331,7 @@ export default { name = !params.pageID && canManageNamespace && !name.includes('namespace.') ? name : 'pages' - this.$router.push({ name, params: { slug } }) + this.$router.push({ name, params: { slug: slug || namespaceID } }) }, pageIndex (wraps) { diff --git a/client/web/compose/src/components/PageBlocks/RecordListBase.vue b/client/web/compose/src/components/PageBlocks/RecordListBase.vue index 1f32d15de..6003b747d 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListBase.vue @@ -1084,7 +1084,7 @@ export default { name: 'page.record', label: 'Record page', params: { - slug: this.namespace.slug, + slug: this.namespace.slug || this.namespace.namespaceID, pageID: this.recordPageID, recordID: recordID, }, @@ -1104,7 +1104,7 @@ export default { ...e, namespaceID, moduleID, - filename: `${this.namespace.slug} - ${this.recordListModule.name}`, + filename: `${this.namespace.slug || namespaceID} - ${this.recordListModule.name}`, } if (filterRaw.rangeType === 'range') { diff --git a/client/web/compose/src/views/Namespace/Edit.vue b/client/web/compose/src/views/Namespace/Edit.vue index b86ea58cf..46e858609 100644 --- a/client/web/compose/src/views/Namespace/Edit.vue +++ b/client/web/compose/src/views/Namespace/Edit.vue @@ -602,9 +602,9 @@ export default { async handleApplicationSave () { if (this.application) { - this.application.name = this.namespace.slug + this.application.name = this.namespace.slug || this.namespace.namespaceID this.application.unify.name = this.namespace.name - this.application.unify.url = `/compose/ns/${this.namespace.slug}/pages` + this.application.unify.url = `/compose/ns/${this.application.name}/pages` let enabled = this.application.enabled if (this.isApplication && !this.application.enabled) { @@ -626,12 +626,12 @@ export default { } else if (this.isApplication) { // If namespace not an application - create one and enable const application = { - name: this.namespace.slug, + name: this.namespace.slug || this.namespace.namespaceID, enabled: true, unify: { name: this.namespace.name, listed: true, - url: `compose/ns/${this.namespace.slug}/pages`, + url: `compose/ns/${this.namespace.slug || this.namespace.namespaceID}/pages`, icon: this.namespace.meta.icon || this.$Settings.attachment('ui.iconLogo'), logo: this.namespace.meta.logo || this.$Settings.attachment('ui.mainLogo'), }, diff --git a/client/web/privacy/src/views/Privacy/SensitiveData.vue b/client/web/privacy/src/views/Privacy/SensitiveData.vue index 8e1fbf7d3..e3b509506 100644 --- a/client/web/privacy/src/views/Privacy/SensitiveData.vue +++ b/client/web/privacy/src/views/Privacy/SensitiveData.vue @@ -106,7 +106,8 @@ export default { }, rowClicked ({ namespace, module }) { - window.open(`/compose/ns/${namespace.slug}/admin/modules/${module.moduleID}/edit`, '_blank') + const { namespaceID, slug } = namespace + window.open(`/compose/ns/${slug || namespaceID}/admin/modules/${module.moduleID}/edit`, '_blank') }, }, }