+
- Invalid selection! Start date must be before end date. Please adjust your selection to ensure the start date is not after the end date, and that both dates are within any specified restrictions.
-
+ >
+ Invalid selection! Start date must be before end date. Please adjust your selection to ensure the start date is not after the end date, and that both dates are within any specified restrictions.
+
-
-
- Selection spans multiple months! This may lead to unexpected results. Consider selecting an entire month or a shorter period for more accurate insights.
-
-
-
+ Selection spans multiple months! This may lead to unexpected results. Consider selecting an entire month or a shorter period for more accurate insights.
+
+
+
- Selection is not an entire month Click to set entire month.
- When a partial month selection is made, it may not accurately represent the intended time period. Consider selecting an entire month for more precise results.
-
+ >
+ Selection is not an entire month Click to set entire month.
+ When a partial month selection is made, it may not accurately represent the intended time period. Consider selecting an entire month for more precise results.
+
+
diff --git a/src/components/displays/department/moduleNavigation/DepartmentModulesDisplay.vue b/src/components/displays/department/moduleNavigation/DepartmentModulesDisplay.vue
index 80452e50..bc252c6d 100644
--- a/src/components/displays/department/moduleNavigation/DepartmentModulesDisplay.vue
+++ b/src/components/displays/department/moduleNavigation/DepartmentModulesDisplay.vue
@@ -19,6 +19,15 @@ const isLoadingSelfServeEnabled = ref(false);
const isSavingSelfServeEnabled = ref(false);
const bookingsCount = ref(0);
+const getDepartmentId = () => {
+ return parseInt(router.currentRoute.value.params.departmentId);
+};
+
+const buildDepartmentModulePath = (modulePath = "") => {
+ const departmentId = getDepartmentId();
+ return `/admin/${departmentId}${modulePath}`;
+};
+
const modules = computed(() => [
{
id: 1,
@@ -26,13 +35,10 @@ const modules = computed(() => [
description: t('admin.department_modules.pos.description'),
icon: "fas fa-book",
onClick: () => {
- // Get the departmentId from the URL
- const departmentId = router.currentRoute.value.params.departmentId;
- // Redirect to the POS system
- router.push(`/admin/${departmentId}/modules/pos`);
+ router.push(buildDepartmentModulePath('/modules/pos'));
},
onClickCount: () => {
- this.onClick();
+ router.push(buildDepartmentModulePath('/modules/pos'));
},
count: 0
},
@@ -42,16 +48,10 @@ const modules = computed(() => [
description: t('admin.department_modules.bookings.description'),
icon: "fas fa-calendar-alt",
onClick: () => {
- // Get the departmentId from the URL
- const departmentId = router.currentRoute.value.params.departmentId;
- // Redirect to the bookings
- router.push(`/admin/${departmentId}/modules/bookings`);
+ router.push(buildDepartmentModulePath('/modules/bookings'));
},
onClickCount: () => {
- // Get the departmentId from the URL
- const departmentId = router.currentRoute.value.params.departmentId;
- // Redirect to the bookings
- router.push(`/admin/${departmentId}/modules/bookings?search=pending`);
+ router.push(buildDepartmentModulePath('/modules/bookings?search=pending'));
},
count: bookingsCount.value
},
@@ -61,13 +61,10 @@ const modules = computed(() => [
description: t('admin.department_modules.daily_report.description'),
icon: "fas fa-book",
onClick: () => {
- // Get the departmentId from the URL
- const departmentId = router.currentRoute.value.params.departmentId;
- // Redirect to the POS system
- router.push(`/admin/${departmentId}/modules/daily-report`);
+ router.push(buildDepartmentModulePath('/modules/daily-report'));
},
onClickCount: () => {
- this.onClick();
+ router.push(buildDepartmentModulePath('/modules/daily-report'));
},
count: 0
},
@@ -77,13 +74,10 @@ const modules = computed(() => [
description: t('admin.department_modules.goals.description'),
icon: "fas fa-bullseye",
onClick: () => {
- // Get the departmentId from the URL
- const departmentId = router.currentRoute.value.params.departmentId;
- // Redirect to the goals
- router.push(`/admin/${departmentId}/modules/goals`);
+ router.push(buildDepartmentModulePath('/modules/goals'));
},
onClickCount: () => {
- this.onClick();
+ router.push(buildDepartmentModulePath('/modules/goals'));
},
count: 0
},
@@ -93,13 +87,10 @@ const modules = computed(() => [
description: t('admin.department_modules.self_wash.description'),
icon: "fas fa-tint",
onClick: () => {
- // Get the departmentId from the URL
- const departmentId = router.currentRoute.value.params.departmentId;
- // Redirect to the wash lanes
- router.push(`/admin/${departmentId}/modules/wash-lanes`);
+ router.push(buildDepartmentModulePath('/modules/wash-lanes'));
},
onClickCount: () => {
- this.onClick();
+ router.push(buildDepartmentModulePath('/modules/wash-lanes'));
},
count: 0,
hasSwitch: true,
@@ -131,11 +122,10 @@ const modules = computed(() => [
description: 'Configure questions, conditions, rules and tasks',
icon: "fas fa-project-diagram",
onClick: () => {
- const departmentId = router.currentRoute.value.params.departmentId;
- router.push(`/admin/${departmentId}/modules/self-serve/studio`);
+ router.push(buildDepartmentModulePath('/modules/self-serve/studio'));
},
onClickCount: () => {
- this.onClick();
+ router.push(buildDepartmentModulePath('/modules/self-serve/studio'));
},
count: 0
}
@@ -177,11 +167,6 @@ const modules = computed(() => [
*/
]);
-// Get the departmentId from the URL
-const getDepartmentId = () => {
- return parseInt(router.currentRoute.value.params.departmentId);
-};
-
// Get today's bookings
const getTodaysBookings = async () => {
// Return, if the departmentId is not set
@@ -231,9 +216,9 @@ setInterval(() => {
-