-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Finish Interview Improvements #82
Conversation
adds to appSettings, toggle setting on settings page
uses cookies-next to set a cookie with protocolId on complete interview. check for cookie in interview shell. if app setting limitInterviews and cookie is present, redirect to finished interview screen
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
allows us to use built in cookies from next/headers. also puts check/redirect in onboard route so that no interviews are created if condition is met.
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.
Really great work, man 👏 . I asked for a minor change above. If you think this isn't necessary, feel free to mark it as resolved
const appSettings = await api.appSettings.get.query(); | ||
|
||
// if limitInterviews is enabled | ||
// Check cookies for interview already completed for this user for this protocol | ||
// and redirect to finished page | ||
if (appSettings?.limitInterviews && cookies().get(protocolId)) { | ||
redirect('/interview/finished'); | ||
} |
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 future, think about making this a single function in a separate file, that the route handler and the page can both import. That way we can update the behaviour later in a simpler way.
This PR implements several improvements to the Finish Interview functionality:
Confirm dialog UI/UX Improvements
Event tracking for InterviewCompleted
nodeCount
andedgeCount
metadata addedOption to limit participants to one interview per protocol
limitInterviews
setting added toappSettings
. Toggleable from app setup and settings page on the dashboardprotocolId
as the key. There are checks for the cookie in the/interview
and/onboard
routes. If cookie is present andlimitInterviews
is true, user is redirected to the thank you for participating page.