cstate icon indicating copy to clipboard operation
cstate copied to clipboard

NetlifyCMS Incident Affected Systems doesnt allow whitespace

Open szilvasidave opened this issue 3 years ago • 2 comments

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

szilvasidave avatar Aug 03 '22 14:08 szilvasidave

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)

mistermantas avatar Aug 05 '22 12:08 mistermantas

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

szilvasidave avatar Aug 05 '22 12:08 szilvasidave