@iservice365/layer-common 0.2.2 → 1.0.0

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,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - d24ed34: Building mgmt initial release
8
+
3
9
  ## 0.2.2
4
10
 
5
11
  ### Patch Changes
@@ -173,6 +173,8 @@ const message = ref("");
173
173
  const messageColor = ref("");
174
174
  const messageSnackbar = ref(false);
175
175
 
176
+ const { getUserFromCookie } = useLocal();
177
+
176
178
  const serviceProviders = ref<
177
179
  Array<{ title: string; value: string; subtitle: string }>
178
180
  >([]);
@@ -345,6 +347,9 @@ function handleCloseDialog() {
345
347
  const _feedbackId = ref<string | null>(null);
346
348
 
347
349
  async function _createFeedback(organization: string, site: string) {
350
+
351
+ const userId = getUserFromCookie();
352
+
348
353
  const createPayload: TFeedbackCreate = {
349
354
  subject: _feedback.value.subject,
350
355
  category: _feedback.value.category,
@@ -356,6 +361,7 @@ async function _createFeedback(organization: string, site: string) {
356
361
  assignee: _feedback.value.assignee || "",
357
362
  organization,
358
363
  site,
364
+ ...(userId !== null ? {createdBy: userId } : {}),
359
365
  };
360
366
 
361
367
  const response = await createFeedback(createPayload);
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <span class="text-subtitle-2 font-weight-medium">
2
+ <span :class="`text-subtitle-2 font-weight-medium ${props.class}`">
3
3
  {{ title }} <span v-if="props.required" class="text-error">*</span>
4
4
  </span>
5
5
  </template>
@@ -14,5 +14,9 @@ const props = defineProps({
14
14
  type: Boolean,
15
15
  default: false,
16
16
  },
17
+ class: {
18
+ type: String,
19
+ default: "",
20
+ },
17
21
  });
18
22
  </script>
@@ -12,19 +12,18 @@
12
12
  :key="`${navigationItem.title}-${navigationIndex}`"
13
13
  >
14
14
  <NavigationItem
15
- v-if="navigationItem.route && navigationItem.route.name"
15
+ v-if="navigationItem.children?.length"
16
16
  :title="navigationItem.title"
17
17
  :icon="navigationItem.icon"
18
- :route="navigationItem.route"
19
18
  :children="navigationItem.children"
20
19
  />
21
20
 
22
21
  <NavigationItem
23
- v-else-if="navigationItem.link"
22
+ v-else-if="navigationItem.route"
24
23
  :title="navigationItem.title"
25
24
  :icon="navigationItem.icon"
26
25
  :link="navigationItem.link"
27
- :children="navigationItem.children"
26
+ :route="navigationItem.route"
28
27
  />
29
28
  </template>
30
29
 
@@ -1,8 +1,5 @@
1
1
  export function useLocalSetup() {
2
- const userAppRole = useState<Record<string, any> | null>(
3
- "userAppRole",
4
- () => null
5
- );
2
+ const userAppRole = useState<TRole | null>("userAppRole", () => null);
6
3
 
7
4
  const id = useState<string | null>("memberShipOrgId", () => null);
8
5
 
@@ -1,5 +1,11 @@
1
1
  export default function useOrg() {
2
- function getOrgs({ page = 1, search = "", user = "", limit = 20 } = {}) {
2
+ function getOrgs({
3
+ page = 1,
4
+ search = "",
5
+ user = "",
6
+ limit = 20,
7
+ type = "organization",
8
+ } = {}) {
3
9
  return useNuxtApp().$api<Record<string, any>>(
4
10
  `/api/organizations/user/${user}`,
5
11
  {
@@ -8,6 +14,7 @@ export default function useOrg() {
8
14
  page,
9
15
  search,
10
16
  limit,
17
+ type,
11
18
  },
12
19
  }
13
20
  );
@@ -12,6 +12,7 @@ export default function useSite() {
12
12
  name: "",
13
13
  description: "",
14
14
  orgId: "",
15
+ blocks: 0,
15
16
  customerOrgId: "",
16
17
  customerSiteId: "",
17
18
  createdAt: "",
@@ -73,7 +74,7 @@ export default function useSite() {
73
74
  }
74
75
 
75
76
  async function getSiteById(id: string) {
76
- return useNuxtApp().$api<TCustomer>(`/api/sites/${id}`, {
77
+ return useNuxtApp().$api<TSite>(`/api/sites/${id}`, {
77
78
  method: "GET",
78
79
  });
79
80
  }
@@ -89,6 +89,7 @@ export default function useSubscription() {
89
89
  organization?: TOrg;
90
90
  billingAddress: TAddress;
91
91
  promoCode?: string;
92
+ user?: string;
92
93
  };
93
94
 
94
95
  function initOrgSubscription(value: TSub) {
@@ -295,6 +295,12 @@ export default function useUtils() {
295
295
  return params;
296
296
  }
297
297
 
298
+ function toOrdinal(n: number): string {
299
+ const s = ["th", "st", "nd", "rd"];
300
+ const v = n % 100;
301
+ return n + (s[(v - 20) % 10] || s[v] || s[0]);
302
+ }
303
+
298
304
  return {
299
305
  requiredRule,
300
306
  emailRule,
@@ -324,5 +330,6 @@ export default function useUtils() {
324
330
  formatNature,
325
331
  replaceMatch,
326
332
  setRouteParams,
333
+ toOrdinal,
327
334
  };
328
335
  }
package/package.json CHANGED
@@ -2,11 +2,8 @@
2
2
  "name": "@iservice365/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "0.2.2",
5
+ "version": "1.0.0",
6
6
  "main": "./nuxt.config.ts",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
7
  "scripts": {
11
8
  "dev": "nuxi dev .playground",
12
9
  "dev:prepare": "nuxt prepare .playground",
@@ -18,6 +18,7 @@ declare type TFeedback = {
18
18
  highPriority?: boolean;
19
19
  serviceProvider?: string;
20
20
  assignee?: string;
21
+ createdBy?: string;
21
22
  };
22
23
 
23
24
  declare type TFeedbackMetadata = {
@@ -43,6 +44,7 @@ declare type TFeedbackCreate = Pick<
43
44
  | "assignee"
44
45
  | "organization"
45
46
  | "site"
47
+ | "createdBy"
46
48
  >;
47
49
 
48
50
  declare type TFeedbackUpdate = Pick<
package/types/site.d.ts CHANGED
@@ -3,6 +3,7 @@ declare type TSite = {
3
3
  name: string;
4
4
  description: string;
5
5
  orgId: string;
6
+ blocks?: number;
6
7
  customerOrgId: string;
7
8
  customerSiteId: string;
8
9
  createdAt?: string;