Conversation
fb96126
to
a250785
Compare
a250785
to
307fa44
Compare
Turns out we do want contributors without lists to be selectable so I'll make the necessary adjustments here. |
9e33a3a
to
f9cca82
Compare
Looking at this now. |
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.
This is a nice, straightforward implementation. I ran into a small issue with a discrepancy between user ID and contributor ID when building /profile/
links and made a suggestion regarding the field labeling on the claim form.
src/django/api/serializers.py
Outdated
@@ -427,13 +427,22 @@ def get_claim_info(self, facility): | |||
.filter(status=FacilityClaim.APPROVED) \ | |||
.get(facility=facility) | |||
|
|||
if claim.parent_company: | |||
parent_company = { | |||
'id': claim.parent_company.id, |
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.
I ran into an issue with linking to the wrong profile page. Our /profile/
endpoint currently expects a user ID, not a contributor ID. We can fix this by adopting the strategy we use for the facility details
In this case we would use:
'id': claim.parent_company.admin.id,
The time to fix this properly is probably when (if) we implement multi-user contributors.
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.
Thanks for catching that -- I remember being slightly confused by this in instances when the contributor is and the contributor.admin id are the same, so it doesn't show the discrepancy. I adjusted this in efee42f.
src/app/src/util/constants.js
Outdated
@@ -434,6 +434,10 @@ export const claimAFacilityFormFields = Object.freeze({ | |||
id: 'company-name', | |||
label: 'Official name of LLC or company registered', | |||
}), | |||
parentCompany: Object.freeze({ | |||
id: 'parent-company', | |||
label: 'Parent company of facility, selected from contributors 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.
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.
That makes sense. I adjusted this on both the initial form and the update page in 364ce9d
364ce9d
to
47fbb63
Compare
Rebased this on |
47fbb63
to
22e344c
Compare
- add parent_company field to facilityclaim model - add & use a parent company selection on the claim a facility form - display facility parent company on admin dashboard claim details page - display editable facility parent company on claimed facility profile form - display linked facility parent company on facility details page
22e344c
to
33cbe55
Compare
Rebased on |
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.
Excellent work.
Thanks! Going to merge and then I'll run the migration on staging. |
Overview
This PR adds a parent_company field to the FacilityClaim model as a FK to Contributor, and also enables selecting, displaying, and updating that field from the list of contributorOptions.
Connects #618
Demo
Notes
Adding the new field makes the number of items displayed in the dashboard claim details page uneven, which breaks using having the two text area fields sit adjacent at the bottom of the list. We can probably wait to fix this when and if it is an actual issue.
Testing Instructions
resetdb
andprocessfixtures
andserver
Checklist
fixup!
commits have been squashed