-
Notifications
You must be signed in to change notification settings - Fork 36
[Connect] Conditionally render Access Request navigation menu #1273
Changes from 4 commits
d194789
043d4e6
f61054a
5bc9fc0
3a1d27a
d73d80d
3a878c8
641a0ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,7 +59,10 @@ export function NavigationMenu() { | |
| const [isPopoverOpened, setIsPopoverOpened] = useState(false); | ||
| const selectorRef = useRef<HTMLButtonElement>(); | ||
|
|
||
| if (!activeRootCluster) { | ||
| if ( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to put the access requests menu to the left of profile selector? Otherwise the profile selector switches position when switching between a cluster that has access requests and one that doesn't. |
||
| !activeRootCluster || | ||
| !activeRootCluster.features.advancedAccessWorkflows | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd assume that when we get a response from endpoint that doesn't actually populate
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is bad design. I've updated the backend to only return the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Another idea for the future would be to utilize the render view pattern that Alan mentioned. But yeah, we're free to completely change the RPCs around getting root cluster details, there's nothing holding us back. They work the way they work right now because we've never had to do more than just read stuff from the disk. |
||
| ) { | ||
| return <></>; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,7 +72,6 @@ export class ClustersService extends ImmutableStore<ClustersServiceState> { | |
| async logout(clusterUri: string) { | ||
| // TODO(gzdunek): logout and removeCluster should be combined into a single acton in tshd | ||
| await this.client.logout(clusterUri); | ||
| await this.syncClusterInfo(clusterUri); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would we need to try and
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for posterity, I'm linking my comment from another PR gravitational/teleport#17497 (comment) which explains that this is probably a remnant of times when logging out and removing a cluster from the list were two separate actions. |
||
| this.removeResources(clusterUri); | ||
| await this.removeCluster(clusterUri); | ||
| await this.removeClusterKubeConfigs(clusterUri); | ||
|
|
@@ -705,8 +704,6 @@ export class ClustersService extends ImmutableStore<ClustersServiceState> { | |
| return useStore(this).state; | ||
| } | ||
|
|
||
| // Note: client.getCluster ultimately reads data from the disk, so syncClusterInfo will not fail | ||
| // with a retryable error in case the certs have expired. | ||
| private async syncClusterInfo(clusterUri: string) { | ||
| const cluster = await this.client.getCluster(clusterUri); | ||
| const assumedRequests = cluster.loggedInUser | ||
|
|
||
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.
Maybe something like this? It seems easier to understand