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

FIO-9059: fixed an issue where the string type returns for textarea with json type #156

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

TanyaGashtold
Copy link
Contributor

@TanyaGashtold TanyaGashtold commented Sep 25, 2024

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-9059

Description

What changed?

Added a check that returns any type for textarea that is configured to save as JSON

Dependencies

formio/formio.js#5829

How has this PR been tested?

tests

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@@ -193,6 +193,12 @@ export function getModelType(component: Component): keyof typeof MODEL_TYPES_OF_
return component.modelType;
}

switch (component.type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd rather just treat textarea components like selects and make their data model just 'any' to begin with. Also, see my comment in the upstream formio.js PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the textarea data model to 'any' and added normalization logic for it in the renderer.
I also added a fix for the issue where the validation error appears for multiple textarea with JSON type when the first value is array.

@brendanbond brendanbond merged commit d651f03 into master Sep 27, 2024
8 checks passed
@brendanbond brendanbond deleted the FIO-9059-fixed-incorrect-type-for-tetarea-json branch September 27, 2024 14:03
lane-formio pushed a commit that referenced this pull request Sep 30, 2024
…-tetarea-json

FIO-9059: fixed an issue where  the string type returns for textarea with json type
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.

2 participants