Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bcgov/EDUC-STUDENT-ADMIN
Browse files Browse the repository at this point in the history
…into feature/PenContacts
  • Loading branch information
arcshiftsolutions committed Oct 20, 2023
2 parents 7dc85c3 + 310d80c commit b33959f
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 39 deletions.
3 changes: 2 additions & 1 deletion backend/src/components/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const roles = {
//Help functions created in auth module: isValidPenTeamRoleUserToken, isValidPenTeamRoleUser
PenTeamRole: config.get('server:edx:teamRoles:pen'),
//Help functions created in auth module: isValidSchoolMoveUserToken, isValidSchoolMoveUser
School: ['SCHOOL_ADMIN']
School: ['SCHOOL_ADMIN'],
EDX: [config.get('server:edx:roleAdmin')]
},
Admin: {
//Help functions created in auth module: isValidGMPAdmin
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {
validationResult
} = require('express-validator');

const isValidStaffUserWithRoles = auth.isValidUserWithRoles('GMP & UMP & PenRequestBatch & StudentSearch & StaffAdministration & NominalRoll & NominalRollReadOnly & GUMPAnalytics & PenRequestBatchAnalytics & Exchange', [...roles.User.GMP, ...roles.User.UMP, ...roles.User.PenRequestBatch, ...roles.User.StudentSearch, ...roles.User.StaffAdministration, ...roles.User.NominalRoll , ...roles.User.NominalRollReadOnly, ...roles.User.GUMPAnalytics, ...roles.User.PenRequestBatchAnalytics, ...roles.User.Exchange]);
const isValidStaffUserWithRoles = auth.isValidUserWithRoles('GMP & UMP & PenRequestBatch & StudentSearch & StaffAdministration & NominalRoll & NominalRollReadOnly & GUMPAnalytics & PenRequestBatchAnalytics & Exchange & EDX', [...roles.User.GMP, ...roles.User.UMP, ...roles.User.PenRequestBatch, ...roles.User.StudentSearch, ...roles.User.StaffAdministration, ...roles.User.NominalRoll , ...roles.User.NominalRollReadOnly, ...roles.User.GUMPAnalytics, ...roles.User.PenRequestBatchAnalytics, ...roles.User.Exchange, ...roles.User.EDX]);
const isValidWebSocketUserWithRoles = auth.isValidUserWithRoles('GMP & UMP & PenRequestBatch & Exchange & School', [...roles.User.GMP, ...roles.User.UMP, ...roles.User.PenRequestBatch, ...roles.User.Exchange, ...roles.User.School]);

const router = express.Router();
Expand Down
17 changes: 9 additions & 8 deletions backend/src/routes/edx-router.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions frontend/src/components/institute/authority/Details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
</v-row>
<div v-if="!editing">
<v-row
v-if="!hasMailingAddress() && !editing"
v-if="canEditAuthorities() && !hasMailingAddress() && !editing"
no-gutters
class="d-flex justify-start"
>
Expand Down Expand Up @@ -520,7 +520,7 @@
</v-row>
</v-col>
</v-row>
</v-col>
</v-col>
<v-col
v-if="showPhysicalAddress"
cols="3"
Expand Down Expand Up @@ -699,7 +699,7 @@
</v-col>
</v-row>

<v-row>
<v-row v-if="showPhysicalAddress">
<v-col>
<v-row
no-gutters
Expand Down Expand Up @@ -808,7 +808,7 @@
</v-col>
</v-row>

<v-row no-gutters>
<v-row v-if="showPhysicalAddress" no-gutters>
<v-col>
<v-checkbox
id="sameAsMailingCheckbox"
Expand Down Expand Up @@ -913,7 +913,7 @@ export default {
},
showPhysicalAddress() {
if (this.editing) {
return !this.excludeShowingPhysicalAddressesForAuthoritiesOfType.includes(this.authorityCopy.authorityTypeCode);
return !this.excludeShowingPhysicalAddressesForAuthoritiesOfType.includes(this.authorityCopy?.authorityTypeCode);
}
return !this.excludeShowingPhysicalAddressesForAuthoritiesOfType.includes(this.authority?.authorityTypeCode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@
v-model="editContact.firstName"
class="pt-0"
variant="underlined"
:rules="[rules.noSpecialCharactersContactName()]"
:maxlength="255"
label="First Name"
/>
<v-text-field
id="editAuthorityContactLastNameInput"
v-model="editContact.lastName"
:rules="[rules.required(), rules.noSpecialCharactersContactName()]"
:rules="[rules.required()]"
class="pt-0"
variant="underlined"
:maxlength="255"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<v-text-field
id="newContactFirstNameInput"
v-model="newContact.firstName"
:rules="[rules.noSpecialCharactersContactName()]"
variant="underlined"
class="pt-0"
:maxlength="255"
Expand All @@ -36,7 +35,7 @@
<v-text-field
id="newContactLastNameInput"
v-model="newContact.lastName"
:rules="[rules.required(), rules.noSpecialCharactersContactName()]"
:rules="[rules.required()]"
variant="underlined"
class="pt-0"
:maxlength="255"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@
v-model="editContact.firstName"
class="pt-0"
variant="underlined"
:rules="[rules.noSpecialCharactersContactName()]"
:maxlength="255"
label="First Name"
/>
<v-text-field
id="editSchoolContactLastNameInput"
v-model="editContact.lastName"
:rules="[rules.required(), rules.noSpecialCharactersContactName()]"
:rules="[rules.required()]"
class="pt-0"
variant="underlined"
:maxlength="255"
Expand All @@ -48,7 +47,6 @@
label="Position Title"
type="text"
variant="underlined"
:rules="[rules.noSpecialCharactersContactTitle()]"
maxlength="255"
/>
<v-text-field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
v-model="newContact.firstName"
variant="underlined"
class="pt-0"
:rules="[rules.noSpecialCharactersContactName()]"
:maxlength="255"
label="First Name"
/>
<v-text-field
id="newContactLastNameInput"
v-model="newContact.lastName"
variant="underlined"
:rules="[rules.required(), rules.noSpecialCharactersContactName()]"
:rules="[rules.required()]"
class="pt-0"
:maxlength="255"
label="Last Name"
Expand All @@ -47,7 +46,6 @@
v-model="newContact.jobTitle"
class="pt-0"
variant="underlined"
:rules="[rules.noSpecialCharactersContactTitle()]"
:maxlength="255"
label="Position Title"
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/institute/district/Details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
</v-row>
<div v-if="!editing">
<v-row
v-if="!hasMailingAddress() && !editing"
v-if="canEditDistrictDetails() && !hasMailingAddress() && !editing"
no-gutters
class="mt-2 d-flex justify-start"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@
v-model="editContact.firstName"
class="pt-0"
variant="underlined"
:rules="[rules.noSpecialCharactersContactName()]"
:maxlength="255"
label="First Name"
/>
<v-text-field
id="editDistrictContactLastNameInput"
v-model="editContact.lastName"
:rules="[rules.required(), rules.noSpecialCharactersContactName()]"
:rules="[rules.required()]"
class="pt-0"
variant="underlined"
:maxlength="255"
Expand All @@ -45,7 +44,6 @@
<v-text-field
id="editDistrictContactJobTitle"
v-model="editContact.jobTitle"
:rules="[rules.noSpecialCharactersContactTitle()]"
label="Position Title"
variant="underlined"
type="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<v-text-field
id="newContactFirstNameInput"
v-model="newContact.firstName"
:rules="[rules.required(), rules.noSpecialCharactersContactName()]"
:rules="[rules.required()]"
class="pt-0"
variant="underlined"
:maxlength="255"
Expand All @@ -36,7 +36,7 @@
<v-text-field
id="newContactLastNameInput"
v-model="newContact.lastName"
:rules="[rules.required(), rules.noSpecialCharactersContactName()]"
:rules="[rules.required()]"
class="pt-0"
variant="underlined"
:maxlength="255"
Expand All @@ -45,7 +45,6 @@
<v-text-field
id="newContactJobTitleInput"
v-model="newContact.jobTitle"
:rules="[rules.noSpecialCharactersContactTitle()]"
class="pt-0"
variant="underlined"
:maxlength="255"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/secure-message/AccessUserCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ export default {
});
this.selectedRoles = [...mySelection];
this.accessExpiryDate = this.user.edxUserSchools[0].expiryDate;
this.accessExpiryDate = this.getExpiryDate(this.user);
},
clearExpiryDate(){
this.accessExpiryDate = null;
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/util/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default {
},
computed: {
...mapState(appStore, ['config']),
...mapState(authStore, ['isAuthorizedUser', 'ADVANCED_SEARCH_ROLE', 'VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE', 'EDIT_MACROS_ROLE', 'VIEW_GMP_REQUESTS_ROLE', 'VIEW_UMP_REQUESTS_ROLE', 'PROCESS_STUDENT_ROLE', 'VIEW_PEN_COORDINATOR_INFO_ROLE', 'NOMINAL_ROLL_ROLE', 'STAFF_ADMINISTRATION_ADMIN', 'HAS_STATS_ROLE', 'STUDENT_ANALYTICS_STUDENT_PROFILE', 'STUDENT_ANALYTICS_BATCH', 'EXCHANGE_ROLE', 'EXCHANGE_ACCESS_ROLE', 'PEN_TEAM_ROLE']),
...mapState(authStore, ['isAuthorizedUser', 'ADVANCED_SEARCH_ROLE', 'VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE', 'EDIT_MACROS_ROLE', 'VIEW_GMP_REQUESTS_ROLE', 'VIEW_UMP_REQUESTS_ROLE', 'PROCESS_STUDENT_ROLE', 'VIEW_PEN_COORDINATOR_INFO_ROLE', 'NOMINAL_ROLL_ROLE', 'STAFF_ADMINISTRATION_ADMIN', 'HAS_STATS_ROLE', 'STUDENT_ANALYTICS_STUDENT_PROFILE', 'STUDENT_ANALYTICS_BATCH', 'EXCHANGE_ROLE', 'EXCHANGE_ACCESS_ROLE', 'PEN_TEAM_ROLE', 'INSTITUTIONS_ADMINISTRATION_ADMIN']),
items() {
return [
{
Expand Down Expand Up @@ -254,22 +254,22 @@ export default {
},
{
title: 'Institutions',
authorized: this.isAuthorizedUser,
authorized: this.INSTITUTIONS_ADMINISTRATION_ADMIN,
items: [
{
title: 'Schools',
link: 'instituteSchoolList',
authorized: this.isAuthorizedUser
authorized: this.INSTITUTIONS_ADMINISTRATION_ADMIN
},
{
title: 'Districts',
link: 'instituteDistrict',
authorized: this.isAuthorizedUser
authorized: this.INSTITUTIONS_ADMINISTRATION_ADMIN
},
{
title: 'Authorities',
link: 'instituteAuthoritiesList',
authorized: this.isAuthorizedUser
authorized: this.INSTITUTIONS_ADMINISTRATION_ADMIN
}
],
},
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/store/modules/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export const authStore = defineStore('auth', {
SCHOOL_ADMIN_ROLE: state => state.isValidSchoolAdmin,
INDEPENDENT_SCHOOLS_ADMIN_ROLE: state => state.isValidSchoolIndependentAdmin,
OFFSHORE_SCHOOLS_ADMIN_ROLE: state => state.isValidSchoolOffshoreAdmin,
INDEPENDENT_AUTHORITY_ADMIN_ROLE: state => state.isValidIndependentAuthorityAdmin
INDEPENDENT_AUTHORITY_ADMIN_ROLE: state => state.isValidIndependentAuthorityAdmin,
INSTITUTIONS_ADMINISTRATION_ADMIN: state => state.isValidSchoolAdmin || state.isValidDistrictAdmin || state.isValidSchoolIndependentAdmin || state.isValidSchoolOffshoreAdmin || state.isValidIndependentAuthorityAdmin,
},
actions: {
//sets Json web token and determines whether user is authenticated
Expand Down

0 comments on commit b33959f

Please sign in to comment.