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

CMS Editor: Handle booleans #209

Open
some-molasses opened this issue May 18, 2024 · 2 comments
Open

CMS Editor: Handle booleans #209

some-molasses opened this issue May 18, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers launch blocking The rebuilt site cannot be launched until this is addressed

Comments

@some-molasses
Copy link
Member

There's a bug we need to fix around the admin editor.

Steps to replicate:

  1. Open http://localhost:3000/admin/editor?page=documents/elections.json
  2. Try updating the value of a candidate's elected status (i.e. true -> false)
  3. Press save.
  4. Note that rather than successfully saving, an error is thrown. If you go into the Network tab of your devtools and look at the response under http://localhost:3000/api/data?path=documents/elections, you'll see why. The backend expected a boolean for elected, but received a string.

This is because the EditorLabelNode only handles strings at the moment. It's our fallback for all non-object data types, so even though the elected is a boolean, we're using EditorLabelNode anyway.

Steps to solve:

Let's make a new EditorNode subclass to handle booleans. Displaying a checkbox input element would work, among other options.

@some-molasses some-molasses added good first issue Good for newcomers launch blocking The rebuilt site cannot be launched until this is addressed labels May 18, 2024
@isobarbaric
Copy link

hey, I'd like to help with this issue

@criscreates
Copy link

I'd be happy to work on this!! I don't think I have the ability to assign myself to it yet due to permissions tho 💀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers launch blocking The rebuilt site cannot be launched until this is addressed
Projects
None yet
Development

No branches or pull requests

3 participants