From e94bfffe606436bb2030bfd2a2cfb0ea4e8778cc Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Tue, 24 Oct 2023 13:02:39 -0700 Subject: [PATCH 1/2] chore: satisfy eslint --- frontend/src/components/Home.vue | 61 +++++++++++++++++++------------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/Home.vue b/frontend/src/components/Home.vue index 166db2d66..9a1e8e84e 100644 --- a/frontend/src/components/Home.vue +++ b/frontend/src/components/Home.vue @@ -186,7 +186,10 @@ - + (!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' + ]), + 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(); }, @@ -396,29 +432,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 From f5e00ac3b0e5af81efab2b48fc304d239eb8e5c5 Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Tue, 24 Oct 2023 13:45:59 -0700 Subject: [PATCH 2/2] feature: add dashboard welcome message if no roles ...and by no roles, I mean no roles that display something on the dashboard --- frontend/src/components/Home.vue | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Home.vue b/frontend/src/components/Home.vue index 9a1e8e84e..1a2543797 100644 --- a/frontend/src/components/Home.vue +++ b/frontend/src/components/Home.vue @@ -1,6 +1,19 @@