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

NetlifyCMS Incident Affected Systems doesnt allow whitespace #241

Open
szilvasidave opened this issue Aug 3, 2022 · 2 comments
Open

NetlifyCMS Incident Affected Systems doesnt allow whitespace #241

szilvasidave opened this issue Aug 3, 2022 · 2 comments

Comments

@szilvasidave
Copy link

Describe the bug
When creating an incident where the name of the affected system(s) contains a whitespace or comma, NetlifyCMS' list widget doesnt allow the user to enter these two characters

Reproduction steps
Steps to reproduce the behavior:

  1. Create a system component that has a space or comma in it (e.g. "example.com website")
  2. Create an incident and try to type in the system component's exact name

Expected behavior
Spaces and commas should be allowed within a system component name

Additional context
Partial-Workaround:

  1. Type the text first then add the spaces - example.comwebsite -> example.com website

Possible solution:

  1. Replace static/admin/config.yml lines 62-65 with:
    - { label: "Affected systems (use exact name, separated by commas) 🧐", name: "affected", widget: "list", required: false, summary: "{{fields.individualaffected}}", field: { label: "Affected System", name: "individualaffected", widget: "string" }}
    (sorry, I'm new at contributing, not sure how to directly reference the code in the file)

  2. Use a select widget instead of list and populate select widget options with system components defined in repo-root/config.yml

@mistermantas
Copy link
Member

mistermantas commented Aug 5, 2022

This seems more like a netlifycms quirk with the spaces themselves but yes we could change the default config

can you expand on and explain why you want to change lines 62-65 with your first proposed solution? What would your solution do in that case?

as for the second idea – not sure how easy it is to populate the options with the components but that would be a nicer implementation obviously (for not having to remember all the components)

@szilvasidave
Copy link
Author

With the proposed first option we change the behavior of the list widget.
Default behavior is in use today in the config.yml which means a single text field is shown where comma separated entries can be added.
With the field attribute specified to be a string, the list behavior changes, so that multiple text fields can be added - and even rearranged - , therefore overcoming the whitespace issue.
Source: NetlifyCMS List Widget UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants