@7365admin1/layer-common 3.0.20 → 3.0.21

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.
@@ -19,7 +19,7 @@
19
19
 
20
20
  <v-toolbar class="pa-0" density="compact">
21
21
  <v-row no-gutters>
22
- <v-col cols="6" class="pa-0">
22
+ <v-col :cols="showMoreActions ? 6 : 12" class="pa-0">
23
23
  <v-btn
24
24
  block
25
25
  variant="text"
@@ -32,7 +32,7 @@
32
32
  </v-btn>
33
33
  </v-col>
34
34
 
35
- <v-col cols="6" class="pa-0">
35
+ <v-col v-if="showMoreActions" cols="6" class="pa-0">
36
36
  <v-menu>
37
37
  <template #activator="{ props }">
38
38
  <v-btn
@@ -204,6 +204,11 @@ const prop = defineProps({
204
204
  type: String,
205
205
  default: "Actions",
206
206
  },
207
+
208
+ showMoreActions: {
209
+ type: Boolean,
210
+ default: true,
211
+ },
207
212
  });
208
213
 
209
214
  const emit = defineEmits([
@@ -73,6 +73,9 @@
73
73
  <template #item.nature="{ item }">
74
74
  {{ replaceMatch(item.nature, "_", " ") }}
75
75
  </template>
76
+ <template #item.dateInvited="{ item }">
77
+ {{ formatDateInvited(item.dateInvited) }}
78
+ </template>
76
79
  <template #item.action-table="{ item }">
77
80
  <v-menu
78
81
  v-if="
@@ -289,19 +292,24 @@ const props = defineProps({
289
292
  value: "name",
290
293
  },
291
294
  {
292
- title: "Role",
295
+ title: "Email",
296
+
297
+ value: "email",
298
+ },
299
+ {
300
+ title: "Roles and Permission",
293
301
 
294
302
  value: "roleName",
295
303
  },
296
304
  {
297
- title: "Organization",
305
+ title: "Site Invited To",
298
306
 
299
- value: "orgName",
307
+ value: "siteName",
300
308
  },
301
309
  {
302
- title: "Status",
310
+ title: "Date",
303
311
 
304
- value: "status",
312
+ value: "dateInvited",
305
313
  },
306
314
  {
307
315
  title: "Action",
@@ -347,7 +355,7 @@ const normalizedRouteParams = computed(() => {
347
355
 
348
356
  const tabOptions = [
349
357
  { name: "Active", status: "active" },
350
- { name: "Suspended", status: "suspended" },
358
+ { name: "Inactive", status: "suspended" },
351
359
  ];
352
360
 
353
361
  function toRoute(status: any) {
@@ -477,6 +485,29 @@ function showMessage(msg: string, color: string) {
477
485
  messageSnackbar.value = true;
478
486
  }
479
487
 
488
+ function formatDateInvited(value?: string | null) {
489
+ if (!value) return "";
490
+
491
+ const date = new Date(value);
492
+ if (Number.isNaN(date.getTime())) return "";
493
+
494
+ const parts = new Intl.DateTimeFormat("en-US", {
495
+ month: "long",
496
+ day: "numeric",
497
+ year: "numeric",
498
+ hour: "2-digit",
499
+ minute: "2-digit",
500
+ hour12: true,
501
+ }).formatToParts(date);
502
+
503
+ const getPart = (type: Intl.DateTimeFormatPartTypes) =>
504
+ parts.find((part) => part.type === type)?.value ?? "";
505
+
506
+ return `${getPart("month")} ${getPart("day")}, ${getPart("year")} ${getPart(
507
+ "hour"
508
+ )}:${getPart("minute")}${getPart("dayPeriod").toUpperCase()}`;
509
+ }
510
+
480
511
  async function handleUpdateMemberStatus() {
481
512
  if (!selectedMemberId.value) return;
482
513
  updateLoading.value = true;
@@ -132,6 +132,25 @@ export default function useHidAmico() {
132
132
  });
133
133
  }
134
134
 
135
+ function getIntercomStatus(readerId: string) {
136
+ return useNuxtApp().$api<Record<string, any>>(`${basePath}/readers/${readerId}/intercom/status`, {
137
+ method: "GET",
138
+ });
139
+ }
140
+
141
+ function makeIntercomCall(readerId: string, target: string) {
142
+ return useNuxtApp().$api<Record<string, any>>(`${basePath}/readers/${readerId}/intercom/call`, {
143
+ method: "POST",
144
+ body: { target },
145
+ });
146
+ }
147
+
148
+ function finalizeIntercomCall(readerId: string) {
149
+ return useNuxtApp().$api<Record<string, any>>(`${basePath}/readers/${readerId}/intercom/hangup`, {
150
+ method: "POST",
151
+ });
152
+ }
153
+
135
154
  return {
136
155
  getReaders,
137
156
  createReader,
@@ -148,5 +167,8 @@ export default function useHidAmico() {
148
167
  createIdentity,
149
168
  updateIdentity,
150
169
  deleteIdentity,
170
+ getIntercomStatus,
171
+ makeIntercomCall,
172
+ finalizeIntercomCall,
151
173
  };
152
174
  }
@@ -34,6 +34,13 @@ export default function useHidNavigation() {
34
34
  params: { org, site },
35
35
  },
36
36
  },
37
+ {
38
+ title: "Intercom",
39
+ route: {
40
+ name: "org-site-access-mgmt-intercom",
41
+ params: { org, site },
42
+ },
43
+ },
37
44
  {
38
45
  title: "Identity Mapping",
39
46
  route: {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "3.0.20",
5
+ "version": "3.0.21",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "publishConfig": {
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <v-container fluid>
3
+ <HidEnabledGate
4
+ :site="siteId"
5
+ :org="orgId"
6
+ message="Enable HID as a service for this site before configuring HID intercom."
7
+ >
8
+ <HidIntercomManagement :site="siteId" />
9
+ </HidEnabledGate>
10
+ </v-container>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ definePageMeta({
15
+ layout: "default",
16
+ middleware: ["01-auth", "02-org"],
17
+ memberOnly: true,
18
+ });
19
+
20
+ const route = useRoute();
21
+
22
+ const orgId = computed(() => String(route.params.org || ""));
23
+ const siteId = computed(() => String(route.params.site || ""));
24
+ </script>