* Connect: Remove resource cache
This commit refactors parts of the Electron app which still depend on
the resource cache, that is cluster sync and `tsh ssh` executed from the
command bar.
A number of adjustments has been made to executing `tsh ssh` from the
command bar, namely the logic of resolving the hostname has been moved
from the command launcher to useDocumentTerminal. The UI was also
adjusted to allow the user to reconnect to an SSH server if resolving
the hostname fails. This has a nice benefit of also allowing them to
retry if the PTY couldn't be created for some reason.
---
Before gravitational/webapps#1307, Connect was pulling all resources
from the cluster on app start and cluster login. Then it'd show them to
you in tables if you opened a new tab with cluster resources. There were
at least two problems with this approach:
1. It was slow for big clusters as pagination, filtering and sorting
were all done client-side and blocked the main thread.
2. It wasn't possible to implement advanced search unless we copied the
implementation from the backend to tshd.
gravitational/webapps#1307 made it so that instead of depending on that
resource cache to show resource tables, Connect would pull paginated
resources from the backend.
However, the resource tables were not the only part of the app depending
on that cache. Due to time constraints, we weren't able to refactor all
of them. We managed to refactor autocomplete (gravitational/webapps#1406)
and the remaining places are listed in #21800.
This PR refactors those remaining places to not use the cache by either
not depending on resource details or by making a call to the proxy
instead.
* Add missing license
* Create user trait hook and setup access wrapper
- create a reusable hook related to setup access and user traits
- create a setup access wrapper that dedups repeated logic
- rename and added more yaml readers
* Create SetupAccess screen for database
* Refactor SetupAccess for kube
* Refactor SetupAccess for server
* Add database json vals and prevent infinite rendering from
dependency array
* add import order lint rule.
* auto fix import order and spacing.
* prettier fix.
* manual fix of import order.
* update failing snapshots.
* bump e submodule for import order fixes.
* Create Pill component for Label manager component.
* Fixed some styling issues when using the Pill component.
* Initial layout for the Label Selector component.
* Add basic new label input scaffold
* Added label format validation and error message.
* When hitting enter or clicking add, add a label to the list.
* Added tooltip to add labels header.
* Support dismissing labels and focus the input when opening.
* Create clickoutside hook and use it in the label picker.
* Create and use a onescape hook in the label picker.
* Remove the temp ability to pass in existing labels.
* added tests for LabelSelector component
* fix validation regex to allow numbers hyphens and periods.
* remove incorrectly added component instance.
* do not use default imports and other tweaks.
* use flexbox instead of floats for label input labels.
* use utility methods for tests to make it easier to understand.
* remove remaining floats and some review cleanup.
* added missing license messages.
* Move useCallback usage into parent component from hook.
* Move useAsync to the shared package, add docs
* Add async variant of MenuLogin
* Add Teleport Connect version of MenuLogin to its story
* Update gRPC files
* Show database username suggestions
* Use JSdoc in useAsync
Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
* Convert useAsync to a named export
* Refactor MenuLogin to use useAsync underneath
* Rewrite useAsync to use a promise instead of async
The Web UI currently doesn't support `async`. To do this, we'd need to
configure polyfills there, but we don't have time for that right now.
* Replace async with promise in MenuLogin
Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
- Renew session endpoint is modified so that we no longer send
request ID in param but as a json object.
- This endpoint now returns a new field sessionExpires.
This is the absolute time the web session will expire for the most
recently consumed access request and is the value used in the
switchback countdown.
- Refactored how bearer token is being set (used type instead of class)
- Update e-ref
* New Top Nav (#136)
* Moves AuthConnectors/TrustedClusters/Roles to the Dashboard Top Nav
* Add feature to allow user in context to perform operations on other users (#137)
* Added List/Create/Update/Delete/Reset user functionality
* Added enterprise api endpoint to OSS config
Co-authored-by: Alexey Kontsevoy <biz.kovoy@gmail.com>
* Fix handling of feature flags (#138)
* Prevent closing when there is an error with deleting user (#142)
* Alexey/v5nav (#155)
* Touch Ups (#157)
* Create a story for Teleport App (#158)
* Add Application Launcher (AAP) (#162)
* use publicAddr and clusterName URL parameters to launch apps. (#169)
* Update sideNav styles and ssh input box (#170)
* [teleport] Implement add node dialog (#165)
* [teleport] Change NodeJoinToken prop expires to expiry (#176)
* Remove empty state from NodesList (#179)
* [teleport] Add -f flag to add node curl command (#180)
* [teleport] Add app session chunk and start events (#181)
* Add Application Dialog
* Delete Force
Co-authored-by: Lisa Kim <lisa@gravitational.com>
* Updates design components
* Updates popover styles
* Updates FeatureHeader component including the title, tabs, and date selector.
* Updates the Side Navigation component to match new design updates
* Updates font size for error card
* Updates offline text
* Updates loading spinner
* Updates to tables and colors for components and buttons to match with new designs
* Updates dialog header size
* Updates cluster nodes table
* Updates top bar
* Updates the cluster table rows, search, and title styles
* Updated shared components FormInvite and FormLogin with updated designs.
* Updates size for outlined button to be consistent with button component
* Update terminal tabs
* Updates blankstate for console
* Updates to events list and ranger picker
* Updates help and support
* Updates session icon
* Updates login page with SSO
* Fixes router error in menu ssh login
* Success for login and small input field adjustments
* Tags with states update
* Updates to menu and icons menu
* Updates cluster info box
* Addresses design-system changes
* Adds missing events
* Fixes unit-tests
* Updates e-ref
Co-authored-by: Alexander Wolfe <alexanderwolfe@Alexanders-MacBook-Air.local>
* Update jest.config.js to map jquery path
* Remove leftovers in hooks/withState
* Create render helper for jest tests
* Convert Login story to CSF
* Renamed TopNav.test to TopNav.story.test and edited to use render helper
* Add eslint-plugin-jest pkg for enforcing testing best practices
* Add react-test-renderer pkg for use with snapshot tests
* Add prettier required by snapshot
* Edit eslintrc to include jest lint
* Update testing.js to include helper to convert component to JSON
* Snapshot Login.story
Refers to issue: https://github.com/gravitational/webapps/issues/3