@7365admin1/layer-common 4.5.1-staging.301 → 4.7.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,37 +1,5 @@
1
1
  # @iservice365/layer-common
2
2
 
3
- ## 4.7.2
4
-
5
- ### Patch Changes
6
-
7
- - ce15a17: Require a photo before a checklist task can be completed.
8
-
9
- The Submit button in the completion dialog stays disabled until at least one
10
- photo is attached, and the uploader is marked required. It gates on the uploaded
11
- ids rather than previews, so a half-finished upload cannot slip through to a
12
- server that then refuses it.
13
-
14
- The reject dialog is deliberately not gated — a reject is somebody reporting a
15
- problem, and demanding a photograph first would stop them reporting it. The
16
- server scopes the rule the same way.
17
-
18
- ## 4.7.1
19
-
20
- ### Patch Changes
21
-
22
- - fcb2938: Fix the context switcher showing a tick against two sites at once.
23
-
24
- Not a comparison bug: `selected === item.value` was true for both rows because
25
- both rows were the same site. The seven service apps build this list from
26
- `customer-sites` with `value: i.site`, and a customer-sites row is an ENGAGEMENT,
27
- not a site — one site can carry more than one. Production has two active rows for
28
- the same site, identical except for a stale `name` snapshot.
29
-
30
- The switcher now offers each destination once. First occurrence wins, so the
31
- surviving label is the current one rather than the stale snapshot. Items with no
32
- `value` are kept — they cannot collide, and dropping them would hide a malformed
33
- row.
34
-
35
3
  ## 4.7.0
36
4
 
37
5
  ### Minor Changes
@@ -963,11 +931,11 @@
963
931
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
964
932
  own rule from two endpoints the console already calls, unprojected:
965
933
 
966
- GET /api/members/user/:user/app/admin the Seven365 staff membership
967
- GET /api/roles/id/:role that membership's role document
934
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
935
+ GET /api/roles/id/:role that membership's role document
968
936
 
969
- owner = member.type === "admin" && role.type === "admin" && role.default === true
970
- staff = member.type === "admin" && role.type === "admin"
937
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
938
+ staff = member.type === "admin" && role.type === "admin"
971
939
 
972
940
  `role.default` is the marker because it is the only property of a platform
973
941
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -170,63 +170,6 @@
170
170
  />
171
171
  </v-col>
172
172
  </v-row>
173
-
174
- <!-- The photos the technician took to complete the
175
- unit. The API has always returned these ids on the
176
- history record; nothing drew them, so the office
177
- had no way to see the proof of work. -->
178
- <v-row
179
- v-if="unit.attachment?.length"
180
- no-gutters
181
- class="pb-2"
182
- >
183
- <v-col cols="12">
184
- <div class="text-body-2 text-medium-emphasis mb-1">
185
- Attached Photos ({{ unit.attachment.length }})
186
- </div>
187
- <div class="d-flex flex-wrap ga-2">
188
- <v-img
189
- v-for="id in unit.attachment"
190
- :key="id"
191
- :src="getFileUrl(id)"
192
- width="72"
193
- height="72"
194
- cover
195
- rounded="lg"
196
- class="border-thin"
197
- style="cursor: zoom-in; flex: 0 0 auto"
198
- @click="openFullImage(getFileUrl(id))"
199
- >
200
- <template v-slot:placeholder>
201
- <v-row
202
- class="fill-height ma-0"
203
- align="center"
204
- justify="center"
205
- >
206
- <v-progress-circular
207
- indeterminate
208
- size="20"
209
- color="grey-lighten-4"
210
- />
211
- </v-row>
212
- </template>
213
- <template v-slot:error>
214
- <v-row
215
- class="fill-height ma-0"
216
- align="center"
217
- justify="center"
218
- >
219
- <v-icon
220
- icon="mdi-image-broken"
221
- size="24"
222
- color="grey"
223
- />
224
- </v-row>
225
- </template>
226
- </v-img>
227
- </div>
228
- </v-col>
229
- </v-row>
230
173
  </v-list-item>
231
174
 
232
175
  <v-divider
@@ -243,22 +186,6 @@
243
186
  </AppCard>
244
187
  </v-col>
245
188
  </v-row>
246
-
247
- <v-dialog v-model="showLightbox" max-width="900">
248
- <v-card class="screen-modal">
249
- <v-card-actions class="pa-2 justify-end">
250
- <v-btn
251
- icon="mdi-close"
252
- variant="text"
253
- class="screen-modal__close"
254
- @click="showLightbox = false"
255
- />
256
- </v-card-actions>
257
- <v-card-text class="screen-modal__body pa-2 pt-0">
258
- <v-img :src="lightboxSrc" contain max-height="80vh" />
259
- </v-card-text>
260
- </v-card>
261
- </v-dialog>
262
189
  </template>
263
190
 
264
191
  <script setup lang="ts">
@@ -300,14 +227,6 @@ watchEffect(() => {
300
227
  }
301
228
  });
302
229
 
303
- const showLightbox = ref(false);
304
- const lightboxSrc = ref("");
305
-
306
- const openFullImage = (src: string) => {
307
- lightboxSrc.value = src;
308
- showLightbox.value = true;
309
- };
310
-
311
230
  const createdAt = ref<string>("N/A");
312
231
  const createdBy = ref<string>("N/A");
313
232
  const timeOut = ref<string>("N/A");
@@ -1,120 +1,62 @@
1
1
  <template>
2
- <v-card
3
- class="chat-bubble screen-card pa-3"
4
- :class="isCurrentUser ? 'chat-bubble--mine' : 'chat-bubble--theirs'"
5
- elevation="0"
6
- >
7
- <v-row no-gutters align="start" class="flex-nowrap">
8
- <v-col cols="auto" :class="isCurrentUser ? 'order-last ml-3' : 'mr-3'">
2
+ <v-card class="chat-bubble screen-card mb-2 pa-4" width="400" elevation="0">
3
+ <v-row no-gutters align="center">
4
+ <v-col cols="auto" class="mr-3">
9
5
  <v-avatar class="chat-bubble__avatar" size="35">
10
- <!-- Was `<v-img width="15" height="15" />` with no `src` at all, so a
11
- sender with a profile picture got a blank 15px box instead of a
12
- photo - and never fell through to their initials either. -->
13
- <v-img v-if="avatarUrl" :src="avatarUrl" cover />
6
+ <v-img v-if="currentUser?.profile" width="15" height="15" />
14
7
  <span v-else>{{ getNameInitials(senderName) }}</span>
15
8
  </v-avatar>
16
9
  </v-col>
17
10
 
18
- <v-col class="chat-bubble__body">
19
- <div class="chat-bubble__sender">{{ senderName }}</div>
20
- <div v-if="roleLabel" class="chat-bubble__sub">{{ roleLabel }}</div>
21
-
22
- <div v-if="message" class="chat-bubble__text mt-2">{{ message }}</div>
23
-
24
- <div v-if="attachments?.length" class="d-flex flex-wrap ga-2 mt-2">
25
- <v-img
26
- v-for="file in attachments"
27
- :key="file.id"
28
- :src="getFileUrl(file.id)"
29
- width="110"
30
- height="90"
31
- cover
32
- rounded="lg"
33
- class="border-thin"
34
- style="cursor: zoom-in; flex: 0 0 auto"
35
- @click="emit('preview', getFileUrl(file.id))"
36
- >
37
- <template #placeholder>
38
- <v-row class="fill-height ma-0" align="center" justify="center">
39
- <v-progress-circular
40
- indeterminate
41
- size="20"
42
- color="grey-lighten-4"
43
- />
44
- </v-row>
45
- </template>
46
- <template #error>
47
- <v-row class="fill-height ma-0" align="center" justify="center">
48
- <v-icon icon="mdi-image-broken" size="24" color="grey" />
49
- </v-row>
50
- </template>
51
- </v-img>
52
- </div>
11
+ <v-col class="d-flex flex-column">
12
+ <span class="chat-bubble__sender">{{ senderName }}</span>
13
+ <span class="chat-bubble__sub">{{ role }}</span>
14
+ </v-col>
15
+ </v-row>
53
16
 
54
- <div class="chat-bubble__sub chat-bubble__time mt-2">
55
- {{ timestamp }}
56
- </div>
17
+ <v-row no-gutters class="mt-1">
18
+ <v-col>
19
+ <span class="chat-bubble__text py-2">{{ message }}</span>
20
+
21
+ <v-row no-gutters justify="space-between" align="center" class="mt-1">
22
+ <v-col cols="auto">
23
+ <span class="chat-bubble__sub">{{ timestamp }}</span>
24
+ </v-col>
25
+ <v-col v-if="isCurrentUser" cols="auto" class="d-flex align-center">
26
+ <v-icon size="16" class="chat-bubble__sub mr-1"
27
+ >mdi-eye-outline</v-icon
28
+ >
29
+ <span class="chat-bubble__sub">{{ seenLabel }}</span>
30
+ </v-col>
31
+ </v-row>
57
32
  </v-col>
58
33
  </v-row>
59
34
  </v-card>
60
35
  </template>
61
36
 
62
37
  <script setup lang="ts">
63
- import { formatSenderRole } from "../../utils/chat-sender.ts";
64
-
65
- /**
66
- * One message bubble, drawn the same way for both people in the conversation
67
- * and matching the mobile apps' bubble field for field: avatar, sender, role,
68
- * message, photos, time.
69
- *
70
- * It used to be a fixed `width="400"` card with no left/right distinction, an
71
- * avatar that could not render a photo, and a "Seen" line that only the current
72
- * user's own messages carried.
73
- */
74
- const props = defineProps<{
38
+ defineProps<{
75
39
  isCurrentUser: boolean;
76
40
  message: string;
77
41
  timestamp: string;
42
+ seenLabel?: string;
78
43
  senderName: string;
79
44
  role?: string;
80
- attachments?: TAttachment[];
81
- avatarId?: string;
82
45
  }>();
83
46
 
84
- const emit = defineEmits<{ (event: "preview", src: string): void }>();
85
-
47
+ const { currentUser } = useLocalAuth();
86
48
  const { getNameInitials } = useUtils();
87
- const { getFileUrl } = useFile();
88
-
89
- const roleLabel = computed(() => formatSenderRole(props.role));
90
- const avatarUrl = computed(() =>
91
- props.avatarId ? getFileUrl(props.avatarId) : ""
92
- );
93
49
  </script>
94
50
 
95
51
  <style scoped>
96
52
  .chat-bubble {
97
53
  font-family: var(--font-sans);
98
54
  color: var(--text);
99
- /* Was a fixed 400px, which is both too wide on a narrow panel and unable to
100
- grow on a wide one. The thread caps the column instead. */
101
- max-width: 100%;
102
- }
103
-
104
- /* Alignment alone is a weak signal on a panel this narrow, so the two sides
105
- also differ in fill - the same distinction the mobile bubbles make. */
106
- .chat-bubble--mine {
107
- background: var(--hover);
108
- }
109
-
110
- .chat-bubble--theirs {
111
- background: var(--card);
112
- }
113
-
114
- .chat-bubble__body {
115
- min-width: 0;
116
55
  }
117
56
 
57
+ /* Was `color="surface-variant"` with the initials at `text-h5`, i.e. a 24px
58
+ pair of letters in a 35px circle. The design's avatar is the tone wash with
59
+ the accent ink, and the initials fit inside it. */
118
60
  .chat-bubble__avatar {
119
61
  background: var(--hover);
120
62
  color: var(--text2);
@@ -129,8 +71,6 @@ const avatarUrl = computed(() =>
129
71
 
130
72
  .chat-bubble__text {
131
73
  font-size: var(--fs-cell);
132
- white-space: pre-wrap;
133
- overflow-wrap: anywhere;
134
74
  }
135
75
 
136
76
  /* The role, the timestamp and the seen label were `text-grey`, `text-caption`
@@ -139,8 +79,4 @@ const avatarUrl = computed(() =>
139
79
  font-size: var(--fs-chip);
140
80
  color: var(--muted);
141
81
  }
142
-
143
- .chat-bubble__time {
144
- text-align: right;
145
- }
146
82
  </style>