@7365admin1/layer-common 4.97.1-staging.643 → 4.97.1-staging.644

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.
@@ -1771,6 +1771,35 @@
1771
1771
  </v-card>
1772
1772
  </v-dialog>
1773
1773
 
1774
+ <!-- A visit holding nothing has no return step to stop at, so it asks here. -->
1775
+ <ConfirmDialog
1776
+ v-model="dialog.confirmCheckout"
1777
+ :loading="loading.checkingOut"
1778
+ >
1779
+ <template #title>Check Out Visitor</template>
1780
+ <template #description>
1781
+ Are you sure you want to check out {{ checkoutConfirmName }}?
1782
+ </template>
1783
+ <template #footer>
1784
+ <v-spacer />
1785
+ <v-btn
1786
+ class="text-capitalize"
1787
+ variant="text"
1788
+ text="Cancel"
1789
+ :disabled="loading.checkingOut"
1790
+ @click="dialog.confirmCheckout = false"
1791
+ />
1792
+ <v-btn
1793
+ class="text-capitalize font-weight-bold"
1794
+ color="red"
1795
+ variant="flat"
1796
+ text="Check Out"
1797
+ :loading="loading.checkingOut"
1798
+ @click="confirmCheckout"
1799
+ />
1800
+ </template>
1801
+ </ConfirmDialog>
1802
+
1774
1803
  <v-dialog v-model="hidQrDialog" max-width="440" persistent>
1775
1804
  <v-card>
1776
1805
  <v-toolbar color="transparent" density="comfortable" class="px-2">
@@ -2386,6 +2415,7 @@ const dialog = reactive({
2386
2415
  returnNfcCard: false,
2387
2416
  approveRejectVisitorDialog: false,
2388
2417
  blockVehicle: false,
2418
+ confirmCheckout: false,
2389
2419
  });
2390
2420
 
2391
2421
  /* ---- Block a visitor's vehicle ------------------------------------------ */
@@ -3928,8 +3958,8 @@ function showCheckOutButton(item: Record<string, any>) {
3928
3958
 
3929
3959
  /**
3930
3960
  * Check Out, in iSecure's order: a held pass or key goes to the return
3931
- * statuses first, an NFC card to the card return, and only a visit holding
3932
- * neither checks out straight away. Each path is an update of the visit.
3961
+ * statuses first, an NFC card to the card return, and a visit holding neither
3962
+ * asks for confirmation. Each path is an update of the visit.
3933
3963
  */
3934
3964
  function handleCheckout(userId: string, visitorObj?: Record<string, any>) {
3935
3965
  if (!userId) {
@@ -3957,7 +3987,15 @@ function handleCheckout(userId: string, visitorObj?: Record<string, any>) {
3957
3987
  openNfcDialog(visitor);
3958
3988
  return;
3959
3989
  }
3960
- proceedCheckout();
3990
+ checkoutConfirmName.value = visitor?.name || "this visitor";
3991
+ dialog.confirmCheckout = true;
3992
+ }
3993
+
3994
+ const checkoutConfirmName = ref("");
3995
+
3996
+ async function confirmCheckout() {
3997
+ await proceedCheckout();
3998
+ dialog.confirmCheckout = false;
3961
3999
  }
3962
4000
 
3963
4001
  /** A visit holding nothing: just the check-out. */
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.643",
5
+ "version": "4.97.1-staging.644",
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.",