Support for multiple Gitlab instances

This MR aims to support multi-instance tokens for Gitlab.

Setting token

  1. Displays a text input for typing in the instance URL to Gitlab image

  2. Shows the same token input as before image

Removing token

Removing a token shows a list of all instance URL's. Selecting one will remove that token.

image

Old single instance token

If a user has already set a single token, they will see a message for if they want to:

  1. Add the token to a cluster
  2. Remove the token
  3. Cancel (or ESC) do nothing, the popup will be seen next time they open VSCode

image

Clicking "Set instance" will let them see the instance URL text field (same as for setting token), but they do not need to fill in the token in the second text field.

De- & re-activation

The status bar will initialize when:

  1. On startup if a token for current instanceURL exists
  2. If inactive and instanceURL is changed, and the new instanceURL has a token
  3. If inactive and a token is set and workspace instanceURL matches url for which token was set

The status bar will be disposed if:

  1. If active and current instanceURL token is removed
  2. If active and workspace instanceURL is changed and token does not exist

Disclaimer: The status bar might not work perfectly in all cases if a lot of token switching is happening, but this is not a normal use case. To avoid writing/re-writing even more code in this MR I did not spend too much time inside status_bar.js.

Feedback and questions are welcome.

Fixes #15 (closed)

Merge request reports

Loading
Loading