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

feat: Implement custom submission message #1659

Merged
merged 1 commit into from Oct 16, 2023

Conversation

susnux
Copy link
Collaborator

@susnux susnux commented Jun 28, 2023

ℹ️ Summary

Users can configure a custom text which is shown if a users submits the form (custom "Thank you message").
It can be formatted using markdown, so it also allows the requested link feature (e.g. to link back to a website).

🖼️ Screenshots

Form submitted Editing the message Preview the message
image image image

@susnux susnux added enhancement New feature or request 3. to review Waiting for reviews feature: 📝 submitting responses labels Jun 28, 2023
@susnux susnux added this to the 3.4 milestone Jun 28, 2023
@susnux susnux force-pushed the feat/custom-submission-message-385 branch 2 times, most recently from 5cd7610 to b03d290 Compare June 28, 2023 10:48
@Chartman123
Copy link
Collaborator

@susnux Nice addition :) Should we hide the message input field behind a switch? [ ] Show custom message

@susnux susnux force-pushed the feat/custom-submission-message-385 branch 2 times, most recently from c797fd2 to 72f8798 Compare June 28, 2023 11:21
@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #1659 (812a637) into main (6c0ad5d) will decrease coverage by 0.24%.
Report is 5 commits behind head on main.
The diff coverage is 11.76%.

❗ Current head 812a637 differs from pull request most recent head fed3d4c. Consider uploading reports for the commit fed3d4c to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1659      +/-   ##
============================================
- Coverage     43.19%   42.96%   -0.24%     
- Complexity      611      613       +2     
============================================
  Files            57       58       +1     
  Lines          2475     2486      +11     
============================================
- Hits           1069     1068       -1     
- Misses         1406     1418      +12     

@susnux
Copy link
Collaborator Author

susnux commented Jun 28, 2023

Should we hide the message input field behind a switch? [ ] Show custom message

Unsure about this, what do you think looks better? (For me both variants have equal pros and cons)

@Chartman123
Copy link
Collaborator

Unsure about this, what do you think looks better? (For me both variants have equal pros and cons)

Using the switch we would surely need one more column in the DB, but then could also have an empty submission message. I think this is also a question for the designers. If we add the switch, we should also indent the text box under the text of the switches. Would you like to bring it up in the design team chat?

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Nice idea @susnux! And yep, I think @Chartman123’s suggestion about doing it as a switch is good, keeps it cleaner too since most people are likely to keep the original submission message. And then we can also add some grey hint text when it’s enabled saying something like:
"Message to show after form submission. Note that this can not be translated."

@susnux susnux force-pushed the feat/custom-submission-message-385 branch from 72f8798 to a772483 Compare August 26, 2023 08:18
@susnux
Copy link
Collaborator Author

susnux commented Aug 26, 2023

@Chartman123 @jancborchardt

Implemented the checkbox:
Screenshot_20230826_101816

Copy link
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

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

I had another look at the corresponding issue and saw that there was a request for customizing the title message of the submission page, too. Would you like to add this into this PR as well?

Other than that, please update the API docs :)

src/components/SidebarTabs/SettingsSidebarTab.vue Outdated Show resolved Hide resolved
src/components/SidebarTabs/SettingsSidebarTab.vue Outdated Show resolved Hide resolved
src/components/SidebarTabs/SettingsSidebarTab.vue Outdated Show resolved Hide resolved
@susnux susnux force-pushed the feat/custom-submission-message-385 branch from a7523e5 to cf134e5 Compare August 26, 2023 12:43
@susnux susnux force-pushed the feat/custom-submission-message-385 branch from cf134e5 to 8c2beb9 Compare August 26, 2023 19:19
@susnux
Copy link
Collaborator Author

susnux commented Aug 26, 2023

@jancborchardt the setting do look like this now:
image

Chartman123
Chartman123 previously approved these changes Aug 26, 2023
@Chartman123
Copy link
Collaborator

Chartman123 commented Aug 26, 2023

Looks good now. So only the following things are remaining:

  • add the new prop to docs/API.md and docs/DataStructure.md, add info that prop is only available with higher API level
  • raise API level?
  • What to do about the title? Always keep the default or make it customizable, too?
  • Squash commits into one, do a rebase

@Chartman123 Chartman123 dismissed their stale review August 26, 2023 22:15

clicked wrong button

@susnux susnux force-pushed the feat/custom-submission-message-385 branch from 8c2beb9 to 7e5b431 Compare October 8, 2023 17:31
@susnux
Copy link
Collaborator Author

susnux commented Oct 16, 2023

@Chartman123 done with the todos

raise API level?

I would say no as we did not change it, there are no new routes, we did not increase the API level for new option keys before (e.g. extraSettings).

What to do about the title? Always keep the default or make it customizable, too?

can we do this in a follow up? I would like to discuss some options before and this PR at least provides the functionality requested.

@susnux susnux force-pushed the feat/custom-submission-message-385 branch from 7e5b431 to 99c1aba Compare October 16, 2023 17:25
@Chartman123
Copy link
Collaborator

we did not increase the API level for new option keys before (e.g. extraSettings).

I'm no expert in API level definitions... But fine for me to stay with 2.1

can we do this in a follow up?

Fine for me 👍🏻

@susnux susnux force-pushed the feat/custom-submission-message-385 branch 2 times, most recently from 267e690 to 812a637 Compare October 16, 2023 18:58
This message is shown when a user submits the form and can be formatted using markdown.
Make the custom submission message hidden behind a checkbox
Null on submissionMessage means disabled

Co-authored-by: Chartman123 <chris-hartmann@gmx.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the feat/custom-submission-message-385 branch from 812a637 to fed3d4c Compare October 16, 2023 20:03
@Chartman123 Chartman123 merged commit ef0bdcd into main Oct 16, 2023
19 of 20 checks passed
@Chartman123 Chartman123 deleted the feat/custom-submission-message-385 branch October 16, 2023 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for custom message and/or redirect after submission
3 participants