Skip to content
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

Fix display of "inventory only" radio buttons #8263

Merged

Conversation

Matt-Yorkley
Copy link
Contributor

@Matt-Yorkley Matt-Yorkley commented Sep 30, 2021

What? Why?

Addresses UI issue described in #8256 (comment)

Previously the two radio buttons were not showing which option was set; both options were blank even if one had been selected.

What should we test?

When an inventory setting is set in the enterprise "Inventory Settings" tab, it should correctly show which setting is currently in use. Note: the default value is false.

Release notes

Fixed display of "inventory only" setting in enterprise edit page

Changelog Category: Technical changes

@Matt-Yorkley Matt-Yorkley self-assigned this Sep 30, 2021
Previously the two radio buttons were not showing which option was set; both options were blank even if one had been selected.
@Matt-Yorkley Matt-Yorkley marked this pull request as ready for review September 30, 2021 12:34
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And simplifying the code. 😍

@filipefurtad0 filipefurtad0 self-assigned this Oct 5, 2021
@filipefurtad0 filipefurtad0 added the pr-staged-uk staging.openfoodnetwork.org.uk label Oct 5, 2021
@filipefurtad0
Copy link
Contributor

filipefurtad0 commented Oct 5, 2021

Hey @Matt-Yorkley ,

I've checked this now, for

  • pre-existing enterprises
    It can be seen that where previously no selection in the UI was visible, i) now there is one, and ii) that it corresponds to the value in the DB. Changing it and updating the values changes the values in the DB accordingly:

Peek 2021-10-05 12-26

  • newly created enterprises

As before, the default selection is seen in the UI, but I cannot seem to find this preference saved in the DB:

image

Would it be expected that there is a preference entry on the DB? Or is this only expected if it differs from the false default setting? I'm thinking we might still have bug occurrences if this is missing, but I'm not sure. What do you think?

PS: Even though the DB does not show this preference, I could not reproduce the bug here - it is possible to add products on the outgoing section:
image

So maybe we're good? Will await for your feedback on this.

@filipefurtad0 filipefurtad0 added feedback-needed and removed pr-staged-uk staging.openfoodnetwork.org.uk feedback-needed labels Oct 5, 2021
@filipefurtad0
Copy link
Contributor

I've moved it to ready to go - there's a good chance this fixes the S1 👍 We can consider this one perhaps a prod-test, as I was not able to reproduce the exact scenario in staging.

@Matt-Yorkley Matt-Yorkley merged commit 05ba7df into openfoodfoundation:master Oct 5, 2021
@Matt-Yorkley
Copy link
Contributor Author

Would it be expected that there is a preference entry on the DB? Or is this only expected if it differs from the false default setting?

Yes, that's how it generally works with defaults 👌

@filipefurtad0
Copy link
Contributor

Ah great! I was unaware of that, thank you for that feedback 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants