-
-
Notifications
You must be signed in to change notification settings - Fork 572
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
Feature Request: Userfield checkboxes: Mandatory unchecked state #2601
Comments
Great that you haven't declared it as a Bug, since I'm very allergic that everything, what's just not behaving how one personally likes it, is reported as a big Bug. Grocy's web frontend utilizes standard HTML. Mandatory form input fields are declared by an attributed So generally we can only use what the HTML standard defines and major web Browser's support. If you e.g. search for something like So we can't utilize a standard for that and have to invent it ourselves when we want that in Grocy's web frontend. Maybe somehow utilizing the input |
Totally agree. Sometimes it's a grey area, but it's always good practice to try to look at issues from different angles, and try to find out if it is actually just that you have different expectations. From a user stand-point, I still think that the "mandatory checkbox that is not able to be unchecked" is kind of a "bug". Because having a checkbox (that is mandatory) that can only ever be checked, is not what I would call "expected behavior". And as such, I would not consider this like any sort of high priority. So I basically just wanted to flag this, when I noticed it.
Unfortunately, no. Still very limited in my coding experience. So I am one of those people who can just find the issues (and having worked as a business analyst and being part of testing, basically have been trained for it), often suggest (part of) a solution, but then have to hand the actual work over to someone else... |
When adding a mandatory checkbox as a userfield, currently this will force you to check it (=True), otherwise you cannot save.
My example below is based on a checkbox for a product, but I think this applies everywhere.
Benefits:
The current implementation of checkboxes, does not show whether or not you have actively chosen the checkbox to be "un-checked", or if you just haven't selected anything (for instance for products that was already created, when you create the checkbox).
The below suggestion would make it easy to see whether or not you have actually "selected" true/false on the checkbox or not.
Suggestion for how it should work:
Should have both a "checked"/true and "un-checked"/false state - plus a "not-yet-selected"/blank state.
These could be: "Checkmark" (true), "X" (false), "blank" (blank/unselected).
Or alternatively "Checkmark" (true), "blank" (false), "greyed out" (blank/unselected).
The checkbox should always start as "blank". This should happen both if you create a new product after the userfield has been created, or if you create the Userfield after (meaning the "blank" checkbox gets added to all current products).
The "unselected" option is only "available" to Grocy (not the user). Once you either check or uncheck the checkbox, it is not possible to go back to "blank/unselected" state.
For Mandatory checkboxes, this would now give the option to actively select "un-checked" for a checkbox, as the "mandatory-check" would check whether the checkbox is "blank"/unselected.
Other considerations:
I don't know if this should be a change to the current checkbox, or if it should be a new different type of userfield. Like a separate "true/false"-checkbox. Personally I think this is how the checkbox should work, so no need to have two different "versions".
I can't think of a reason (other than time needed to implement vs benefit) why you would specifically want the checkbox to function the way it currently does, over the above suggestion, but I might be missing some usecases.
Also, the current implementation basically make a "mandatory checkbox" redundant, as the only possible option when creating a product, is to have it "checked" - otherwiser you wont be allowed to save.
Current workarounds
You can create a userfield list instead, with the options: "Yes"/"No" (or similar), which basically gives the same functionality (which is what I have done in the cases where I wanted a mandatory checkbox.
However, I think I actually consider this a bug (at least the part about the mandatory checkbox), which is why I have made an issue (even though there is a fairly obvious and easy workaround).
Whether or not this should have been marked as a bug or feature request, I was unsure. But I think the possible solutions goes beyond just a bug fix, so I settled on feature request.
Demo instance for the "Bug" regarding mandatory Checkbox:
I have created a demo-instance: https://test-4q9qfsfebzq698hq1wn9vt.demo-prerelease.grocy.info
It has 2 products under Master Data -> Products: Food Product and Non-Food Product.
And a userfield mandatory checkbox "is this food?" (created AFTER both products was created).
For the Food Product, the checkbox has been "checked".
For the Non-Food Product, the checkbox is unchecked (as the userfield was created AFTER the product).
When trying to edit the product, the mandatory checkbox is marked as an error, if you try to leave it unchecked. Checking, and then unchecking again, also gives an error.
The text was updated successfully, but these errors were encountered: