@7365admin1/layer-common 4.174.0 → 4.174.1
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 +10 -4
- package/components/VehicleForm.vue +40 -69
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 4.174.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e39bffb: Vehicle Management > Add Season Pass: the Start Date and Expiry Date are always shown (no more "Show Subscription Options" toggle) and both are required when adding a season pass. Editing an older pass saved without dates still only needs one date with the other.
|
|
8
|
+
|
|
3
9
|
## 4.174.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -3915,11 +3921,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
|
|
|
3915
3921
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
3916
3922
|
own rule from two endpoints the console already calls, unprojected:
|
|
3917
3923
|
|
|
3918
|
-
|
|
3919
|
-
|
|
3924
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
3925
|
+
GET /api/roles/id/:role that membership's role document
|
|
3920
3926
|
|
|
3921
|
-
|
|
3922
|
-
|
|
3927
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
3928
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
3923
3929
|
|
|
3924
3930
|
`role.default` is the marker because it is the only property of a platform
|
|
3925
3931
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -306,68 +306,40 @@
|
|
|
306
306
|
/>
|
|
307
307
|
</v-col>
|
|
308
308
|
|
|
309
|
+
<!--
|
|
310
|
+
DV-1355: a season pass always shows its Start and Expiry dates. They
|
|
311
|
+
used to sit behind "Show Subscription Options", so a pass was often
|
|
312
|
+
saved with no dates at all. Both are required when adding; editing
|
|
313
|
+
an older pass saved without dates still only needs one with the other.
|
|
314
|
+
-->
|
|
309
315
|
<v-col v-if="shouldShowField('start')" cols="12">
|
|
310
|
-
<v-
|
|
311
|
-
<v-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
<v-row no-gutters class="mt-5">
|
|
324
|
-
<v-col cols="12">
|
|
325
|
-
<InputLabel
|
|
326
|
-
class="text-capitalize"
|
|
327
|
-
title="Start Date"
|
|
328
|
-
required
|
|
329
|
-
/>
|
|
330
|
-
<InputDateTimePicker
|
|
331
|
-
ref="startDateRef"
|
|
332
|
-
v-model:utc="vehicle.start"
|
|
333
|
-
:rules="[validStartDateRule]"
|
|
334
|
-
/>
|
|
335
|
-
</v-col>
|
|
316
|
+
<v-row no-gutters>
|
|
317
|
+
<v-col cols="12">
|
|
318
|
+
<InputLabel
|
|
319
|
+
class="text-capitalize"
|
|
320
|
+
title="Start Date"
|
|
321
|
+
required
|
|
322
|
+
/>
|
|
323
|
+
<InputDateTimePicker
|
|
324
|
+
ref="startDateRef"
|
|
325
|
+
v-model:utc="vehicle.start"
|
|
326
|
+
:rules="[validStartDateRule]"
|
|
327
|
+
/>
|
|
328
|
+
</v-col>
|
|
336
329
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
</v-row>
|
|
351
|
-
</v-expand-transition>
|
|
352
|
-
|
|
353
|
-
<v-col cols="12" :class="[showSubscriptionDateOptions && 'mt-5']">
|
|
354
|
-
<v-row justify="center">
|
|
355
|
-
<v-col cols="6" class="d-flex justify-center">
|
|
356
|
-
<AppButton
|
|
357
|
-
variant="ghost"
|
|
358
|
-
@click="
|
|
359
|
-
showSubscriptionDateOptions = !showSubscriptionDateOptions
|
|
360
|
-
"
|
|
361
|
-
>
|
|
362
|
-
{{
|
|
363
|
-
showSubscriptionDateOptions
|
|
364
|
-
? "Hide Subscription Options"
|
|
365
|
-
: "Show Subscription Options"
|
|
366
|
-
}}
|
|
367
|
-
</AppButton>
|
|
368
|
-
</v-col>
|
|
369
|
-
</v-row>
|
|
370
|
-
</v-col>
|
|
330
|
+
<v-col cols="12">
|
|
331
|
+
<InputLabel
|
|
332
|
+
class="text-capitalize"
|
|
333
|
+
title="Expiry Date"
|
|
334
|
+
required
|
|
335
|
+
/>
|
|
336
|
+
<InputDateTimePicker
|
|
337
|
+
ref="expiryDateRef"
|
|
338
|
+
v-model:utc="vehicle.end"
|
|
339
|
+
:rules="[validExpiryDateRule]"
|
|
340
|
+
/>
|
|
341
|
+
</v-col>
|
|
342
|
+
</v-row>
|
|
371
343
|
</v-col>
|
|
372
344
|
|
|
373
345
|
<v-col cols="12">
|
|
@@ -894,7 +866,6 @@ const expiryDateRef = ref<HTMLInputElement | null>(null);
|
|
|
894
866
|
const processing = ref(false);
|
|
895
867
|
const message = ref("");
|
|
896
868
|
const selectedSubscriptionDuration = ref<string | null>("custom");
|
|
897
|
-
const showSubscriptionDateOptions = ref(false);
|
|
898
869
|
const errorMessage = ref("");
|
|
899
870
|
|
|
900
871
|
// fetch existing vehicle data if in edit mode
|
|
@@ -1073,14 +1044,12 @@ function removePlate(index: number) {
|
|
|
1073
1044
|
function back() {
|
|
1074
1045
|
emit("back");
|
|
1075
1046
|
message.value = "";
|
|
1076
|
-
showSubscriptionDateOptions.value = false;
|
|
1077
1047
|
selectedSubscriptionDuration.value = null;
|
|
1078
1048
|
}
|
|
1079
1049
|
|
|
1080
1050
|
function close() {
|
|
1081
1051
|
emit("close");
|
|
1082
1052
|
message.value = "";
|
|
1083
|
-
showSubscriptionDateOptions.value = false;
|
|
1084
1053
|
selectedSubscriptionDuration.value = null;
|
|
1085
1054
|
}
|
|
1086
1055
|
|
|
@@ -1404,9 +1373,15 @@ watch(selectedSubscriptionDuration, (duration) => {
|
|
|
1404
1373
|
}
|
|
1405
1374
|
});
|
|
1406
1375
|
|
|
1376
|
+
// DV-1355: both dates are required on a NEW season pass. On edit, an older
|
|
1377
|
+
// pass saved without dates can still be updated: there one needs the other.
|
|
1378
|
+
const datesRequired = computed(
|
|
1379
|
+
() => prop.type === "seasonpass" && prop.mode === "add"
|
|
1380
|
+
);
|
|
1381
|
+
|
|
1407
1382
|
function validStartDateRule(value: string) {
|
|
1408
1383
|
const expiryDateISO = vehicle.end;
|
|
1409
|
-
if (!value && expiryDateISO) {
|
|
1384
|
+
if (!value && (expiryDateISO || datesRequired.value)) {
|
|
1410
1385
|
return "Start Date is required";
|
|
1411
1386
|
}
|
|
1412
1387
|
|
|
@@ -1417,7 +1392,7 @@ function validExpiryDateRule() {
|
|
|
1417
1392
|
const startDateISO = vehicle.start;
|
|
1418
1393
|
const endDateISO = vehicle.end;
|
|
1419
1394
|
|
|
1420
|
-
if (!endDateISO && startDateISO) {
|
|
1395
|
+
if (!endDateISO && (startDateISO || datesRequired.value)) {
|
|
1421
1396
|
return "Expiry Date is required";
|
|
1422
1397
|
}
|
|
1423
1398
|
|
|
@@ -1558,10 +1533,6 @@ onMounted(() => {
|
|
|
1558
1533
|
vehicle.plateNumber = prop.vehicleData.plateNumber;
|
|
1559
1534
|
vehicle.peopleId = prop.vehicleData.peopleId || "";
|
|
1560
1535
|
vehicle.block = prop.vehicleData.block || null;
|
|
1561
|
-
|
|
1562
|
-
if (prop.type === "seasonpass") {
|
|
1563
|
-
showSubscriptionDateOptions.value = true;
|
|
1564
|
-
}
|
|
1565
1536
|
}
|
|
1566
1537
|
}, 300);
|
|
1567
1538
|
|
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.174.
|
|
5
|
+
"version": "4.174.1",
|
|
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.",
|