fix(scaffolding): redid some folder structure to be more modular, moved some folders from modules to src, general file/folder cleanup.

This commit is contained in:
Nicolas Drolet 2025-07-28 12:22:51 -04:00
parent a63ae452a8
commit 94604cda1b
71 changed files with 72 additions and 55 deletions

View File

@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 326.39 70.35"><defs><style>.cls-1{fill:#019547;}</style></defs><path class="cls-1" d="M25.83,15H8.41a4.14,4.14,0,0,1-3.89-2.71L0,1.18H66.59L62.07,12.27A4.14,4.14,0,0,1,58.18,15H40.76V69.19H25.81Z"/><path class="cls-1" d="M90.74.68h18.55a5.63,5.63,0,0,1,5.63,5.6l.26,62.91H99.55L99.76,54H71.87L66.41,65.51a6.45,6.45,0,0,1-5.84,3.68H49.35L73.53,12.11A18.7,18.7,0,0,1,90.74.68M100,40.73l.07-26h-8a6.75,6.75,0,0,0-6.26,4.18L76.73,40.73Z"/><path class="cls-1" d="M124.51,6.81a5.64,5.64,0,0,1,5.65-5.65H155.6c8.64,0,15.37,2.44,19.81,6.91,3.81,3.78,5.84,9.14,5.84,15.53v.18c0,11-5.92,17.87-14.59,21.1l16.61,24.29h-14a6.51,6.51,0,0,1-5.39-2.87L151.21,47.41H139.44V69.17h-15Zm30.12,27.41c7.28,0,11.45-3.89,11.45-9.62v-.21c0-6.42-4.46-9.7-11.74-9.7H139.46V34.22Z"/><path class="cls-1" d="M184.74,35.37v-.18C184.74,15.85,199.8,0,220.4,0,232.65,0,240,3.31,247.13,9.33l-6.28,7.57a5.18,5.18,0,0,1-6.84,1,23.71,23.71,0,0,0-14.11-4.13c-10.88,0-19.52,9.62-19.52,21.18v.19c0,12.43,8.54,21.57,20.6,21.57a24,24,0,0,0,14.09-4.07V42.91h-8.68A6.41,6.41,0,0,1,220,36.53V30h29.54V59.52a44,44,0,0,1-29,10.78c-21.18,0-35.74-14.8-35.74-34.93"/><path class="cls-1" d="M254.09,35.37v-.18C254.09,15.85,269.33,0,290.33,0s36.06,15.66,36.06,35v.18c0,19.34-15.27,35.19-36.24,35.19s-36.06-15.64-36.06-35m56.63,0v-.18c0-11.67-8.54-21.39-20.6-21.39S269.73,23.34,269.73,35v.18c0,11.67,8.54,21.37,20.6,21.37S310.72,47,310.72,35.37"/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -5,7 +5,7 @@ import messages from 'src/modules/i18n';
export type MessageLanguages = keyof typeof messages; export type MessageLanguages = keyof typeof messages;
// Type-define 'en-US' as the master schema for the resource // Type-define 'en-US' as the master schema for the resource
export type MessageSchema = typeof messages['en-CA']; export type MessageSchema = typeof messages['en-ca'];
// See https://vue-i18n.intlify.dev/guide/advanced/typescript.html#global-resource-schema-type-definition // See https://vue-i18n.intlify.dev/guide/advanced/typescript.html#global-resource-schema-type-definition
/* eslint-disable @typescript-eslint/no-empty-object-type */ /* eslint-disable @typescript-eslint/no-empty-object-type */
@ -23,7 +23,7 @@ declare module 'vue-i18n' {
export default defineBoot(({ app }) => { export default defineBoot(({ app }) => {
const i18n = createI18n<{ message: MessageSchema }, MessageLanguages>({ const i18n = createI18n<{ message: MessageSchema }, MessageLanguages>({
locale: 'en-CA', locale: 'en-ca',
legacy: false, legacy: false,
messages, messages,
}); });

View File

@ -1,27 +1,21 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import router from "src/modules/router"; import router from "src/modules/router";
import { api } from "src/boot/axios"; import { api } from "src/boot/axios";
import { User } from "../shared/components/models/models-user"; import { User } from "src/modules/users/types/user-interface";
import { AuthState } from "./types/auth-interface";
interface AuthState {
token: string | null;
user: User;
loading: boolean;
error: string | null;
}
export const useAuthStore = defineStore('auth', { export const useAuthStore = defineStore('auth', {
state: (): AuthState => ({ state: (): AuthState => ({
token: null, token: "",
user: { user: {
firstName: 'Guest', firstName: 'Guest',
lastName: 'Guest', lastName: 'Guest',
email: 'guest@guest.com', email: 'guest@guest.com',
role: 'guest' role: 'guest'
}, } as User,
loading: false, loading: false,
error: null, error: "",
}), }),
getters: { getters: {

View File

@ -1,4 +1,4 @@
import { useAuthStore } from "src/modules/stores/auth.store"; import { useAuthStore } from "src/modules/auth/auth-store";
export const useAuthAccess = () => { export const useAuthAccess = () => {
const authStore = useAuthStore(); const authStore = useAuthStore();
@ -14,4 +14,10 @@ export const useAuthAccess = () => {
const forgotPassword = async (email: string) => { const forgotPassword = async (email: string) => {
return authStore.forgotPassword(email); return authStore.forgotPassword(email);
}; };
}
return {
isLoggedIn,
isAuthorizedUser,
forgotPassword,
};
};

View File

@ -1,4 +1,4 @@
import { useAuthStore } from "src/modules/stores/auth.store"; import { useAuthStore } from "src/modules/auth/auth-store";
export const useAuthSession = () => { export const useAuthSession = () => {
const authStore = useAuthStore(); const authStore = useAuthStore();
@ -22,4 +22,12 @@ export const useAuthSession = () => {
const setAuthToken = (token: string) => { const setAuthToken = (token: string) => {
return authStore.setAuthToken( token ); return authStore.setAuthToken( token );
}; };
}
return {
login,
oidcLogin,
logout,
setUser,
setAuthToken,
};
};

View File

@ -0,0 +1,30 @@
import { api } from 'src/boot/axios';
export const AuthService = {
// Will likely be deprecated and relegated to Authentik
login: (credentials: { email: string; password: string }) => {
// TODO: possibly add some kind of login logic, but will most likely be redirected
// to Authentik as well.
api.post('/auth/login', credentials)
},
oidcLogin: () => {
// TODO: OIDC login logic
api.post('/auth/oidclogin');
},
logout: () => {
// TODO: logout logic
api.post('/auth/logout')
},
refreshToken: () => {
// TODO: token refresh logic
api.post('/auth/refresh')
},
getProfile: () => {
// TODO: user info fetch logic
api.get('/auth/me')
},
};

View File

@ -0,0 +1,8 @@
import { User } from "src/modules/users/types/user-interface";
export interface AuthState {
token: string;
user: User;
loading: boolean;
error: string;
}

View File

View File

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { useAuthStore } from 'src/modules/stores/auth.store'; import { useAuthStore } from 'src/modules/auth/auth-store';
// import { getInitials } from 'src/helpers/object'; // import { getInitials } from 'src/helpers/object';
const route = useRoute(); const route = useRoute();
@ -35,46 +35,21 @@
<template> <template>
<q-footer bordered class="bg-white"> <q-footer bordered class="bg-white">
<q-tabs <q-tabs no-caps active-color="primary" indicator-color="transparent" class="text-grey-8">
no-caps
active-color="primary"
indicator-color="transparent"
class="text-grey-8"
>
<q-tab name="home" icon="home" @click="goToHome" /> <q-tab name="home" icon="home" @click="goToHome" />
<!-- <q-tab name="help" icon="help" @click="goToHelp" /> --> <!-- <q-tab name="help" icon="help" @click="goToHelp" /> -->
<q-tab name="menu" icon="menu" @click="toggleLeftDrawer" /> <q-tab name="menu" icon="menu" @click="toggleLeftDrawer" />
<q-drawer v-model="leftDrawerOpen" side="right"> <q-drawer v-model="leftDrawerOpen" side="right">
<q-scroll-area <q-scroll-area style="height: calc(100% - 150px); margin-top: 150px; border-right: 1px solid #ddd;">
style="
height: calc(100% - 150px);
margin-top: 150px;
border-right: 1px solid #ddd;
"
>
<q-list padding> <q-list padding>
<q-item <q-item clickable v-ripple :active="route.path === '/users'" active-class="bg-primary text-white" @click="goToUsers" v-if="userRole === 'admin'">
clickable
v-ripple
:active="route.path === '/users'"
active-class="bg-primary text-white"
@click="goToUsers"
v-if="userRole === 'admin'"
>
<q-item-section avatar> <q-item-section avatar>
<q-icon name="list" /> <q-icon name="list" />
</q-item-section> </q-item-section>
<q-item-section> {{ $t('navBar.navItem_1') }} </q-item-section> <q-item-section> {{ $t('navBar.navItem_1') }} </q-item-section>
</q-item> </q-item>
<q-item <q-item clickable v-ripple :active="route.path === '/time_sheet_validations'" active-class="bg-primary text-white" @click="goToShiftsValidations" v-if="userRole === 'admin'">
clickable
v-ripple
:active="route.path === '/time_sheet_validations'"
active-class="bg-primary text-white"
@click="goToShiftsValidations"
v-if="userRole === 'admin'"
>
<q-item-section avatar> <q-item-section avatar>
<q-icon name="supervisor_account" /> <q-icon name="supervisor_account" />
</q-item-section> </q-item-section>
@ -84,11 +59,7 @@
</q-list> </q-list>
</q-scroll-area> </q-scroll-area>
<q-img <q-img class="absolute-top" src="https://cdn.quasar.dev/img/material.png" style="height: 150px">
class="absolute-top"
src="https://cdn.quasar.dev/img/material.png"
style="height: 150px"
>
<div class="absolute-bottom bg-transparent"> <div class="absolute-bottom bg-transparent">
<!-- <q-avatar color="primary" size="68px" class="q-mb-sm"> <!-- <q-avatar color="primary" size="68px" class="q-mb-sm">
{{ {{

0
src/pages/help.vue Normal file
View File

0
src/pages/index.vue Normal file
View File

View File

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { computed } from 'vue'; import { computed } from 'vue';
import { useAuthStore } from 'src/modules/stores/auth.store'; import { useAuthStore } from 'src/modules/auth/auth-store';
// import dialogs from 'src/components/dialogs'; // import dialogs from 'src/components/dialogs';
const authStore = useAuthStore(); const authStore = useAuthStore();
@ -19,7 +19,6 @@
); );
</script> </script>
<template> <template>
<q-toolbar v-if="!isBackRoute"> <q-toolbar v-if="!isBackRoute">
<q-toolbar-title> <q-toolbar-title>

View File

@ -96,7 +96,7 @@
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
// import { getInitials } from 'src/helpers/object'; // import { getInitials } from 'src/helpers/object';
import { useAuthStore } from 'src/modules/stores/auth.store'; import { useAuthStore } from 'src/modules/auth/auth-store';
import LangSwitch from 'src/components/LangSwitch.vue'; import LangSwitch from 'src/components/LangSwitch.vue';
// import dialogs from 'src/components/dialogs'; // import dialogs from 'src/components/dialogs';
// import authenticationApi from 'src/composables/useAuthentication'; // import authenticationApi from 'src/composables/useAuthentication';

View File

View File