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

Change block/field default to None #32

Closed
4 of 7 tasks
loicteixeira opened this issue Apr 6, 2017 · 3 comments
Closed
4 of 7 tasks

Change block/field default to None #32

loicteixeira opened this issue Apr 6, 2017 · 3 comments
Assignees
Milestone

Comments

@loicteixeira
Copy link
Contributor

loicteixeira commented Apr 6, 2017

Currently, the default value is an empty dict which is basically an invalid content state. Therefore, the editor should return None which clearly state the lack of content.

  • Update springload/draftail package.
  • Update springload/draftjs_exporter package.
  • Update springload/draftail dependency for this package.
  • Update springload/draftjs_exporter dependency for this package.
  • Update block accordingly
  • Update field accordingly (actually the field doesn't have a default value atm?)
  • Remove the now useless form field and validator?
@thibaudcolas
Copy link
Contributor

@loicteixeira I've done the work in Draftail (#40) and the exporter (#36) to support this, and updated those two here – will leave the Django changes to you if you have the time.

@thibaudcolas
Copy link
Contributor

I have re-added a default value of {} within this project (bb4b68f) so that we can finish this later on.

Note that nothing needs to happen for the exporter, it will handle None or {} just the same.

@loicteixeira
Copy link
Contributor Author

Sorry I didn't get time to look into this before my break.

Basically, the block use a custom form field to handle the '{}' string as empty.

Now that draftail returns None, this is not needed anymore. This can probably use the same formfield as the parent class, so there is no need for the form and validator linked above in the issue.

FWIW, it looks like DraftailTextBlock and DraftailTextField don't use the same underlying form field and this should be updated to the same (but potentially removing the overwrite on the block should do the trick).

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

No branches or pull requests

2 participants