UX: Add simple-list setting type (PR #9970)

Adds a new site setting list type called simple list, to be used only with settings that do not have a list of choices available.

This PR only enables this new setting type for the content security policy script src setting, as a first step., Support for other site settings (and theme settings) will be added in subsequent PRs.

GitHub

Looks good, thx! will do few comment.

don’t this this const is needed, I would just directly use this.values

once you change to @action you can do this.addValue(this.newValue)

please use @action

      return values.split(delimiter).filter(Boolean);

indentation of both is wrong here

indentation is wrong

why 0px and not 0 ?

can we use a class please?

can we use a class please?

Hmm, I was forced to do this by pre-commit hooks though, before I had this indentation, there were linting issues:

image

I copied the styles from the value-list SCSS, but found that this was an IE11 fix:

https://github.com/discourse/discourse/commit/ba5e17a7a98af178c75d00d7be817c471fc88911

I know we don’t support IE11 anymore, but I would keep this as 0px for consistency.

correct indentation is:

{{input
  title=value
  value=value
  class="value-input"
  focus-out=(action "changeValue" index)
}}

:+1:

guess it would be cleaner to stop the event here if we do something with it

I’m unsure this has value as a fn here given we only use it once

I’m unsure this has value as a fn here given we only use it once

and same thing for _addValue

I would rather want to have an onChange event, instead of mutating this inside the component, values should be read only inside the component, given it’s coming from outside the component.