Remove EdgeGatewayManager and related assets:

- Deleted `EdgeGatewayManager.vue` alongside its components, templates, styles, and functionality.
- Added tests for `fetchDepartmentOrderBookingCount`.
- Introduced `adminBookingCount.js` for department booking count logic.
This commit is contained in:
Jeppe Bundgaard
2026-04-21 12:46:58 +02:00
parent d7ff64bf4e
commit 72fdc4c490
42 changed files with 1783 additions and 1231 deletions
@@ -2,6 +2,7 @@
import Swal from "sweetalert2";
import {authenticatedRequest, unauthenticatedRequest} from "@/components/session/authenticatedRequest.vue";
import i18n from '@/i18n';
import { getSystemUserIds } from "@/components/session/token/SessionUser/Objects/systemUserIds.js";
// Helper function to get i18n translation
const t = (key) => i18n.global.t(key);
@@ -33,7 +34,7 @@ export const ObjectsGlobal = {
info: 'fas fa-info',
import: 'fas fa-file-import',
},
system_user_ids: [1857], // The system user ids, used by e.g. OrdersTable to highlight system orders
system_user_ids: getSystemUserIds(), // The system user ids, used by e.g. OrdersTable to highlight system orders
cache: new Map(),
clearCache: () => {
ObjectsGlobal.cache.clear();
@@ -0,0 +1,17 @@
const SYSTEM_USER_IDS = [1857];
const normalizePositiveInteger = (value) => {
const parsedValue = Number.parseInt(String(value ?? ""), 10);
return Number.isInteger(parsedValue) && parsedValue > 0 ? parsedValue : null;
};
export const getSystemUserIds = () => {
return SYSTEM_USER_IDS.map((userId) => normalizePositiveInteger(userId)).filter((userId) => userId !== null);
};
export const isSystemUserId = (userId) => {
const normalizedUserId = normalizePositiveInteger(userId);
return normalizedUserId !== null && getSystemUserIds().includes(normalizedUserId);
};
export default getSystemUserIds;