+
diff --git a/src/components/session/token/SessionUser.vue b/src/components/session/token/SessionUser.vue
index 50d09e01..7666c2ef 100644
--- a/src/components/session/token/SessionUser.vue
+++ b/src/components/session/token/SessionUser.vue
@@ -16,6 +16,7 @@ import {EconomicProducts} from "@/components/session/token/SessionUser/Objects/e
import {Roles} from "@/components/session/token/SessionUser/Objects/Roles.vue";
import {Permissions} from "@/components/session/token/SessionUser/Objects/Permissions.vue";
import {ObjectsGlobal} from "@/components/session/token/SessionUser/Objects/ObjectsGlobal.vue";
+import {useRouter} from "vue-router";
/**
* Initiate the user session on app start
@@ -68,6 +69,7 @@ export const getSessionData = async () => {
SessionUser.user.group_id.value = response.data.data.group_id;
SessionUser.user.created_at.value = response.data.data.created_at;
SessionUser.user.updated_at.value = response.data.data.updated_at;
+ SessionUser.user.display_name.value = response.data.data.display_name;
// Set the last cached time to now, this is used to determine if the user's data is outdated
SessionUser.user.cached_at.value = new Date();
SessionUser.permissions.value = response.data.data.permissions;
@@ -75,6 +77,10 @@ export const getSessionData = async () => {
if (response.data.data.economic_customer.length > 0) {
SessionUser.economicData.customerNumber.value = response.data.data.economic_customer.customerNumber;
SessionUser.economicData.name.value = response.data.data.economic_customer.name;
+ // Set the display name to the e-conomic name if it's empty
+ if (SessionUser.user.display_name.value === null) {
+ SessionUser.user.display_name.value = response.data.data.economic_customer.name;
+ }
SessionUser.economicData.address.value = response.data.data.economic_customer.address;
SessionUser.economicData.zip.value = response.data.data.economic_customer.zip;
SessionUser.economicData.city.value = response.data.data.economic_customer.city;
@@ -251,6 +257,42 @@ export const SessionUser = {
/** reCAPTCHA */
reCAPTCHA: reCAPTCHA,
},
+ functions: {
+ /** Get the department id from the url */
+ getDepartmentIdFromUrl: () => {
+ // Check if the department id is in the route
+ const router = useRouter();
+ return router.currentRoute.value.params.departmentId;
+ },
+ /** Redirect to */
+ redirectTo: {
+ /**
+ * Redirect to a department
+ * @note This will redirect the user to '/admin/:department(/:path)'
+ * @param department The department id
+ * @param path The path to redirect to (Optional)
+ */
+ department: (department, path = null) => {
+ window.location.href = '/admin/' + department + (path !== null ? '/' + path : '');
+ },
+ /**
+ * Redirect to a superuser page
+ * @note This will redirect the user to '/superuser(/:path)'
+ * @param path The path to redirect to (Optional)
+ */
+ superUser: (path = null) => {
+ window.location.href = '/superuser' + (path !== null ? path : '');
+ },
+ /**
+ * Redirect to a user page
+ * @note This will redirect the user to '/user(/:path)'
+ * @param path The path to redirect to (Optional)
+ */
+ user: (path = null) => {
+ window.location.href = '/user' + (path !== null ? path : '');
+ },
+ }
+ },
request: authenticatedRequest,
editField: EditFieldForm,
getSessionData: getSessionData,
diff --git a/src/main.js b/src/main.js
index 43590a78..3441960d 100644
--- a/src/main.js
+++ b/src/main.js
@@ -9,6 +9,7 @@ import { createApp } from 'vue'
import App from './App.vue'
import store from './store/user.vue'
import {router} from "@/router.js";
+import {Colors} from "./ThemeConfig.vue";
import applyMiddleware from '@/middleware/index.js';
applyMiddleware(router);
@@ -16,4 +17,5 @@ applyMiddleware(router);
createApp(App)
.use(store)
.use(router)
+ .provide('Colors', Colors)
.mount('#app')
diff --git a/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue b/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue
index 9796171b..c4be97b3 100644
--- a/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue
+++ b/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue
@@ -13,8 +13,8 @@ const departmentId = ref(router.currentRoute.value.params.departmentId);
diff --git a/src/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue b/src/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue
new file mode 100644
index 00000000..1308b3de
--- /dev/null
+++ b/src/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue b/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue
index ba0eb5a9..57f307d6 100644
--- a/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue
+++ b/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue
@@ -6,14 +6,23 @@ import PosDepartmentMVP from "@/components/displays/department/pos/PosDepartment
import DepartmentPosNavigation from "@/views/dashboards/departmentDashboard/modules/Pos/DepartmentPosNavigation.vue";
import RestrictedPageWrapper from "@/components/page/wrappers/RestrictedPageWrapper.vue";
import { SessionUser } from "@/components/session/token/SessionUser.vue";
+import DepartmentDashboardPageWrapper from "@/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue";
+import PageTitle from "@/components/global/PageTitle.vue";
-
-
-
-
-
+
+
+
+
+
+
+
+
+