Skip to content

Commit

Permalink
#276 - Main merged to v2.4.0 (#4284)
Browse files Browse the repository at this point in the history
**Main merged to v2.4.0**
  • Loading branch information
sh16011993 authored Jan 23, 2025
2 parents 19bc83d + 6cdc2f8 commit 86f6498
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 34 deletions.
4 changes: 2 additions & 2 deletions sources/packages/forms/src/form-definitions/sfaa2022-23.json
Original file line number Diff line number Diff line change
Expand Up @@ -9309,7 +9309,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down Expand Up @@ -31588,7 +31588,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down
4 changes: 2 additions & 2 deletions sources/packages/forms/src/form-definitions/sfaa2023-24.json
Original file line number Diff line number Diff line change
Expand Up @@ -9309,7 +9309,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down Expand Up @@ -31588,7 +31588,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down
4 changes: 2 additions & 2 deletions sources/packages/forms/src/form-definitions/sfaa2024-25.json
Original file line number Diff line number Diff line change
Expand Up @@ -9309,7 +9309,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down Expand Up @@ -31588,7 +31588,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down
4 changes: 2 additions & 2 deletions sources/packages/forms/src/form-definitions/sfaa2025-26.json
Original file line number Diff line number Diff line change
Expand Up @@ -10541,7 +10541,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down Expand Up @@ -31279,7 +31279,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
"key": "transportationCostSituation",
"conditional": {
"show": "",
"when": "",
"when": null,
"eq": ""
},
"type": "radio",
Expand Down Expand Up @@ -422,8 +422,7 @@
"properties": {},
"decimalLimit": 0,
"lockKey": true,
"customConditional": "",
"isNew": false
"customConditional": ""
},
{
"autofocus": false,
Expand Down Expand Up @@ -840,7 +839,7 @@
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
"required": true,
"custom": "",
"customPrivate": false,
"strictDateValidation": false,
Expand Down
11 changes: 2 additions & 9 deletions sources/packages/web/src/components/generic/ModalDialogBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

<script lang="ts">
import { ref, watch, defineComponent, computed } from "vue";
import { useDisplay } from "vuetify";
const dialogClosedEvent = "dialogClosed";

export default defineComponent({
Expand All @@ -60,15 +61,7 @@ export default defineComponent({

setup(props, context) {
const showHideDialog = ref(false);
const showFullScreen = ref(true);
const mediaQuery = window.matchMedia(
"(max-width: 768px), (max-height: 576px)",
);
function handleScreenChange(e: MediaQueryList) {
showFullScreen.value = e.matches;
}
mediaQuery.addEventListener("change", () => handleScreenChange(mediaQuery));
handleScreenChange(mediaQuery);
const { smAndDown: showFullScreen } = useDisplay();
const width = computed(() => (showFullScreen.value ? undefined : "auto"));
watch(
() => props.showDialog,
Expand Down
106 changes: 93 additions & 13 deletions sources/packages/web/src/views/student/AppStudent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<v-btn-toggle
selected-class="active-btn label-bold"
v-model="toggleNav"
v-if="!smallScreen"
class="navigation-btn float-left"
>
<v-btn
Expand Down Expand Up @@ -49,7 +50,6 @@
prepend-icon="fa:far fa-hand-paper"
>Request a Change</v-btn
>

<v-menu v-if="isAuthenticated">
<template v-slot:activator="{ props }">
<v-btn
Expand All @@ -64,6 +64,7 @@
></v-btn>
</template>
<v-list
v-show="isAuthenticated"
active-class="active-list-item"
density="compact"
bg-color="default"
Expand All @@ -88,7 +89,37 @@
</v-list>
</v-menu>
</v-btn-toggle>
<v-app-bar-nav-icon
variant="text"
@click.stop="drawer = !drawer"
v-if="showNavigationDrawer"
></v-app-bar-nav-icon>
</v-app-bar>
<v-navigation-drawer
v-if="showNavigationDrawer"
v-model="drawer"
location="right"
temporary
>
<v-list active-class="active-list-item" density="compact" color="primary">
<template v-for="(item, index) in menuItems" :key="index">
<v-list-item
:value="index"
@click="item.command"
:to="item.props?.to"
tabindex="0"
>
<v-list-item-title>
<span class="label-bold">{{ item.title }}</span>
</v-list-item-title>
</v-list-item>
<v-divider-inset-opaque
v-if="index < menuItems.length - 1"
:key="index"
></v-divider-inset-opaque>
</template>
</v-list>
</v-navigation-drawer>
<router-view name="sidebar"></router-view>
<v-main class="body-background">
<v-container fluid>
Expand All @@ -100,13 +131,14 @@

<script lang="ts">
import { useRouter } from "vue-router";
import { computed, ref, defineComponent, onMounted } from "vue";
import { computed, ref, defineComponent, onMounted, watchEffect } from "vue";
import { StudentRoutesConst } from "@/constants/routes/RouteConstants";
import { ClientIdType, MenuItemModel } from "@/types";
import { useAuth, useStudentStore } from "@/composables";
import BCLogo from "@/components/generic/BCLogo.vue";
import IdleTimeChecker from "@/components/common/IdleTimeChecker.vue";
import { AppConfigService } from "@/services/AppConfigService";
import { useDisplay } from "vuetify";

export default defineComponent({
components: { BCLogo, IdleTimeChecker },
Expand All @@ -116,6 +148,9 @@ export default defineComponent({
const router = useRouter();
const { isAuthenticated } = useAuth();
const { hasStudentAccount } = useStudentStore();
const drawer = ref(false);
const allowFulltime = ref(false);
const { smAndDown: smallScreen } = useDisplay();

const logoClick = () => {
if (hasStudentAccount.value) {
Expand All @@ -132,9 +167,56 @@ export default defineComponent({
() => isAuthenticated.value && hasStudentAccount.value,
);

const showNavigationDrawer = computed(() => {
return isAuthenticated.value && smallScreen.value;
});

// Close the navigation drawer when the screen is large.
watchEffect(() => {
if (!smallScreen.value) {
drawer.value = false;
}
});

const menuItems = computed(() => {
const items: MenuItemModel[] = [];
if (hasStudentAccount.value) {
if (smallScreen.value) {
items.push(
{
title: "Home",
props: {
to: {
name: StudentRoutesConst.STUDENT_DASHBOARD,
},
},
},
{
title: "Applications",
props: {
to: {
name: StudentRoutesConst.STUDENT_APPLICATION_SUMMARY,
},
},
},
{
title: "File Uploader",
props: {
to: {
name: StudentRoutesConst.STUDENT_FILE_UPLOADER,
},
},
},
{
title: "Request a Change",
props: {
to: {
name: StudentRoutesConst.STUDENT_REQUEST_CHANGE,
},
},
},
);
}
items.push(
{
title: "Profile",
Expand All @@ -152,17 +234,18 @@ export default defineComponent({
},
},
},
{
);
if (allowFulltime.value) {
items.push({
title: "Overawards Balance",
props: {
to: {
name: StudentRoutesConst.STUDENT_OVERAWARDS,
},
},
},
);
});
}
}

items.push({
title: "Log Out",
command: async () => {
Expand All @@ -174,13 +257,7 @@ export default defineComponent({

onMounted(async () => {
const { isFulltimeAllowed } = await AppConfigService.shared.config();
if (!isFulltimeAllowed) {
menuItems.value.forEach((item, index) => {
if (item.title === "Overawards Balance") {
menuItems.value.splice(index, 1);
}
});
}
allowFulltime.value = isFulltimeAllowed;
});
return {
logoClick,
Expand All @@ -190,6 +267,9 @@ export default defineComponent({
ClientIdType,
hasAuthenticatedStudentAccount,
toggleNav,
smallScreen,
drawer,
showNavigationDrawer,
};
},
});
Expand Down

0 comments on commit 86f6498

Please sign in to comment.