Skip to content

Refresh resources after dropping an access request #49125

Merged
gzdunek merged 10 commits intomasterfrom
gzdunek/refresh-resources-on-request-drop
Nov 20, 2024
Merged

Refresh resources after dropping an access request #49125
gzdunek merged 10 commits intomasterfrom
gzdunek/refresh-resources-on-request-drop

Conversation

@gzdunek
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek commented Nov 18, 2024

Closes #42381

As mentioned in the linked issue, we were unable to refresh resources after dropping an access request because ResourcesContext was lower in the component tree, so we simply couldn't access it.
A simple fix for this problem is to move it higher in the tree and add a root cluster URI as an argument to its functions, so we can still refresh resources within a single workspace.

Changelog: Teleport Connect now refreshes the resources view after dropping an access request

Comment thread web/packages/teleterm/src/ui/DocumentCluster/resourcesContext.tsx
@ravicious ravicious self-requested a review November 18, 2024 14:01
Comment thread web/packages/teleterm/src/ui/AccessRequestCheckout/useAssumedRolesBar.ts Outdated
Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

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

Good idea and great execution. 👏

Comment thread web/packages/teleterm/src/ui/DocumentCluster/resourcesContext.tsx
Comment thread web/packages/teleterm/src/ui/DocumentCluster/UnifiedResources.tsx Outdated
@ravicious
Copy link
Copy Markdown
Member

It actually feels so nice that this works now and has been implemented in an elegant way.

@gzdunek gzdunek enabled auto-merge November 20, 2024 14:40
@gzdunek gzdunek added this pull request to the merge queue Nov 20, 2024
Merged via the queue into master with commit b3f1c0b Nov 20, 2024
@gzdunek gzdunek deleted the gzdunek/refresh-resources-on-request-drop branch November 20, 2024 14:59
@public-teleport-github-review-bot
Copy link
Copy Markdown

@gzdunek See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Create PR

gzdunek added a commit that referenced this pull request Nov 22, 2024
* Pass `rootClusterUri` to functions in `ResourcesContext`

* Support refreshing resources per cluster URI in unified resources

* Move `ResourcesContextProvider` higher in component hierarchy

* Refresh resources after dropping request

* Fix casing of Assume Roles button

* Add `rootClusterUri` as an argument to `useResourcesContext`

* Change the error message

* Change one more usage of `requestResourcesRefresh(rootClusterUri)`

* Move `onResourcesRefreshRequest` listener logic to `ResourcesContextProvider`

* Remove unnecessary `props.clusterUri` from deps

(cherry picked from commit b3f1c0b)
github-merge-queue Bot pushed a commit that referenced this pull request Nov 22, 2024
* Pass `rootClusterUri` to functions in `ResourcesContext`

* Support refreshing resources per cluster URI in unified resources

* Move `ResourcesContextProvider` higher in component hierarchy

* Refresh resources after dropping request

* Fix casing of Assume Roles button

* Add `rootClusterUri` as an argument to `useResourcesContext`

* Change the error message

* Change one more usage of `requestResourcesRefresh(rootClusterUri)`

* Move `onResourcesRefreshRequest` listener logic to `ResourcesContextProvider`

* Remove unnecessary `props.clusterUri` from deps

(cherry picked from commit b3f1c0b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop Access Request doesn't refresh access

3 participants