From 7f3d961e898da3517af71f819424c23f53ec79e9 Mon Sep 17 00:00:00 2001 From: Sanjay Babu Date: Wed, 2 Oct 2024 11:35:12 -0700 Subject: [PATCH] Housing enquiry/submission intake permission added, housing enquiry permission added to admin, supervisor, navigator & navigator read-only, InputMaskInternal placeholder prop type optional to fix console warning, navbar enquiry permission updated --- .../form/internal/InputMaskInternal.vue | 2 +- frontend/src/components/layout/Navbar.vue | 8 ++++---- frontend/src/router/index.ts | 4 ++-- frontend/src/store/authzStore.ts | 17 ++++++++++++----- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/form/internal/InputMaskInternal.vue b/frontend/src/components/form/internal/InputMaskInternal.vue index 4cab4ef4..157fbe8b 100644 --- a/frontend/src/components/form/internal/InputMaskInternal.vue +++ b/frontend/src/components/form/internal/InputMaskInternal.vue @@ -8,7 +8,7 @@ const { label, name, mask, placeholder, disabled, bold } = defineProps<{ label: string; name: string; mask: string; - placeholder: string; + placeholder?: string; disabled: boolean; bold: boolean; }>(); diff --git a/frontend/src/components/layout/Navbar.vue b/frontend/src/components/layout/Navbar.vue index ddfeff5a..73b633d9 100644 --- a/frontend/src/components/layout/Navbar.vue +++ b/frontend/src/components/layout/Navbar.vue @@ -15,7 +15,7 @@ type NavItem = { label: string; route?: string; public?: boolean; - access?: string; + access?: NavigationPermission | Array; items?: Array; mailTo?: string; }; @@ -39,12 +39,12 @@ onMounted(() => { { label: 'Start a new project investigation', route: RouteName.HOUSING_SUBMISSION_INTAKE, - access: NavigationPermission.HOUSING_INTAKE + access: NavigationPermission.HOUSING_SUBMISSION_INTAKE }, { label: 'Submit an enquiry', route: RouteName.HOUSING_ENQUIRY_INTAKE, - access: NavigationPermission.HOUSING_ENQUIRY + access: NavigationPermission.HOUSING_ENQUIRY_INTAKE }, { label: 'View my drafts and previous entries', @@ -80,7 +80,7 @@ onMounted(() => { { label: 'Contact a Navigator', mailTo: `mailto:${HOUSING_CONTACT.email}?subject=${HOUSING_CONTACT.subject}`, - access: NavigationPermission.HOUSING_INTAKE + access: [NavigationPermission.HOUSING_SUBMISSION_INTAKE, NavigationPermission.HOUSING_ENQUIRY_INTAKE] }, { label: 'Report a problem', diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 20e0cfbc..73fcd21e 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -113,7 +113,7 @@ const routes: Array = [ beforeEnter: accessHandler, props: createProps, meta: { - access: [NavigationPermission.HOUSING_INTAKE] + access: [NavigationPermission.HOUSING_ENQUIRY_INTAKE] } } ] @@ -138,7 +138,7 @@ const routes: Array = [ beforeEnter: accessHandler, props: createProps, meta: { - access: [NavigationPermission.HOUSING_INTAKE] + access: [NavigationPermission.HOUSING_SUBMISSION_INTAKE] } } ] diff --git a/frontend/src/store/authzStore.ts b/frontend/src/store/authzStore.ts index 592c4879..dc1270ae 100644 --- a/frontend/src/store/authzStore.ts +++ b/frontend/src/store/authzStore.ts @@ -10,8 +10,9 @@ export enum NavigationPermission { HOUSING = 'housing', HOUSING_DROPDOWN = 'housing.dropdown', HOUSING_ENQUIRY = 'housing.enquiry', - HOUSING_INTAKE = 'housing.intake', + HOUSING_ENQUIRY_INTAKE = 'housing.enquiry.intake', HOUSING_SUBMISSION = 'housing.submission', + HOUSING_SUBMISSION_INTAKE = 'housing.submission.intake', HOUSING_SUBMISSIONS = 'housing.submissions', HOUSING_SUBMISSIONS_SUB = 'housing.submissions.sub', HOUSING_STATUS_TRACKER = 'housing.statustracker', @@ -26,6 +27,7 @@ const NavigationAuthorizationMap = [ group: GroupName.ADMIN, permissions: [ NavigationPermission.HOUSING_DROPDOWN, + NavigationPermission.HOUSING_ENQUIRY, NavigationPermission.HOUSING_STATUS_TRACKER, NavigationPermission.HOUSING_SUBMISSION, NavigationPermission.HOUSING_SUBMISSIONS, @@ -37,6 +39,7 @@ const NavigationAuthorizationMap = [ group: GroupName.NAVIGATOR, permissions: [ NavigationPermission.HOUSING_DROPDOWN, + NavigationPermission.HOUSING_ENQUIRY, NavigationPermission.HOUSING_STATUS_TRACKER, NavigationPermission.HOUSING_SUBMISSION, NavigationPermission.HOUSING_SUBMISSIONS @@ -44,16 +47,19 @@ const NavigationAuthorizationMap = [ }, { group: GroupName.NAVIGATOR_READ_ONLY, - permissions: [NavigationPermission.HOUSING_SUBMISSION, NavigationPermission.HOUSING_SUBMISSIONS] + permissions: [ + NavigationPermission.HOUSING_ENQUIRY, + NavigationPermission.HOUSING_SUBMISSION, + NavigationPermission.HOUSING_SUBMISSIONS + ] }, { group: GroupName.PROPONENT, permissions: [ NavigationPermission.HOUSING, NavigationPermission.HOUSING_DROPDOWN, - NavigationPermission.HOUSING_ENQUIRY, - NavigationPermission.HOUSING_INTAKE, - NavigationPermission.HOUSING_SUBMISSION, + NavigationPermission.HOUSING_ENQUIRY_INTAKE, + NavigationPermission.HOUSING_SUBMISSION_INTAKE, NavigationPermission.HOUSING_SUBMISSIONS_SUB ] }, @@ -61,6 +67,7 @@ const NavigationAuthorizationMap = [ group: GroupName.SUPERVISOR, permissions: [ NavigationPermission.HOUSING_DROPDOWN, + NavigationPermission.HOUSING_ENQUIRY, NavigationPermission.HOUSING_STATUS_TRACKER, NavigationPermission.HOUSING_SUBMISSION, NavigationPermission.HOUSING_SUBMISSIONS,