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

Add defaultValue to file-widget default config #10181

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

jacobtylerwalls
Copy link
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Previously, saving an empty tile through the file widget raised TypeError, as None was saved, not an empty list.

Issues Solved

Closes #10176

Checklist

  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Testing instructions

  • you can save an empty tile in file widget
  • file widget doesn't start from dirty state (with "cancel edit")
  • regression test saving and deleting files

Copy link
Member

@chiatt chiatt left a comment

Choose a reason for hiding this comment

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

This works great for new nodes, but existing nodes with records in the cards_x_nodes_x_widgets table won't have the default value. I think we'd just have to apply similar sql to that cards_x_nodes_x_widgets table's config column (where widgetid = '10000000-0000-0000-0000-000000000019'). You can create a record in cards_x_nodes_x_widgets by giving your widget a custom label.

image

@jacobtylerwalls
Copy link
Member Author

Great spot. I made those changes, but found they had no effect unless the graph was republished. Added programmatic graph republishing to the migration, LMK what you think.

@chiatt
Copy link
Member

chiatt commented Oct 24, 2023

Works like a charm. Nice catch with the graph publication.

@chiatt chiatt merged commit 0fb58e8 into dev/7.5.x Oct 24, 2023
1 check passed
@chiatt chiatt deleted the 10176-default-value-file-list branch October 24, 2023 20:08
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.

Adding an empty tile to a file-list node raises TypeError
2 participants