feat: added a centralized context folder which holds objects that describes the webpages of the app from a high level
This commit is contained in:
parent
19b2dd934c
commit
6277a73bd6
|
|
@ -73,7 +73,7 @@ const handleLogout = () => {
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label class="text-uppercase text-weight-bold">{{ $t('nav_bar.timesheet_approvals')
|
<q-item-label class="text-uppercase text-weight-bold">{{ $t('nav_bar.timesheet_approvals')
|
||||||
}}</q-item-label>
|
}}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
|
|
@ -93,7 +93,7 @@ const handleLogout = () => {
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label class="text-uppercase text-weight-bold">{{ $t('nav_bar.employee_list')
|
<q-item-label class="text-uppercase text-weight-bold">{{ $t('nav_bar.employee_list')
|
||||||
}}</q-item-label>
|
}}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ const handleLogout = () => {
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label class="text-uppercase text-weight-bold">{{ $t('nav_bar.timesheet')
|
<q-item-label class="text-uppercase text-weight-bold">{{ $t('nav_bar.timesheet')
|
||||||
}}</q-item-label>
|
}}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,31 @@
|
||||||
<script
|
<script setup lang="ts">
|
||||||
setup
|
import { computed, ref } from 'vue';
|
||||||
lang="ts"
|
import { useTimesheetStore } from 'src/stores/timesheet-store';
|
||||||
>
|
import OverviewListItem from 'src/modules/timesheet-approval/components/overview-list-item.vue';
|
||||||
import { computed, ref } from 'vue';
|
import QTableFilters from 'src/modules/shared/components/q-table-filters.vue';
|
||||||
import { useTimesheetStore } from 'src/stores/timesheet-store';
|
import PayPeriodNavigator from 'src/modules/shared/components/pay-period-navigator.vue';
|
||||||
import OverviewListItem from 'src/modules/timesheet-approval/components/overview-list-item.vue';
|
import { pay_period_overview_columns, type PayPeriodOverview } from 'src/modules/timesheet-approval/models/pay-period-overview.models';
|
||||||
import QTableFilters from 'src/modules/shared/components/q-table-filters.vue';
|
|
||||||
import PayPeriodNavigator from 'src/modules/shared/components/pay-period-navigator.vue';
|
|
||||||
import { pay_period_overview_columns, type PayPeriodOverview } from 'src/modules/timesheet-approval/models/pay-period-overview.models';
|
|
||||||
|
|
||||||
const timesheet_store = useTimesheetStore();
|
const timesheet_store = useTimesheetStore();
|
||||||
const filter = ref<string | number | null>('');
|
const filter = ref<string | number | null>('');
|
||||||
|
|
||||||
const employeeEmail = defineModel();
|
const employeeEmail = defineModel();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
'clickedDetailsButton': [email: string];
|
'clickedDetailsButton': [email: string];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const overview_rows = computed(() => timesheet_store.pay_period_overviews[0]?.regular_hours === -1 ?
|
const overview_rows = computed(() => timesheet_store.pay_period_overviews[0]?.regular_hours === -1 ?
|
||||||
[] :
|
[] :
|
||||||
timesheet_store.pay_period_overviews
|
timesheet_store.pay_period_overviews
|
||||||
)
|
)
|
||||||
|
|
||||||
const onClickedDetails = async (employee_email: string, row: PayPeriodOverview) => {
|
const onClickedDetails = async (employee_email: string, row: PayPeriodOverview) => {
|
||||||
employeeEmail.value = employee_email;
|
employeeEmail.value = employee_email;
|
||||||
emit('clickedDetailsButton', employee_email);
|
emit('clickedDetailsButton', employee_email);
|
||||||
timesheet_store.current_pay_period_overview = row;
|
timesheet_store.current_pay_period_overview = row;
|
||||||
await timesheet_store.getPayPeriodDetailsByEmployeeEmail(employee_email);
|
await timesheet_store.getPayPeriodDetailsByEmployeeEmail(employee_email);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -77,8 +74,8 @@
|
||||||
<template #no-data="{ message, filter }">
|
<template #no-data="{ message, filter }">
|
||||||
<div class="full-width column items-center text-primary q-gutter-sm">
|
<div class="full-width column items-center text-primary q-gutter-sm">
|
||||||
<q-icon
|
<q-icon
|
||||||
size="4em"
|
size="4em"
|
||||||
:name="filter ? 'filter_alt_off' : 'error_outline'"
|
:name="filter ? 'filter_alt_off' : 'error_outline'"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<span class="text-h6">
|
<span class="text-h6">
|
||||||
|
|
|
||||||
6
src/page-contexts/index.ts
Normal file
6
src/page-contexts/index.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
export * from "./pages/dashboard-context";
|
||||||
|
export * from "./pages/left-drawer-context";
|
||||||
|
export * from "./pages/supervisor-crew-context";
|
||||||
|
export * from "./pages/profile-context";
|
||||||
|
export * from "./pages/timesheet-approval-context";
|
||||||
|
export * from "./pages/timesheet-context";
|
||||||
10
src/page-contexts/pages/dashboard-context.ts
Normal file
10
src/page-contexts/pages/dashboard-context.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
export const dashboardContext = {
|
||||||
|
name: "Test-Page",
|
||||||
|
description:
|
||||||
|
"Temporary static landing page while the application is still in development",
|
||||||
|
features: [
|
||||||
|
"Used as a landing platform and navigate the left drawer",
|
||||||
|
"Access the ai chatbot from the header",
|
||||||
|
"See your user icon with a notification icon",
|
||||||
|
],
|
||||||
|
};
|
||||||
14
src/page-contexts/pages/left-drawer-context.ts
Normal file
14
src/page-contexts/pages/left-drawer-context.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
export const leftDrawerContext = {
|
||||||
|
name: "Left Drawer",
|
||||||
|
description:
|
||||||
|
"A drawer that acts as a navigation bar, able to surf to differnent parts of the website.",
|
||||||
|
features: [
|
||||||
|
"The user can navigate to the home page.",
|
||||||
|
"Depending on their role and clearence can approve timesheets. ",
|
||||||
|
"Depending on their role, can see the full list of employees.",
|
||||||
|
"Can access the timesheet interface to input employee hours.",
|
||||||
|
"Can acess your user profile to add or change information",
|
||||||
|
"Can access the Help page to ask for assistance.",
|
||||||
|
"Can logout",
|
||||||
|
],
|
||||||
|
};
|
||||||
9
src/page-contexts/pages/profile-context.ts
Normal file
9
src/page-contexts/pages/profile-context.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
export const profileContext = {
|
||||||
|
name: "Profile",
|
||||||
|
description: "Display and edit user information",
|
||||||
|
features: [
|
||||||
|
"Add and edit Personal information such as first and last name, phone, birthdate and address.",
|
||||||
|
"Add and edit Career information such job title, company, supervisor, email and hiring date.",
|
||||||
|
"Edit available preferences such as Display options of light and dark mode, and language options",
|
||||||
|
],
|
||||||
|
};
|
||||||
8
src/page-contexts/pages/supervisor-crew-context.ts
Normal file
8
src/page-contexts/pages/supervisor-crew-context.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
export const supervisorContext = {
|
||||||
|
name: "Supervisor Crew Page",
|
||||||
|
description: "View all the hired Staff",
|
||||||
|
feature: [
|
||||||
|
"View the list of hired employees",
|
||||||
|
"Access an individual employee",
|
||||||
|
],
|
||||||
|
};
|
||||||
14
src/page-contexts/pages/timesheet-approval-context.ts
Normal file
14
src/page-contexts/pages/timesheet-approval-context.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
export const timesheetApprovalContext = {
|
||||||
|
name: "Timesheet-Approval",
|
||||||
|
description:
|
||||||
|
"Page where employee hours and shifts are approved by the HR deparment",
|
||||||
|
features: [
|
||||||
|
"See a list of cards with the total hours for the week for each employee.",
|
||||||
|
"Access different weeks thanks to the calender button",
|
||||||
|
"Approve the hours for the cards displayed.",
|
||||||
|
"Open a detailed modal for each card",
|
||||||
|
"Display a bar chart within the modal to display the type of hours, expenses, and mileage.",
|
||||||
|
"Edit the hours, and their type such as regular, holiday, vacation etc.",
|
||||||
|
"Add and edit expenses for the week, along with attached files for said expenses",
|
||||||
|
],
|
||||||
|
};
|
||||||
13
src/page-contexts/pages/timesheet-context.ts
Normal file
13
src/page-contexts/pages/timesheet-context.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
export const timesheetContext = {
|
||||||
|
name: "Timesheet-page",
|
||||||
|
description:
|
||||||
|
"Page where an employee can enter their hours for their day and week",
|
||||||
|
features: [
|
||||||
|
"Enter your in and out times per day",
|
||||||
|
"Add and edit what kind of hours your shift was example regular, overtime, vacation etc.",
|
||||||
|
"Edit your own shift hours",
|
||||||
|
"Delete your shift hours",
|
||||||
|
"List your expenses for the week",
|
||||||
|
"Add expenses for the week, along with attached files for said expenses",
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ProfileEmployee from 'src/modules/profile/pages/employee/profile-employee.vue';
|
import ProfileEmployee from 'src/modules/profile/pages/employee/profile-employee.vue';
|
||||||
import { useAuthStore } from 'src/stores/auth-store';
|
import { useAuthStore } from 'src/stores/auth-store';
|
||||||
import { type EmployeeProfile } from 'src/modules/employee-list/types/employee-profile-interface';
|
import { type EmployeeProfile } from 'src/modules/employee-list/types/employee-profile-interface';
|
||||||
|
|
||||||
const auth_store = useAuthStore();
|
const auth_store = useAuthStore();
|
||||||
const employee_roles = [ 'SUPERVISOR', 'EMPLOYEE', 'ADMIN', 'HR', 'ACCOUNTING' ];
|
const employee_roles = ['SUPERVISOR', 'EMPLOYEE', 'ADMIN', 'HR', 'ACCOUNTING'];
|
||||||
|
|
||||||
const { employeeProfile } = defineProps<{
|
const { employeeProfile } = defineProps<{
|
||||||
employeeProfile?: EmployeeProfile | undefined;
|
employeeProfile?: EmployeeProfile | undefined;
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-page class="bg-secondary column items-center justify-center">
|
<q-page class="bg-secondary column items-center justify-center">
|
||||||
<ProfileEmployee
|
<ProfileEmployee
|
||||||
v-if="employee_roles.includes( auth_store.user.role.toUpperCase() )"
|
v-if="employee_roles.includes(auth_store.user.role.toUpperCase())"
|
||||||
class="col-auto"
|
class="col-auto"
|
||||||
:employee-profile="employeeProfile"
|
:employee-profile="employeeProfile"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import SupervisorCrewTable from '../components/supervisor/supervisor-crew-table.vue';
|
import SupervisorCrewTable from '../components/supervisor/supervisor-crew-table.vue';
|
||||||
import EmployeeListAddModifyDialog from '../components/employee/employee-list-add-modify-dialog.vue';
|
import EmployeeListAddModifyDialog from '../components/employee/employee-list-add-modify-dialog.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
<script
|
<script setup lang="ts">
|
||||||
setup
|
import { useQuasar } from 'quasar';
|
||||||
lang="ts"
|
import type { QVueGlobals } from 'quasar';
|
||||||
>
|
|
||||||
import { useQuasar } from 'quasar';
|
|
||||||
import type { QVueGlobals } from 'quasar';
|
|
||||||
|
|
||||||
const q: QVueGlobals = useQuasar();
|
const q: QVueGlobals = useQuasar();
|
||||||
|
|
||||||
const clickNotify = () => {
|
const clickNotify = () => {
|
||||||
q.notify({
|
q.notify({
|
||||||
message: 'Nick pinged you.',
|
message: 'Nick pinged you.',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,38 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { useTimesheetApprovalApi } from 'src/modules/timesheet-approval/composables/use-timesheet-approval-api';
|
import { useTimesheetApprovalApi } from 'src/modules/timesheet-approval/composables/use-timesheet-approval-api';
|
||||||
import { useTimesheetStore } from 'src/stores/timesheet-store';
|
import { useTimesheetStore } from 'src/stores/timesheet-store';
|
||||||
import PageHeaderTemplate from 'src/modules/shared/components/page-header-template.vue';
|
import PageHeaderTemplate from 'src/modules/shared/components/page-header-template.vue';
|
||||||
import OverviewList from 'src/modules/timesheet-approval/components/overview-list.vue';
|
import OverviewList from 'src/modules/timesheet-approval/components/overview-list.vue';
|
||||||
import DetailscrudDialog from 'src/modules/timesheet-approval/components/details-crud-dialog.vue';
|
import DetailscrudDialog from 'src/modules/timesheet-approval/components/details-crud-dialog.vue';
|
||||||
|
|
||||||
const timesheet_approval_api = useTimesheetApprovalApi();
|
const timesheet_approval_api = useTimesheetApprovalApi();
|
||||||
const timesheet_store = useTimesheetStore();
|
const timesheet_store = useTimesheetStore();
|
||||||
const is_details_dialog_open = ref(false);
|
const is_details_dialog_open = ref(false);
|
||||||
const employee_email = ref('');
|
const employee_email = ref('');
|
||||||
|
|
||||||
const onDetailsClicked = (email: string) => {
|
const onDetailsClicked = (email: string) => {
|
||||||
employee_email.value = email;
|
employee_email.value = email;
|
||||||
is_details_dialog_open.value = true;
|
is_details_dialog_open.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted( async () => {
|
onMounted(async () => {
|
||||||
await timesheet_approval_api.getPayPeriodOverviewsByDate(date.formatDate( new Date(), 'YYYY-MM-DD'));
|
await timesheet_approval_api.getPayPeriodOverviewsByDate(date.formatDate(new Date(), 'YYYY-MM-DD'));
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-page
|
<q-page
|
||||||
padding
|
padding
|
||||||
class="q-pa-md bg-secondary "
|
class="q-pa-md bg-secondary "
|
||||||
>
|
>
|
||||||
<PageHeaderTemplate
|
<PageHeaderTemplate
|
||||||
title="timesheet_approvals.page_title"
|
title="timesheet_approvals.page_title"
|
||||||
:start-date="timesheet_store.pay_period.period_start"
|
:start-date="timesheet_store.pay_period.period_start"
|
||||||
:end-date="timesheet_store.pay_period.period_end"
|
:end-date="timesheet_store.pay_period.period_end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DetailscrudDialog
|
<DetailscrudDialog
|
||||||
v-model:dialog="is_details_dialog_open"
|
v-model:dialog="is_details_dialog_open"
|
||||||
:employee-email="employee_email"
|
:employee-email="employee_email"
|
||||||
|
|
@ -41,6 +41,6 @@
|
||||||
:timesheet-details="timesheet_store.pay_period_details"
|
:timesheet-details="timesheet_store.pay_period_details"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<OverviewList @clickedDetailsButton="onDetailsClicked"/>
|
<OverviewList @clickedDetailsButton="onDetailsClicked" />
|
||||||
</q-page>
|
</q-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -1,25 +1,21 @@
|
||||||
<script
|
<script setup lang="ts">
|
||||||
setup
|
import { date } from 'quasar';
|
||||||
lang="ts"
|
import { onMounted } from 'vue';
|
||||||
>
|
import { useAuthStore } from 'src/stores/auth-store';
|
||||||
import { date } from 'quasar';
|
import { useTimesheetApi } from 'src/modules/timesheets/composables/api/use-timesheet-api';
|
||||||
import { onMounted } from 'vue';
|
import { useTimesheetStore } from 'src/stores/timesheet-store';
|
||||||
import { useAuthStore } from 'src/stores/auth-store';
|
import PageHeaderTemplate from 'src/modules/shared/components/page-header-template.vue';
|
||||||
import { useTimesheetApi } from 'src/modules/timesheets/composables/api/use-timesheet-api';
|
import TimesheetWrapper from 'src/modules/timesheets/components/timesheet-wrapper.vue';
|
||||||
import { useTimesheetStore } from 'src/stores/timesheet-store';
|
|
||||||
import PageHeaderTemplate from 'src/modules/shared/components/page-header-template.vue';
|
|
||||||
import TimesheetWrapper from 'src/modules/timesheets/components/timesheet-wrapper.vue';
|
|
||||||
|
|
||||||
const { user } = useAuthStore();
|
const { user } = useAuthStore();
|
||||||
const timesheet_store = useTimesheetStore();
|
const timesheet_store = useTimesheetStore();
|
||||||
const timesheet_api = useTimesheetApi();
|
const timesheet_api = useTimesheetApi();
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await timesheet_api.getPayPeriodDetailsByDate(date.formatDate(new Date(), 'YYYY-MM-DD'));
|
await timesheet_api.getPayPeriodDetailsByDate(date.formatDate(new Date(), 'YYYY-MM-DD'));
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-page
|
<q-page
|
||||||
padding
|
padding
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user