From 295f69ee41592fff81ba7e53528bcf23ab02c7db Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Mon, 13 Apr 2026 14:20:36 +0200 Subject: [PATCH] Implement POS registration field and autosave utility: - Added `PosOrderRegistrationField.vue` for managing inline registration field inputs with autosave behavior. - Introduced `useOrderMetadataAutosave.js` composable for seamless value normalization, dirty tracking, and delayed persistence. - Refactored mobile and desktop POS components to integrate `useOrderMetadataAutosave` for improved field management (e.g., `POSOrderReference.vue`, `PosOrderLicensePlates.vue`). - Updated e2e tests to cover registration field scenarios, including input normalization and persistence (`pos-mobile-order-flow.spec.js`, `admin-pos-orders.spec.ts`). - Enhanced styling and responsiveness for registration fields in `pos.css`. --- src/assets/pos.css | 24 ++ .../department/pos/order/POSOrderNote.vue | 75 ++---- .../pos/order/POSOrderReference.vue | 75 ++---- .../pos/order/PosOrderLicensePlates.vue | 42 +--- .../pos/order/PosOrderRegistrationField.vue | 116 ++++++++++ .../steps/mobile/PosDepartmentStepMobile2.vue | 123 +++++++++- .../PosDepartmentStep1MobileManualInput.vue | 216 ++++++++++++++---- src/composables/useOrderMetadataAutosave.js | 147 ++++++++++++ tests/e2e/admin-pos-orders.spec.ts | 124 ++++++++++ tests/e2e/pos-mobile-order-flow.spec.js | 79 ++++++- tests/e2e/support/mobilePos.js | 25 +- 11 files changed, 855 insertions(+), 191 deletions(-) create mode 100644 src/components/displays/department/pos/order/PosOrderRegistrationField.vue create mode 100644 src/composables/useOrderMetadataAutosave.js diff --git a/src/assets/pos.css b/src/assets/pos.css index b2ce9807..858a7e80 100644 --- a/src/assets/pos.css +++ b/src/assets/pos.css @@ -383,6 +383,11 @@ transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; } +.pos-registration-field--editing { + justify-content: center; + cursor: text; +} + .pos-registration-field:hover, .pos-registration-field:focus-visible { border-color: #93b3d8; @@ -428,6 +433,25 @@ color: #63768f; } +.pos-registration-field__input { + width: 100%; + min-width: 0; + padding: 0; + border: 0; + box-shadow: none; + background: transparent; + color: inherit; + font-size: 0.95rem; + font-weight: 600; + line-height: 1.35; + text-transform: uppercase; +} + +.pos-registration-field__input:focus { + outline: none; + box-shadow: none; +} + .pos-order-items--order-detail .pos-order-metadata-grid { gap: 0.9rem; grid-template-columns: minmax(20rem, 1.22fr) minmax(16rem, 1fr); diff --git a/src/components/displays/department/pos/order/POSOrderNote.vue b/src/components/displays/department/pos/order/POSOrderNote.vue index 07575faf..b212a114 100644 --- a/src/components/displays/department/pos/order/POSOrderNote.vue +++ b/src/components/displays/department/pos/order/POSOrderNote.vue @@ -1,7 +1,8 @@