@7365admin1/layer-common 4.101.0 → 4.103.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,17 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.103.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2ca1c40: Online forms review screen: read-only answers stay legible (readonly instead of greyed disabled); a short how-to line; "Request resubmission" and remarks labels that match iMA365 and say the resident sees them; Confirm reads Confirm approval / Confirm rejection / Send back to resident; the page can clear the Confirm spinner when a save fails.
8
+
9
+ ## 4.102.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 77be2c0: Change site owner: the button shows for Seven365 staff only; the new-owner list is searchable and shows each company's type; no "invite first" step.
14
+
3
15
  ## 4.101.0
4
16
 
5
17
  ### Minor Changes
@@ -107,7 +107,7 @@
107
107
  v-if="field.fieldType === 'text'"
108
108
  v-model="values[field.key]"
109
109
  density="comfortable"
110
- :disabled="readonly"
110
+ :readonly="readonly"
111
111
  :rules="!readonly && field.required ? [requiredRule] : []"
112
112
  />
113
113
  <v-text-field
@@ -115,7 +115,7 @@
115
115
  v-model.number="values[field.key]"
116
116
  type="number"
117
117
  density="comfortable"
118
- :disabled="readonly"
118
+ :readonly="readonly"
119
119
  :rules="!readonly && field.required ? [requiredRule] : []"
120
120
  />
121
121
  <v-text-field
@@ -123,7 +123,7 @@
123
123
  v-model="values[field.key]"
124
124
  type="date"
125
125
  density="comfortable"
126
- :disabled="readonly"
126
+ :readonly="readonly"
127
127
  :rules="!readonly && field.required ? [requiredRule] : []"
128
128
  />
129
129
  <v-select
@@ -131,7 +131,7 @@
131
131
  v-model="values[field.key]"
132
132
  :items="field.options || []"
133
133
  density="comfortable"
134
- :disabled="readonly"
134
+ :readonly="readonly"
135
135
  :rules="!readonly && field.required ? [requiredRule] : []"
136
136
  />
137
137
  <v-textarea
@@ -140,7 +140,7 @@
140
140
  density="comfortable"
141
141
  rows="3"
142
142
  auto-grow
143
- :disabled="readonly"
143
+ :readonly="readonly"
144
144
  :rules="!readonly && field.required ? [requiredRule] : []"
145
145
  />
146
146
  </v-col>
@@ -153,7 +153,7 @@
153
153
  v-if="block.field.fieldType === 'text'"
154
154
  v-model="values[block.field.key]"
155
155
  density="comfortable"
156
- :disabled="readonly"
156
+ :readonly="readonly"
157
157
  :rules="!readonly && block.field.required ? [requiredRule] : []"
158
158
  />
159
159
  <v-text-field
@@ -161,7 +161,7 @@
161
161
  v-model.number="values[block.field.key]"
162
162
  type="number"
163
163
  density="comfortable"
164
- :disabled="readonly"
164
+ :readonly="readonly"
165
165
  :rules="!readonly && block.field.required ? [requiredRule] : []"
166
166
  />
167
167
  <v-text-field
@@ -169,7 +169,7 @@
169
169
  v-model="values[block.field.key]"
170
170
  type="date"
171
171
  density="comfortable"
172
- :disabled="readonly"
172
+ :readonly="readonly"
173
173
  :rules="!readonly && block.field.required ? [requiredRule] : []"
174
174
  />
175
175
  <v-select
@@ -177,7 +177,7 @@
177
177
  v-model="values[block.field.key]"
178
178
  :items="block.field.options || []"
179
179
  density="comfortable"
180
- :disabled="readonly"
180
+ :readonly="readonly"
181
181
  :rules="!readonly && block.field.required ? [requiredRule] : []"
182
182
  />
183
183
  <v-textarea
@@ -186,7 +186,7 @@
186
186
  density="comfortable"
187
187
  rows="3"
188
188
  auto-grow
189
- :disabled="readonly"
189
+ :readonly="readonly"
190
190
  :rules="!readonly && block.field.required ? [requiredRule] : []"
191
191
  />
192
192
  </div>
@@ -227,7 +227,7 @@
227
227
  density="compact"
228
228
  hide-details
229
229
  class="mt-0 pt-0 flex-shrink-0"
230
- :disabled="readonly"
230
+ :readonly="readonly"
231
231
  />
232
232
  <div class="flex-grow-1">
233
233
  <span class="text-body-2" style="line-height: 1.4">{{ item.label }}</span>
@@ -392,14 +392,17 @@
392
392
  v-if="readonly && approvalMode"
393
393
  class="online-form-fill__approve"
394
394
  >
395
+ <p class="text-caption text-medium-emphasis mb-2" data-test="online-form-review-hint">
396
+ {{ reviewHint }}
397
+ </p>
395
398
  <v-text-field
396
399
  v-model="adminRemarks"
397
- label="Remarks"
400
+ :label="remarksLabel"
398
401
  density="compact"
399
402
  variant="outlined"
400
403
  :hide-details="adminRemarks.trim().length > 0"
401
404
  :error="remarksRequired && adminRemarks.trim().length === 0"
402
- :error-messages="remarksRequired && adminRemarks.trim().length === 0 ? 'Remarks are required' : ''"
405
+ :error-messages="remarksRequired && adminRemarks.trim().length === 0 ? 'Please add remarks - the resident sees them' : ''"
403
406
  />
404
407
  <!-- The three verdicts keep their colour coding - it is what tells them
405
408
  apart - but on the theme's own status colours rather than fixed
@@ -413,7 +416,7 @@
413
416
  color="warning"
414
417
  class="text-none"
415
418
  @click="selectAction('resubmission')"
416
- >Resubmit</v-btn>
419
+ >Request resubmission</v-btn>
417
420
  <v-btn
418
421
  :variant="selectedAction === 'rejected' ? 'flat' : 'tonal'"
419
422
  color="error"
@@ -433,7 +436,7 @@
433
436
  :disabled="!canConfirm"
434
437
  :loading="updatingStatus"
435
438
  @click="confirmStatusUpdate"
436
- >Confirm</v-btn>
439
+ >{{ confirmLabel }}</v-btn>
437
440
  </div>
438
441
  </div>
439
442
 
@@ -592,6 +595,20 @@ watch(() => props.initialManagementValues, (saved) => {
592
595
 
593
596
  const remarksRequired = computed(() => !!selectedAction.value);
594
597
 
598
+ // Same wording as the iMA365 review screen, so office and phone read alike.
599
+ const REVIEW_TEXT: Record<string, { remarks: string; confirm: string }> = {
600
+ approved: { remarks: "Remarks (the resident sees this)", confirm: "Confirm approval" },
601
+ rejected: { remarks: "Reason for rejection (the resident sees this)", confirm: "Confirm rejection" },
602
+ resubmission: { remarks: "Reason for resubmission (the resident sees this)", confirm: "Send back to resident" },
603
+ };
604
+ const remarksLabel = computed(() => REVIEW_TEXT[selectedAction.value]?.remarks ?? "Remarks (the resident sees this)");
605
+ const confirmLabel = computed(() => REVIEW_TEXT[selectedAction.value]?.confirm ?? "Confirm");
606
+ const reviewHint = computed(() =>
607
+ selectedAction.value === "approved" && managementUseItems.value.length
608
+ ? "Fill in the For Management Use Only box and your remarks, then confirm."
609
+ : "Choose Approve, Request resubmission or Reject, add your remarks, then confirm.",
610
+ );
611
+
595
612
  const managementComplete = computed(() => {
596
613
  if (selectedAction.value !== "approved") return true;
597
614
  return managementUseItems.value.every(item => (managementValues.value[item] ?? "").trim().length > 0);
@@ -629,6 +646,8 @@ function confirmStatusUpdate() {
629
646
  status: selectedAction.value,
630
647
  remarks: adminRemarks.value,
631
648
  managementValues: managementValues.value,
649
+ // The page calls this when the save finished or failed, so Confirm never stays spinning.
650
+ done: () => (updatingStatus.value = false),
632
651
  });
633
652
  }
634
653
 
@@ -18,8 +18,8 @@
18
18
  <p class="spc-intro">
19
19
  <template v-if="kind === 'owner'">
20
20
  {{ siteName || "This site" }} moves to a new owner, who takes charge of all of its records.
21
- Every service provider at the site keeps working as it is. Only the new owner must already be working at the site
22
- (invite them first; Seven365 can pick any company).
21
+ Every service provider at the site keeps working as it is, and the new owner needs no invitation. Only Seven365
22
+ can do this.
23
23
  </template>
24
24
  <template v-else>
25
25
  Only {{ preview?.service || "this service" }} at {{ siteName || "this site" }} changes. Other services at the site,
@@ -28,7 +28,7 @@
28
28
  </p>
29
29
 
30
30
  <label class="spc-label" for="spc-to">{{ kind === "owner" ? "New owner" : "New company (optional)" }}</label>
31
- <v-select
31
+ <v-autocomplete
32
32
  id="spc-to"
33
33
  v-model="to"
34
34
  :items="toItems"
@@ -38,7 +38,7 @@
38
38
  variant="outlined"
39
39
  class="filter-field"
40
40
  :disabled="saving"
41
- :no-data-text="kind === 'owner' ? 'Invite the new owner to the site first.' : 'Invite the new company to the site first.'"
41
+ :no-data-text="kind === 'owner' ? 'No company found.' : 'Invite the new company to the site first.'"
42
42
  data-test="spc-to"
43
43
  @update:model-value="refresh"
44
44
  />
@@ -96,7 +96,7 @@
96
96
  Provider changes at {{ siteName || "this site" }}
97
97
  <v-spacer />
98
98
  <v-btn
99
- v-if="ownerOrgId"
99
+ v-if="ownerOrgId && isStaff"
100
100
  variant="outlined"
101
101
  class="screen-btn-ghost mr-2"
102
102
  data-test="spc-change-owner"
@@ -186,11 +186,24 @@ const snackText = ref("");
186
186
  const snackColor = ref("success");
187
187
 
188
188
  const tomorrow = computed(() => new Date(Date.now() + 864e5).toISOString().slice(0, 10));
189
- const replacements = ref<Array<{ org: string; name: string }>>([]);
189
+ const replacements = ref<Array<{ org: string; name: string; nature?: string }>>([]);
190
+ const OWNER_KIND: Record<string, string> = {
191
+ property_management_agency: "Property management",
192
+ real_estate_developer: "Developer",
193
+ property_owner: "Owner",
194
+ };
190
195
  const toItems = computed(() => [
191
196
  ...(kind.value === "provider" ? [{ title: "No new company yet - just end", value: null }] : []),
192
- ...replacements.value.map((r) => ({ title: r.name, value: r.org })),
197
+ ...replacements.value.map((r) => ({
198
+ title: kind.value === "owner" && OWNER_KIND[r.nature ?? ""] ? `${r.name} - ${OWNER_KIND[r.nature ?? ""]}` : r.name,
199
+ value: r.org,
200
+ })),
193
201
  ]);
202
+
203
+ // Changing the site's owner is Seven365's job only (owner, 2026-10-06): a
204
+ // property manager must never see which other property managers use the system.
205
+ const { isStaff, load: loadTier } = useConsoleTier();
206
+ onMounted(() => loadTier());
194
207
  const canConfirm = computed(
195
208
  () =>
196
209
  !loading.value &&
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.101.0",
5
+ "version": "4.103.0",
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.",