Skip to content

Commit

Permalink
Merge pull request #163 from icefoganalytics/test
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
datajohnson authored Sep 29, 2023
2 parents bff2adb + 52ba6f7 commit 73e8e22
Show file tree
Hide file tree
Showing 12 changed files with 1,822 additions and 1,387 deletions.
657 changes: 332 additions & 325 deletions src/api/repositories/assessment/assessment-yg-repository.ts

Large diffs are not rendered by default.

54 changes: 10 additions & 44 deletions src/web/src/components/OtherAgencyFundingForm.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
<template>
<div class="home">
<v-switch
dense
hide-details
label="Applied for other funding"
v-model="applied_other_funding"
></v-switch>
<v-switch dense hide-details label="Applied for other funding" v-model="applied_other_funding"></v-switch>

<div v-if="applied_other_funding" class="mt-5">
<v-card
class="default mb-5"
v-for="(item, i) of application.other_funding"
:key="i"
>
<v-card class="default mb-5" v-for="(item, i) of application.other_funding" :key="i">
<v-card-title>
Agency {{ 1 + i }}
<v-spacer></v-spacer>
<v-btn
color="warning"
x-small
fab
class="my-0"
@click="removeOtherFunding(i)"
<v-btn color="warning" x-small fab class="my-0" @click="removeOtherFunding(i)"
><v-icon>mdi-close</v-icon></v-btn
></v-card-title
>
Expand Down Expand Up @@ -53,36 +39,16 @@
</div>

<div class="col-md-2 py-0">
<v-switch
dense
hide-details
label="Tuition"
v-model="item.TUITION_FLAG"
></v-switch>
<v-switch dense hide-details label="Tuition" v-model="item.TUITION_FLAG"></v-switch>
</div>
<div class="col-md-2 py-0">
<v-switch
dense
hide-details
label="Books"
v-model="item.BOOKS_FLAG"
></v-switch>
<v-switch dense hide-details label="Books" v-model="item.BOOKS_FLAG"></v-switch>
</div>
<div class="col-md-2 py-0">
<v-switch
dense
hide-details
label="Living expenses"
v-model="item.LIVING_EXPENSE_FLAG"
></v-switch>
<v-switch dense hide-details label="Living expenses" v-model="item.LIVING_EXPENSE_FLAG"></v-switch>
</div>
<div class="col-md-2 py-0">
<v-switch
dense
hide-details
label="Transportation"
v-model="item.TRANSPORTATION_FLAG"
></v-switch>
<v-switch dense hide-details label="Transportation" v-model="item.TRANSPORTATION_FLAG"></v-switch>
</div>

<div class="col-md-4">
Expand Down Expand Up @@ -119,12 +85,12 @@
<script>
import store from "../store";
import axios from "axios";
import { AGENCY_URL } from "../urls";
import { AGENCY } from "../urls";
export default {
name: "Home",
computed: {
application: function () {
application: function() {
return store.getters.selectedApplication;
},
},
Expand All @@ -138,7 +104,7 @@ export default {
},
methods: {
loadAgencies() {
axios.get(AGENCY_URL).then((resp) => {
axios.get(AGENCY).then((resp) => {
this.agencyOptions = resp.data;
});
},
Expand Down
123 changes: 55 additions & 68 deletions src/web/src/components/application/ProgramInformationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
></v-text-field>
</div>
</div>

</div>
<div class="col-md-9">
<div class="row">
Expand Down Expand Up @@ -102,7 +101,7 @@
background-color="white"
hide-details
label="City"
:value="cities.find(c => c.id === selectedInstitution.address_city_id)?.description"
:value="cities.find((c) => c.id === selectedInstitution.address_city_id)?.description"
></v-text-field>
</div>
<div class="col-md-3">
Expand All @@ -113,7 +112,7 @@
background-color="white"
hide-details
label="Province"
:value="provinces.find(c => c.id === selectedInstitution.address_province_id)?.description"
:value="provinces.find((c) => c.id === selectedInstitution.address_province_id)?.description"
></v-text-field>
</div>
<div class="col-md-2">
Expand All @@ -135,7 +134,7 @@
background-color="white"
hide-details
label="Country"
:value="countries.find(c => c.id === selectedInstitution.address_country_id)?.description"
:value="countries.find((c) => c.id === selectedInstitution.address_country_id)?.description"
></v-text-field>
</div>
<div class="col-md-1"></div>
Expand All @@ -158,7 +157,7 @@
background-color="white"
hide-details
label="Institution level"
:value="institutionLevels.find(i => i.id = selectedInstitution.institution_level_id)?.description"
:value="institutionLevels.find((i) => (i.id = selectedInstitution.institution_level_id))?.description"
></v-text-field>
</div>
<div class="col-md-2">
Expand Down Expand Up @@ -198,11 +197,7 @@
></v-autocomplete>
</div>
<div class="col-md-6">
<v-btn
class="mt-0"
color="success"
@click="showPDF(76)"
>
<v-btn class="mt-0" color="success" @click="showPDF(76)">
View PIF
</v-btn>
</div>
Expand Down Expand Up @@ -234,7 +229,7 @@
:items="programDivisions"
item-text="description"
item-value="id"
v-model="application.program_division"
v-model="application.program_division"
@change="doSaveApp('program_division', application.program_division)"
></v-select>
</div>
Expand All @@ -250,7 +245,6 @@
item-value="id"
v-model="application.attendance_id"
@change="doSaveApp('attendance_id', application.attendance_id)"

></v-select>
</div>
<div class="col-md-6 px-1">
Expand Down Expand Up @@ -287,10 +281,12 @@
</template>
<v-date-picker
:value="application.classes_start_date?.slice(0, 10)"
@input="e => {
application.classes_start_date = e;
classes_start_menu = false;
}"
@input="
(e) => {
application.classes_start_date = e;
classes_start_menu = false;
}
"
@change="doSaveApp('classes_start_date', application.classes_start_date)"
></v-date-picker>
</v-menu>
Expand Down Expand Up @@ -321,10 +317,12 @@
</template>
<v-date-picker
:value="application.classes_end_date?.slice(0, 10)"
@input="e => {
application.classes_end_date = e;
classes_end_menu = false;
}"
@input="
(e) => {
application.classes_end_date = e;
classes_end_menu = false;
}
"
@change="doSaveApp('classes_end_date', application.classes_end_date)"
></v-date-picker>
</v-menu>
Expand All @@ -345,17 +343,14 @@
></v-text-field>
</div-->
</div>
</div>
</div>
</v-card-text>
</v-card>

<show-pdf ref="showPdf">
</show-pdf>

<show-pdf ref="showPdf"> </show-pdf>
</div>
</template>


<style>
.v-expansion-panel {
height: 38px;
Expand All @@ -365,44 +360,37 @@
}
</style>



<script>
import store from "../../store";
import axios from "axios";
import moment from "moment";
import validator from "@/validator";
import {
INSTITUTION_URL,
INSTITUTION_LEVEL_URL,
CITY_URL,
COUNTRY_URL,
PROVINCE_URL,
PROGRAM_AREA_URL,
PROGRAM_TYPE_URL,
PROGRAM_DIVISION_URL,
CATEGORY_URL,
APPLICATION_URL,
STUDENT_URL
} from "../../urls";
import { mapGetters } from 'vuex';
import { INSTITUTION_URL, APPLICATION_URL } from "@/urls";
import { mapGetters } from "vuex";
export default {
computed: {
...mapGetters(["yearOptions", "countries", "cities", "provinces",
"institutionLevels", "studyAreas", "yukonGrantEligibilityList",
"programs", "attendances", "programDivisions"]),
student: function () {
...mapGetters([
"yearOptions",
"countries",
"cities",
"provinces",
"institutionLevels",
"studyAreas",
"yukonGrantEligibilityList",
"programs",
"attendances",
"programDivisions",
]),
student: function() {
return store.getters.selectedStudent;
},
application: function () {
application: function() {
return store.getters.selectedApplication;
},
selectedInstitution() {
const finded = this.institutionOptions.find(
(i) => i.id === this.application.institution_campus_id
);
return finded ? finded : {};
const finded = this.institutionOptions.find((i) => i.id === this.application.institution_campus_id);
return finded ? finded : {};
},
},
data: () => ({
Expand Down Expand Up @@ -434,16 +422,19 @@ export default {
store.dispatch("setPrograms");
store.dispatch("setProgramDivisions");
store.dispatch("setAttendances");
},
methods: {
loadInstitutions() {
axios
.get(`${INSTITUTION_URL}`)
.then((resp) => {
this.institutionOptions = resp.data.data
.map(data => {
const campuses = data.campuses?.map(c => ({ ...c, name: `${c.name} - ${data.name}`, institution_level_id: data.institution_level_id }));
.map((data) => {
const campuses = data.campuses?.map((c) => ({
...c,
name: `${c.name} - ${data.name}`,
institution_level_id: data.institution_level_id,
}));
return [...campuses];
})
.flat();
Expand All @@ -452,26 +443,22 @@ export default {
console.log(err);
});
},
loadPrograms() {
axios.get(PROGRAM_DIVISION_URL).then((resp) => {
this.programDivisionOptions = resp.data;
});
},
doSaveApp(field, value) {
store.dispatch("updateApplication", [field, value, this]);
},
async showPDF(reqId) {
try {
let buf = await fetch(APPLICATION_URL + `/${this.application.id}/student/${this.student.id}/files/76`)
.then((r) => r.arrayBuffer());
const blob = new Blob([buf], {type: 'application/pdf'});
const blobURL = URL.createObjectURL(blob) || "";
this.$refs.showPdf.showModal(blobURL);
async showPDF(reqId) {
try {
let buf = await fetch(
APPLICATION_URL + `/${this.application.id}/student/${this.student.id}/files/76`
).then((r) => r.arrayBuffer());
const blob = new Blob([buf], { type: "application/pdf" });
const blobURL = URL.createObjectURL(blob) || "";
this.$refs.showPdf.showModal(blobURL);
} catch (error) {
console.log(error);
}
}
},
},
};
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ export default {
&& residence.to_month === null))
?.filter((residence) => !(residence.country_id === 1 && residence.province_id === 3
&& residence.to_year === null && residence.to_month === null));
console.log("***", list);
list.sort((a, b) => {
if (a.from_year > b.from_year) {
Expand Down
Loading

0 comments on commit 73e8e22

Please sign in to comment.