-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat(interview): apply to all [2] #1125
Conversation
199863c
to
be2dea7
Compare
5c65410
to
498ae19
Compare
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 front-end only, so it does not require any tests 😶🌫️
Ive tried out answering some questions and applying the answers to other datasets, it functions intuitively.
One problem I found for the multiple text answer types, where I could not see the button "apply to all" anymore after filling-out and removing again. Are these values not properly compared? And should I also be able to apply-to-all after i just add another entry or not?
Another thing is about the radio buttons, they are floating over, but it's not for this PR I guess, see picture.
rdmo/projects/assets/js/interview/components/main/question/QuestionCopyValue.js
Outdated
Show resolved
Hide resolved
The radio button problem should be fixed in 24f6831. |
About the apply to all, it works like expected (by me 😄 ). It apears only if the question in at least one of the "sibling" sets has no or only empty values. Maybe we discuss how the feature should work when showing it to more users. |
be2dea7
to
493f4b5
Compare
498ae19
to
5ec0b86
Compare
Rebased and good to go! |
So, with the behaviour of the checkboxes I can only add selected checkboxes and not remove unselected checkboxes when I apply to all. |
The behavior was a bit odd, because of a bug. The idea was that values are not copied when any value exists "on the receiving side" (which is not what you describe, lets discuss this later in a call or so). |
sets.filter((set) => set.set_prefix === setPrefix).forEach((set) => { | ||
element.elements.filter((e) => (e.model === 'questions.question')).forEach((question) => { | ||
// check if there is any value for this question and set | ||
if (isNil(values.find((value) => ( | ||
(value.attribute === question.attribute) && | ||
(value.set_prefix == set.set_prefix) && | ||
(value.set_index == set.set_index) |
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 these need to be strict ===
as well?
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.
in principle ==
would be ok, I guess but I will change it (JS is weird).
from local testing the interview, now the "Apply this answer to all tabs where this question is empty" behaves accordingly. As a side note, from a UX, I maybe would expect a button to erase (uncheck) all check-boxes but that's not for this PR. |
I added the erase button to the checkboxes, it was not to complicated. I don't know why I did not add it in the first place. |
When reopening the interview in an existing project, at a checkbox question I got the "existing value" conflict validation error.
but it was only initially, after that I tried to make another Dataset and could check the boxes in there. PS |
When I apply here to all
then it also applies to the next question
Is that a bug? |
No, its the same attribute. However, you found a different bug 🐛. The |
About the other thing, maybe there was a faulty value in your database from tests before. |
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.
very nice, thanks!
This PR adds the possibility to make projects to all users (#152)
To that purpose, it adds a copyValue action to the new interface, which can be used to copy values to different tabs of a page.
It also makes the add value button for questions a bit smaller.