Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated display of school details per Kim's suggestions #711

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions frontend/src/components/Common/SchoolDetailsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,45 @@
<v-btn
variant="text"
@click="schoolDialog = !schoolDialog"
class="text-left px-0"
>{{ school.displayName }}<br />{{ school.mincode }}</v-btn
class="text-left px-0 text-none"
>{{ school?.displayNameNoSpecialChars ?? school.displayName }}<br />{{
school.mincode
}}</v-btn
>
<v-dialog v-model="schoolDialog" max-width="600px">
<v-card :title="title">
<!-- <pre>{{ school }}</pre> -->
<v-card-text>
<div>
<div class="my-1">
<strong>District </strong
>{{ getDistrictById(school.districtId)?.districtNumber }} -
{{ getDistrictById(school.districtId)?.displayName }}
</div>
<div>
<div class="my-1">
<strong>School Code and Name </strong>{{ school.mincode }} -
{{ school.displayName }}
{{ school?.displayNameNoSpecialChars ?? school.displayName }}
</div>
<div>
<div class="my-1">
<strong>Open Date </strong
>{{ $filters.formatSimpleDate(school.openedDate) }}
</div>
<div>
<div class="my-1">
<strong>Close Date </strong
>{{ $filters.formatSimpleDate(school.closedDate) }}
</div>
<div>
<strong>Can Issue Transcripts? </strong
>{{ school.canIssueTranscripts }}
<div class="my-1">
<strong>School Category </strong
>{{
getInstituteCategoryByCode(school.schoolCategoryCode)?.legacyCode
}}&nbsp;{{ school.schoolCategoryCode }}
</div>
<div>
<strong>Can Issue Certificates? </strong
>{{ school.canIssueCertificates }}
<div class="my-1">
<strong>Issue Transcripts </strong
>{{ formatFlag(school.canIssueTranscripts) }}
</div>
<div class="my-1">
<strong>Issue Certificates </strong
>{{ formatFlag(school.canIssueCertificates) }}
</div>
</v-card-text>
</v-card>
Expand All @@ -44,6 +52,7 @@
<script>
import { mapState } from "pinia";
import { useAppStore } from "@/store/modules/app";
import { formatFlag } from "@/utils/common.js";

export default {
props: {
Expand All @@ -56,22 +65,19 @@ export default {
computed: {
...mapState(useAppStore, {
getDistrictById: "getDistrictById",
getInstituteCategoryByCode: "getInstituteCategoryByCode",
}),
},
methods: {
formatFlag(flag) {
return formatFlag(flag);
},
},
data() {
return {
schoolDialog: false,
title: "School Details",
};
},
created() {
if (this.props?.title) {
this.title = this.props?.title;
}
},
setup(props) {
//console.log(props);
},
};
</script>

Expand Down
226 changes: 4 additions & 222 deletions frontend/src/components/StudentProfile/GraduationStatus/GRADStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,239 +46,21 @@
<td><strong>School of record: </strong></td>
<td>
<SchoolDetailsDialog
title="TEST"
v-if="!!studentGradStatus?.schoolOfRecordId"
title="School Of Record"
:school="getSchoolById(studentGradStatus.schoolOfRecordId)"
/>
<!-- OLD SCHOOL OF RECORD DISPLAY - DELETE -->
<!-- <v-btn
class="v-btn-link p-0 text-left"
variant="plain"
:disabled="getSchoolsList.length == 0"
@click="
schoolOfRecordDialog = true;
getSchoolInfo(
studentGradStatus.schoolOfRecordId,
'schoolOfRecord'
);
"
>
{{
getSchoolById(studentGradStatus.schoolOfRecordId)
?.displayNameNoSpecialChars ??
getSchoolById(studentGradStatus.schoolOfRecordId)
?.displayName
}}<br />
{{
getSchoolById(studentGradStatus.schoolOfRecordId)?.mincode
}}
</v-btn> -->

<!-- <v-dialog v-model="schoolOfRecordDialog" max-width="600px">
<v-card>
<v-card-title class="text-h6"
>School of record
<v-progress-circular
v-if="schoolSearchLoading"
indeterminate
color="green"
>
</v-progress-circular
></v-card-title>
<v-card-text>
<v-table role="presentation" aria-label="grad status">
<template v-if="schoolOfRecord">
<tbody>
<tr>
<td><strong>District:</strong></td>
<td>{{ schoolOfRecord.districtId }}</td>
</tr>
<tr>
<td><strong>School Code and Name:</strong></td>
<td>
{{
schoolOfRecord.mincode +
" " +
schoolOfRecord.displayName
}}
</td>
</tr>
<tr>
<td><strong>School Category Code</strong></td>
<td>{{ schoolOfRecord.schoolCategoryCode }}</td>
</tr>
<tr>
<td><strong>Open Date:</strong></td>
<td>
{{
$filters.formatSimpleDate(
schoolOfRecord?.openedDate
)
}}
</td>
</tr>
<tr>
<td><strong>Close Date:</strong></td>
<td>
{{
$filters.formatSimpleDate(
schoolOfRecord?.closedDate
)
}}
</td>
</tr>
<tr>
<td><strong>Issue Transcript:</strong></td>
<td>
{{
schoolOfRecord.canIssueTranscripts == true
? "Y"
: "N"
}}
</td>
</tr>
<tr>
<td><strong>Issue Certificate:</strong></td>
<td>
{{
schoolOfRecord.canIssueCertificates == true
? "Y"
: "N"
}}
</td>
</tr>
</tbody>
</template>
</v-table>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="primary"
@click="schoolOfRecordDialog = false"
>Close</v-btn
>
</v-card-actions>
</v-card>
</v-dialog> -->
</td>
</tr>
<!-- School at graduation -->
<tr>
<td><strong>School at graduation: </strong></td>
<td>
<SchoolDetailsDialog
title="TEST"
v-if="!!studentGradStatus?.schoolAtGradId"
title="School At Graduation"
:school="getSchoolById(studentGradStatus.schoolAtGradId)"
/>
<!-- OLD SCHOOL AT GRAD BTN - DELETE -->
<!-- <v-btn
v-if="studentGradStatus && studentGradStatus.schoolAtGrad"
:disabled="getSchoolsList.length == 0"
class="p-0 text-left v-btn-link"
variant="plain"
@click="
schoolAtGradDialog = true;
getSchoolInfo(
studentGradStatus.schoolAtGradId,
'schoolAtGrad'
);
"
>
{{
getSchoolById(studentGradStatus.schoolAtGradId)
?.displayNameNoSpecialChars ??
getSchoolById(studentGradStatus.schoolAtGradId)
?.displayName
}}<br />
{{ getSchoolById(studentGradStatus.schoolAtGradId)?.mincode }}
<v-progress-circular
v-if="schoolSearchLoading"
indeterminate
color="green"
>
</v-progress-circular>
</v-btn> -->

<!-- <v-dialog v-model="schoolAtGradDialog" max-width="600px">
<v-card>
<v-card-title class="text-h6"
>School at graduation</v-card-title
>
<v-card-text>
<v-table
role="presentation"
aria-label="edit graduation status"
>
<template v-if="schoolAtGraduation">
<tbody>
<tr>
<td><strong>District:</strong></td>
<td>{{ schoolAtGraduation.districtId }}</td>
</tr>
<tr>
<td><strong>School Code and Name:</strong></td>
<td>
{{
schoolAtGraduation.mincode +
" " +
schoolAtGraduation.displayName
}}
</td>
</tr>
<tr>
<td><strong>Open Date:</strong></td>
<td>
{{
$filters.formatSimpleDate(
schoolAtGraduation?.openedDate
)
}}
</td>
</tr>
<tr>
<td><strong>Close Date:</strong></td>
<td>
{{
$filters.formatSimpleDate(
schoolAtGraduation?.closedDate
)
}}
</td>
</tr>
<tr>
<td><strong>Issue Transcript:</strong></td>
<td>
{{
schoolAtGraduation.canIssueTranscripts == true
? "Y"
: "N"
}}
</td>
</tr>
<tr>
<td><strong>Issue Certificate:</strong></td>
<td>
{{
schoolAtGraduation.canIssueCertificates ==
true
? "Y"
: "N"
}}
</td>
</tr>
</tbody>
</template>
</v-table>
</v-card-text>

<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" @click="schoolAtGradDialog = false"
>Close</v-btn
>
</v-card-actions>
</v-card>
</v-dialog> -->
</td>
</tr>
<!-- Honours standing -->
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const useAppStore = defineStore("app", {
console.error(error);
}
});
InstituteService.getCategoryCodes().then((response) => {
InstituteService.getSchoolCategoryCodes().then((response) => {
try {
this.instituteCategoryCodes = response.data;
} catch (error) {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/store/modules/student.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,6 @@ export const useStudentStore = defineStore("student", {
return this.student.profile.pen;
},
getStudentGradStatus() {
// eslint-disable-next-line
console.log(this.student.gradStatus);
return this.student.gradStatus;
},
getStudentOptionalPrograms() {
Expand Down
22 changes: 15 additions & 7 deletions frontend/src/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ export function parseStudentStatus(code, studentStatusOptions) {
return "";
}

/**
* FORMATTING
*/
export function formatFlag(flag) {
switch (flag) {
case null:
case false:
case "N" || "n":
return "N";
case true:
case "Y" || "y":
return "Y";
}
}

/**
* SORTING
*/
Expand Down Expand Up @@ -67,13 +82,6 @@ export function isPFSchool(mincode) {
}

export function isProgramComplete(completionDate, programCode) {
console.debug(
"DEBUG: Program is Complete data:\n completionDate - " +
completionDate +
"\n programCode - " +
programCode
);

if (programCode === "SCCP") {
let today = new Date();
return !!completionDate && new Date(completionDate) <= today;
Expand Down
Loading