Trouble with hbs ValueList as non-admin--what to use instead?

AI-generated summary

The user pfaffman is having trouble with the ValueList component in a non-admin context. The code works as an admin but fails to render as a regular user, producing an error. After investigation, pfaffman suspects that ValueList might be intended for admin use only, as it’s only found in an admin component. The user is looking for an alternative solution to allow users to select plugins, as shown in the provided screenshot. In a follow-up post, pfaffman mentions finding and restoring a custom PvalueList component they had created previously, which was copied from the admin ValueList.

I’ve got code on my https://dashboard.literatecomputing.com/ that works as admin (and has worked for a long while as regular users, I’m pretty sure) that is now failing as a regular user.

When I include this code on the page, it works as an admin, but not as a regular user:

        <ValueList
          @values={{this.server.custom_plugins}}
          @inputType="array"
          @addKey="pfaffmanager.server.custom_plugins_suggestion"
        />

I checked that the regular user has access to this.server.custom_plugins and

What strikes me as strange is that if I hit the page as a regular user, the page renders nothing, not even the {{log ...}} lines in the hbs that do log if the errant lines are removed.

Error occurred:

- While rendering:
  -top-level
    application
      discourse-root
        pfaffmanager
          pfaffmanager.servers
            pfaffmanager.servers.edit

And another <ValueList..> is also causing the same problem. Is there something else I should use? I think that I thought . . . wait. The only place I see <ValueList> is in a admin component.

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/admin/addon/components/admin-user-field-item.hbs#L29

I’m using this selector to allow users to select plugins, like this:

I can’t remember what I was doing before. I think I did this for the Ember 5 upgrade?

Is there something else I should do?

EDIT: I guess <ValueList is only for admins and now I have a vague memory of creating my own valueList and then wondering why I’d done so and deleting it.

I found the PvalueList that I had created before (and had just copied from the value-ilist in admin) and restored it from github.