Skip to content

Commit

Permalink
Merge pull request #711 from bcgov/GRAD2-2751-Sam
Browse files Browse the repository at this point in the history
updated display of school details per Kim's suggestions
michaeltangbcgov authored Jan 13, 2025
2 parents 25f324f + 095e78d commit 7b15eb5
Showing 4 changed files with 47 additions and 253 deletions.
50 changes: 28 additions & 22 deletions frontend/src/components/Common/SchoolDetailsDialog.vue
Original file line number Diff line number Diff line change
@@ -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>
@@ -44,6 +52,7 @@
<script>
import { mapState } from "pinia";
import { useAppStore } from "@/store/modules/app";
import { formatFlag } from "@/utils/common.js";
export default {
props: {
@@ -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>

226 changes: 4 additions & 222 deletions frontend/src/components/StudentProfile/GraduationStatus/GRADStatus.vue
Original file line number Diff line number Diff line change
@@ -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 -->
2 changes: 0 additions & 2 deletions frontend/src/store/modules/student.js
Original file line number Diff line number Diff line change
@@ -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() {
22 changes: 15 additions & 7 deletions frontend/src/utils/common.js
Original file line number Diff line number Diff line change
@@ -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
*/
@@ -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;

0 comments on commit 7b15eb5

Please sign in to comment.