@7365admin1/layer-common 3.0.12 → 3.0.14
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 +13 -0
- package/components/BuildingManagement/buildings.vue +14 -1
- package/components/BuildingManagement/units.vue +14 -3
- package/components/ServiceProviderMain.vue +226 -152
- package/components/SiteSettings.vue +18 -1
- package/composables/useAreaPermission.ts +6 -6
- package/composables/useCleaningPermission.ts +2 -0
- package/composables/useCleaningSchedulePermission.ts +7 -7
- package/composables/useEquipmentItemPermission.ts +6 -6
- package/composables/useEquipmentManagementPermission.ts +7 -7
- package/composables/useEquipmentPermission.ts +7 -7
- package/composables/useLocal.ts +12 -0
- package/composables/useScheduleTaskPermission.ts +5 -5
- package/composables/useUnitPermission.ts +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 3.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 47d94a5: update service provider flow
|
|
8
|
+
|
|
9
|
+
## 3.0.13
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 2fd8563: Update Version to 3.0.13
|
|
14
|
+
- c538bb8: Update Layer-common version to 3.0.13
|
|
15
|
+
|
|
3
16
|
## 3.0.12
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
<v-btn fab icon density="comfortable" @click="getBuildings()">
|
|
16
16
|
<v-icon>mdi-refresh</v-icon>
|
|
17
17
|
</v-btn>
|
|
18
|
+
<v-text-field v-model="searchInput" autocomplete="off" placeholder="Search" density="compact" hide-details dense clearable
|
|
19
|
+
class="mx-2" style="width: 200px;" />
|
|
18
20
|
</template>
|
|
19
21
|
|
|
20
22
|
<template #append>
|
|
@@ -219,9 +221,11 @@ const props = defineProps({
|
|
|
219
221
|
const site = (useRoute().params.site as string) ?? "";
|
|
220
222
|
const status = (useRoute().params.status as string) ?? "active";
|
|
221
223
|
|
|
222
|
-
const {
|
|
224
|
+
const { debounce } = useUtils();
|
|
223
225
|
const { getAll: _getBuildings, deleteById } = useBuilding();
|
|
224
226
|
|
|
227
|
+
const searchInput = ref("");
|
|
228
|
+
const headerSearch = ref("");
|
|
225
229
|
const page = ref(1);
|
|
226
230
|
const pages = ref(0);
|
|
227
231
|
const pageRange = ref("-- - -- of --");
|
|
@@ -252,6 +256,15 @@ const {
|
|
|
252
256
|
|
|
253
257
|
const loading = computed(() => getBuildingReqStatus.value === "pending");
|
|
254
258
|
|
|
259
|
+
const debounceSearch = debounce(() => {
|
|
260
|
+
headerSearch.value = searchInput.value?.trim() || "";
|
|
261
|
+
page.value = 1;
|
|
262
|
+
}, 500);
|
|
263
|
+
|
|
264
|
+
watch(searchInput, () => {
|
|
265
|
+
debounceSearch();
|
|
266
|
+
});
|
|
267
|
+
|
|
255
268
|
watchEffect(() => {
|
|
256
269
|
if (getBuildingReq.value) {
|
|
257
270
|
items.value = getBuildingReq.value.items;
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
<v-btn fab icon density="comfortable" @click="getBuildingUnit()">
|
|
16
16
|
<v-icon>mdi-refresh</v-icon>
|
|
17
17
|
</v-btn>
|
|
18
|
+
<v-text-field v-model="searchInput" placeholder="Search" density="compact" hide-details dense clearable
|
|
19
|
+
class="mx-2" style="width: 200px;" />
|
|
18
20
|
</template>
|
|
19
21
|
|
|
20
22
|
<template #append>
|
|
@@ -156,12 +158,12 @@ const status = (useRoute().params.status as string) ?? "active";
|
|
|
156
158
|
|
|
157
159
|
const { smAndUp } = useDisplay();
|
|
158
160
|
|
|
159
|
-
const { toOrdinal } = useUtils();
|
|
161
|
+
const { debounce, formatDateDDMMYYYYLocal, toOrdinal } = useUtils();
|
|
160
162
|
|
|
161
|
-
const { headerSearch } = useLocal();
|
|
162
163
|
const { getAll, deleteById } = useBuildingUnit();
|
|
163
|
-
const { formatDateDDMMYYYYLocal } = useUtils();
|
|
164
164
|
|
|
165
|
+
const searchInput = ref("");
|
|
166
|
+
const headerSearch = ref("");
|
|
165
167
|
const page = ref(1);
|
|
166
168
|
const pages = ref(0);
|
|
167
169
|
const pageRange = ref("-- - -- of --");
|
|
@@ -192,6 +194,15 @@ const {
|
|
|
192
194
|
|
|
193
195
|
const loading = computed(() => getBuildingReqStatus.value === "pending");
|
|
194
196
|
|
|
197
|
+
const debounceSearch = debounce(() => {
|
|
198
|
+
headerSearch.value = searchInput.value?.trim() || "";
|
|
199
|
+
page.value = 1;
|
|
200
|
+
}, 500);
|
|
201
|
+
|
|
202
|
+
watch(searchInput, () => {
|
|
203
|
+
debounceSearch();
|
|
204
|
+
});
|
|
205
|
+
|
|
195
206
|
watchEffect(() => {
|
|
196
207
|
if (getBuildingReq.value) {
|
|
197
208
|
items.value = getBuildingReq.value.items;
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
v-model="serviceProvider.type"
|
|
320
320
|
item-title="title"
|
|
321
321
|
item-value="value"
|
|
322
|
-
:items="
|
|
322
|
+
:items="natureOfBusinessV3"
|
|
323
323
|
density="comfortable"
|
|
324
324
|
:rules="[requiredRule]"
|
|
325
325
|
></v-select>
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
variant="flat"
|
|
403
403
|
color="black"
|
|
404
404
|
class="text-none"
|
|
405
|
-
size="
|
|
405
|
+
size="small"
|
|
406
406
|
:disabled="!validServiceProvider"
|
|
407
407
|
:loading="disableServiceProvider"
|
|
408
408
|
@click="submitServiceProviderAdd"
|
|
@@ -415,39 +415,68 @@
|
|
|
415
415
|
</v-card>
|
|
416
416
|
</v-dialog>
|
|
417
417
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
<v-card-text class="sp-invite-body">
|
|
428
|
-
<v-form
|
|
429
|
-
v-model="validServiceProvider"
|
|
430
|
-
:disabled="disableServiceProvider"
|
|
431
|
-
>
|
|
432
|
-
<v-row no-gutters>
|
|
433
|
-
<v-col cols="12">
|
|
434
|
-
<v-row no-gutters>
|
|
435
|
-
<InputLabel class="text-capitalize" title="Email" required />
|
|
436
|
-
<v-col cols="12">
|
|
437
|
-
<v-text-field
|
|
438
|
-
v-model="serviceProviderInvite.email"
|
|
439
|
-
variant="outlined"
|
|
440
|
-
density="comfortable"
|
|
441
|
-
:rules="[requiredRule, emailRule]"
|
|
442
|
-
></v-text-field>
|
|
443
|
-
</v-col>
|
|
444
|
-
</v-row>
|
|
445
|
-
</v-col>
|
|
418
|
+
<v-dialog v-model="createInviteDialog" width="580" persistent>
|
|
419
|
+
<v-card width="100%" rounded="lg" class="sp-invite-card">
|
|
420
|
+
<v-toolbar flat color="grey-lighten-4" height="76">
|
|
421
|
+
<v-row no-gutters class="fill-height px-6" align="center">
|
|
422
|
+
<span class="font-weight-bold text-h5">
|
|
423
|
+
Invite Service Provider
|
|
424
|
+
</span>
|
|
425
|
+
</v-row>
|
|
426
|
+
</v-toolbar>
|
|
446
427
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
428
|
+
<v-card-text class="sp-invite-body">
|
|
429
|
+
<v-form
|
|
430
|
+
v-model="validServiceProvider"
|
|
431
|
+
:disabled="disableServiceProvider"
|
|
432
|
+
>
|
|
433
|
+
<v-row no-gutters>
|
|
434
|
+
<!-- Email -->
|
|
435
|
+
<v-col cols="12">
|
|
436
|
+
<v-row no-gutters>
|
|
437
|
+
<InputLabel class="text-capitalize" title="Email" required />
|
|
438
|
+
<v-col cols="12">
|
|
439
|
+
<v-text-field
|
|
440
|
+
v-model="serviceProviderInvite.email"
|
|
441
|
+
variant="outlined"
|
|
442
|
+
density="comfortable"
|
|
443
|
+
:rules="[requiredRule, emailRule]"
|
|
444
|
+
></v-text-field>
|
|
445
|
+
</v-col>
|
|
446
|
+
</v-row>
|
|
447
|
+
</v-col>
|
|
450
448
|
|
|
449
|
+
<!-- Existing account block -->
|
|
450
|
+
<v-col cols="12" v-if="existingAccount">
|
|
451
|
+
<v-divider class="mb-6" />
|
|
452
|
+
|
|
453
|
+
<div class="sp-existing-title">Existing Account Verified</div>
|
|
454
|
+
|
|
455
|
+
<div class="sp-existing-copy">
|
|
456
|
+
{{ serviceProviderInvite.email }} is already onboarded.
|
|
457
|
+
Sending this invite will add this site to the list of
|
|
458
|
+
locations this company manages.
|
|
459
|
+
</div>
|
|
460
|
+
|
|
461
|
+
<v-row no-gutters>
|
|
462
|
+
<InputLabel title="Organization" />
|
|
463
|
+
<v-col cols="12">
|
|
464
|
+
<v-text-field
|
|
465
|
+
:model-value="existingAccount.text"
|
|
466
|
+
readonly
|
|
467
|
+
variant="outlined"
|
|
468
|
+
density="comfortable"
|
|
469
|
+
/>
|
|
470
|
+
</v-col>
|
|
471
|
+
</v-row>
|
|
472
|
+
</v-col>
|
|
473
|
+
|
|
474
|
+
<v-col cols="12">
|
|
475
|
+
<v-divider class="mb-6" />
|
|
476
|
+
</v-col>
|
|
477
|
+
|
|
478
|
+
<!-- App & Site: only shown when no existing account is verified -->
|
|
479
|
+
<template v-if="!existingAccount">
|
|
451
480
|
<v-col cols="12">
|
|
452
481
|
<v-row no-gutters>
|
|
453
482
|
<InputLabel class="text-capitalize" title="App" required />
|
|
@@ -460,7 +489,6 @@
|
|
|
460
489
|
variant="outlined"
|
|
461
490
|
density="comfortable"
|
|
462
491
|
:rules="[requiredRule]"
|
|
463
|
-
@update:model-value="loadInviteRoles"
|
|
464
492
|
></v-select>
|
|
465
493
|
</v-col>
|
|
466
494
|
</v-row>
|
|
@@ -483,79 +511,64 @@
|
|
|
483
511
|
</v-col>
|
|
484
512
|
</v-row>
|
|
485
513
|
</v-col>
|
|
514
|
+
</template>
|
|
486
515
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
:loading="loadingInviteRoles"
|
|
499
|
-
:rules="[requiredRule]"
|
|
500
|
-
></v-select>
|
|
501
|
-
</v-col>
|
|
502
|
-
</v-row>
|
|
503
|
-
</v-col>
|
|
504
|
-
|
|
505
|
-
<v-col cols="12" class="my-2">
|
|
506
|
-
<v-row no-gutters>
|
|
507
|
-
<v-col cols="12" class="text-center">
|
|
508
|
-
<span
|
|
509
|
-
class="text-none text-subtitle-2 font-weight-medium text-error"
|
|
510
|
-
>
|
|
511
|
-
{{ messageServiceProvider }}
|
|
512
|
-
</span>
|
|
513
|
-
</v-col>
|
|
514
|
-
</v-row>
|
|
515
|
-
</v-col>
|
|
516
|
-
</v-row>
|
|
517
|
-
</v-form>
|
|
518
|
-
</v-card-text>
|
|
519
|
-
|
|
520
|
-
<v-toolbar flat height="76" class="sp-invite-footer">
|
|
521
|
-
<v-row no-gutters class="fill-height">
|
|
522
|
-
<v-col cols="6" class="fill-height">
|
|
523
|
-
<v-btn
|
|
524
|
-
block
|
|
525
|
-
variant="flat"
|
|
526
|
-
class="text-none sp-invite-footer-btn"
|
|
527
|
-
height="76"
|
|
528
|
-
@click="setServiceProvider({ mode: 'invite', dialog: false })"
|
|
529
|
-
>
|
|
530
|
-
Cancel
|
|
531
|
-
</v-btn>
|
|
532
|
-
</v-col>
|
|
533
|
-
|
|
534
|
-
<v-col cols="6" class="fill-height">
|
|
535
|
-
<v-btn
|
|
536
|
-
block
|
|
537
|
-
variant="flat"
|
|
538
|
-
class="text-none sp-invite-submit-btn"
|
|
539
|
-
height="76"
|
|
540
|
-
:disabled="!validServiceProvider"
|
|
541
|
-
:loading="disableServiceProvider"
|
|
542
|
-
@click="submitServiceProviderInvite()"
|
|
543
|
-
>
|
|
544
|
-
Submit
|
|
545
|
-
</v-btn>
|
|
516
|
+
<!-- Error message -->
|
|
517
|
+
<v-col cols="12" class="my-2">
|
|
518
|
+
<v-row no-gutters>
|
|
519
|
+
<v-col cols="12" class="text-center">
|
|
520
|
+
<span
|
|
521
|
+
class="text-none text-subtitle-2 font-weight-medium text-error"
|
|
522
|
+
>
|
|
523
|
+
{{ messageServiceProvider }}
|
|
524
|
+
</span>
|
|
525
|
+
</v-col>
|
|
526
|
+
</v-row>
|
|
546
527
|
</v-col>
|
|
547
528
|
</v-row>
|
|
548
|
-
</v-
|
|
549
|
-
</v-card>
|
|
550
|
-
|
|
529
|
+
</v-form>
|
|
530
|
+
</v-card-text>
|
|
531
|
+
|
|
532
|
+
<v-toolbar flat height="76" class="sp-invite-footer">
|
|
533
|
+
<v-row no-gutters class="fill-height">
|
|
534
|
+
<v-col cols="6" class="fill-height">
|
|
535
|
+
<v-btn
|
|
536
|
+
block
|
|
537
|
+
variant="flat"
|
|
538
|
+
class="text-none sp-invite-footer-btn"
|
|
539
|
+
height="76"
|
|
540
|
+
@click="setServiceProvider({ mode: 'invite', dialog: false })"
|
|
541
|
+
>
|
|
542
|
+
Back
|
|
543
|
+
</v-btn>
|
|
544
|
+
</v-col>
|
|
545
|
+
|
|
546
|
+
<v-col cols="6" class="fill-height">
|
|
547
|
+
<v-btn
|
|
548
|
+
block
|
|
549
|
+
variant="flat"
|
|
550
|
+
class="text-none sp-invite-submit-btn"
|
|
551
|
+
height="76"
|
|
552
|
+
:disabled="!validServiceProvider"
|
|
553
|
+
:loading="disableServiceProvider"
|
|
554
|
+
@click="submitServiceProviderInvite()"
|
|
555
|
+
>
|
|
556
|
+
Submit
|
|
557
|
+
</v-btn>
|
|
558
|
+
</v-col>
|
|
559
|
+
</v-row>
|
|
560
|
+
</v-toolbar>
|
|
561
|
+
</v-card>
|
|
562
|
+
</v-dialog>
|
|
551
563
|
|
|
552
564
|
<Snackbar v-model="messageSnackbar" :text="message" :color="messageColor" />
|
|
553
565
|
</template>
|
|
554
566
|
|
|
555
567
|
<script lang="ts" setup>
|
|
556
568
|
import useServiceProvider from "../composables/useServiceProvider";
|
|
569
|
+
import useUser from "../composables/useUser";
|
|
557
570
|
import useVerification from "../composables/useVerification";
|
|
558
|
-
import useRole from "../composables/useRole";
|
|
571
|
+
// import useRole from "../composables/useRole";
|
|
559
572
|
import { errorConverter } from "../utils/data";
|
|
560
573
|
|
|
561
574
|
type ListTab = "active" | "pending" | "inactive";
|
|
@@ -674,8 +687,9 @@ const headers = [
|
|
|
674
687
|
},
|
|
675
688
|
];
|
|
676
689
|
|
|
677
|
-
const {
|
|
690
|
+
const { natureOfBusinessV3 } = useLocal();
|
|
678
691
|
const { requiredRule, emailRule, debounce } = useUtils();
|
|
692
|
+
const {getUserByEmail} = useUser()
|
|
679
693
|
|
|
680
694
|
const listTab = ref<ListTab>("active");
|
|
681
695
|
const page = ref(1);
|
|
@@ -705,13 +719,12 @@ const serviceProvider = ref({
|
|
|
705
719
|
orgName: "",
|
|
706
720
|
category: "",
|
|
707
721
|
});
|
|
708
|
-
const defaultInviteApp = "
|
|
722
|
+
const defaultInviteApp = "security_agency";
|
|
709
723
|
const serviceProviderInvite = ref({
|
|
710
724
|
email: "",
|
|
711
725
|
app: defaultInviteApp,
|
|
712
726
|
siteId: props.siteId,
|
|
713
727
|
siteName: props.siteName,
|
|
714
|
-
role: "",
|
|
715
728
|
});
|
|
716
729
|
|
|
717
730
|
const {
|
|
@@ -722,8 +735,14 @@ const {
|
|
|
722
735
|
} = useServiceProvider();
|
|
723
736
|
const { getAll: getAllMembers } = useMember();
|
|
724
737
|
|
|
725
|
-
const { getVerifications, cancelUserInvitation } = useVerification();
|
|
726
|
-
const {
|
|
738
|
+
const { getVerifications, cancelUserInvitation, getVerificationByEmail } = useVerification();
|
|
739
|
+
const {
|
|
740
|
+
getOrgsByMembership,
|
|
741
|
+
} = useMember();
|
|
742
|
+
|
|
743
|
+
const existingAccount = ref<any>(null);
|
|
744
|
+
const checkingExistingAccount = ref(false);
|
|
745
|
+
// const { getRoles } = useRole();
|
|
727
746
|
|
|
728
747
|
const { getSiteById } = useSite();
|
|
729
748
|
|
|
@@ -736,11 +755,53 @@ const searchText = ref("");
|
|
|
736
755
|
|
|
737
756
|
const createDialog = ref(false);
|
|
738
757
|
const createInviteDialog = ref(false);
|
|
739
|
-
const loadingInviteRoles = ref(false);
|
|
740
|
-
const serviceProviderInviteRoles = ref<Array<Record<string, any>>>([]);
|
|
758
|
+
// const loadingInviteRoles = ref(false);
|
|
759
|
+
// const serviceProviderInviteRoles = ref<Array<Record<string, any>>>([]);
|
|
760
|
+
|
|
761
|
+
const { getByUserType } = useMember();
|
|
762
|
+
|
|
763
|
+
async function checkExistingAccount(email: string) {
|
|
764
|
+
// existingAccount.value = null;
|
|
765
|
+
|
|
766
|
+
if (!email.trim() || emailRule(email) !== true) return;
|
|
767
|
+
|
|
768
|
+
checkingExistingAccount.value = true;
|
|
769
|
+
|
|
770
|
+
try {
|
|
771
|
+
const user = await getUserByEmail(email);
|
|
772
|
+
|
|
773
|
+
if (!user?._id) return;
|
|
774
|
+
|
|
775
|
+
const member = await getByUserType(user._id, "organization");
|
|
776
|
+
console.log("member raw:", member);
|
|
777
|
+
console.log("onboardingCompleted:", member?.onboardingCompleted);
|
|
778
|
+
|
|
779
|
+
if (member?.onboardingCompleted) {
|
|
780
|
+
existingAccount.value = {
|
|
781
|
+
_id: member.org,
|
|
782
|
+
text: member.orgName,
|
|
783
|
+
...member,
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
} catch (error) {
|
|
787
|
+
console.error(error);
|
|
788
|
+
existingAccount.value = null;
|
|
789
|
+
} finally {
|
|
790
|
+
checkingExistingAccount.value = false;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
watch(
|
|
796
|
+
() => serviceProviderInvite.value.email,
|
|
797
|
+
async (value) => {
|
|
798
|
+
console.log("typing:", value);
|
|
799
|
+
await checkExistingAccount(value);
|
|
800
|
+
}
|
|
801
|
+
);
|
|
741
802
|
|
|
742
803
|
const serviceProviderInviteApps = computed(() =>
|
|
743
|
-
|
|
804
|
+
natureOfBusinessV3.map((item) => ({
|
|
744
805
|
...item,
|
|
745
806
|
title:
|
|
746
807
|
item.value === "cleaning_services"
|
|
@@ -801,7 +862,7 @@ function rowActionLabel(row: TableRow) {
|
|
|
801
862
|
|
|
802
863
|
function typeDisplay(type: string, nature?: string) {
|
|
803
864
|
if (nature && String(nature).trim()) return String(nature);
|
|
804
|
-
const list =
|
|
865
|
+
const list = natureOfBusinessV3.value as Array<{ title?: string; value?: string }>;
|
|
805
866
|
const hit = list?.find((x) => x.value === type);
|
|
806
867
|
return hit?.title ?? type ?? "-";
|
|
807
868
|
}
|
|
@@ -822,25 +883,25 @@ function statusChipColor(statusLabel: string) {
|
|
|
822
883
|
return "primary";
|
|
823
884
|
}
|
|
824
885
|
|
|
825
|
-
async function loadInviteRoles() {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
}
|
|
886
|
+
// async function loadInviteRoles() {
|
|
887
|
+
// loadingInviteRoles.value = true;
|
|
888
|
+
// serviceProviderInvite.value.role = "";
|
|
889
|
+
// try {
|
|
890
|
+
// const response = await getRoles({
|
|
891
|
+
// org: props.orgId,
|
|
892
|
+
// type: serviceProviderInvite.value.app,
|
|
893
|
+
// limit: 50,
|
|
894
|
+
// });
|
|
895
|
+
// serviceProviderInviteRoles.value = response?.items ?? [];
|
|
896
|
+
// serviceProviderInvite.value.role =
|
|
897
|
+
// serviceProviderInviteRoles.value[0]?._id ?? "";
|
|
898
|
+
// } catch (error: any) {
|
|
899
|
+
// serviceProviderInviteRoles.value = [];
|
|
900
|
+
// showMessage(errorConverter(error), "error");
|
|
901
|
+
// } finally {
|
|
902
|
+
// loadingInviteRoles.value = false;
|
|
903
|
+
// }
|
|
904
|
+
// }
|
|
844
905
|
|
|
845
906
|
function setInviteSiteName(siteId: string) {
|
|
846
907
|
const selectedSite = serviceProviderInviteSites.value.find(
|
|
@@ -1067,37 +1128,38 @@ function setServiceProvider({
|
|
|
1067
1128
|
createDialog.value = dialog;
|
|
1068
1129
|
}
|
|
1069
1130
|
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1131
|
+
if (dialog) {
|
|
1132
|
+
serviceProvider.value = {
|
|
1133
|
+
name: "",
|
|
1134
|
+
type: "",
|
|
1135
|
+
email: "",
|
|
1136
|
+
description: "",
|
|
1137
|
+
orgId: props.orgId,
|
|
1138
|
+
siteId: props.siteId,
|
|
1139
|
+
siteName: site.value?.name ?? "",
|
|
1140
|
+
orgName: "Org Name",
|
|
1141
|
+
category: mode === "add" ? "internal" : "external",
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
if (mode === "invite") {
|
|
1145
|
+
existingAccount.value = null;
|
|
1146
|
+
|
|
1147
|
+
serviceProviderInvite.value = {
|
|
1074
1148
|
email: "",
|
|
1075
|
-
|
|
1076
|
-
orgId: props.orgId,
|
|
1149
|
+
app: defaultInviteApp,
|
|
1077
1150
|
siteId: props.siteId,
|
|
1078
|
-
siteName: site.value?.name
|
|
1079
|
-
orgName: "Org Name",
|
|
1080
|
-
category: mode === "add" ? "internal" : "external",
|
|
1151
|
+
siteName: site.value?.name || props.siteName,
|
|
1081
1152
|
};
|
|
1082
|
-
|
|
1083
|
-
if (mode === "invite") {
|
|
1084
|
-
serviceProviderInvite.value = {
|
|
1085
|
-
email: "",
|
|
1086
|
-
app: defaultInviteApp,
|
|
1087
|
-
siteId: props.siteId,
|
|
1088
|
-
siteName: site.value?.name || props.siteName,
|
|
1089
|
-
role: "",
|
|
1090
|
-
};
|
|
1091
|
-
createMoreServiceProvider.value = false;
|
|
1092
|
-
void loadInviteRoles();
|
|
1093
|
-
}
|
|
1094
|
-
return;
|
|
1095
1153
|
}
|
|
1096
1154
|
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1155
|
+
createMoreServiceProvider.value = false;
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
serviceProvider.value.description = data.description ?? "";
|
|
1160
|
+
serviceProvider.value.email = data.email ?? "";
|
|
1161
|
+
serviceProvider.value.name = data.name ?? "";
|
|
1162
|
+
serviceProvider.value.type = data.type ?? "";
|
|
1101
1163
|
}
|
|
1102
1164
|
|
|
1103
1165
|
async function submitServiceProviderAdd() {
|
|
@@ -1130,7 +1192,6 @@ async function submitServiceProviderInvite() {
|
|
|
1130
1192
|
email: serviceProviderInvite.value.email.trim(),
|
|
1131
1193
|
name: "",
|
|
1132
1194
|
app: serviceProviderInvite.value.app,
|
|
1133
|
-
role: serviceProviderInvite.value.role,
|
|
1134
1195
|
orgId: props.orgId,
|
|
1135
1196
|
siteId: serviceProviderInvite.value.siteId,
|
|
1136
1197
|
siteName:
|
|
@@ -1318,4 +1379,17 @@ async function submitServiceProviderInvite() {
|
|
|
1318
1379
|
font-size: 1.5rem;
|
|
1319
1380
|
font-weight: 700;
|
|
1320
1381
|
}
|
|
1382
|
+
.sp-existing-title {
|
|
1383
|
+
font-size: 1.125rem;
|
|
1384
|
+
font-weight: 700;
|
|
1385
|
+
color: #101828;
|
|
1386
|
+
margin-bottom: 16px;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
.sp-existing-copy {
|
|
1390
|
+
font-size: 1rem;
|
|
1391
|
+
color: #344054;
|
|
1392
|
+
line-height: 1.5;
|
|
1393
|
+
margin-bottom: 24px;
|
|
1394
|
+
}
|
|
1321
1395
|
</style>
|
|
@@ -206,7 +206,7 @@ const { canManageSiteInformation,
|
|
|
206
206
|
const { getSiteById, updateSitebyId, updateSiteInformation } =
|
|
207
207
|
useSiteSettings();
|
|
208
208
|
const { requiredRule } = useUtils();
|
|
209
|
-
const { getFileUrl } = useFile();
|
|
209
|
+
const { getFileUrl, getFileById } = useFile();
|
|
210
210
|
|
|
211
211
|
const blocks = ref(0);
|
|
212
212
|
const guardPosts = ref(0);
|
|
@@ -229,6 +229,23 @@ const siteDocuments = ref<string[]>([]);
|
|
|
229
229
|
const siteDocumentsNames = ref<Record<string, string>>({});
|
|
230
230
|
const savingSiteInfo = ref<boolean>(false);
|
|
231
231
|
|
|
232
|
+
watch(
|
|
233
|
+
siteDocuments,
|
|
234
|
+
async (ids) => {
|
|
235
|
+
for (const id of ids) {
|
|
236
|
+
if (!siteDocumentsNames.value[id]) {
|
|
237
|
+
try {
|
|
238
|
+
const file = (await getFileById(id)) as any;
|
|
239
|
+
siteDocumentsNames.value[id] = file?.data?.name ?? file?.name ?? "";
|
|
240
|
+
} catch {
|
|
241
|
+
siteDocumentsNames.value[id] = "";
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{ deep: true }
|
|
247
|
+
);
|
|
248
|
+
|
|
232
249
|
const coverPhotoUrl = computed(() =>
|
|
233
250
|
coverPhoto.value.length > 0 ? getFileUrl(coverPhoto.value[0]) : ""
|
|
234
251
|
);
|
|
@@ -5,37 +5,37 @@ export function useAreaPermission() {
|
|
|
5
5
|
const { userAppRole } = useLocalSetup();
|
|
6
6
|
|
|
7
7
|
const canViewAreas = computed(() => {
|
|
8
|
-
if (!userAppRole.value) return
|
|
8
|
+
if (!userAppRole.value) return false;
|
|
9
9
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
10
10
|
return hasPermission(userAppRole.value, permissions, "area-mgmt", "see-all-areas");
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
const canCreateArea = computed(() => {
|
|
14
|
-
if (!userAppRole.value) return
|
|
14
|
+
if (!userAppRole.value) return false;
|
|
15
15
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
16
16
|
return hasPermission(userAppRole.value, permissions, "area-mgmt", "add-area");
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const canUpdateArea = computed(() => {
|
|
20
|
-
if (!userAppRole.value) return
|
|
20
|
+
if (!userAppRole.value) return false;
|
|
21
21
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
22
22
|
return hasPermission(userAppRole.value, permissions, "area-mgmt", "update-area");
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const canViewAreaDetails = computed(() => {
|
|
26
|
-
if (!userAppRole.value) return
|
|
26
|
+
if (!userAppRole.value) return false;
|
|
27
27
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
28
28
|
return hasPermission(userAppRole.value, permissions, "area-mgmt", "see-area-details");
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const canImportArea = computed(() => {
|
|
32
|
-
if (!userAppRole.value) return
|
|
32
|
+
if (!userAppRole.value) return false;
|
|
33
33
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
34
34
|
return hasPermission(userAppRole.value, permissions, "area-mgmt", "import-areas");
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const canDeleteArea = computed(() => {
|
|
38
|
-
if (!userAppRole.value) return
|
|
38
|
+
if (!userAppRole.value) return false;
|
|
39
39
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
40
40
|
return hasPermission(userAppRole.value, permissions, "area-mgmt", "delete-area");
|
|
41
41
|
});
|
|
@@ -6,6 +6,7 @@ export default function useCleaningPermission() {
|
|
|
6
6
|
workOrderPermissions,
|
|
7
7
|
invitationPermissions,
|
|
8
8
|
bulletinBoardPermissions,
|
|
9
|
+
dashboardPermissions,
|
|
9
10
|
} = useCommonPermissions();
|
|
10
11
|
const permissions: TPermissions = {
|
|
11
12
|
members: memberPermissions,
|
|
@@ -14,6 +15,7 @@ export default function useCleaningPermission() {
|
|
|
14
15
|
roles: rolePermissions,
|
|
15
16
|
invitations: invitationPermissions,
|
|
16
17
|
"bulletin-board": bulletinBoardPermissions,
|
|
18
|
+
dashboard: dashboardPermissions,
|
|
17
19
|
inventory: {
|
|
18
20
|
"view-inventory": {
|
|
19
21
|
check: true,
|
|
@@ -5,43 +5,43 @@ export function useCleaningSchedulePermission() {
|
|
|
5
5
|
const { userAppRole } = useLocalSetup();
|
|
6
6
|
|
|
7
7
|
const canViewSchedules = computed(() => {
|
|
8
|
-
if (!userAppRole.value) return
|
|
8
|
+
if (!userAppRole.value) return false;
|
|
9
9
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
10
10
|
return hasPermission(userAppRole.value, permissions, "cleaning-schedule-mgmt", "see-all-schedules");
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
const canViewScheduleDetails = computed(() => {
|
|
14
|
-
if (!userAppRole.value) return
|
|
14
|
+
if (!userAppRole.value) return false;
|
|
15
15
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
16
16
|
return hasPermission(userAppRole.value, permissions, "cleaning-schedule-mgmt", "see-schedule-details");
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const canDownloadSchedule = computed(() => {
|
|
20
|
-
if (!userAppRole.value) return
|
|
20
|
+
if (!userAppRole.value) return false;
|
|
21
21
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
22
22
|
return hasPermission(userAppRole.value, permissions, "cleaning-schedule-mgmt", "download-schedule");
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const canManageScheduleTasks = computed(() => {
|
|
26
|
-
if (!userAppRole.value) return
|
|
26
|
+
if (!userAppRole.value) return false;
|
|
27
27
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
28
28
|
return hasPermission(userAppRole.value, permissions, "cleaning-schedule-mgmt", "manage-schedule-tasks");
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const canGenerateChecklist = computed(() => {
|
|
32
|
-
if (!userAppRole.value) return
|
|
32
|
+
if (!userAppRole.value) return false;
|
|
33
33
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
34
34
|
return hasPermission(userAppRole.value, permissions, "cleaning-schedule-mgmt", "generate-checklist");
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const canViewHistory = computed(() => {
|
|
38
|
-
if (!userAppRole.value) return
|
|
38
|
+
if (!userAppRole.value) return false;
|
|
39
39
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
40
40
|
return hasPermission(userAppRole.value, permissions, "cleaning-schedule-mgmt", "view-history");
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const canAddRemarks = computed(() => {
|
|
44
|
-
if (!userAppRole.value) return
|
|
44
|
+
if (!userAppRole.value) return false;
|
|
45
45
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
46
46
|
return hasPermission(userAppRole.value, permissions, "cleaning-schedule-mgmt", "add-remarks");
|
|
47
47
|
});
|
|
@@ -4,7 +4,7 @@ export function useEquipmentItemPermission() {
|
|
|
4
4
|
const { userAppRole } = useLocalSetup();
|
|
5
5
|
|
|
6
6
|
const canViewAllEquipmentItems = computed(() => {
|
|
7
|
-
if (!userAppRole.value) return
|
|
7
|
+
if (!userAppRole.value) return false;
|
|
8
8
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
9
9
|
return hasPermission(
|
|
10
10
|
userAppRole.value,
|
|
@@ -15,7 +15,7 @@ export function useEquipmentItemPermission() {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
const canCreateEquipmentItem = computed(() => {
|
|
18
|
-
if (!userAppRole.value) return
|
|
18
|
+
if (!userAppRole.value) return false;
|
|
19
19
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
20
20
|
return hasPermission(
|
|
21
21
|
userAppRole.value,
|
|
@@ -26,7 +26,7 @@ export function useEquipmentItemPermission() {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const canUpdateEquipmentItem = computed(() => {
|
|
29
|
-
if (!userAppRole.value) return
|
|
29
|
+
if (!userAppRole.value) return false;
|
|
30
30
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
31
31
|
return hasPermission(
|
|
32
32
|
userAppRole.value,
|
|
@@ -37,7 +37,7 @@ export function useEquipmentItemPermission() {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const canApproveEquipmentItem = computed(() => {
|
|
40
|
-
if (!userAppRole.value) return
|
|
40
|
+
if (!userAppRole.value) return false;
|
|
41
41
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
42
42
|
return hasPermission(
|
|
43
43
|
userAppRole.value,
|
|
@@ -48,7 +48,7 @@ export function useEquipmentItemPermission() {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const canDisapproveEquipmentItem = computed(() => {
|
|
51
|
-
if (!userAppRole.value) return
|
|
51
|
+
if (!userAppRole.value) return false;
|
|
52
52
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
53
53
|
return hasPermission(
|
|
54
54
|
userAppRole.value,
|
|
@@ -59,7 +59,7 @@ export function useEquipmentItemPermission() {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
const canViewEquipmentItemDetails = computed(() => {
|
|
62
|
-
if (!userAppRole.value) return
|
|
62
|
+
if (!userAppRole.value) return false;
|
|
63
63
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
64
64
|
return hasPermission(
|
|
65
65
|
userAppRole.value,
|
|
@@ -8,7 +8,7 @@ export function useEquipmentManagementPermission() {
|
|
|
8
8
|
const { userAppRole } = useLocalSetup();
|
|
9
9
|
|
|
10
10
|
const canViewEquipments = computed(() => {
|
|
11
|
-
if (!userAppRole.value) return
|
|
11
|
+
if (!userAppRole.value) return false;
|
|
12
12
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
13
13
|
return hasPermission(
|
|
14
14
|
userAppRole.value,
|
|
@@ -19,7 +19,7 @@ export function useEquipmentManagementPermission() {
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
const canAddEquipment = computed(() => {
|
|
22
|
-
if (!userAppRole.value) return
|
|
22
|
+
if (!userAppRole.value) return false;
|
|
23
23
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
24
24
|
return hasPermission(
|
|
25
25
|
userAppRole.value,
|
|
@@ -30,7 +30,7 @@ export function useEquipmentManagementPermission() {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const canUpdateEquipment = computed(() => {
|
|
33
|
-
if (!userAppRole.value) return
|
|
33
|
+
if (!userAppRole.value) return false;
|
|
34
34
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
35
35
|
return hasPermission(
|
|
36
36
|
userAppRole.value,
|
|
@@ -41,7 +41,7 @@ export function useEquipmentManagementPermission() {
|
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const canDeleteEquipment = computed(() => {
|
|
44
|
-
if (!userAppRole.value) return
|
|
44
|
+
if (!userAppRole.value) return false;
|
|
45
45
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
46
46
|
return hasPermission(
|
|
47
47
|
userAppRole.value,
|
|
@@ -52,7 +52,7 @@ export function useEquipmentManagementPermission() {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
const canAddStock = computed(() => {
|
|
55
|
-
if (!userAppRole.value) return
|
|
55
|
+
if (!userAppRole.value) return false;
|
|
56
56
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
57
57
|
return hasPermission(
|
|
58
58
|
userAppRole.value,
|
|
@@ -63,7 +63,7 @@ export function useEquipmentManagementPermission() {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
const canViewStock = computed(() => {
|
|
66
|
-
if (!userAppRole.value) return
|
|
66
|
+
if (!userAppRole.value) return false;
|
|
67
67
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
68
68
|
return hasPermission(
|
|
69
69
|
userAppRole.value,
|
|
@@ -74,7 +74,7 @@ export function useEquipmentManagementPermission() {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
const canRequestItem = computed(() => {
|
|
77
|
-
if (!userAppRole.value) return
|
|
77
|
+
if (!userAppRole.value) return false;
|
|
78
78
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
79
79
|
return hasPermission(
|
|
80
80
|
userAppRole.value,
|
|
@@ -4,7 +4,7 @@ export function useEquipmentPermission() {
|
|
|
4
4
|
const { userAppRole } = useLocalSetup();
|
|
5
5
|
|
|
6
6
|
const canViewEquipments = computed(() => {
|
|
7
|
-
if (!userAppRole.value) return
|
|
7
|
+
if (!userAppRole.value) return false;
|
|
8
8
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
9
9
|
return hasPermission(
|
|
10
10
|
userAppRole.value,
|
|
@@ -15,7 +15,7 @@ export function useEquipmentPermission() {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
const canAddEquipment = computed(() => {
|
|
18
|
-
if (!userAppRole.value) return
|
|
18
|
+
if (!userAppRole.value) return false;
|
|
19
19
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
20
20
|
return hasPermission(
|
|
21
21
|
userAppRole.value,
|
|
@@ -26,7 +26,7 @@ export function useEquipmentPermission() {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const canUpdateEquipment = computed(() => {
|
|
29
|
-
if (!userAppRole.value) return
|
|
29
|
+
if (!userAppRole.value) return false;
|
|
30
30
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
31
31
|
return hasPermission(
|
|
32
32
|
userAppRole.value,
|
|
@@ -37,7 +37,7 @@ export function useEquipmentPermission() {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const canDeleteEquipment = computed(() => {
|
|
40
|
-
if (!userAppRole.value) return
|
|
40
|
+
if (!userAppRole.value) return false;
|
|
41
41
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
42
42
|
return hasPermission(
|
|
43
43
|
userAppRole.value,
|
|
@@ -48,7 +48,7 @@ export function useEquipmentPermission() {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const canAddStock = computed(() => {
|
|
51
|
-
if (!userAppRole.value) return
|
|
51
|
+
if (!userAppRole.value) return false;
|
|
52
52
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
53
53
|
return hasPermission(
|
|
54
54
|
userAppRole.value,
|
|
@@ -59,7 +59,7 @@ export function useEquipmentPermission() {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
const canViewStock = computed(() => {
|
|
62
|
-
if (!userAppRole.value) return
|
|
62
|
+
if (!userAppRole.value) return false;
|
|
63
63
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
64
64
|
return hasPermission(
|
|
65
65
|
userAppRole.value,
|
|
@@ -70,7 +70,7 @@ export function useEquipmentPermission() {
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
const canRequestItem = computed(() => {
|
|
73
|
-
if (!userAppRole.value) return
|
|
73
|
+
if (!userAppRole.value) return false;
|
|
74
74
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
75
75
|
return hasPermission(
|
|
76
76
|
userAppRole.value,
|
package/composables/useLocal.ts
CHANGED
|
@@ -65,6 +65,17 @@ export default function useLocal() {
|
|
|
65
65
|
{ title: "Pest Control Services", value: "pest_control_services" },
|
|
66
66
|
{ title: "Pool Maintenance Services", value: "pool_maintenance_services" },
|
|
67
67
|
];
|
|
68
|
+
const natureOfBusinessV3 = [
|
|
69
|
+
{ title: "Security", value: "security_agency" },
|
|
70
|
+
{ title: "Cleaning", value: "cleaning_services" },
|
|
71
|
+
{
|
|
72
|
+
title: "Mechanical & Electrical ",
|
|
73
|
+
value: "mechanical_electrical_services",
|
|
74
|
+
},
|
|
75
|
+
{ title: "Landscaping", value: "landscaping_services" },
|
|
76
|
+
{ title: "Pest Control", value: "pest_control_services" },
|
|
77
|
+
{ title: "Pool Maintenance", value: "pool_maintenance_services" },
|
|
78
|
+
];
|
|
68
79
|
|
|
69
80
|
|
|
70
81
|
const landingPage = useCookie("landing-page", cookieConfig);
|
|
@@ -143,6 +154,7 @@ export default function useLocal() {
|
|
|
143
154
|
headerSearch,
|
|
144
155
|
natureOfBusiness,
|
|
145
156
|
natureOfBusinessV2,
|
|
157
|
+
natureOfBusinessV3,
|
|
146
158
|
landingPage,
|
|
147
159
|
subjects,
|
|
148
160
|
};
|
|
@@ -4,7 +4,7 @@ export default function useScheduleTaskPermission() {
|
|
|
4
4
|
const { userAppRole } = useLocalSetup();
|
|
5
5
|
|
|
6
6
|
const canViewScheduleTasks = computed(() => {
|
|
7
|
-
if (!userAppRole.value) return
|
|
7
|
+
if (!userAppRole.value) return false;
|
|
8
8
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
9
9
|
return hasPermission(
|
|
10
10
|
userAppRole.value,
|
|
@@ -15,7 +15,7 @@ export default function useScheduleTaskPermission() {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
const canCreateScheduleTask = computed(() => {
|
|
18
|
-
if (!userAppRole.value) return
|
|
18
|
+
if (!userAppRole.value) return false;
|
|
19
19
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
20
20
|
return hasPermission(
|
|
21
21
|
userAppRole.value,
|
|
@@ -26,7 +26,7 @@ export default function useScheduleTaskPermission() {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const canUpdateScheduleTask = computed(() => {
|
|
29
|
-
if (!userAppRole.value) return
|
|
29
|
+
if (!userAppRole.value) return false;
|
|
30
30
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
31
31
|
return hasPermission(
|
|
32
32
|
userAppRole.value,
|
|
@@ -37,7 +37,7 @@ export default function useScheduleTaskPermission() {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const canDeleteScheduleTask = computed(() => {
|
|
40
|
-
if (!userAppRole.value) return
|
|
40
|
+
if (!userAppRole.value) return false;
|
|
41
41
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
42
42
|
return hasPermission(
|
|
43
43
|
userAppRole.value,
|
|
@@ -48,7 +48,7 @@ export default function useScheduleTaskPermission() {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const canViewScheduleTaskDetails = computed(() => {
|
|
51
|
-
if (!userAppRole.value) return
|
|
51
|
+
if (!userAppRole.value) return false;
|
|
52
52
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
53
53
|
return hasPermission(
|
|
54
54
|
userAppRole.value,
|
|
@@ -5,37 +5,37 @@ export function useUnitPermission() {
|
|
|
5
5
|
const { userAppRole } = useLocalSetup();
|
|
6
6
|
|
|
7
7
|
const canViewUnits = computed(() => {
|
|
8
|
-
if (!userAppRole.value) return
|
|
8
|
+
if (!userAppRole.value) return false;
|
|
9
9
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
10
10
|
return hasPermission(userAppRole.value, permissions, "unit-mgmt", "see-all-units");
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
const canCreateUnit = computed(() => {
|
|
14
|
-
if (!userAppRole.value) return
|
|
14
|
+
if (!userAppRole.value) return false;
|
|
15
15
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
16
16
|
return hasPermission(userAppRole.value, permissions, "unit-mgmt", "add-unit");
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const canUpdateUnit = computed(() => {
|
|
20
|
-
if (!userAppRole.value) return
|
|
20
|
+
if (!userAppRole.value) return false;
|
|
21
21
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
22
22
|
return hasPermission(userAppRole.value, permissions, "unit-mgmt", "update-unit");
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const canViewUnitDetails = computed(() => {
|
|
26
|
-
if (!userAppRole.value) return
|
|
26
|
+
if (!userAppRole.value) return false;
|
|
27
27
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
28
28
|
return hasPermission(userAppRole.value, permissions, "unit-mgmt", "see-unit-details");
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const canDeleteUnit = computed(() => {
|
|
32
|
-
if (!userAppRole.value) return
|
|
32
|
+
if (!userAppRole.value) return false;
|
|
33
33
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
34
34
|
return hasPermission(userAppRole.value, permissions, "unit-mgmt", "delete-unit");
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const canImportUnit = computed(() => {
|
|
38
|
-
if (!userAppRole.value) return
|
|
38
|
+
if (!userAppRole.value) return false;
|
|
39
39
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
40
40
|
return hasPermission(userAppRole.value, permissions, "unit-mgmt", "import-units");
|
|
41
41
|
});
|