revelrylabs/slax

As a user, when I try to create a repo when using the /token command and I don't fill in the project fields I get an error

Opened this issue · 1 comments

Description

When using the /token command to add a repo, if your repo isn't listed you need to click the create repo button. When you do this, there are 3 fields:

  • Projects, which is marked as optional
  • Project name, also marked as optional
  • Repo name, required

If you leave both "optional" fields blank, you receive an error:

[error] GenServer #PID<0.677.0> terminating
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: not a binary

    :erlang.binary_to_integer(nil)
    (slax 0.0.1) lib/slax_web/websockets/token.ex:80: SlaxWeb.Token.handle_payload/1
  ...

Filling in either of these optional fields allows the repo to be added. If you leave the Projects field blank and fill in the Project name field, that name appears in the "Projects" selector on future attempts.

It appears that this is an either/or option: either select an existing project or create a new project. However it is not clear from the UI that this is the case and it is also not clear what these project fields are referring to or how they are used.

Screenshot on 2024-03-27 at 11-52-09

The optional tags are added by Slack, not part of the specified config. It implies both fields are optional, when it is actually an either/or situation. Probably need to rethink this UI.