From c40156adbd2df023490bbe5dc8b5b4ca2d26163c Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Mon, 22 Dec 2025 14:35:45 -0500 Subject: [PATCH] BREAKING(help-page): commit breaking codes to switch branch --- src/modules/help/components/help-module.vue | 9 ++-- src/modules/help/models/help-module.model.ts | 28 ++++++---- src/modules/help/services/help.service.ts | 6 +-- src/stores/help-store.ts | 56 ++++++++++---------- 4 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/modules/help/components/help-module.vue b/src/modules/help/components/help-module.vue index 1ede6f3..f46de62 100644 --- a/src/modules/help/components/help-module.vue +++ b/src/modules/help/components/help-module.vue @@ -7,8 +7,8 @@ import default_employee_list from 'src/assets/help-ss/default-employee-list.png' import default_employee_management from 'src/assets/help-ss/default-employee-management.png'; import default_validation_page from 'src/assets/help-ss/default-validation-page.png'; -const default_images: Record = { - // dashboard: default_dashboard, +const default_images: Record = { + dashboard: '', personal_profile: default_personal_profile, timesheets: default_timesheet, employee_list: default_employee_list, @@ -16,11 +16,12 @@ const default_images: Record = { timesheets_approval: default_validation_page, }; -import type { HelpModuleKey, HelpModuleOptions } from 'src/modules/help/models/help-module.model'; +import type { HelpModuleOptions } from 'src/modules/help/models/help-module.model'; import { ref } from 'vue'; +import { ModuleAccessName } from 'src/modules/employee-list/models/employee-profile.models'; const props = defineProps<{ - help_module: HelpModuleKey; + help_module: ModuleAccessName; options: HelpModuleOptions[]; moduleIndex: number; }>(); diff --git a/src/modules/help/models/help-module.model.ts b/src/modules/help/models/help-module.model.ts index cad8cc1..e1fe1b3 100644 --- a/src/modules/help/models/help-module.model.ts +++ b/src/modules/help/models/help-module.model.ts @@ -1,10 +1,10 @@ -export type HelpModuleKey = - // | 'dashboard' - | 'personal_profile' - | 'timesheets' - | 'employee_list' - | 'employee_management' - | 'timesheets_approval'; +// export type HelpModuleKey = +// // | 'dashboard' +// | 'personal_profile' +// | 'timesheets' +// | 'employee_list' +// | 'employee_management' +// | 'timesheets_approval'; export type HelpModuleOptions = { label: string; @@ -13,8 +13,9 @@ export type HelpModuleOptions = { icon: string; }; -export type Options = Record; -export type PartialOptions = Partial>; +export type Options = Record; +export type PartialOptions = Partial>; + //Shared images and descriptions @@ -125,6 +126,7 @@ import comment_expense from 'src/assets/help-ss/timesheet-details.png'; import timesheet_approval_inspect from 'src/assets/help-ss/timesheet-approvals.png'; import timesheet_details from 'src/assets/help-ss/timesheet-details.png'; import timesheet_approval_list from 'src/assets/help-ss/timesheet-appovals-list.png'; +import { ModuleAccessName } from 'src/modules/employee-list/models/employee-profile.models'; const comment_expense_desc = "descriptions.timesheets_approval.comment_expense"; const timesheets_approval_desc = "descriptions.timesheets_approval.approval"; @@ -142,6 +144,14 @@ export const timesheets_approval_options: HelpModuleOptions[] = [ +export const help_module_details: Options = { + dashboard: [], + personal_profile: profile_options, + timesheets: timesheets_options, + employee_list: employee_list_options, + employee_management: employee_management_options, + timesheets_approval: timesheets_approval_options, +}; diff --git a/src/modules/help/services/help.service.ts b/src/modules/help/services/help.service.ts index ff4eb4d..ea7dafa 100644 --- a/src/modules/help/services/help.service.ts +++ b/src/modules/help/services/help.service.ts @@ -1,10 +1,10 @@ import { api } from "src/boot/axios"; -import type { HelpModuleKey } from "src/modules/help/models/help-module.model"; +import { ModuleAccessName } from "src/modules/employee-list/models/employee-profile.models"; import type { BackendResponse } from "src/modules/shared/models/backend-response.models"; export const HelpService = { - getHelpModules: async (): Promise> => { - const response = await api.get>(`/help`); + getHelpModules: async (): Promise> => { + const response = await api.get>(`/help`); return response.data; } } \ No newline at end of file diff --git a/src/stores/help-store.ts b/src/stores/help-store.ts index 957a888..dd33cc7 100644 --- a/src/stores/help-store.ts +++ b/src/stores/help-store.ts @@ -1,58 +1,56 @@ import { defineStore } from "pinia"; import { computed, ref } from "vue"; import { HelpService } from "src/modules/help/services/help.service"; -import { profile_options, timesheets_options, employee_list_options, employee_management_options, timesheets_approval_options } from "src/modules/help/models/help-module.model"; -import type { Options, HelpModuleKey, HelpModuleOptions } from "src/modules/help/models/help-module.model"; +import { help_module_details } from "src/modules/help/models/help-module.model"; +import type { HelpModuleOptions } from "src/modules/help/models/help-module.model"; +import { ModuleAccessName } from "src/modules/employee-list/models/employee-profile.models"; +import { useAuthStore } from "src/stores/auth-store"; export const useHelpStore = defineStore('help', () => { const is_loading = ref(false); - const help_modules = ref([]); + const auth_store = useAuthStore(); - const help_module_details = ref({ - // dashboard: dashboard_options, - personal_profile: profile_options, - timesheets: timesheets_options, - employee_list: employee_list_options, - employee_management: employee_management_options, - timesheets_approval: timesheets_approval_options, - }); + const getFilteredModule = () => { - const help_module_filters = computed>(() => { + } + + + >(() => { const entries = help_modules.value .map((key) => { - const options = help_module_details.value[key]; + const options = help_module_details[key]; return options ? ([key, options] as const) : null; }) .filter( - (entry): entry is readonly [HelpModuleKey, HelpModuleOptions[]] => + (entry): entry is readonly [ModuleAccessName, HelpModuleOptions[]] => entry !== null ); - return Object.fromEntries(entries) as Record; + return Object.fromEntries(entries) as Record; }); - const getHelpModules = async (): Promise => { - is_loading.value = true; - try { - const response = await HelpService.getHelpModules(); - if (response.success && response.data) help_modules.value = response.data; + // const getHelpModules = async (): Promise => { + // is_loading.value = true; + // try { + // const response = await HelpService.getHelpModules(); + // if (response.success && response.data) help_modules.value = response.data; - return response.success; - } catch (error) { - console.error('An error occured while fetching Help modules', error); - return false; - } finally { - is_loading.value = false; - } - }; + // return response.success; + // } catch (error) { + // console.error('An error occured while fetching Help modules', error); + // return false; + // } finally { + // is_loading.value = false; + // } + // }; return { is_loading, help_modules, help_module_details, help_module_filters, - getHelpModules, + // getHelpModules, }; }); \ No newline at end of file