@7365admin1/layer-common 4.118.2 → 4.118.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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 4.118.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 90727b3: Incident report PDF: a field label stays with its value across a page break. Incident report dialog: shows "Reported by" (the report's organisation) when given `organizationId`.
|
|
8
|
+
|
|
3
9
|
## 4.118.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -3139,11 +3145,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
|
|
|
3139
3145
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
3140
3146
|
own rule from two endpoints the console already calls, unprojected:
|
|
3141
3147
|
|
|
3142
|
-
|
|
3143
|
-
|
|
3148
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
3149
|
+
GET /api/roles/id/:role that membership's role document
|
|
3144
3150
|
|
|
3145
|
-
|
|
3146
|
-
|
|
3151
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
3152
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
3147
3153
|
|
|
3148
3154
|
`role.default` is the marker because it is the only property of a platform
|
|
3149
3155
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
{{ incidentInformation?.siteInfo?.designation || "NA" }}
|
|
32
32
|
</p>
|
|
33
33
|
</v-col>
|
|
34
|
+
<v-col v-if="companyName" cols="12" sm="6" md="3">
|
|
35
|
+
<InputLabel class="text-capitalize" title="Reported by" />
|
|
36
|
+
<p class="my-1 text-h6">{{ companyName }}</p>
|
|
37
|
+
</v-col>
|
|
34
38
|
</v-row>
|
|
35
39
|
</v-col>
|
|
36
40
|
|
|
@@ -256,8 +260,15 @@ const props = defineProps({
|
|
|
256
260
|
type: Object as PropType<Record<string, any> | null>,
|
|
257
261
|
required: true,
|
|
258
262
|
},
|
|
263
|
+
// The report's `organization` id: the company that filed it.
|
|
264
|
+
organizationId: {
|
|
265
|
+
type: String,
|
|
266
|
+
default: "",
|
|
267
|
+
},
|
|
259
268
|
});
|
|
260
269
|
|
|
270
|
+
const companyName = useIncidentCompany(() => props.organizationId);
|
|
271
|
+
|
|
261
272
|
const emit = defineEmits(["showNRICComplainant", "showNRICRecipient"]);
|
|
262
273
|
|
|
263
274
|
// utilities
|
|
@@ -183,21 +183,7 @@ const props = defineProps({
|
|
|
183
183
|
},
|
|
184
184
|
});
|
|
185
185
|
|
|
186
|
-
const
|
|
187
|
-
const companyName = ref("");
|
|
188
|
-
watch(
|
|
189
|
-
() => props.organizationId,
|
|
190
|
-
async (id) => {
|
|
191
|
-
companyName.value = "";
|
|
192
|
-
if (!id) return;
|
|
193
|
-
try {
|
|
194
|
-
companyName.value = incidentCompanyName(await getOrgById(id));
|
|
195
|
-
} catch {
|
|
196
|
-
// Not readable by this viewer: print nothing rather than a wrong name.
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
{ immediate: true }
|
|
200
|
-
);
|
|
186
|
+
const companyName = useIncidentCompany(() => props.organizationId);
|
|
201
187
|
|
|
202
188
|
const statusKey = computed(() => String(props.status || "").toLowerCase());
|
|
203
189
|
|
|
@@ -297,12 +283,11 @@ const maskNRIC = (value: any) => {
|
|
|
297
283
|
}
|
|
298
284
|
.ir-last {
|
|
299
285
|
border-bottom: 0;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
widows: 3;
|
|
286
|
+
}
|
|
287
|
+
/* A label always travels with its value. */
|
|
288
|
+
.ir-cell p:first-child {
|
|
289
|
+
break-after: avoid;
|
|
290
|
+
page-break-after: avoid;
|
|
306
291
|
}
|
|
307
292
|
.ir-section {
|
|
308
293
|
break-after: avoid;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// "Reported by" company for an incident report: the report's `organization`
|
|
2
|
+
// id looked up through the existing org endpoint. Blank when unreadable.
|
|
3
|
+
export function useIncidentCompany(getId: () => string | undefined) {
|
|
4
|
+
const { getById: getOrgById } = useOrg();
|
|
5
|
+
const companyName = ref("");
|
|
6
|
+
watch(
|
|
7
|
+
getId,
|
|
8
|
+
async (id) => {
|
|
9
|
+
companyName.value = "";
|
|
10
|
+
if (!id) return;
|
|
11
|
+
try {
|
|
12
|
+
companyName.value = incidentCompanyName(await getOrgById(id));
|
|
13
|
+
} catch {
|
|
14
|
+
// Not readable by this viewer: show nothing rather than a wrong name.
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{ immediate: true }
|
|
18
|
+
);
|
|
19
|
+
return companyName;
|
|
20
|
+
}
|
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.118.
|
|
5
|
+
"version": "4.118.3",
|
|
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.",
|