@7365admin1/layer-common 4.118.5 → 4.118.6

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.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 16e1cd2: Incident report PDF: the Incident Information block is a real table whose heading row repeats on every page, so each page starts with a closed top edge and nothing is painted in the page margin.
8
+
3
9
  ## 4.118.5
4
10
 
5
11
  ### Patch Changes
@@ -3157,11 +3163,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3157
3163
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3158
3164
  own rule from two endpoints the console already calls, unprojected:
3159
3165
 
3160
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3161
- GET /api/roles/id/:role that membership's role document
3166
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3167
+ GET /api/roles/id/:role that membership's role document
3162
3168
 
3163
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3164
- staff = member.type === "admin" && role.type === "admin"
3169
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3170
+ staff = member.type === "admin" && role.type === "admin"
3165
3171
 
3166
3172
  `role.default` is the marker because it is the only property of a platform
3167
3173
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -10,156 +10,188 @@
10
10
  Reported by: {{ companyName }}
11
11
  </p>
12
12
  </div>
13
- <v-row no-gutters class="ir-box mt-5">
14
- <p class="ir-section w-100 text-h6 pa-2 text-center bg-warning text-on-warning">
15
- Incident Information
16
- </p>
17
-
18
- <v-col cols="6" class="pa-3 ir-cell ir-e">
19
- <p class="font-weight-bold">Site</p>
20
- <p>{{ siteName || "-" }}</p>
21
- </v-col>
22
- <v-col cols="6" class="pa-3 ir-cell">
23
- <p class="font-weight-bold">Reference</p>
24
- <p>{{ incidentInformation?.siteInfo?.irNumber || "-" }}</p>
25
- </v-col>
26
-
27
- <v-col v-if="companyName" cols="12" class="pa-3 ir-cell">
28
- <p class="font-weight-bold">Reported by (Company)</p>
29
- <p>{{ companyName }}</p>
30
- </v-col>
31
-
32
- <v-col cols="6" class="pa-3 ir-cell ir-e">
33
- <p class="font-weight-bold">Place of Incident</p>
34
- <p>
35
- {{ incidentInformation?.placeOfIncident?.incidentLocation || "-" }}
36
- </p>
37
- </v-col>
38
- <v-col cols="6" class="pa-3 ir-cell">
39
- <p class="font-weight-bold">Type of Incident</p>
40
- <p>
41
- {{ incidentInformation?.incidentTypeAndTime?.typeOfIncident || "-" }}
42
- </p>
43
- </v-col>
44
-
45
- <v-col cols="6" class="pa-3 ir-cell ir-e">
46
- <p class="font-weight-bold">Date of Incident</p>
47
- <p>
48
- {{
49
- toLocalDate(
50
- incidentInformation?.incidentTypeAndTime?.dateOfIncident
51
- ) || "NA"
52
- }}
53
- </p>
54
- </v-col>
55
- <v-col cols="6" class="pa-3 ir-cell">
56
- <p class="font-weight-bold">Incident Start Time</p>
57
- <p>
58
- {{ incidentInformation?.incidentTypeAndTime?.incidentStart || "-" }}
59
- </p>
60
- </v-col>
61
-
62
- <v-col cols="6" class="pa-3 ir-cell ir-e">
63
- <p class="font-weight-bold">Time of Response (From 1st Contact)</p>
64
- <p>
65
- {{ incidentInformation?.incidentTypeAndTime?.timeOfResponse || "-" }}
66
- </p>
67
- </v-col>
68
- <v-col cols="6" class="pa-3 ir-cell">
69
- <p class="font-weight-bold">Incident End Time</p>
70
- <p>
71
- {{ incidentInformation?.incidentTypeAndTime?.incidentEnd || "-" }}
72
- </p>
73
- </v-col>
74
-
75
- <v-col cols="6" class="pa-3 ir-cell ir-e">
76
- <p class="font-weight-bold">Date of Report Submission</p>
77
- <p>
78
- {{
79
- toLocalDate(incidentInformation?.submissionForm?.dateOfReport) ||
80
- "NA"
81
- }}
82
- </p>
83
- </v-col>
84
- <v-col cols="6" class="pa-3 ir-cell">
85
- <p class="font-weight-bold">Time of Report Submission</p>
86
- <p>{{ incidentInformation?.submissionForm?.time || "-" }}</p>
87
- </v-col>
88
-
89
- <v-col cols="6" class="pa-3 ir-cell ir-e">
90
- <p class="font-weight-bold">Report Submitted By</p>
91
- <p>{{ incidentInformation?.siteInfo?.submittedBy || "-" }}</p>
92
- </v-col>
93
- <v-col cols="6" class="pa-3 ir-cell">
94
- <p class="font-weight-bold">Designation</p>
95
- <p>{{ incidentInformation?.siteInfo?.designation || "-" }}</p>
96
- </v-col>
97
-
98
- <v-col cols="4" class="pa-3 ir-cell ir-e">
99
- <p class="font-weight-bold">Name of Informant/Complainant</p>
100
- <p>{{ incidentInformation?.complaintInfo?.complainant || "-" }}</p>
101
- </v-col>
102
- <v-col cols="4" class="pa-3 ir-cell ir-e">
103
- <p class="font-weight-bold">Contact No.</p>
104
- <p>{{ incidentInformation?.complaintInfo?.contact || "-" }}</p>
105
- </v-col>
106
- <v-col cols="4" class="pa-3 ir-cell">
107
- <p class="font-weight-bold">NRIC/WP No.</p>
108
- <p>
109
- {{
110
- showNRICComplainant
111
- ? incidentInformation?.complaintInfo?.nric || "-"
112
- : maskNRIC(incidentInformation?.complaintInfo?.nric)
113
- }}
114
- </p>
115
- </v-col>
116
-
117
- <v-col cols="4" class="pa-3 ir-cell ir-e">
118
- <p class="font-weight-bold">
119
- Name of Recipient of Complaint (1st Contact)
120
- </p>
121
- <p>{{ incidentInformation?.recipientOfComplaint?.recipient || "-" }}</p>
122
- </v-col>
123
- <v-col cols="4" class="pa-3 ir-cell ir-e">
124
- <p class="font-weight-bold">Contact No.</p>
125
- <p>{{ incidentInformation?.recipientOfComplaint?.contact || "-" }}</p>
126
- </v-col>
127
- <v-col cols="4" class="pa-3 ir-cell">
128
- <p class="font-weight-bold">NRIC/WP No.</p>
129
- <p>
130
- {{
131
- showNRICRecipient
132
- ? incidentInformation?.recipientOfComplaint?.nric || "-"
133
- : maskNRIC(incidentInformation?.recipientOfComplaint?.nric)
134
- }}
135
- </p>
136
- </v-col>
137
-
138
- <v-col cols="12" class="pa-3 ir-cell">
139
- <p class="font-weight-bold">Complaint Received through</p>
140
- <p
141
- v-if="
13
+ <table class="ir-table mt-5">
14
+ <colgroup>
15
+ <col style="width: 8.3333%" />
16
+ <col style="width: 8.3333%" />
17
+ <col style="width: 8.3333%" />
18
+ <col style="width: 8.3333%" />
19
+ <col style="width: 8.3333%" />
20
+ <col style="width: 8.3333%" />
21
+ <col style="width: 8.3333%" />
22
+ <col style="width: 8.3333%" />
23
+ <col style="width: 8.3333%" />
24
+ <col style="width: 8.3333%" />
25
+ <col style="width: 8.3333%" />
26
+ <col style="width: 8.3333%" />
27
+ </colgroup>
28
+ <thead>
29
+ <tr>
30
+ <th colspan="12" class="ir-section text-h6 pa-2 text-center bg-warning text-on-warning">Incident Information</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ <tr>
35
+ <td colspan="6" class="pa-3 ir-cell">
36
+ <p class="font-weight-bold">Site</p>
37
+ <p>{{ siteName || "-" }}</p>
38
+ </td>
39
+ <td colspan="6" class="pa-3 ir-cell">
40
+ <p class="font-weight-bold">Reference</p>
41
+ <p>{{ incidentInformation?.siteInfo?.irNumber || "-" }}</p>
42
+ </td>
43
+ </tr>
44
+ <tr v-if="companyName">
45
+ <td colspan="12" class="pa-3 ir-cell">
46
+ <p class="font-weight-bold">Reported by (Company)</p>
47
+ <p>{{ companyName }}</p>
48
+ </td>
49
+ </tr>
50
+ <tr>
51
+ <td colspan="6" class="pa-3 ir-cell">
52
+ <p class="font-weight-bold">Place of Incident</p>
53
+ <p>
54
+ {{ incidentInformation?.placeOfIncident?.incidentLocation || "-" }}
55
+ </p>
56
+ </td>
57
+ <td colspan="6" class="pa-3 ir-cell">
58
+ <p class="font-weight-bold">Type of Incident</p>
59
+ <p>
60
+ {{ incidentInformation?.incidentTypeAndTime?.typeOfIncident || "-" }}
61
+ </p>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td colspan="6" class="pa-3 ir-cell">
66
+ <p class="font-weight-bold">Date of Incident</p>
67
+ <p>
68
+ {{
69
+ toLocalDate(
70
+ incidentInformation?.incidentTypeAndTime?.dateOfIncident
71
+ ) || "NA"
72
+ }}
73
+ </p>
74
+ </td>
75
+ <td colspan="6" class="pa-3 ir-cell">
76
+ <p class="font-weight-bold">Incident Start Time</p>
77
+ <p>
78
+ {{ incidentInformation?.incidentTypeAndTime?.incidentStart || "-" }}
79
+ </p>
80
+ </td>
81
+ </tr>
82
+ <tr>
83
+ <td colspan="6" class="pa-3 ir-cell">
84
+ <p class="font-weight-bold">Time of Response (From 1st Contact)</p>
85
+ <p>
86
+ {{ incidentInformation?.incidentTypeAndTime?.timeOfResponse || "-" }}
87
+ </p>
88
+ </td>
89
+ <td colspan="6" class="pa-3 ir-cell">
90
+ <p class="font-weight-bold">Incident End Time</p>
91
+ <p>
92
+ {{ incidentInformation?.incidentTypeAndTime?.incidentEnd || "-" }}
93
+ </p>
94
+ </td>
95
+ </tr>
96
+ <tr>
97
+ <td colspan="6" class="pa-3 ir-cell">
98
+ <p class="font-weight-bold">Date of Report Submission</p>
99
+ <p>
100
+ {{
101
+ toLocalDate(incidentInformation?.submissionForm?.dateOfReport) ||
102
+ "NA"
103
+ }}
104
+ </p>
105
+ </td>
106
+ <td colspan="6" class="pa-3 ir-cell">
107
+ <p class="font-weight-bold">Time of Report Submission</p>
108
+ <p>{{ incidentInformation?.submissionForm?.time || "-" }}</p>
109
+ </td>
110
+ </tr>
111
+ <tr>
112
+ <td colspan="6" class="pa-3 ir-cell">
113
+ <p class="font-weight-bold">Report Submitted By</p>
114
+ <p>{{ incidentInformation?.siteInfo?.submittedBy || "-" }}</p>
115
+ </td>
116
+ <td colspan="6" class="pa-3 ir-cell">
117
+ <p class="font-weight-bold">Designation</p>
118
+ <p>{{ incidentInformation?.siteInfo?.designation || "-" }}</p>
119
+ </td>
120
+ </tr>
121
+ <tr>
122
+ <td colspan="4" class="pa-3 ir-cell">
123
+ <p class="font-weight-bold">Name of Informant/Complainant</p>
124
+ <p>{{ incidentInformation?.complaintInfo?.complainant || "-" }}</p>
125
+ </td>
126
+ <td colspan="4" class="pa-3 ir-cell">
127
+ <p class="font-weight-bold">Contact No.</p>
128
+ <p>{{ incidentInformation?.complaintInfo?.contact || "-" }}</p>
129
+ </td>
130
+ <td colspan="4" class="pa-3 ir-cell">
131
+ <p class="font-weight-bold">NRIC/WP No.</p>
132
+ <p>
133
+ {{
134
+ showNRICComplainant
135
+ ? incidentInformation?.complaintInfo?.nric || "-"
136
+ : maskNRIC(incidentInformation?.complaintInfo?.nric)
137
+ }}
138
+ </p>
139
+ </td>
140
+ </tr>
141
+ <tr>
142
+ <td colspan="4" class="pa-3 ir-cell">
143
+ <p class="font-weight-bold">
144
+ Name of Recipient of Complaint (1st Contact)
145
+ </p>
146
+ <p>{{ incidentInformation?.recipientOfComplaint?.recipient || "-" }}</p>
147
+ </td>
148
+ <td colspan="4" class="pa-3 ir-cell">
149
+ <p class="font-weight-bold">Contact No.</p>
150
+ <p>{{ incidentInformation?.recipientOfComplaint?.contact || "-" }}</p>
151
+ </td>
152
+ <td colspan="4" class="pa-3 ir-cell">
153
+ <p class="font-weight-bold">NRIC/WP No.</p>
154
+ <p>
155
+ {{
156
+ showNRICRecipient
157
+ ? incidentInformation?.recipientOfComplaint?.nric || "-"
158
+ : maskNRIC(incidentInformation?.recipientOfComplaint?.nric)
159
+ }}
160
+ </p>
161
+ </td>
162
+ </tr>
163
+ <tr v-if="
142
164
  incidentInformation?.complaintReceivedTo?.receivedVia != 'others'
143
- "
144
- >
145
- {{ incidentInformation?.complaintReceivedTo?.receivedVia || "-" }}
146
- </p>
165
+ ">
166
+ <td colspan="12" class="pa-3 ir-cell">
167
+ <p class="font-weight-bold">Complaint Received through</p>
168
+ <p
169
+ v-if="
170
+ incidentInformation?.complaintReceivedTo?.receivedVia != 'others'
171
+ "
172
+ >
173
+ {{ incidentInformation?.complaintReceivedTo?.receivedVia || "-" }}
174
+ </p>
147
175
 
148
- <p v-else>
149
- {{
150
- incidentInformation?.complaintReceivedTo?.otherDescription || "-"
151
- }}
152
- </p>
153
- </v-col>
154
- <v-col cols="12" class="pa-3 ir-cell ir-last">
155
- <p class="font-weight-bold">Brief Description</p>
156
- <p>
157
- {{
158
- incidentInformation?.complaintReceivedTo?.briefDescription || "-"
159
- }}
160
- </p>
161
- </v-col>
162
- </v-row>
176
+ <p v-else>
177
+ {{
178
+ incidentInformation?.complaintReceivedTo?.otherDescription || "-"
179
+ }}
180
+ </p>
181
+ </td>
182
+ </tr>
183
+ <tr>
184
+ <td colspan="12" class="pa-3 ir-cell">
185
+ <p class="font-weight-bold">Brief Description</p>
186
+ <p>
187
+ {{
188
+ incidentInformation?.complaintReceivedTo?.briefDescription || "-"
189
+ }}
190
+ </p>
191
+ </td>
192
+ </tr>
193
+ </tbody>
194
+ </table>
163
195
  </div>
164
196
  </template>
165
197
 
@@ -270,18 +302,24 @@ const maskNRIC = (value: any) => {
270
302
  }
271
303
  .ir-status--approved { color: #2e7d32; }
272
304
  .ir-status--rejected { color: #c62828; }
273
- /* No outer wrapper border: every field cell draws its own left/bottom edge (and
274
- right edge when it ends a row), so a page break leaves each box closed. */
275
- .ir-cell {
276
- /* Top AND bottom, so a cell that starts a page is closed above as well. */
277
- border-left: 1px solid #8a8a8a;
278
- border-top: 1px solid #8a8a8a;
279
- border-bottom: 1px solid #8a8a8a;
305
+ /* One table: borders collapse into single 1px rules. The heading row is the table
306
+ header, so it repeats at the top of every page and every page starts with a
307
+ closed top edge; rows never split. */
308
+ .ir-table {
309
+ width: 100%;
310
+ table-layout: fixed;
311
+ border-collapse: collapse;
312
+ }
313
+ .ir-table thead {
314
+ display: table-header-group;
315
+ }
316
+ .ir-table tr {
280
317
  break-inside: avoid;
281
318
  page-break-inside: avoid;
282
319
  }
283
- .ir-cell:not(.ir-e) {
284
- border-right: 1px solid #8a8a8a;
320
+ .ir-cell {
321
+ border: 1px solid #8a8a8a;
322
+ vertical-align: top;
285
323
  }
286
324
  /* A label always travels with its value. */
287
325
  .ir-cell p:first-child {
@@ -289,8 +327,7 @@ const maskNRIC = (value: any) => {
289
327
  page-break-after: avoid;
290
328
  }
291
329
  .ir-section {
292
- break-after: avoid;
293
330
  border: 1px solid #8a8a8a;
294
- border-bottom: 0;
331
+ font-weight: 400;
295
332
  }
296
333
  </style>
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",
5
+ "version": "4.118.6",
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.",