@7365admin1/layer-common 4.97.1-staging.566 → 4.97.1-staging.567
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.
|
@@ -1,33 +1,55 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div data-test="visitor-pass-sms-settings">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
<template v-if="canEdit">
|
|
4
|
+
<v-switch v-model="enabled" label="Send visitor pass by SMS" color="primary" hide-details
|
|
5
|
+
data-test="visitor-pass-sms-switch" />
|
|
6
|
+
<p class="text-caption text-medium-emphasis mt-1 mb-3">
|
|
7
|
+
Staff can text an approved visitor their pass link (the QR they show at the guardhouse). The text has the site
|
|
8
|
+
name, the visit date and the link only. Only Seven365 can switch this on or off.
|
|
9
|
+
</p>
|
|
10
|
+
<v-btn class="screen-btn-primary" color="primary-button" variant="flat" text="Save"
|
|
11
|
+
:loading="saving" :disabled="!loaded" data-test="visitor-pass-sms-save" @click="save" />
|
|
12
|
+
</template>
|
|
13
|
+
<template v-else>
|
|
14
|
+
<div class="text-body-2" data-test="visitor-pass-sms-readonly">
|
|
15
|
+
SMS pass: <strong>{{ savedOn ? "On" : "Off" }}</strong> — managed by Seven365.
|
|
16
|
+
</div>
|
|
17
|
+
<p class="text-caption text-medium-emphasis mt-1 mb-3">
|
|
18
|
+
Contact Seven365 to {{ savedOn ? "switch it off" : "enable" }}. When on, staff can text an approved visitor
|
|
19
|
+
their pass link (site name, visit date and link only).
|
|
20
|
+
</p>
|
|
21
|
+
</template>
|
|
11
22
|
<Snackbar v-model="toast.show" :text="toast.message" :color="toast.color" />
|
|
12
23
|
</div>
|
|
13
24
|
</template>
|
|
14
25
|
|
|
15
26
|
<script setup lang="ts">
|
|
16
27
|
import useSiteFeatureSettings from "../composables/useSiteFeatureSettings";
|
|
28
|
+
import useConsoleTier from "../composables/useConsoleTier";
|
|
17
29
|
|
|
18
30
|
/**
|
|
19
31
|
* Site setting `metadata.visitorPassSms` (core site-feature-settings).
|
|
20
32
|
* Off = today: no "Send pass by SMS" action anywhere.
|
|
33
|
+
*
|
|
34
|
+
* SMS is billed to Seven365, so only the Seven365 Super Admin switches it
|
|
35
|
+
* (owner 2026-10-19). Everyone else sees On/Off, read-only. The server
|
|
36
|
+
* refuses a change by anyone else (403); this only decides what to draw.
|
|
21
37
|
*/
|
|
22
38
|
const props = defineProps({
|
|
23
39
|
siteId: { type: String, required: true },
|
|
24
40
|
saved: { type: Object as PropType<{ enabled?: boolean } | null>, default: null },
|
|
41
|
+
/** Kept for callers; editing now depends on being Seven365 Super Admin only. */
|
|
25
42
|
readOnly: { type: Boolean, default: false },
|
|
26
43
|
/** The site has been read; Save stays off until then. */
|
|
27
44
|
loaded: { type: Boolean, default: false },
|
|
28
45
|
});
|
|
29
46
|
const emit = defineEmits(["saved"]);
|
|
30
47
|
|
|
48
|
+
const { isStaff, load: loadTier } = useConsoleTier();
|
|
49
|
+
const canEdit = computed(() => isStaff.value);
|
|
50
|
+
onMounted(() => loadTier());
|
|
51
|
+
|
|
52
|
+
const savedOn = computed(() => props.saved?.enabled === true);
|
|
31
53
|
const enabled = ref(false);
|
|
32
54
|
watch(
|
|
33
55
|
() => props.saved,
|
|
@@ -42,7 +64,7 @@ const saving = ref(false);
|
|
|
42
64
|
const toast = reactive({ show: false, message: "", color: "" });
|
|
43
65
|
|
|
44
66
|
async function save() {
|
|
45
|
-
if (!props.loaded) return;
|
|
67
|
+
if (!props.loaded || !canEdit.value) return;
|
|
46
68
|
saving.value = true;
|
|
47
69
|
try {
|
|
48
70
|
await saveSiteFeature(props.siteId, "visitorPassSms", { enabled: enabled.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.97.1-staging.
|
|
5
|
+
"version": "4.97.1-staging.567",
|
|
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.",
|