Skip to content

Commit

Permalink
Updates to make safe school coord mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
arcshiftsolutions committed Jul 10, 2024
1 parent 3b7c5bb commit c63d207
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 44 deletions.
31 changes: 2 additions & 29 deletions backend/src/config/test.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
{
"server": {
"logLevel": "verbose",
"morganFormat": "dev",
"port": "8080",
"frontend": "http://localhost:8081"
},
"tokenGenerate": {
"privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIICWwIBAAKBgQCCwwpHw1vbpRG4aG1OTG+L+HOETTQypRgkU5I8MPNgRLDlo5JZ\nMlSiON7rU45+CkSHsWuk3HcZEdu6ly9A9LtMt24JeWW/olcpzDO+U0DBleW1qDxk\nce5DfiUVdd6EYHvD+kfEa1IlSAoWbT65u9EqEm9GJtZ3sWFEhuekpZdE1QIDAQAB\nAoGACPJXTbmsG0ccA0YB1I2eRDFnlfHCVIS/Nh0RsFSZEkkg4VVjuf6bk83YUrmQ\n0kbZkX8uIkWDUI/MPOQDM6qK9ge9a3hfSJ6W/41Moy/EHXPlJDQxftEmzXWZ/hHa\nXrnJ4vh/rXqiXsVl/G6hKwA6FMZJpsPbShKJ4AGSXX4pHAECQQC3udOdE9Woiz6R\neB49EiFXR4uxnzQoi78OdHXQuvq5izpzvfj6ILz+ZK9lX9CsGJyL7eMXpaOkLein\n1FQAGO7BAkEAtjN0yao8TzpTk46b8/eFEXs30UsIZkuIES1Uv9Usso0na3CPtMxj\ngVMV7NT/XJ52NftGbWOk50trqQuam4ZvFQJAPCTa/1rU4L3kl55o17ktrPLA6j6h\nxnwo6UR6pP/wv/iyA922ubsp42V2fYsmNpA//xa69qzEqyRUO0yoyvdegQJAK0t8\n4/LM0/LDK1wG2OknOKkz8UrIGy61jYddDRyFu4PpKxGbRFYRCwkIO7e9Wm/ZHSix\naor0A3YbhhbYzT4bpQJALFNQYh7oS9WlAEvIU6pB/0h3E8tGbHpVvR0UZloGjdsA\nXa19ANQV3p+DCLzu9xZVgsXjqhx9wHVIABbd+zU7DQ==\n-----END RSA PRIVATE KEY-----",
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCwwpHw1vbpRG4aG1OTG+L+HOE\nTTQypRgkU5I8MPNgRLDlo5JZMlSiON7rU45+CkSHsWuk3HcZEdu6ly9A9LtMt24J\neWW/olcpzDO+U0DBleW1qDxkce5DfiUVdd6EYHvD+kfEa1IlSAoWbT65u9EqEm9G\nJtZ3sWFEhuekpZdE1QIDAQAB\n-----END PUBLIC KEY-----",
"audience": "TEST AUDIENCE",
"issuer": "TEST ISSUER"
},
"oidc": {
"discovery": "https://c2mvws-test.pathfinder.gov.bc.ca/auth/realms/master/.well-known/openid-configuration",
"clientSecret": "12345"
},
"digitalID": {
"apiEndpoint": "http://localhost"
},
"student": {
"apiEndpoint": "http://localhost"
},
"secureExchange": {
"apiEndpoint": "http://localhost"
},
"email": {
"apiEndpoint": "http://localhost",
"secretKey": "123456",
"tokenTTL": 1440
"discovery": "https://c2mvws-prod.pathfinder.gov.bc.ca/auth/realms/master/.well-known/openid-configuration"
}
}
}
5 changes: 2 additions & 3 deletions frontend/src/components/common/forms/SchoolContactsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,6 @@ export default {
this.getThisSchoolsContacts();
},
methods: {
redirectToSchoolDetails() {
this.$router.push({name: 'schoolDetails', params: {schoolID: this.school.schoolId}});
},
async loadSchoolContactTypeCodes() {
this.loadingCount += 1;
await instituteStore().getSchoolContactTypeCodes()
Expand All @@ -271,6 +268,8 @@ export default {
.then(response => {
this.schoolContacts = new Map();
this.school = response.data;
let isOffshore = this.offshoreArray.includes(this.school.schoolCategoryCode);
this.$emit('update-is-offshore', isOffshore);
response.data.contacts = sortBy(response.data.contacts, ['firstName']);
response.data.contacts.forEach(contact => {
if(!isExpired(contact)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
variant="tonal"
>
<span>Please review and verify that the details on the record for the school are accurate.</span>
<span v-if="isOffshoreSchool"> Require updates to school details? Please contact {{ MINISTRY_CONTACTS.OFFSHORE_ADMIN }}</span>

</v-alert>
</v-col>
</v-row>
Expand All @@ -17,7 +17,7 @@
:function-name="type"
:school-collection-object="schoolCollectionObject"
:school-i-d="schoolCollectionObject?.schoolID"
@school-contacts="checkIfPrincipalContactExists"
@school-contacts="checkIfRequiredSchoolContactsExists"
@update-is-offshore="handleIsOffshoreSchool"
/>
</div>
Expand All @@ -26,8 +26,11 @@
v-if="isDisabled"
>
<v-col class="error-message">
<p class="form-hint">
A principal with an active start date and contact information must be added
<p class="form-hint" v-if="isOffshoreSchool">
A principal with an active start date and contact information must be added.
</p>
<p class="form-hint" v-else>
A principal, safe schools coordinator and safe schools coordinator backup<br>with an active start date and contact information must be added.
</p>
</v-col>
</v-row>
Expand Down Expand Up @@ -111,15 +114,26 @@ export default {
this.setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while verifying school contacts. Please try again later.');
});
},
checkIfPrincipalContactExists(contacts) {
let contact = contacts.filter(contact => contact.schoolContactTypeCode === 'PRINCIPAL' && isContactCurrent(contact));
if(contact.length > 0 && (contact[0].phoneNumber || contact[0].email)) {
checkIfRequiredSchoolContactsExists(contacts) {
let principal = contacts.filter(contact => contact.schoolContactTypeCode === 'PRINCIPAL' && isContactCurrent(contact));
if(this.isOffshoreSchool && (principal.length > 0 && (principal[0].phoneNumber !== null || principal[0].email !== null))){
this.isDisabled = false;
} else {
this.isDisabled = true;
return;
}else{
let safeSchoolsCoordinator = contacts.filter(contact => contact.schoolContactTypeCode === 'SAFE_COORD' && isContactCurrent(contact));
let safeSchoolsCoordinatorBackup = contacts.filter(contact => contact.schoolContactTypeCode === 'SFECOORDBU' && isContactCurrent(contact));
if((principal.length > 0 && (principal[0].phoneNumber || principal[0].email))
&& (safeSchoolsCoordinator.length > 0 && (safeSchoolsCoordinator[0].phoneNumber || safeSchoolsCoordinator[0].email))
&& (safeSchoolsCoordinatorBackup.length > 0 && (safeSchoolsCoordinatorBackup[0].phoneNumber || safeSchoolsCoordinatorBackup[0].email))) {
this.isDisabled = false;
return;
}
}
this.isDisabled = true;
},
handleIsOffshoreSchool(isOffshore) {
console.log('Not here');
this.isOffshoreSchool = isOffshore;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@
</v-row>
<v-row>
<v-col class="d-flex justify-end mt-1">
<PrimaryButton
<v-btn
id="uploadButton"
icon="mdi-file-upload"
prepend-icon="mdi-file-upload"
style="width: 18em"
variant="elevated"
color="#003366"
text="Upload 1701 Submission"
:loading="isReadingFile"
:disabled="schoolCollectionObject?.sdcSchoolCollectionStatusCode === 'SUBMITTED'"
Expand Down Expand Up @@ -198,6 +201,7 @@
id="reportZeroEnrollment"
variant="outlined"
color="#003366"
style="width: 18em"
prepend-icon="mdi-numeric-0-circle"
text="Report Zero Enrollment"
:disabled="schoolCollectionObject?.sdcSchoolCollectionStatusCode === 'SUBMITTED'"
Expand All @@ -206,7 +210,7 @@
</v-col>
<v-col class="d-flex justify-start">
<div class="mt-2">
This option should only be used if this school does not have a file for this collection.
This option should only be used for schools with no student<br> enrollment to report for this collection.
</div>
</v-col>
</v-row>
Expand Down

0 comments on commit c63d207

Please sign in to comment.