Skip to content

Fix empty join token ui state#45413

Merged
avatus merged 1 commit intomasterfrom
avatus/fix_token
Aug 13, 2024
Merged

Fix empty join token ui state#45413
avatus merged 1 commit intomasterfrom
avatus/fix_token

Conversation

@avatus
Copy link
Copy Markdown
Contributor

@avatus avatus commented Aug 13, 2024

Empty join token responses would show an error instead of an empty list message

Screenshot 2024-08-13 at 8 41 35 AM

Empty join token responses would show an error instead of an empty list
message
@avatus avatus added backport-required no-changelog Indicates that a PR does not require a changelog entry backport/branch/v16 labels Aug 13, 2024
@github-actions github-actions Bot requested review from kiosion and ravicious August 13, 2024 13:43
@avatus avatus enabled auto-merge August 13, 2024 14:05
@avatus avatus added this pull request to the merge queue Aug 13, 2024
Merged via the queue into master with commit d54eb78 Aug 13, 2024
@avatus avatus deleted the avatus/fix_token branch August 13, 2024 14:33
@public-teleport-github-review-bot
Copy link
Copy Markdown

@avatus See the table below for backport results.

Branch Result
branch/v16 Failed

avatus added a commit that referenced this pull request Aug 13, 2024
Empty join token responses would show an error instead of an empty list
message
@avatus avatus mentioned this pull request Aug 13, 2024
@avatus
Copy link
Copy Markdown
Contributor Author

avatus commented Aug 13, 2024

Backport collected here #44701

return api.get(cfg.getJoinTokensUrl(), signal).then(resp => {
return {
items: resp.items.map(makeJoinToken),
items: resp.items?.map(makeJoinToken) || [],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the API endpoint not include items when there are no items to return?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It includes it, but it's null:
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it has to do with not using zero-length slices.

github-merge-queue Bot pushed a commit that referenced this pull request Aug 26, 2024
* Add token list/delete endpoints (#42402)

This PR implements list/delete for tokens in the api the same way as
tctl interacts with them. This does not include pagination yet but is
currently being used while the feature is in development. Pagination can
come in the future in the form of a sort cache, but the endpoints won't
change

* Add token ACL/routes

* Add initial join tokens UI

* Add Allow and GCP fields to ui join token

* Fix missing styled components

* Fix empty join token state (#45413)

Empty join token responses would show an error instead of an empty list
message

* Update button case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-required no-changelog Indicates that a PR does not require a changelog entry size/sm ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants