@edgedev/create-edge-app 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -55,15 +55,31 @@ const page = computed(() => {
|
|
|
55
55
|
|
|
56
56
|
<template>
|
|
57
57
|
<div
|
|
58
|
-
v-if="
|
|
58
|
+
v-if="edgeGlobal.edgeState.organizationDocPath"
|
|
59
59
|
>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
<edge-organization-settings
|
|
61
|
+
v-if="page === 'organization-settings'"
|
|
62
|
+
:subscribe-options="subscribeOptions"
|
|
63
|
+
:form-schema="orgSchema"
|
|
64
|
+
:org-fields="orgFields"
|
|
65
|
+
/>
|
|
66
|
+
<edge-my-account
|
|
67
|
+
v-if="page === 'my-account'"
|
|
68
|
+
/>
|
|
69
|
+
<edge-my-profile
|
|
70
|
+
v-if="page === 'my-profile'"
|
|
71
|
+
:form-schema="metaSchema"
|
|
72
|
+
:meta-fields="metaFields"
|
|
73
|
+
/>
|
|
74
|
+
<edge-organization-members
|
|
75
|
+
v-if="page === 'organization-members'"
|
|
76
|
+
/>
|
|
77
|
+
<edge-my-organizations
|
|
78
|
+
v-if="page === 'my-organizations'"
|
|
79
|
+
:registration-code="config.public.registrationCode"
|
|
80
|
+
/>
|
|
81
|
+
<edge-billing
|
|
82
|
+
v-if="page === 'subscription'"
|
|
83
|
+
/>
|
|
68
84
|
</div>
|
|
69
85
|
</template>
|
|
@@ -62,10 +62,40 @@ definePageMeta({
|
|
|
62
62
|
middleware: 'auth',
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
+
const isAdmin = computed(() => {
|
|
66
|
+
return edgeGlobal.isAdminGlobal(edgeFirebase).value
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const toBool = v => v === true || v === 'true' || v === 1 || v === '1'
|
|
70
|
+
|
|
71
|
+
const allowMenuItem = (item) => {
|
|
72
|
+
const isDev = config.public.developmentMode
|
|
73
|
+
const adminOnly = toBool(item.adminOnly)
|
|
74
|
+
const devOnly = toBool(item.devOnly)
|
|
75
|
+
const override = toBool(item.override)
|
|
76
|
+
if (item.override !== undefined)
|
|
77
|
+
return override
|
|
78
|
+
if (adminOnly && !isAdmin.value)
|
|
79
|
+
return false
|
|
80
|
+
if (devOnly && !isDev)
|
|
81
|
+
return false
|
|
82
|
+
return true
|
|
83
|
+
}
|
|
84
|
+
|
|
65
85
|
onMounted(() => {
|
|
66
86
|
if (!route.params.collection) {
|
|
67
|
-
|
|
68
|
-
|
|
87
|
+
const menuItems = edgeGlobal.edgeState.menuItems
|
|
88
|
+
.filter(allowMenuItem)
|
|
89
|
+
.map(item => ({
|
|
90
|
+
...item,
|
|
91
|
+
submenu: Array.isArray(item.submenu)
|
|
92
|
+
? item.submenu.filter(allowMenuItem)
|
|
93
|
+
: item.submenu,
|
|
94
|
+
}))
|
|
95
|
+
const firstTop = (menuItems && menuItems.length) ? menuItems[0] : null
|
|
96
|
+
if (firstTop && typeof firstTop.to === 'string' && firstTop.to.length) {
|
|
97
|
+
router.replace(firstTop.to)
|
|
98
|
+
}
|
|
69
99
|
}
|
|
70
100
|
})
|
|
71
101
|
</script>
|