-
Notifications
You must be signed in to change notification settings - Fork 13
Update Claim a Facility claim form & profile fields #650
Conversation
89f9537
to
b25e320
Compare
fe38fcb
to
8d93c74
Compare
Note from #647 (comment) As part of this pull request add a commit to:
|
I will hold off on reviewing this until the migration and code conflicts are resolved. |
6b41b54
to
df94afc
Compare
Rebased this on
@jwalgran I believe this is ready for review! |
Looking at this now. |
d67149d
to
e9495f9
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.
Thanks for breaking up this big change into more easily reviewable chunks. There are some problems to resolve and I made some suggestions.
<InfoSection | ||
label="Facility Parent Company" | ||
value={ | ||
(() => { | ||
const parentCompanyName = get(data, 'facility_parent_company.name', null); | ||
|
||
if (!parentCompanyName) { | ||
return null; | ||
return ''; |
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.
Curious about this change from null
to ''
. Is it to prevent rendering the string "null?"
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 believe this was to remedy a propTypes warning but is otherwise a noop.
src/django/api/models.py
Outdated
help_text='The editable facility name for this claim.') | ||
help_text='The editable official English facility name for the claim.', | ||
verbose_name='facility name in English') | ||
facility_name_non_english = models.CharField( |
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.
#634 calls for this field to be "Official facility name (native language)." Unless this label change was specifically requested I do think that "native language" is a better descriptor than "non-English"
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.
Sounds good. I'll update the field names throughout.
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 in 65b7fa4
@@ -27,7 +27,10 @@ import COLOURS from '../util/COLOURS'; | |||
import { | |||
fetchClaimedFacilityDetails, | |||
clearClaimedFacilityDetails, | |||
updateClaimedFacilityName, | |||
updateClaimedFacilityNameEnglish, | |||
updateClaimedFacilityNameNonEnglish, |
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.
Consider "non-english" → "native language"
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 in 65b7fa4
disabled={updating} | ||
/> | ||
<InputSection | ||
label="Facility name (non-English language)" |
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.
Consider "non-english" → "native language"
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 in 65b7fa4
@@ -229,14 +232,17 @@ function ClaimedFacilitiesDetails({ | |||
data, | |||
getDetails, | |||
clearDetails, | |||
updateFacilityName, | |||
updateFacilityNameEnglish, | |||
updateFacilityNameNonEnglish, |
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.
Consider "non-english" → "native language"
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 in 65b7fa4
src/django/api/views.py
Outdated
facility_name=request.data.get('facility_name'), | ||
facility_name_english=request.data | ||
.get('facility_name_english'), | ||
facility_name_non_english=request.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.
Consider "non-english" → "native language"
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 in 65b7fa4
label="Minimum Order" | ||
/> | ||
<ClaimInfoSection | ||
value={facility.facility_average_lead_time} | ||
value={facility.average_lead} |
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.
Was this field incorrectly named and we are now fixing it in passing along with reordering the fields?
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.
Yeah, that's right. It's called average_lead
in the geojson properties but it was just silently absent here.
src/django/api/views.py
Outdated
office_country_code=request.data.get('office_country_code'), | ||
office_phone_number=request.data.get('office_phone_number'), | ||
office_info_publicly_visible=request.data | ||
claim_to_update = FacilityClaim \ |
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.
</Typography> | ||
</InputLabel> | ||
<TextField | ||
error={isEmpty(jobTitle)} |
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.
I fixed this in 4c3b188
src/django/api/views.py
Outdated
.data \ | ||
.get('facility_average_lead_time') | ||
|
||
claim_to_update.facility_workers_count = request \ |
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.
If I leave either this field of the female worker percentage field blank saving crashes with
ValueError: invalid literal for int() with base 10: ''
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.
Fixed this in 6449b9f in two parts:
- prevent the client from sending non-int values for these fields
- if the api encounters non-int values here, they are ignored and the fields are set to None
e9495f9
to
b56e684
Compare
@jwalgran this is ready for another review! |
Looking at this now. |
6e649a0
to
cf92229
Compare
Commit message for cf92229 |
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.
Fixes look good and work well. Thanks. Mind the squash.
Awesome, thanks! |
- add fields for facility claim form and claimed facility profile - adjust display order for claimed facility details page - replace .update with .save in facility claim details endpoint
cf92229
to
2dcd09b
Compare
Overview
facility_name_non_english profile fields
Connects #617
Connects #634
Demo
Notes
There are a bunch of migrations here but I'll squash them when the other PRs are merged in -- so I didn't bother renaming anything.
I made discrete followup issues for handling
Testing Instructions
Checklist
fixup!
commits have been squashed