Skip to content

Commit

Permalink
Merge pull request #1619 from bcgov/fix/edx-1929
Browse files Browse the repository at this point in the history
Add welcome message to dashboard when there are no roles that display info.
  • Loading branch information
arcshiftsolutions authored Oct 24, 2023
2 parents 10f8c3a + f5e00ac commit 32b046f
Showing 1 changed file with 63 additions and 25 deletions.
88 changes: 63 additions & 25 deletions frontend/src/components/Home.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<template>
<div>
<v-row class="pb-6">
<v-row
v-if="hasNoRole"
>
<v-col
class="pt-6"
>
<h3>Welcome to Education Administration!</h3>
<p>Please find your available features in the menu.</p>
</v-col>
</v-row>
<v-row
v-else
class="pb-6"
>
<v-col
v-if="VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE"
cols="8"
Expand Down Expand Up @@ -186,7 +199,10 @@
</router-link>
</v-col>
</v-row>
<v-row no-gutters class="mt-2">
<v-row
no-gutters
class="mt-2"
>
<v-col>
<router-link
v-if="STUDENT_ANALYTICS_STUDENT_PROFILE"
Expand Down Expand Up @@ -315,6 +331,51 @@ export default {
loadDateRules: [v => (!v || isPresentDateAndAfter1900(v)) || 'Invalid date'],
};
},
computed: {
...mapState(appStore, ['mincodeSchoolNames', 'districtCodes']),
...mapState(authStore, [
'VIEW_GMP_REQUESTS_ROLE',
'VIEW_UMP_REQUESTS_ROLE',
'ADVANCED_SEARCH_ROLE',
'VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE',
'HAS_STATS_ROLE',
'STUDENT_ANALYTICS_STUDENT_PROFILE',
'STUDENT_ANALYTICS_BATCH',
'EXCHANGE_ROLE',
'PEN_TEAM_ROLE'
]),
hasNoRole() {
const roles = [
this.HAS_STATS_ROLE,
this.EXCHANGE_ROLE,
this.ADVANCED_SEARCH_ROLE,
this.VIEW_GMP_REQUESTS_ROLE,
this.VIEW_UMP_REQUESTS_ROLE,
this.VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE,
];
return roles.find(r => r === true) === undefined;
},
requestTypes() {
return REQUEST_TYPES;
},
isValidPEN() {
return isValidPEN(this.pen);
},
isValidRequestsSearchInput() {
if (!this.mincode && !this.loadDate) {
return false;
}
return (!this.mincode || this.isValidDistrictOrMincode(this.mincode)) &&
(!this.loadDate || isPresentDateAndAfter1900(this.loadDate));
},
authorizedExchangeData() {
return this.exchangeData.filter(exchangeInbox => exchangeInbox.authorized);
},
hasAuthorizedExchangeData() {
return this.authorizedExchangeData.length > 0;
}
},
async beforeMount() {
await appStore().getCodes();
},
Expand Down Expand Up @@ -396,29 +457,6 @@ export default {
});
}
},
computed: {
...mapState(appStore, ['mincodeSchoolNames', 'districtCodes']),
...mapState(authStore, ['VIEW_GMP_REQUESTS_ROLE', 'VIEW_UMP_REQUESTS_ROLE', 'ADVANCED_SEARCH_ROLE', 'VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE', 'HAS_STATS_ROLE', 'STUDENT_ANALYTICS_STUDENT_PROFILE', 'STUDENT_ANALYTICS_BATCH', 'EXCHANGE_ROLE', 'PEN_TEAM_ROLE']),
requestTypes() {
return REQUEST_TYPES;
},
isValidPEN() {
return isValidPEN(this.pen);
},
isValidRequestsSearchInput() {
if (!this.mincode && !this.loadDate) {
return false;
}
return (!this.mincode || this.isValidDistrictOrMincode(this.mincode)) &&
(!this.loadDate || isPresentDateAndAfter1900(this.loadDate));
},
authorizedExchangeData() {
return this.exchangeData.filter(exchangeInbox => exchangeInbox.authorized);
},
hasAuthorizedExchangeData() {
return this.authorizedExchangeData.length > 0;
}
},
methods: {
quickSearch() {
ApiService.apiAxios
Expand Down

0 comments on commit 32b046f

Please sign in to comment.