@edgedev/create-edge-app 1.1.17 → 1.1.18
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/.env +2 -1
- package/.env.dev +2 -1
- package/package.json +1 -1
- package/pages/app/account/[page].vue +6 -0
- package/pages/app/dashboard/[[collection]]/[[docId]].vue +13 -26
- package/pages/app/index.vue +13 -0
- package/pages/app.vue +26 -14
- package/pages/index.vue +13 -0
- package/plugins/firebase.client.ts +1 -0
- package/public/favicon/site.webmanifest +2 -2
- package/public/images/logo-square.png +0 -0
- package/public/images/logo.png +0 -0
package/.env
CHANGED
|
@@ -9,4 +9,5 @@ VITE_FIREBASE_EMULATOR_AUTH=
|
|
|
9
9
|
VITE_FIREBASE_EMULATOR_FIRESTORE=
|
|
10
10
|
VITE_FIREBASE_EMULATOR_FUNCTIONS=
|
|
11
11
|
VITE_FIREBASE_EMULATOR_STORAGE=
|
|
12
|
-
REGISTRATION_CODE=organization-registration-template
|
|
12
|
+
REGISTRATION_CODE=organization-registration-template
|
|
13
|
+
DEVELOPMENT_MODE=false
|
package/.env.dev
CHANGED
|
@@ -9,4 +9,5 @@ VITE_FIREBASE_EMULATOR_AUTH=9099
|
|
|
9
9
|
VITE_FIREBASE_EMULATOR_FIRESTORE=8080
|
|
10
10
|
VITE_FIREBASE_EMULATOR_FUNCTIONS=5001
|
|
11
11
|
VITE_FIREBASE_EMULATOR_STORAGE=9199
|
|
12
|
-
REGISTRATION_CODE=organization-registration-template
|
|
12
|
+
REGISTRATION_CODE=organization-registration-template
|
|
13
|
+
DEVELOPMENT_MODE=true
|
package/package.json
CHANGED
|
@@ -62,24 +62,30 @@ const page = computed(() => {
|
|
|
62
62
|
:subscribe-options="subscribeOptions"
|
|
63
63
|
:form-schema="orgSchema"
|
|
64
64
|
:org-fields="orgFields"
|
|
65
|
+
class="pt-0"
|
|
65
66
|
/>
|
|
66
67
|
<edge-my-account
|
|
67
68
|
v-if="page === 'my-account'"
|
|
69
|
+
class="pt-0"
|
|
68
70
|
/>
|
|
69
71
|
<edge-my-profile
|
|
70
72
|
v-if="page === 'my-profile'"
|
|
71
73
|
:form-schema="metaSchema"
|
|
72
74
|
:meta-fields="metaFields"
|
|
75
|
+
class="pt-0"
|
|
73
76
|
/>
|
|
74
77
|
<edge-organization-members
|
|
75
78
|
v-if="page === 'organization-members'"
|
|
79
|
+
class="pt-0"
|
|
76
80
|
/>
|
|
77
81
|
<edge-my-organizations
|
|
78
82
|
v-if="page === 'my-organizations'"
|
|
79
83
|
:registration-code="config.public.registrationCode"
|
|
84
|
+
class="pt-0"
|
|
80
85
|
/>
|
|
81
86
|
<edge-billing
|
|
82
87
|
v-if="page === 'subscription'"
|
|
88
|
+
class="pt-0"
|
|
83
89
|
/>
|
|
84
90
|
</div>
|
|
85
91
|
</template>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { toTypedSchema } from '@vee-validate/zod'
|
|
3
3
|
import * as z from 'zod'
|
|
4
|
+
|
|
4
5
|
const route = useRoute()
|
|
5
6
|
const router = useRouter()
|
|
6
7
|
// const edgeGlobal = inject('edgeGlobal')
|
|
@@ -66,30 +67,14 @@ const isAdmin = computed(() => {
|
|
|
66
67
|
return edgeGlobal.isAdminGlobal(edgeFirebase).value
|
|
67
68
|
})
|
|
68
69
|
|
|
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
|
-
|
|
85
70
|
onMounted(() => {
|
|
86
71
|
if (!route.params.collection) {
|
|
87
72
|
const menuItems = edgeGlobal.edgeState.menuItems
|
|
88
|
-
.filter(allowMenuItem)
|
|
73
|
+
.filter(item => edgeGlobal.allowMenuItem(item, isAdmin.value))
|
|
89
74
|
.map(item => ({
|
|
90
75
|
...item,
|
|
91
76
|
submenu: Array.isArray(item.submenu)
|
|
92
|
-
? item.submenu.filter(allowMenuItem)
|
|
77
|
+
? item.submenu.filter(subItem => edgeGlobal.allowMenuItem(subItem, isAdmin.value))
|
|
93
78
|
: item.submenu,
|
|
94
79
|
}))
|
|
95
80
|
const firstTop = (menuItems && menuItems.length) ? menuItems[0] : null
|
|
@@ -104,19 +89,21 @@ onMounted(() => {
|
|
|
104
89
|
<div
|
|
105
90
|
v-if="edgeGlobal.edgeState.organizationDocPath"
|
|
106
91
|
>
|
|
107
|
-
<edge-dashboard v-if="docId === ''" :filter="state.filter" :collection="collection" class="flex-1">
|
|
92
|
+
<edge-dashboard v-if="docId === ''" :filter="state.filter" :collection="collection" class="flex-1 pt-0">
|
|
108
93
|
<template #header-start>
|
|
109
94
|
<LayoutDashboard class="mr-2" />
|
|
110
95
|
<span class="capitalize">{{ collection }}</span>
|
|
111
96
|
</template>
|
|
112
97
|
<template #header-center>
|
|
113
98
|
<div class="w-full px-6">
|
|
114
|
-
<edge-shad-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
99
|
+
<edge-shad-form>
|
|
100
|
+
<edge-shad-input
|
|
101
|
+
v-model="state.filter"
|
|
102
|
+
label=""
|
|
103
|
+
name="filter"
|
|
104
|
+
placeholder="Filter..."
|
|
105
|
+
/>
|
|
106
|
+
</edge-shad-form>
|
|
120
107
|
</div>
|
|
121
108
|
</template>
|
|
122
109
|
<template #header-end="slotProps">
|
|
@@ -155,7 +142,7 @@ onMounted(() => {
|
|
|
155
142
|
:doc-id="docId"
|
|
156
143
|
:schema="schemas[collection]"
|
|
157
144
|
:new-doc-schema="state.newDocs[collection]"
|
|
158
|
-
class="w-full max-w-7xl mx-auto flex-1"
|
|
145
|
+
class="w-full max-w-7xl mx-auto flex-1 pt-0 px-0"
|
|
159
146
|
>
|
|
160
147
|
<template #header-start="slotProps">
|
|
161
148
|
<FilePenLine class="mr-2" />
|
package/pages/app.vue
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { Menu } from 'lucide-vue-next'
|
|
2
3
|
const edgeFirebase = inject('edgeFirebase')
|
|
3
|
-
// const edgeGlobal = inject('edgeGlobal')
|
|
4
|
-
|
|
5
4
|
const route = useRoute()
|
|
6
5
|
|
|
7
6
|
const currentOrganization = computed(() => {
|
|
@@ -26,6 +25,18 @@ const menuBuilder = () => {
|
|
|
26
25
|
to: '/app/dashboard/subthings',
|
|
27
26
|
icon: 'Package',
|
|
28
27
|
},
|
|
28
|
+
{
|
|
29
|
+
title: 'Admin Only', // Example of an admin only menu item
|
|
30
|
+
to: '/app/dashboard/subthings',
|
|
31
|
+
icon: 'Package',
|
|
32
|
+
adminOnly: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'Dev Only', // Example of a dev only menu item
|
|
36
|
+
to: '/app/dashboard/subthings',
|
|
37
|
+
icon: 'Package',
|
|
38
|
+
devOnly: true,
|
|
39
|
+
},
|
|
29
40
|
{
|
|
30
41
|
title: 'Settings',
|
|
31
42
|
to: '/app/account/my-profile',
|
|
@@ -69,6 +80,11 @@ watch(currentOrganization, async () => {
|
|
|
69
80
|
await projectSetOrg(currentOrganization.value, edgeFirebase, edgeGlobal)
|
|
70
81
|
|
|
71
82
|
const orgDocPath = `organizations/${currentOrganization.value}`
|
|
83
|
+
|
|
84
|
+
// If we want other users to "appear" as admins for admin only menu items
|
|
85
|
+
// we need to add them as admin to a least one subcollection of the organization
|
|
86
|
+
// and then add that collection to isAdminCollections example:
|
|
87
|
+
// edgeGlobal.edgeState.isAdminCollections = [`${orgDocPath}-offices`]
|
|
72
88
|
edgeGlobal.edgeState.isAdminCollections = [`organizations-${orgDocPath}`]
|
|
73
89
|
menuBuilder()
|
|
74
90
|
|
|
@@ -108,7 +124,7 @@ const currentOrg = computed(() => edgeFirebase.data[`organizations/${edgeGlobal.
|
|
|
108
124
|
|
|
109
125
|
watch (currentOrg, async () => {
|
|
110
126
|
if (currentOrg.value) {
|
|
111
|
-
edgeGlobal.edgeState = subscribedStatus(currentOrg.value)
|
|
127
|
+
// edgeGlobal.edgeState = subscribedStatus(currentOrg.value)
|
|
112
128
|
}
|
|
113
129
|
}, { immediate: true }, { deep: true })
|
|
114
130
|
|
|
@@ -244,16 +260,12 @@ edgeGlobal.edgeState.menuItems = [
|
|
|
244
260
|
:show-settings-section="false"
|
|
245
261
|
>
|
|
246
262
|
<template #header>
|
|
247
|
-
<
|
|
248
|
-
<
|
|
249
|
-
|
|
250
|
-
<Package class="!h-6 !w-6" /> <span class="text-xl">{{ orgName }}</span>
|
|
251
|
-
</SidebarMenuButton>
|
|
252
|
-
</SidebarMenuItem>
|
|
253
|
-
</SidebarMenu>
|
|
263
|
+
<div class="flex items-center justify-center w-full">
|
|
264
|
+
<img src="/images/logo-square.png" class="w-auto h-14" alt="Edge Logo">
|
|
265
|
+
</div>
|
|
254
266
|
</template>
|
|
255
|
-
<template #footer
|
|
256
|
-
<Card v-if="slotProps.sideBarState === 'expanded'">
|
|
267
|
+
<template #footer>
|
|
268
|
+
<!-- <Card v-if="slotProps.sideBarState === 'expanded'">
|
|
257
269
|
<CardHeader class="p-2 pt-0 md:p-4">
|
|
258
270
|
<CardTitle>Upgrade to Pro</CardTitle>
|
|
259
271
|
<CardDescription>
|
|
@@ -266,7 +278,7 @@ edgeGlobal.edgeState.menuItems = [
|
|
|
266
278
|
Upgrade
|
|
267
279
|
</Button>
|
|
268
280
|
</CardContent>
|
|
269
|
-
</Card>
|
|
281
|
+
</Card> -->
|
|
270
282
|
</template>
|
|
271
283
|
</edge-side-bar>
|
|
272
284
|
</div>
|
|
@@ -293,7 +305,7 @@ edgeGlobal.edgeState.menuItems = [
|
|
|
293
305
|
class="p-1"
|
|
294
306
|
@click="edgeGlobal.edgeState.sidebar.toggleSidebar"
|
|
295
307
|
>
|
|
296
|
-
<
|
|
308
|
+
<Menu class="!w-[40px] !h-[40px]" />
|
|
297
309
|
</edge-shad-button>
|
|
298
310
|
<div id="page-header" />
|
|
299
311
|
</template>
|
package/pages/index.vue
ADDED
|
@@ -12,5 +12,6 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
12
12
|
emulatorAuth: import.meta.env.VITE_FIREBASE_EMULATOR_AUTH,
|
|
13
13
|
emulatorFirestore: import.meta.env.VITE_FIREBASE_EMULATOR_FIRESTORE,
|
|
14
14
|
emulatorFunctions: import.meta.env.VITE_FIREBASE_EMULATOR_FUNCTIONS,
|
|
15
|
+
emulatorStorage: import.meta.env.VITE_FIREBASE_EMULATOR_STORAGE,
|
|
15
16
|
}, true, true)
|
|
16
17
|
})
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"short_name": "FormFling",
|
|
4
4
|
"icons": [
|
|
5
5
|
{
|
|
6
|
-
"src": "/android-chrome-192x192.png",
|
|
6
|
+
"src": "/favicon/android-chrome-192x192.png",
|
|
7
7
|
"sizes": "192x192",
|
|
8
8
|
"type": "image/png"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"src": "/android-chrome-512x512.png",
|
|
11
|
+
"src": "/favicon/android-chrome-512x512.png",
|
|
12
12
|
"sizes": "512x512",
|
|
13
13
|
"type": "image/png"
|
|
14
14
|
}
|
|
Binary file
|
package/public/images/logo.png
CHANGED
|
Binary file
|