@7365admin1/layer-common 4.1.2-staging.247 → 4.1.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,22 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 89deaab: Check the permission the estate stores for the Bulletin Board gates
8
+
9
+ `useBulletinBoardPermission` asked for `bulletin-board:<action>`, a resource held
10
+ by 8-9 of the 428 roles in the live catalogue, while the same five actions under
11
+ `bulletin-board-mgmt:` are held by 80-82. `-hygiene`, `-security` and
12
+ `-pest-control` leave `canViewBulletinBoardDetails` unbound, so this composable
13
+ gates their sidebar-linked bulletin board page and ~74 roles that hold the right
14
+ were refused it.
15
+
16
+ Both resources are now accepted, and the list gate also accepts the singular
17
+ `see-all-bulletin-board` action that 80 roles store. No key is renamed, nothing
18
+ is granted and no role document changes.
19
+
3
20
  ## 4.1.1
4
21
 
5
22
  ### Patch Changes
@@ -313,11 +330,11 @@
313
330
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
314
331
  own rule from two endpoints the console already calls, unprojected:
315
332
 
316
- GET /api/members/user/:user/app/admin the Seven365 staff membership
317
- GET /api/roles/id/:role that membership's role document
333
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
334
+ GET /api/roles/id/:role that membership's role document
318
335
 
319
- owner = member.type === "admin" && role.type === "admin" && role.default === true
320
- staff = member.type === "admin" && role.type === "admin"
336
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
337
+ staff = member.type === "admin" && role.type === "admin"
321
338
 
322
339
  `role.default` is the marker because it is the only property of a platform
323
340
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -35,15 +35,9 @@ const dateFormattedReadOnly = ref<string | null>(null)
35
35
 
36
36
  const dateInput = ref<HTMLInputElement | null>(null)
37
37
  const datePickerRef = ref<HTMLInputElement | null>(null)
38
- let nativeInput: HTMLInputElement | null = null
39
38
 
40
39
  const isInitialLoad = ref(true)
41
40
 
42
- function handleNativeInputClick(e: MouseEvent) {
43
- e.stopPropagation()
44
- openDatePicker()
45
- }
46
-
47
41
  function clearDate() {
48
42
  date.value = null
49
43
  dateFormattedReadOnly.value = null
@@ -94,17 +88,15 @@ watch(date, () => {
94
88
  onMounted(async () => {
95
89
  await nextTick()
96
90
  isInitialLoad.value = false
97
- nativeInput = (datePickerRef.value as any)?.$el?.querySelector('input')
91
+ const nativeInput = (datePickerRef.value as any)?.$el?.querySelector('input')
98
92
  if (nativeInput) {
99
- nativeInput.addEventListener('click', handleNativeInputClick)
93
+ nativeInput.addEventListener('click', (e: MouseEvent) => {
94
+ e.stopPropagation()
95
+ openDatePicker()
96
+ })
100
97
  }
101
98
  })
102
99
 
103
- onBeforeUnmount(() => {
104
- nativeInput?.removeEventListener('click', handleNativeInputClick)
105
- nativeInput = null
106
- })
107
-
108
100
  defineExpose({
109
101
  validate
110
102
  })
@@ -70,15 +70,9 @@ const inputPlaceholder = computed(
70
70
 
71
71
  const dateInput = ref<HTMLInputElement | null>(null);
72
72
  const dateTimePickerRef = ref<HTMLInputElement | null>(null);
73
- let nativeInput: HTMLInputElement | null = null;
74
73
 
75
74
  const isInitialLoad = ref(true);
76
75
 
77
- function handleNativeInputClick(e: MouseEvent) {
78
- e.stopPropagation();
79
- openDatePicker();
80
- }
81
-
82
76
  function openDatePicker() {
83
77
  setTimeout(() => {
84
78
  dateInput.value?.showPicker?.();
@@ -183,19 +177,17 @@ onMounted(async () => {
183
177
  await nextTick();
184
178
  isInitialLoad.value = false;
185
179
  // Wait until Vuetify renders its internal input
186
- nativeInput = (dateTimePickerRef.value as any)?.$el?.querySelector(
180
+ const nativeInput = (dateTimePickerRef.value as any)?.$el?.querySelector(
187
181
  "input"
188
182
  );
189
183
  if (nativeInput) {
190
- nativeInput.addEventListener("click", handleNativeInputClick);
184
+ nativeInput.addEventListener("click", (e: MouseEvent) => {
185
+ e.stopPropagation();
186
+ openDatePicker();
187
+ });
191
188
  }
192
189
  });
193
190
 
194
- onBeforeUnmount(() => {
195
- nativeInput?.removeEventListener("click", handleNativeInputClick);
196
- nativeInput = null;
197
- });
198
-
199
191
  defineExpose({
200
192
  validate,
201
193
  });
@@ -1758,14 +1758,9 @@ function closeApproveRejectVisitorDialog() {
1758
1758
  async function updateVisitorApprovalStatus() {
1759
1759
  isApprovingRejectingVisitor.value = true;
1760
1760
  try {
1761
- const approval = {
1762
- approvedBy: currentUser.value?._id,
1761
+ await updateVisitor(selectedVisitorForApproval.value._id, {
1763
1762
  status: approveRejectVisitorDialog.value.status,
1764
1763
  remarks: visitorApproveRejectRemarks.value,
1765
- approvedAt: new Date(),
1766
- };
1767
- await updateVisitor(selectedVisitorForApproval.value._id, {
1768
- approval,
1769
1764
  updatedBy: currentUser.value?._id,
1770
1765
  } as any);
1771
1766
  showMessage(
@@ -1896,9 +1891,7 @@ const {
1896
1891
  // A self-service submission awaiting Approve/Reject (Self-Service
1897
1892
  // Auto-Approvals off) lands here as "pending" alongside already
1898
1893
  // "approved" guests, rather than being hidden until someone acts on it.
1899
- // "rejected" is included too, so a rejected submission stays visible
1900
- // on this tab instead of disappearing once acted on.
1901
- params.status = "approved,pending,rejected";
1894
+ params.status = "approved,pending";
1902
1895
  } else if (activeTab.value === "resident-transactions") {
1903
1896
  params.status = "registered";
1904
1897
  params.type = "resident,tenant";
@@ -2436,7 +2429,7 @@ function buildReportParams(): any {
2436
2429
  // report generated from this tab would silently omit contractors and
2437
2430
  // pending rows the screen is actually showing.
2438
2431
  params.type = "guest,contractor";
2439
- params.status = "approved,pending,rejected";
2432
+ params.status = "approved,pending";
2440
2433
  } else if (activeTab.value === "resident-transactions") {
2441
2434
  params.status = "registered";
2442
2435
  params.type = "resident,tenant";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.1.2-staging.247",
5
+ "version": "4.1.2",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",