@goweekdays/layer-common 1.0.1 → 1.0.3
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/.playground/nuxt.config.ts +0 -1
- package/CHANGELOG.md +12 -0
- package/components/InvitationMain.vue +195 -0
- package/components/Layout/Header.vue +14 -5
- package/components/LinkHome.vue +9 -0
- package/components/MemberMain.vue +452 -0
- package/components/RolePermissionMain.vue +1 -1
- package/composables/useCommonPermission.ts +61 -2
- package/composables/useLocal.ts +3 -28
- package/composables/useLocalAuth.ts +4 -0
- package/composables/useLocalSetup.ts +46 -0
- package/composables/useMember.ts +80 -59
- package/composables/useOrg.ts +12 -1
- package/composables/useUser.ts +9 -2
- package/composables/useUtils.ts +27 -0
- package/composables/useVerification.ts +3 -2
- package/nuxt.config.ts +1 -4
- package/package.json +2 -1
- package/plugins/iconify.client.ts +5 -0
- package/plugins/vuetify.ts +10 -0
- package/types/role.d.ts +1 -1
- package/composables/useAdminPermission.ts +0 -127
|
@@ -15,7 +15,6 @@ export default defineNuxtConfig({
|
|
|
15
15
|
APP_ACCOUNT: (process.env.APP_ACCOUNT as string) ?? "",
|
|
16
16
|
S3_BUCKET_ENDPOINT: (process.env.S3_BUCKET_ENDPOINT as string) ?? "",
|
|
17
17
|
APP_ADMIN: (process.env.APP_ADMIN as string) ?? "",
|
|
18
|
-
APP_CBA_RECAP: (process.env.APP_CBA_RECAP as string) ?? "",
|
|
19
18
|
},
|
|
20
19
|
},
|
|
21
20
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-row no-gutters>
|
|
3
|
+
<v-col cols="12" class="mb-2">
|
|
4
|
+
<v-row no-gutters>
|
|
5
|
+
<v-btn
|
|
6
|
+
class="text-none mr-2"
|
|
7
|
+
rounded="pill"
|
|
8
|
+
variant="tonal"
|
|
9
|
+
:to="props.inviteRoute"
|
|
10
|
+
size="large"
|
|
11
|
+
v-if="props.inviteMember"
|
|
12
|
+
>
|
|
13
|
+
Invite member
|
|
14
|
+
</v-btn>
|
|
15
|
+
</v-row>
|
|
16
|
+
</v-col>
|
|
17
|
+
|
|
18
|
+
<v-col cols="12">
|
|
19
|
+
<v-card
|
|
20
|
+
width="100%"
|
|
21
|
+
variant="outlined"
|
|
22
|
+
border="thin"
|
|
23
|
+
rounded="lg"
|
|
24
|
+
:loading="loading"
|
|
25
|
+
>
|
|
26
|
+
<v-toolbar density="compact" color="grey-lighten-4">
|
|
27
|
+
<template #prepend>
|
|
28
|
+
<v-btn fab icon density="comfortable" @click="getInvitations()">
|
|
29
|
+
<v-icon>mdi-refresh</v-icon>
|
|
30
|
+
</v-btn>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<template #append>
|
|
34
|
+
<v-row no-gutters justify="end" align="center">
|
|
35
|
+
<span class="mr-2 text-caption text-fontgray">
|
|
36
|
+
{{ pageRange }}
|
|
37
|
+
</span>
|
|
38
|
+
<local-pagination
|
|
39
|
+
v-model="page"
|
|
40
|
+
:length="pages"
|
|
41
|
+
@update:value="getInvitations()"
|
|
42
|
+
/>
|
|
43
|
+
</v-row>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<template #extension>
|
|
47
|
+
<v-tabs>
|
|
48
|
+
<v-tab
|
|
49
|
+
:to="{
|
|
50
|
+
name: 'org-organization-invitations-status-status',
|
|
51
|
+
params: { status: 'pending', organization },
|
|
52
|
+
}"
|
|
53
|
+
>
|
|
54
|
+
Pending
|
|
55
|
+
</v-tab>
|
|
56
|
+
<v-tab
|
|
57
|
+
:to="{
|
|
58
|
+
name: 'org-organization-invitations-status-status',
|
|
59
|
+
params: { status: 'expired', organization },
|
|
60
|
+
}"
|
|
61
|
+
>
|
|
62
|
+
Expired
|
|
63
|
+
</v-tab>
|
|
64
|
+
</v-tabs>
|
|
65
|
+
</template>
|
|
66
|
+
</v-toolbar>
|
|
67
|
+
|
|
68
|
+
<v-data-table
|
|
69
|
+
:headers="headers"
|
|
70
|
+
:items="items"
|
|
71
|
+
item-value="_id"
|
|
72
|
+
items-per-page="20"
|
|
73
|
+
fixed-header
|
|
74
|
+
hide-default-footer
|
|
75
|
+
hide-default-header
|
|
76
|
+
class="table-height"
|
|
77
|
+
:loading="loading"
|
|
78
|
+
@click:row="tableRowClickHandler"
|
|
79
|
+
>
|
|
80
|
+
<template #item.permissions="{ value }">
|
|
81
|
+
<span class="text-caption font-weight-bold text-capitalize">
|
|
82
|
+
permissions
|
|
83
|
+
</span>
|
|
84
|
+
<v-chip>{{ value.length }}</v-chip>
|
|
85
|
+
</template>
|
|
86
|
+
</v-data-table>
|
|
87
|
+
</v-card>
|
|
88
|
+
</v-col>
|
|
89
|
+
</v-row>
|
|
90
|
+
</template>
|
|
91
|
+
|
|
92
|
+
<script setup lang="ts">
|
|
93
|
+
const props = defineProps({
|
|
94
|
+
status: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "active",
|
|
97
|
+
},
|
|
98
|
+
app: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "organization",
|
|
101
|
+
},
|
|
102
|
+
inviteMember: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: false,
|
|
105
|
+
},
|
|
106
|
+
inviteRoute: {
|
|
107
|
+
type: Object as PropType<Record<string, any>>,
|
|
108
|
+
default: () => ({
|
|
109
|
+
name: "index",
|
|
110
|
+
params: {},
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const organization = (useRoute().params.organization as string) ?? "";
|
|
116
|
+
|
|
117
|
+
const headers = [
|
|
118
|
+
{
|
|
119
|
+
title: "Date",
|
|
120
|
+
value: "createdAt",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
title: "E-mail",
|
|
124
|
+
value: "email",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
title: "App",
|
|
128
|
+
value: "metadata.app",
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
const { getVerifications } = useVerification();
|
|
133
|
+
|
|
134
|
+
const page = ref(1);
|
|
135
|
+
const pages = ref(0);
|
|
136
|
+
const pageRange = ref("-- - -- of --");
|
|
137
|
+
|
|
138
|
+
const items = ref<Array<Record<string, any>>>([]);
|
|
139
|
+
const { headerSearch } = useLocal();
|
|
140
|
+
|
|
141
|
+
const {
|
|
142
|
+
data: getInviteReq,
|
|
143
|
+
refresh: getInvitations,
|
|
144
|
+
status: getInviteReqStatus,
|
|
145
|
+
} = await useLazyAsyncData("get-invitations", () =>
|
|
146
|
+
getVerifications({
|
|
147
|
+
page: page.value,
|
|
148
|
+
search: headerSearch.value,
|
|
149
|
+
status: props.status,
|
|
150
|
+
type: "user-invite,member-invite",
|
|
151
|
+
app: props.app,
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
const loading = computed(() => getInviteReqStatus.value === "pending");
|
|
156
|
+
|
|
157
|
+
watchEffect(() => {
|
|
158
|
+
if (getInviteReq.value) {
|
|
159
|
+
const _items = getInviteReq.value.items;
|
|
160
|
+
items.value = _items.length
|
|
161
|
+
? _items.map((i: Record<string, any>) => ({
|
|
162
|
+
...i,
|
|
163
|
+
createdAt: new Date(i.createdAt).toLocaleString(),
|
|
164
|
+
}))
|
|
165
|
+
: [];
|
|
166
|
+
pages.value = getInviteReq.value.pages;
|
|
167
|
+
pageRange.value = getInviteReq.value.pageRange;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
function tableRowClickHandler(_: any, row: any) {
|
|
172
|
+
const item = items.value[row.index];
|
|
173
|
+
useRouter().push({
|
|
174
|
+
name: "roles-permissions-id",
|
|
175
|
+
params: { id: item._id },
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const selected = ref<Array<string>>([]);
|
|
180
|
+
const selectAll = ref(false);
|
|
181
|
+
|
|
182
|
+
watch(selectAll, (curr) => {
|
|
183
|
+
selected.value.splice(0, selected.value.length);
|
|
184
|
+
if (curr) {
|
|
185
|
+
const ids = items.value.map((i) => i._id as string);
|
|
186
|
+
selected.value.push(...ids);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
</script>
|
|
190
|
+
|
|
191
|
+
<style scoped>
|
|
192
|
+
.table-height {
|
|
193
|
+
max-height: calc(100vh - (220px));
|
|
194
|
+
}
|
|
195
|
+
</style>
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
13
|
<v-row no-gutters>
|
|
14
|
-
<v-col cols="6">
|
|
14
|
+
<v-col cols="12" lg="6" md="9">
|
|
15
15
|
<v-text-field
|
|
16
|
-
v-model="
|
|
16
|
+
v-model="_search"
|
|
17
17
|
width="100%"
|
|
18
18
|
prepend-inner-icon="mdi-magnify"
|
|
19
19
|
variant="solo-filled"
|
|
@@ -171,8 +171,19 @@
|
|
|
171
171
|
<script setup lang="ts">
|
|
172
172
|
import { useTheme } from "vuetify";
|
|
173
173
|
|
|
174
|
+
const { getNameInitials, debounce } = useUtils();
|
|
175
|
+
|
|
176
|
+
const _search = ref("");
|
|
177
|
+
|
|
174
178
|
const search = defineModel("search", { type: String });
|
|
175
179
|
|
|
180
|
+
watch(
|
|
181
|
+
_search,
|
|
182
|
+
debounce((value) => {
|
|
183
|
+
search.value = value;
|
|
184
|
+
}, 1000)
|
|
185
|
+
);
|
|
186
|
+
|
|
176
187
|
const { redirect, apps, drawer } = useLocal();
|
|
177
188
|
|
|
178
189
|
const {
|
|
@@ -219,8 +230,6 @@ const name = computed(() => {
|
|
|
219
230
|
return name;
|
|
220
231
|
});
|
|
221
232
|
|
|
222
|
-
const { getNameInitials } = useUtils();
|
|
223
|
-
|
|
224
233
|
const defaultApps = computed(() => [
|
|
225
234
|
{
|
|
226
235
|
title: "Account",
|
|
@@ -229,7 +238,7 @@ const defaultApps = computed(() => [
|
|
|
229
238
|
landingPage: "home",
|
|
230
239
|
},
|
|
231
240
|
{
|
|
232
|
-
title: "
|
|
241
|
+
title: "Business",
|
|
233
242
|
icon: "mdi-domain",
|
|
234
243
|
link: APP_ORG,
|
|
235
244
|
landingPage: currentUser.value?.defaultOrg
|