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

Implement LFC survey question form #4744

Merged
merged 18 commits into from
Jan 30, 2025

Conversation

jrobbins
Copy link
Collaborator

This should resolve #4696. The privacy gates will offer self-certification instead of review, but only if the user enters survey question answers that cause the server to set self_certify_eligible to True. This PR just displays the form and saves any value changes to the server. A future PR will change the behavior of the "Request review" button for the eligible case.

In this PR:

  • Refactor the display of the "Survey questions" part of the gate column into a new component.
  • Display the specific questions for the privacy form.
  • Handle UI element changes by doing a PATCH to the server.

Copy link
Collaborator

@DanielRyanSmith DanielRyanSmith left a comment

Choose a reason for hiding this comment

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

Some questions to clear things up for me 🙂

api/reviews_api.py Show resolved Hide resolved
Comment on lines +73 to +77
window.csClient
.updateGate(this.feature.id, this.gate.id, null, {[name]: value})
.then(() => {
this.refetch();
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will send a request for every time any field changes state, including for each new character change in an input field. Would a "Submit" option be a better choice to avoid the potential of redundant requests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, the sl-change event is only sent once the user un-focuses on the input field or navigates away. So, it is not one for every keystroke. I am thinking that automatic updates are better than having a submit button because there are already enough buttons to compete for the user's attention. Specifically, after filling in these answers, the user will be often be clicking on the "Request review" button. I don't want them to have to fill-in and press submit before being able to press the "Request review" button.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, you are correct about the unfocus aspect 🙂 - although, maybe there is a risk of the user not unfocusing for something - it's like you said about the likelihood of the "Request review" button being the next action - so that sounds fine to me

client-src/elements/chromedash-survey-questions.ts Outdated Show resolved Hide resolved
@jrobbins jrobbins merged commit 9fe34b3 into main Jan 30, 2025
7 checks passed
@jrobbins jrobbins deleted the 20250117-implement-survey-question-form branch January 30, 2025 00:40
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.

Implement a gate survey form
2 participants