-
Notifications
You must be signed in to change notification settings - Fork 35
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
B 22493 int - clear addr fields when toggle to No #14979
base: integrationTesting
Are you sure you want to change the base?
Conversation
updated success message verbiage
B-21348 Bulk Assignment Save
@@ -154,7 +154,7 @@ export FEATURE_FLAG_SAFETY_MOVE=true | |||
export FEATURE_FLAG_MANAGE_SUPPORTING_DOCS=true | |||
|
|||
# Feature flags to enable third address | |||
export FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=false | |||
export FEATURE_FLAG_THIRD_ADDRESS_AVAILABLE=true |
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.
do we need the green light from @deandreJones on this
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 it is not on in prod, then it should not be on here
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.
hmmm....we've had other flags that were turned on right away from creation. I see Boat, Mobile Home, Safety, Queue management, Bulk assignment all as True and none of those are on in prod. I just felt like we had this FF long enough to know any true issues, and I find myself having to change this one constantly lately. Not sure what the rule is but will check
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.
Well looks like those changes have been pushed under our noses. I'm just telling you what @deandreJones has said in the past
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 file should reflect the current state of prod
so that when a dev starts work- they are working with the current state that is prod
you always have the option to use a .envrc.local file to override the values here
@@ -252,6 +253,104 @@ class MtoShipmentForm extends Component { | |||
}); | |||
} | |||
}; | |||
const handleAddressToggleChange = (e) => { |
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.
move this into a helper function and call it from all the places you're doing this please
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.
maybe you could refactor to something like this
const updateAddressToggle = (fieldName, value, fieldKey, blankValue) => {
setValues((prevValues) => ({
...prevValues,
[fieldName]: value,
[fieldKey]: value === 'false' ? blankValue : { ...prevValues[fieldKey] },
}));
};
const handleAddressToggleChange = (e) => {
const { name, value } = e.target;
const fieldMap = {
hasSecondaryPickup: { key: 'secondaryPickup', blankValue: { blankAddress } },
hasTertiaryPickup: { key: 'tertiaryPickup', blankValue: { blankAddress } },
hasDeliveryAddress: { key: 'delivery', blankValue: { ...values.delivery, address: newDutyLocationAddress } },
hasSecondaryDelivery: { key: 'secondaryDelivery', blankValue: { blankAddress } },
hasTertiaryDelivery: { key: 'tertiaryDelivery', blankValue: { blankAddress } },
};
if (fieldMap[name]) {
updateAddressToggle(name, value, fieldMap[name].key, fieldMap[name].blankValue);
}
};
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, I actually meant to go back and figure out something for this, but got held up on tests for so long, forgot about it.
Agility ticket
Summary
When the user has answered a question regarding an address field as "Yes" and has begun filling out address information, when they change their mind and click "No" the address information should be cleared.
How to test