Refactor and optimize component logic and tests:

- Consolidate route search handling in `PosDepartmentMVP.vue` using `applyPosRouteSearch` for improved maintainability.
- Refactor tab visibility logic in `ElementTabsBox.vue` with reusable `isHidden` utility, removing redundant code.
- Enhance `SessionUser.vue` and `superUserObject.vue` modules with lazy bindings for improved initialization and performance.
- Update `NavigationMenuItemsAdmin.vue` to validate department IDs with `hasValidDepartmentId` and watchers for reactive booking count updates.
- Improve error handling logic in `HandleGlobalError.vue` and `loadOrderItems` for robustness against invalid inputs.
- Add and update regression tests for session and superuser initialization to ensure compliance with binding contracts.
- Refactor POS step components to streamline order-related logic and support immediate reactivity.
This commit is contained in:
Jeppe Bundgaard
2026-03-19 11:25:17 +01:00
parent a02ee3a700
commit 6a8e19b3e2
16 changed files with 317 additions and 143 deletions
@@ -30,28 +30,28 @@ import { useQRCode } from '@vueuse/integrations/useQRCode';
*/
export const SuperUserObject = {
system: {
database: DatabaseSystemObject,
get database() { return DatabaseSystemObject; },
},
modules: {
economic: Economic,
reCAPTCHA: reCAPTCHA,
email: Email,
backups: Backups,
motorapi: MotorAPI,
stripe: Stripe,
fxratesapi: FXRatesAPI,
weatherapi: WeatherAPI,
gatewayapi: GatewayAPI,
xlvask: XLVask,
entra: Entra,
limble: Limble,
ocrspace: OcrSpace,
openai: OpenAI,
licenseplaterecognizer: LicensePlateRecognizer,
virkdata: VirkData,
shelly: Shelly,
selfserve: SelfServe,
bird: Bird,
get economic() { return Economic; },
get reCAPTCHA() { return reCAPTCHA; },
get email() { return Email; },
get backups() { return Backups; },
get motorapi() { return MotorAPI; },
get stripe() { return Stripe; },
get fxratesapi() { return FXRatesAPI; },
get weatherapi() { return WeatherAPI; },
get gatewayapi() { return GatewayAPI; },
get xlvask() { return XLVask; },
get entra() { return Entra; },
get limble() { return Limble; },
get ocrspace() { return OcrSpace; },
get openai() { return OpenAI; },
get licenseplaterecognizer() { return LicensePlateRecognizer; },
get virkdata() { return VirkData; },
get shelly() { return Shelly; },
get selfserve() { return SelfServe; },
get bird() { return Bird; },
},
/** Intimidate a user */
intimidate: {
@@ -135,6 +135,6 @@ export const SuperUserObject = {
return localStorage.getItem("superuser_token") !== null;
}
},
cron: Cron
get cron() { return Cron; }
};
</script>