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

fix(form): set allow_blank for static_content #1577

Closed
wants to merge 1 commit into from

Conversation

Yelinz
Copy link
Member

@Yelinz Yelinz commented Oct 28, 2021

fixes #1576

Copy link
Member

@open-dynaMIX open-dynaMIX left a comment

Choose a reason for hiding this comment

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

🎉

@czosel
Copy link
Contributor

czosel commented Oct 29, 2021

The fix looks good, but I was just wondering - why is the static content optional? What’s the point of having a static question without content?

@Yelinz
Copy link
Member Author

Yelinz commented Nov 3, 2021

If you want to use staticQuestion for an override component which doesnt display the text, for example a custom submit button in the form would be a staticQuestion without static_content

@czosel
Copy link
Contributor

czosel commented Nov 3, 2021

Ah I see, so it's a bit of an edge case. Fine by me 👍
cc @anehx @kaldras

@Yelinz
Copy link
Member Author

Yelinz commented Nov 3, 2021

After some discussion it seems to be a problem of the staticQuestion schema, as static_content optional in the schema and therefore the frontend also marks it as an optional field.
image
static_content should be required, otherwise the question would just be blank when its rendered which wouldn't make sense.

For the case of using a staticQuestion for an override component, a new question type of widgetQuestion should be created for that, instead of abusing a staticQuestion.

@czosel
Copy link
Contributor

czosel commented Nov 3, 2021

Much cleaner! 👍

@anehx anehx deleted the allow-empty-static-content branch March 2, 2022 10:34
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.

static_content in staticQuestion is optional
3 participants