diff --git a/src/pages/help-page.vue b/src/pages/help-page.vue
index e69de29..ef8563f 100644
--- a/src/pages/help-page.vue
+++ b/src/pages/help-page.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/router/router-constants.ts b/src/router/router-constants.ts
index eff5290..b99f6b2 100644
--- a/src/router/router-constants.ts
+++ b/src/router/router-constants.ts
@@ -6,5 +6,6 @@ export enum RouteNames {
EMPLOYEE_LIST = 'employee_list',
EMPLOYEE_MANAGEMENT = 'employee_management',
PROFILE = 'personal_profile',
- TIMESHEET = 'timesheets'
+ TIMESHEET = 'timesheets',
+ HELP = 'help',
}
\ No newline at end of file
diff --git a/src/router/routes.ts b/src/router/routes.ts
index faf1ecb..01927b2 100644
--- a/src/router/routes.ts
+++ b/src/router/routes.ts
@@ -3,12 +3,12 @@ import { RouteNames } from './router-constants';
const routes: RouteRecordRaw[] = [
{
- path: '/',
+ path: '/',
component: () => import('src/layouts/main-layout.vue'),
meta: { requiresAuth: true },
children: [
- {
- path: '',
+ {
+ path: '',
name: RouteNames.DASHBOARD,
component: () => import('src/pages/dashboard-page.vue'),
},
@@ -32,18 +32,23 @@ const routes: RouteRecordRaw[] = [
name: RouteNames.PROFILE,
component: () => import('src/pages/profile-page.vue'),
},
+ {
+ path: 'help',
+ name: RouteNames.HELP,
+ component: () => import('src/pages/help-page.vue'),
+ },
],
},
{
- path: '/v1/login',
+ path: '/v1/login',
name: RouteNames.LOGIN,
component: () => import('src/pages/login-page.vue'),
meta: { requiresAuth: false },
},
{
- path: '/login-success',
+ path: '/login-success',
name: RouteNames.LOGIN_SUCCESS,
component: () => import('src/modules/auth/pages/auth-login-popup-success.vue'),
meta: { requiresAuth: false },
diff --git a/src/stores/auth-store.ts b/src/stores/auth-store.ts
index 17b54e7..7f6ec1e 100644
--- a/src/stores/auth-store.ts
+++ b/src/stores/auth-store.ts
@@ -4,9 +4,11 @@ import { AuthService } from "../modules/auth/services/services-auth";
import { CAN_APPROVE_PAY_PERIODS, type User } from "src/modules/shared/models/user.models";
import { useRouter } from "vue-router";
import { Notify } from "quasar";
+import type { ModuleAccessName } from "src/modules/employee-list/models/employee-profile.models";
export const useAuthStore = defineStore('auth', () => {
const user = ref
();
+ const user_module_access = ref();
const authError = ref("");
const isAuthorizedUser = computed(() => CAN_APPROVE_PAY_PERIODS.includes(user.value?.role ?? 'GUEST'));
const router = useRouter();
@@ -62,6 +64,15 @@ export const useAuthStore = defineStore('auth', () => {
return { status: 400, message: 'unknown error occured' };
}
- return { user, authError, isAuthorizedUser, login, oidcLogin, logout, getProfile };
+ return {
+ user,
+ authError,
+ isAuthorizedUser,
+ user_module_access,
+ login,
+ oidcLogin,
+ logout,
+ getProfile
+ };
});
diff --git a/src/stores/help-store.ts b/src/stores/help-store.ts
new file mode 100644
index 0000000..1141b66
--- /dev/null
+++ b/src/stores/help-store.ts
@@ -0,0 +1,47 @@
+import { defineStore } from "pinia";
+import { ref } from "vue";
+import { HelpService } from "src/modules/help/services/help.service";
+import type { HelpModule } from "src/modules/help/models/help-module.model";
+
+export const useHelpStore = defineStore('help', () => {
+ const is_loading = ref(false);
+ const help_modules = ref([]);
+ const custom_help_module_options: string[] = [];
+ const options: { label: string, path: string }[] = [];
+
+ const getHelpModules = async (): Promise => {
+ try {
+ const response = await HelpService.getHelpModules();
+ if (response.success && response.data) help_modules.value = response.data;
+ for (const module in help_modules) {
+ if (module === 'personal_profile') {
+ custom_help_module_options.push(module);
+ }
+ if (module === 'timesheet') {
+ custom_help_module_options.push(module);
+ }
+ if (module === 'employee_list') {
+ custom_help_module_options.push(module);
+ }
+ if (module === 'employee_management') {
+ custom_help_module_options.push(module);
+ }
+ if (module === 'timesheets_approval') {
+ custom_help_module_options.push(module);
+ }
+ }
+ return response.success;
+ } catch (error) {
+ console.error('An error occured while fetching Help modules', error);
+ return false;
+ }
+ };
+
+ return {
+ is_loading,
+ help_modules,
+ options,
+ custom_help_module_options,
+ getHelpModules,
+ }
+});
\ No newline at end of file