-
Notifications
You must be signed in to change notification settings - Fork 38
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
New survey page based on Next.js v13 using the app router and server actions #1756
base: main
Are you sure you want to change the base?
New survey page based on Next.js v13 using the app router and server actions #1756
Conversation
Nice. The playwright failures here make sense. It's the result of combining the new playwright tests we wrote at code camp with the server action version of the survey form. |
b723dd9
to
5459f24
Compare
First little burst of activity since the hackathon produced 5459f24. The context here is I'm trying to get the survey page playwright tests green, and the executive summary is that this commit gets 2/5 of them green and then skips the remaining three. More details below.
|
92e0d10 gets the My first iteration of the app router thing here was actually mega sloppy about the server component / client component boundary. Now there's a clear & coherent boundary where the Tidying up that boundary line was enough to get this test passing. |
6964e23 has done two things: gotten the
Bit of a two steps forward one step back commit given the number of new playwright test failures it introduces and the worrying dependency on canary versions of key dependencies. But! BUT! We now finally have a decently clear view here of how it'll probably look to write this kind of code at Zetkin a little while in the future once all this bleeding edge stuff goes mainstream. And god help me I think I actually like it! |
a61b925
to
0175e2f
Compare
6964e23
to
be504a9
Compare
I'm just having a look at the preview deployment of this, and I'm missing the "What is this question?" question that should have two options. Are multi-choice questions not implemented? Or maybe it's because there is no What's being rendered on the previewThe API response for this survey{
"data" : {
"access" : "open",
"allow_anonymous" : true,
"callers_only" : false,
"campaign" : null,
"elements" : [
{
"hidden" : false,
"id" : 1,
"question" : {
"description" : "Answer whatever",
"options" : [
{
"id" : 1,
"text" : "Option 1"
},
{
"id" : 2,
"text" : "Option 2"
}
],
"question" : "What is this question?",
"required" : false,
"response_config" : {},
"response_type" : "options"
},
"type" : "question"
},
{
"hidden" : false,
"id" : 2,
"text_block" : {
"content" : "With some instructions",
"header" : "This is a text block"
},
"type" : "text"
},
{
"hidden" : false,
"id" : 3,
"question" : {
"description" : null,
"question" : "Is this a free text question?",
"required" : false,
"response_config" : {
"multiline" : true
},
"response_type" : "text"
},
"type" : "question"
}
],
"expires" : null,
"id" : 1,
"info_text" : "This is a survey",
"org_access" : "sameorg",
"organization" : {
"id" : 1,
"title" : "My Organization"
},
"published" : "2024-02-22T06:16:19.016317",
"signature" : "allow_anonymous",
"title" : "A very open survey"
}
} |
Good spot, I’ll get that sorted this evening. Will also have another look at the playwright thing. The canary version of react-dom is what’s behind all the failing tests so I’m keeping an eye open for new versions in case one fixes that. |
Localization for link and descriptions to Swedish
Fixed in 3bc0f5a. fixed.movIt was a mistake not to pass the original My fix in 3bc0f5a passes the actual |
Great work finding and fixing this @henrycatalinismith! It would be great to have playwright tests testing this too. |
Here's a full completion of the members' survey followed by a visual review of the submission in the organizer UI. Did this while halfway out the door with the kids so may have missed something, but I thought it seemed 100% okay. test.mov |
Awesome @henrycatalinismith! Is there currently anything testing the |
Add support for the full suite of survey question options in the new survey form
…ter-and-server-action
…ter-and-server-action
copyText={`${location.protocol}//${location.host}/o/${orgId}/surveys/${surveyId}`} | ||
> | ||
{`${process.env.NEXT_PUBLIC_ZETKIN_APP_DOMAIN}/o/${orgId}/surveys/${surveyId}`} | ||
{`${location.protocol}//${location.host}/o/${orgId}/surveys/${surveyId}`} |
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.
The orgId
in both of these places should be survey.organization.id
(which may or may not be the organization that we're currently working within). You should be able to get it using useSurvey()
.
See #1941 for related changes (but we refrained from making changes to the URL there to avoid merge conflicts).
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 looks familiar!!! Did #1936 turn out to be the tip of the iceberg? I'll get this sorted right away.
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.
Combining all our work from #1636, #1719 and #1738. Targeting the branch for #1719 as the code changes here depend on merging the Next v13 upgrade to
main
. Once #1719 ships we can update the base branch of this PR tomain
.