-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teleterm: add support for access requesting kube namespaces #47347
Conversation
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
768b594
to
3140a5c
Compare
357f75a
to
65cb297
Compare
web/packages/teleterm/src/ui/AccessRequestCheckout/AccessRequestCheckout.tsx
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/AccessRequestCheckout.tsx
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
3140a5c
to
a7f49c2
Compare
65cb297
to
2042699
Compare
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Show resolved
Hide resolved
web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
2042699
to
6902cd8
Compare
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.test.tsx
Outdated
Show resolved
Hide resolved
I'll take a look tomorrow and I'll try to use the UI. |
web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk how to create a minimal repro for this, but sometimes after closing the select, the list of selected namespaces gets sorted. In the video it happens right at the end.
Is it because we sort it at some point or is it because the namespaces are kept in a set in Connect? FWIW, I think Set in JS keeps insertion order, so idk if it's plausible for this data structure to cause that.
sort-after-select-close.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that doesn't look like sorting, but just rearranging? maybe it's b/c of how we bulk toggle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it might be due to that, but looking at the code I can't quite understand why it happens. A smaller repro would be this:
- Select the first three namespaces (say they're called foo, bar and baz) and close the select.
- Open the select again. From the list, deselect the second item. Deselect the first item and select it again. Close the list.
- Before the list gets closed, foo is the last element (since it was most recently added), but when the list is closed, it is now the first element.
Could you add a test for this and fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what's happening under the hood:
we start with this
later, i deselect coffee2
, deselect and reselect coffee 1
and select coffee4
, final result is this:
The order we expect is coffee3, coffee1, coffee4
, but b/c we aren't replacing the entire array, it like keeps the previous order and just setting new namespaces and deleting ones we dont need, so the order gets re-arranged to coffee1, coffee3, coffee4
i can fix this by just replacing the entire array (this toggling worked better with the previous data modeling, and web UI will also needs to change i think), but i would like to punt this to a separate PR and not block this one.
web/packages/teleterm/src/ui/DocumentAccessRequests/NewRequest/useNewRequest.ts
Outdated
Show resolved
Hide resolved
7b9a051
to
638a391
Compare
939680d
to
c7802cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With some minor comments.
web/packages/teleterm/src/ui/services/workspacesService/accessRequestsService.ts
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/AccessRequestCheckout/useAccessRequestCheckout.ts
Outdated
Show resolved
Hide resolved
638a391
to
1a979b2
Compare
c7802cb
to
9c96761
Compare
9c96761
to
84cac38
Compare
1a979b2
to
d10cd23
Compare
84cac38
to
c63dec9
Compare
…ces during access requests (#48413) * Web: add support for requesting for kube namespaces (#47345) * Teleterm: add support for access requesting kube namespaces (#47347) * WebShared: Update how request checkout handles kube resource related errors (#48168) * WebShared: Update how request checkout handles kube resource related errors * Fix bug where after create/cancel, specifiable fields were retained * Remove single toggler for kube resources * Address CR * Update snaps * Backport fixes - teleport version v16 and less uses react select version 3 which required to add manual support for initially fetching namespaces on select dropdown - hover tooltip design diffs - field select design diffs
part of #46742
requires:
role.allow.request
field calledkubernetes_resources
#47173if you want to test connect, i have a staging cluster that i can invite you to (dm me) then:
screenshots and demo similar as: #47345
changelog: Add Connect support for selecting Kubernetes namespaces during access requests