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:
@@ -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;
|
||||
Reference in New Issue
Block a user