@goweekdays/layer-common 1.4.0 → 1.4.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/CHANGELOG.md +18 -0
- package/components/Layout/NavigationDrawer.vue +3 -0
- package/components/RoleForm.vue +6 -3
- package/components/RolePermissionMain.vue +3 -4
- package/components/SwitchContext.vue +2 -3
- package/composables/useLocalAuth.ts +1 -1
- package/composables/useMember.ts +17 -0
- package/middleware/org.ts +1 -1
- package/package.json +1 -1
- package/pages/index.vue +1 -1
- package/pages/login.vue +4 -1
- package/pages/require-organization.vue +36 -12
- package/pages/sign-up/[id].vue +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @goweekdays/layer-common
|
|
2
2
|
|
|
3
|
+
## 1.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2baee76: Update role and permission components for dynamic app context
|
|
8
|
+
|
|
9
|
+
## 1.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 273fab2: Enhance member fetching and UI improvements
|
|
14
|
+
|
|
15
|
+
## 1.4.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- b7afd94: Improve organization requirement page UX and messaging
|
|
20
|
+
|
|
3
21
|
## 1.4.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/components/RoleForm.vue
CHANGED
|
@@ -268,12 +268,15 @@ const {
|
|
|
268
268
|
status: permissionsReqStatus,
|
|
269
269
|
refresh: refreshPermissions,
|
|
270
270
|
} = await useLazyAsyncData(
|
|
271
|
-
`role-form-get-all-permission-${
|
|
271
|
+
`role-form-get-all-permission-${role.value.app}`,
|
|
272
272
|
() =>
|
|
273
273
|
getAllPerm({
|
|
274
|
-
app:
|
|
274
|
+
app: role.value.app,
|
|
275
275
|
limit: 200,
|
|
276
|
-
})
|
|
276
|
+
}),
|
|
277
|
+
{
|
|
278
|
+
watch: [() => role.value.app],
|
|
279
|
+
}
|
|
277
280
|
);
|
|
278
281
|
|
|
279
282
|
const loadingPermissions = computed(
|
|
@@ -188,7 +188,7 @@ function setRole({
|
|
|
188
188
|
JSON.parse(
|
|
189
189
|
JSON.stringify({
|
|
190
190
|
...data,
|
|
191
|
-
app: mode === "admin" ? props.app : data.app,
|
|
191
|
+
app: mode === "admin" || mode === "add" ? props.app : data.app,
|
|
192
192
|
})
|
|
193
193
|
)
|
|
194
194
|
);
|
|
@@ -221,16 +221,15 @@ const {
|
|
|
221
221
|
refresh: getRoles,
|
|
222
222
|
status: getRoleReqStatus,
|
|
223
223
|
} = useLazyAsyncData(
|
|
224
|
-
|
|
224
|
+
`roles-permissions-get-all-by-${props.app}-${props.org}-page-${page.value}`,
|
|
225
225
|
() =>
|
|
226
226
|
_getRoles({
|
|
227
227
|
page: page.value,
|
|
228
|
-
search: headerSearch.value,
|
|
229
228
|
org: props.org,
|
|
230
229
|
app: isOrg.value ? "" : props.app,
|
|
231
230
|
}),
|
|
232
231
|
{
|
|
233
|
-
watch: [page
|
|
232
|
+
watch: [page],
|
|
234
233
|
}
|
|
235
234
|
);
|
|
236
235
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<v-card width="300px" rounded="lg" class="pa-4">
|
|
27
27
|
<span class="text-subtitle-2 font-weight-bold">
|
|
28
|
-
|
|
28
|
+
{{ prop.title }}
|
|
29
29
|
</span>
|
|
30
30
|
<v-text-field
|
|
31
31
|
v-model="search"
|
|
@@ -65,8 +65,7 @@
|
|
|
65
65
|
const prop = defineProps({
|
|
66
66
|
title: {
|
|
67
67
|
type: String,
|
|
68
|
-
|
|
69
|
-
default: "app",
|
|
68
|
+
default: "Switch Context",
|
|
70
69
|
},
|
|
71
70
|
items: {
|
|
72
71
|
type: Array as PropType<Array<Record<string, any>>>,
|
package/composables/useMember.ts
CHANGED
|
@@ -33,6 +33,22 @@ export default function useMember() {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
function getAllByAppUser({
|
|
37
|
+
app = "",
|
|
38
|
+
user = "",
|
|
39
|
+
limit = 10,
|
|
40
|
+
page = 1,
|
|
41
|
+
search = "",
|
|
42
|
+
} = {}) {
|
|
43
|
+
return $fetch<Record<string, any>>(
|
|
44
|
+
`/api/members/orgs/app/${app}/user/${user}`,
|
|
45
|
+
{
|
|
46
|
+
method: "GET",
|
|
47
|
+
query: { page, limit, search },
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
36
52
|
async function getAll({
|
|
37
53
|
page = 1,
|
|
38
54
|
search = "",
|
|
@@ -104,5 +120,6 @@ export default function useMember() {
|
|
|
104
120
|
updateRoleById,
|
|
105
121
|
updateStatusById,
|
|
106
122
|
deleteById,
|
|
123
|
+
getAllByAppUser,
|
|
107
124
|
};
|
|
108
125
|
}
|
package/middleware/org.ts
CHANGED
|
@@ -8,6 +8,6 @@ export default defineNuxtRouteMiddleware((to) => {
|
|
|
8
8
|
const org = (to.params.org as string) ?? "";
|
|
9
9
|
|
|
10
10
|
if (org && !hexSchema.safeParse(org).success) {
|
|
11
|
-
return navigateTo({ name: "require-organization" }
|
|
11
|
+
return navigateTo({ name: "require-organization" });
|
|
12
12
|
}
|
|
13
13
|
});
|
package/package.json
CHANGED
package/pages/index.vue
CHANGED
package/pages/login.vue
CHANGED
|
@@ -158,7 +158,10 @@ async function submit({ email = "", password = "" } = {}) {
|
|
|
158
158
|
message.value = "An unexpected error occurred. Please try again.";
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
if (
|
|
161
|
+
if (
|
|
162
|
+
error.response.status === 404 &&
|
|
163
|
+
error.response.url.includes("/api/members/app")
|
|
164
|
+
) {
|
|
162
165
|
navigateTo({ name: "index" });
|
|
163
166
|
}
|
|
164
167
|
} finally {
|
|
@@ -7,21 +7,45 @@
|
|
|
7
7
|
</v-col>
|
|
8
8
|
|
|
9
9
|
<span class="text-subtitle-2">
|
|
10
|
-
You must
|
|
10
|
+
You must be part of an organization to access this app. Please contact
|
|
11
|
+
your organization administrator or create a new organization.
|
|
11
12
|
</span>
|
|
12
13
|
|
|
13
14
|
<v-col cols="12" class="mt-6">
|
|
14
15
|
<v-row no-gutters justify="center">
|
|
15
|
-
<v-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
<v-col cols="2">
|
|
17
|
+
<v-btn
|
|
18
|
+
block
|
|
19
|
+
size="large"
|
|
20
|
+
class="text-none"
|
|
21
|
+
variant="flat"
|
|
22
|
+
color="black"
|
|
23
|
+
rounded
|
|
24
|
+
@click="createOrg()"
|
|
25
|
+
>
|
|
26
|
+
Create Organization
|
|
27
|
+
</v-btn>
|
|
28
|
+
</v-col>
|
|
29
|
+
</v-row>
|
|
30
|
+
</v-col>
|
|
31
|
+
|
|
32
|
+
<v-col cols="12" class="text-center font-weight-bold my-2"> or </v-col>
|
|
33
|
+
|
|
34
|
+
<v-col cols="12">
|
|
35
|
+
<v-row no-gutters justify="center">
|
|
36
|
+
<v-col cols="2">
|
|
37
|
+
<v-btn
|
|
38
|
+
block
|
|
39
|
+
size="large"
|
|
40
|
+
class="text-none"
|
|
41
|
+
variant="flat"
|
|
42
|
+
color="black"
|
|
43
|
+
rounded
|
|
44
|
+
:to="{ name: 'index' }"
|
|
45
|
+
>
|
|
46
|
+
Return to landing page
|
|
47
|
+
</v-btn>
|
|
48
|
+
</v-col>
|
|
25
49
|
</v-row>
|
|
26
50
|
</v-col>
|
|
27
51
|
</v-row>
|
|
@@ -34,7 +58,7 @@ definePageMeta({
|
|
|
34
58
|
|
|
35
59
|
function createOrg() {
|
|
36
60
|
const { APP, APP_ORG } = useRuntimeConfig().public;
|
|
37
|
-
if (APP === "
|
|
61
|
+
if (APP === "org") {
|
|
38
62
|
navigateTo({ name: "organizations-create" });
|
|
39
63
|
} else {
|
|
40
64
|
navigateTo(`${APP_ORG}/organizations/create`, { external: true });
|
package/pages/sign-up/[id].vue
CHANGED