-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proponent Contact Profile #235
base: master
Are you sure you want to change the base?
Conversation
33733a1
to
c25b259
Compare
c25b259
to
fd1adca
Compare
Look is great to me but a few issues:
|
Looking great! Here are some things to look at
Thank you!! |
564c66e
to
a1317e1
Compare
done! |
done! |
a1317e1
to
7853dca
Compare
42e02be
to
8adf7e4
Compare
79bb10b
to
0cdbfe4
Compare
Release bb527d8 deployed at https://pcns-dev-pr-235.apps.silver.devops.gov.bc.ca |
app/src/controllers/contact.ts
Outdated
const contactIds = mixedQueryToArray(req.query.contactId); | ||
let userIds = mixedQueryToArray(req.query.userId); | ||
|
||
if (!userIds && req.currentContext.userId) userIds = [req.currentContext.userId]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reasoning for defaulting to searching the current user if no other IDs are provided?
app/src/controllers/contact.ts
Outdated
}, | ||
updateContact: async (req: Request<never, never, Contact, never>, res: Response, next: NextFunction) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: New line between functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,229 @@ | |||
/* eslint-disable max-len */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration will have to be renamed before merging. An earlier PR, #231, has the 018 migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// Add all navigator read only role mappings | ||
await addResourceRoles(navigator_read_group_id[0].group_id, Resource.CONTACT, [Action.READ, Action.UPDATE]); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Unnecessary new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// Add all admin role mappings | ||
await addResourceRoles(admin_group_id[0].group_id, Resource.CONTACT, [Action.READ, Action.UPDATE]); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Unnecessary new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
frontend/src/locales/en-CA.json
Outdated
@@ -129,5 +130,19 @@ | |||
"projectLocationDescriptionCard": "Is there anything else you would like to tell us about this project's location? (optional)", | |||
"provincialPermitsCard": "Have you applied for any provincial permits for this project?", | |||
"investigatePermitsCard": "Select all provincially issued permits you think you might need (optional)" | |||
}, | |||
"contactProfileView": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please alphabetize the top level keys as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* @function updateEnquiry | ||
* @returns {Promise} An axios response | ||
*/ | ||
updateContact(contactId: string, data?: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contactId
is not necessary here. You can pull the path parameter from data
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, missed that. thanks!
const submitData: Contact = setEmptyStringsToNull(values); | ||
const result = await contactService.updateContact(values.contactId, submitData); | ||
if (result.status === 200) { | ||
toast.success('Form saved'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add all new text to the locale file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
h3 { | ||
margin-top: 1em; | ||
} | ||
:deep(.p-card-body) { | ||
width: 35rem; | ||
box-shadow: 0 0 0.2rem #036; | ||
padding-bottom: 0; | ||
} | ||
.display-inline { | ||
display: inline; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: A newline should be present between classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thank you!
<FormNavigationGuard /> | ||
<InputText | ||
name="firstName" | ||
:label="t('contactProfileView.firstName')" | ||
:disabled="true" | ||
/> | ||
|
||
<InputText | ||
name="lastName" | ||
:label="t('contactProfileView.lastName')" | ||
:disabled="true" | ||
/> | ||
<InputText | ||
name="email" | ||
:label="t('contactProfileView.email')" | ||
:disabled="true" | ||
/> | ||
<InputMask | ||
name="phoneNumber" | ||
mask="(999) 999-9999" | ||
:label="t('contactProfileView.phone')" | ||
/> | ||
|
||
<Dropdown | ||
name="contactApplicantRelationship" | ||
:label="t('contactProfileView.relationshipToProject')" | ||
:bold="true" | ||
:options="PROJECT_RELATIONSHIP_LIST" | ||
/> | ||
<Dropdown | ||
name="contactPreference" | ||
:label="t('contactProfileView.preferredContact')" | ||
:bold="true" | ||
:options="CONTACT_PREFERENCE_LIST" | ||
/> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Inconsistent newlines between components. In this instance, we probably want to remove them. Precedence in the application currently is to add a newline between major blocks, such as <Card />
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
2234eef
to
704948c
Compare
app/src/controllers/contact.ts
Outdated
const identityIds = mixedQueryToArray(req.query.identityId); | ||
|
||
console.log('\n\n\nidentityIds>>>>>' + identityIds); | ||
console.log('\n\n\ncontactIds>>>>>' + contactIds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These console statements are needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed! thanks
704948c
to
a1a1ec6
Compare
…tSearch type, migration for contact resource, updated - enquiry, submission controllers upsert calls, user service to create contact on login, renamed contacts validator
…actSearchParams type, contactService, tests, updated - HeaderMenu, en-CA, application enums, router, authzStore
a1a1ec6
to
7eb5a35
Compare
Description
PADS-167
Contact management
Frontend changes:
New contactProfileView added for viewing & updating contact info
New contactSearchParams & contactService added for searching and updating contacts
Updates - HeaderMenu, en-CA, application enums, router, authzStore
Backend changes:
New - controller, route for searching and updating contacts
New contactSearch type
New migration added for creating contact resource,
Updates - enquiry, submission controllers upsert calls, user service to create contact on login, renamed contacts validator
Types of changes
Checklist
Further comments