diff --git a/frontend/src/components/StudentProfile/AuditHistory/StudentAuditHistory.vue b/frontend/src/components/StudentProfile/AuditHistory/StudentAuditHistory.vue index fbd84126..beb808b2 100644 --- a/frontend/src/components/StudentProfile/AuditHistory/StudentAuditHistory.vue +++ b/frontend/src/components/StudentProfile/AuditHistory/StudentAuditHistory.vue @@ -2,10 +2,12 @@ Student Change HistoryStudent Change History Optional Program Change HistoryOptional Program Change History diff --git a/frontend/src/components/StudentProfile/AuditHistory/StudentNotes.vue b/frontend/src/components/StudentProfile/AuditHistory/StudentNotes.vue index 0adf1ee7..b155717f 100644 --- a/frontend/src/components/StudentProfile/AuditHistory/StudentNotes.vue +++ b/frontend/src/components/StudentProfile/AuditHistory/StudentNotes.vue @@ -1,7 +1,13 @@ @@ -47,7 +29,26 @@ export default { }), }, data: function () { - return {}; + return { + undoCompletionReasonsHeaders: [ + { + key: "createDate", + title: "Undo Completion Date", + }, + { + key: "undoCompletionReasonCode", + title: "Code", + }, + { + key: "undoCompletionReasonDescription", + title: "Reason", + }, + { + key: "createUser", + title: "User", + }, + ], + }; }, methods: {}, }; diff --git a/frontend/src/views/StudentProfile.vue b/frontend/src/views/StudentProfile.vue index 3af59556..f5a89e58 100644 --- a/frontend/src/views/StudentProfile.vue +++ b/frontend/src/views/StudentProfile.vue @@ -16,7 +16,7 @@ :disabled="tabLoading || !hasGradStatus" id="actions" right - class="float-right admin-actions" + class="float-right admin-actions text-none" > Transcripts & TVRsUndo Completion @@ -98,13 +99,15 @@ GRAD StatusGRAD Status Requirement DetailsRequirement Details @@ -496,50 +499,64 @@ - + Undo Completion

Undo Completion Reason

-
- +
+ {{ ungradReasons.find( - (element) => element.code === studentUngradReasonSelected + (element) => element.code === studentUngradReasonForm.selected ).description }}
-
+
- - Cancel + + + Cancel + + Undo Completion @@ -565,18 +582,41 @@ import StudentAuditHistory from "@/components/StudentProfile/AuditHistory/Studen import StudentUndoCompletionReasons from "@/components/StudentProfile/StudentUndoCompletionReasons.vue"; import StudentNotes from "@/components/StudentProfile/AuditHistory/StudentNotes.vue"; import DisplayTable from "@/components/DisplayTable.vue"; + +// pinia store import { useSnackbarStore } from "@/store/modules/snackbar"; import { useStudentStore } from "../store/modules/student"; import { useAppStore } from "../store/modules/app"; import { useAccessStore } from "../store/modules/access"; import { mapState, mapActions } from "pinia"; + +// vuelidate +import { useVuelidate } from "@vuelidate/core"; +import { required, requiredIf, sameAs } from "@vuelidate/validators"; + export default { name: "studentProfile", setup() { const studentStore = useStudentStore(); const appStore = useAppStore(); const accessStore = useAccessStore(); - return { appStore, studentStore, accessStore }; + return { appStore, studentStore, accessStore, v$: useVuelidate() }; + }, + validations() { + return { + studentUngradReasonForm: { + selected: { required }, + description: { + required: requiredIf(function () { + return ( + !!this.studentUngradReasonForm && + this.studentUngradReasonForm.selected == "OTH" + ); + }), + }, + confirm: { sameAsTrue: sameAs(true) }, + }, + }; }, created() { StudentService.getStudentPen(this.$route.params.studentId) @@ -603,6 +643,8 @@ export default { } window.addEventListener("resize", this.handleResize); this.handleResize(); + + console.log(this.ungradReasons); }, components: { StudentInformation: StudentInformation, @@ -630,9 +672,14 @@ export default { projectedOptionalGradStatus: "", nonGradReasons: "", projectedrequirementsMet: "", - studentUngradReasonSelected: "", - studentUngradReasonDescription: "", - confirmStudentUndoCompletion: false, + studentUngradReasonForm: { + selected: null, + description: null, + confirm: false, + }, + // studentUngradReasonSelected: "", + // studentUngradReasonDescription: "", + // confirmStudentUndoCompletion: false, selectedSubTab: 0, selectedTab: 0, projectedGradStatus: [], @@ -644,6 +691,7 @@ export default { opened: [], displayMessage: null, smallScreen: false, + showUndoCompletionDialog: false, window: { width: 0, height: 0, @@ -717,7 +765,7 @@ export default { }, watch: { userUndoCompletionReasonChange: function () { - this.confirmStudentUndoCompletion = false; //clear confirm if they change options + this.studentUngradReasonForm.confirm = false; //clear confirm if they change options }, }, destroyed() { @@ -767,11 +815,19 @@ export default { "setStudentPen", "setStudentId", ]), + submitStudentUndoCompletion() { + this.ungraduateStudent(); + this.closeStudentUndoCompletionDialog(); + }, + closeStudentUndoCompletionDialog() { + this.resetUndoCompletionValues(); + this.showUndoCompletionDialog = false; + }, ungraduateStudent() { this.tabLoading = true; - this.confirmStudentUndoCompletion = ""; - let ungradCode = this.studentUngradReasonSelected; - let ungradDesc = this.studentUngradReasonDescription; + this.studentUngradReasonForm.confirm = ""; + let ungradCode = this.studentUngradReasonForm.selected; + let ungradDesc = this.studentUngradReasonForm.description; if (ungradCode != "OTH") { ungradDesc = this.ungradReasons.filter(function (reason) { return reason.code == ungradCode; @@ -823,9 +879,9 @@ export default { }); }, resetUndoCompletionValues() { - this.confirmStudentUndoCompletion = false; - this.studentUngradReasonSelected = ""; - this.studentUngradReasonDescription = ""; + this.studentUngradReasonForm.selected = null; + this.studentUngradReasonForm.description = null; + this.studentUngradReasonForm.confirm = false; }, reloadGradStatus() { StudentService.getGraduationStatus(this.studentId)