@goweekdays/layer-common 1.4.0 → 1.4.2

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @goweekdays/layer-common
2
2
 
3
+ ## 1.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 273fab2: Enhance member fetching and UI improvements
8
+
9
+ ## 1.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - b7afd94: Improve organization requirement page UX and messaging
14
+
3
15
  ## 1.4.0
4
16
 
5
17
  ### Minor Changes
@@ -26,6 +26,9 @@
26
26
  <template #append>
27
27
  <slot name="append"></slot>
28
28
  </template>
29
+ <template #prepend>
30
+ <slot name="prepend"></slot>
31
+ </template>
29
32
  </v-navigation-drawer>
30
33
  </template>
31
34
 
@@ -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
- Switch {{ prop.title }} context
28
+ {{ prop.title }}
29
29
  </span>
30
30
  <v-text-field
31
31
  v-model="search"
@@ -66,7 +66,7 @@ const prop = defineProps({
66
66
  title: {
67
67
  type: String,
68
68
  required: true,
69
- default: "app",
69
+ default: "Switch Context",
70
70
  },
71
71
  items: {
72
72
  type: Array as PropType<Array<Record<string, any>>>,
@@ -48,7 +48,7 @@ export default function useLocalAuth() {
48
48
  }
49
49
 
50
50
  function verify(id: string) {
51
- return $fetch<TKeyValuePair>(`/api/auth/verify/${id}`, {
51
+ return $fetch<Record<string, any>>(`/api/auth/verify/${id}`, {
52
52
  method: "GET",
53
53
  });
54
54
  }
@@ -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" }, { replace: true });
11
+ return navigateTo({ name: "require-organization" });
12
12
  }
13
13
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@goweekdays/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.4.0",
5
+ "version": "1.4.2",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"
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 (error.response.status === 404) {
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 have an organization to access this page.
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-btn
16
- size="large"
17
- class="text-none"
18
- variant="flat"
19
- color="black"
20
- rounded
21
- @click="createOrg()"
22
- >
23
- Create Organization
24
- </v-btn>
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 === "organization") {
61
+ if (APP === "org") {
38
62
  navigateTo({ name: "organizations-create" });
39
63
  } else {
40
64
  navigateTo(`${APP_ORG}/organizations/create`, { external: true });
@@ -139,7 +139,9 @@ const loading = ref(false);
139
139
 
140
140
  async function validate() {
141
141
  try {
142
- await verify(id);
142
+ const result = await verify(id);
143
+
144
+ type.value = result.type;
143
145
 
144
146
  validInvitation.value = true;
145
147
  message.value = "";