Commit Graph
285 Commits
Author SHA1 Message Date
Michael 50d56b28b4 Web: add bypass for flaky test (#41551) 2024-05-14 22:33:26 +00:00
Michael 6b0797adba Update shared access requests components for e changes (#41333) 2024-05-14 17:55:57 +00:00
Marco Dinis be29fd972c Always show the account id when listing IAM roles in AWS Apps (#41228) 2024-05-13 10:48:00 +00:00
Lisa Kim bc115eb21e Web: Add unto flakey test and throws console.error (#41390) 2024-05-09 20:06:05 +00:00
Rafał Cieślak 1e9dc9044c Fail when JS test uses console.error or console.warn (#41252) 2024-05-09 14:44:57 +00:00
Lisa Kim 3a88c153b5 WebDiscover: Add custom input fields for database test connection with wildcard (#40931)
* WebDiscover: Add custom input fields for database test connection with asterisks

* Add specific validation rule and add tests

* Update database fixture for testing
2024-05-08 00:58:03 +00:00
Gavin Frazar ed7d0d223e support gcloud spanner in tsh and web UI (#41129)
* add spanner to tsh and teleterm

* handle spanner events in web ui

* update web audit events test snapshot

* customize web ui connect for spanner

* update ConnectDialog snapshot
2024-05-07 23:17:03 +00:00
Lisa Kim 2af98c6db7 Web: Modify components, define new types for yaml parse/stringify endpoints (#40974)
* Web: update SlideTabs to render spinner depending on condition

* Web: Add async version of FieldSelectCreatable

* Web: Allow modifying fetched resources with useKeyBasedPagination

* Web: Add yaml parse/stringify api endpoints and types

* Web: Allow input search bgColor to take on parents bgColor

* Address CRs

* Update snaps and test
2024-05-02 13:00:01 +00:00
Lisa Kim 00d8addbfc Web: create js version of parsing string with double quotes and commas (#41086) 2024-05-01 17:05:26 +00:00
Yassine Bounekhla d281cf47fa add notifications list component (#40263) 2024-04-30 20:29:32 +00:00
Grzegorz Zdunek 3ee2c51564 Move the shared part of access requests UI to OSS (#41036)
* Move `teleport.e/AccessRequests` to `shared/components/AccessRequests`

The last commit from teleport.e that includes the original files: gravitational/teleport.e@5ca6881e29

* Move `teleport.e/services/accessRequests` to `shared/services/AccessRequests`

* Move `teleterm.e/ui` to `teleterm/ui`

* `make fix-license`

* Fix imports

* Run prettier and eslint

* Rename stories

* Remove ts-ignore comments

`accessRequestsService.test.ts` was refactored slightly,
we don't need assumed requests there at all.
2024-04-30 18:08:38 +00:00
Michael 0051a2b563 Open authorize device popup with deeplink (#40802) 2024-04-26 15:36:32 +00:00
Ryan ClarkandJakub Nyckowski 37d73247ed Remove the Assist UI (#40813)
* Remove Assist command execution and chat feature

The changes remove tests and related code for command execution in the assist package and web command handling.

* Remove the Assist UI

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2024-04-26 09:39:09 +00:00
Marco André DinisandRafał Cieślak 774b54ae5c Add AWS AccountID to IAM Roles in AWS App Access (#40657)
* Add AWS AccountID to IAM Roles in AWS App Access

* add story

* Use named export

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2024-04-25 07:33:59 +00:00
Michael 879de3a41d Open Connect if DeviceTrustWeb token received (#40803) 2024-04-24 17:58:37 +00:00
Michael 420d51d580 Add AuthenticateWebService deeplink in Connect (#40420) 2024-04-24 16:53:35 +00:00
Rafał Cieślak 46b4385693 Connect: Avoid flashing more labels button when switching tabs (#40827) 2024-04-23 16:54:39 +00:00
Michael 4713707b2d Add DeviceTrustWeb passthrough page (#40608) 2024-04-22 16:48:42 +00:00
Michael ceaeabc3ed Dont show cluster dropdown for only one cluster (#40416) 2024-04-11 12:36:00 +00:00
Rafał Cieślak a001c6a10f Make VNet connection item behave like other items (#40249)
* Add JSDoc comments to StepComponentProps

* Vendor in react-merge-refs

* FilterableList: Ignore case when filtering

* Make VNet connection item behave like other items

* Refactor VNet toggle to maintain focus between state transitions

* Always enable VNet in tests

* Add tests for navigating connections
2024-04-09 10:10:03 +00:00
Grzegorz Zdunek d12d714f1e Switch ListRoles to the paginated API (#40165)
* Switch "get roles" endpoint to the paginated version

* Use the paginated API in the roles screen

* Use the paginated API in the locks screen

* Switch select components for roles to an async version

* Do not break backward compatibility of list roles endpoint

* Allow the new web UI to handle old response types

* Disable pagination buttons in the serverside table when loading data

* Add TODO item about rename

* Add `UrlListRolesParams`

* Remove pagination config

* Remove unused `UrlIntegrationExecuteRequestParams`
2024-04-09 07:23:55 +00:00
Grzegorz Zdunek 753c0677bc Add FieldSelectAsync (#40164)
* Add `FieldSelectAsync`

* Add docs to `FieldSelectAsync`

* Use attempt's `statusText` instead of `error` to show the error message
2024-04-08 11:17:56 +00:00
Lisa Kim 55ef4a2f03 Web: intl add a date time short formatter (#39915)
* Web: intl add a date time short formatter

* Address CRs
2024-03-28 15:38:28 +00:00
Michael aeed30d33c Use new access request filters in webUI (#39625) 2024-03-27 18:21:55 +00:00
Michael b9b5905365 Update aws launch buttons with searchable fields (#39639) 2024-03-27 17:29:34 +00:00
Lisa Kim acae5bdc61 Teleterm: add conditional when sending access request create usage (#39743) 2024-03-25 10:11:28 +00:00
Michael 9dcc69d474 Move DownloadConnect to shared (#39703)
* Move DownloadConnect to shared

* Add story for DownloadConnect
2024-03-22 15:54:26 +00:00
Michael 035c791001 Add optional datakey in useKeybasedPagination hook (#39592) 2024-03-20 13:54:32 +00:00
Grzegorz Zdunek 05d1cbdbd3 Fix connectMyComputerContext tests flakiness (#39400)
* Fix `connectMyComputerContext` flakiness

* Use `waitFor` correctly in other places

* Wait for the table to fully render before checking a snapshot
2024-03-19 15:12:27 +00:00
Yassine Bounekhla edf5b27a1d add Cluster: prefix to cluster selector text (#39364) 2024-03-18 20:22:16 +00:00
Grzegorz Zdunek 784d7ac10c Clone the tshd gRPC client to allow inspecting errors (#39229)
* Add functions to clone every gRPC method, so they can be passed over the context bridge

* Replace `@grpc/grpc-js` interceptors with `@protobuf-ts/runtime-rpc` ones

* Replace string check with check on metadata, add missing `AddMetadataToRetryableError`

* Add `pin` to sensitive properties

It's needed because now we also log a passwordless login stream call.

* Add `cloneClient` method to clone the entire gRPC client

* Switch tests to `TshdRetryableError`

* Improve comments

* Move `cloneClient` and `cloneAbortSignal` to the top of the file

* Simplify condition

* Lowercase logs

* Check if the error is `RpcError` using `instanceof`

* Log error object instead of `[object Object]`

* Do not export call specific types

* Wrap gRPC calls in `createClient` to allow passing the errors over the context bridge (#39230)

* Regenerate protos with the `protobuf-ts` client

* Enable `strictBindCallApply` so `.bind()` results have correct types (instead of `any`)

This is needed for wrapping calls in `createClient`.

* Use `protobuf-ts` client instead of `grpc-js` one

* Convert `createClient` to use `protobuf-ts` response style, clone each call

* Switch callsites to `cloneAbortSignal`

* Replace `error.message` checks with a proper check on the error status code

* Clone the entire client instead of each method separately

* Correct the error `cause` in `ResourceSearchError`

* Remove `params.sortBy` defaults, always set `startKey` to string

* Use a simpler type for `reportUsageEvent`

* Fix interceptor test

* Ignore TS error in `highbar.ts`
2024-03-18 16:33:16 +00:00
Lisa Kim d04733578c Web: add another date config (#39389) 2024-03-15 08:13:20 +00:00
Rafał Cieślak 40cfacf601 Update eslint-plugin-jest to 27.9.0, switch to recommended rules only (#39226)
* Update eslint-plugin-jest to 27.9.0

https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md#2600-2022-01-24
https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md#2700-2022-08-28

I switched plugin:jest/all to plugin:jest/recommended, since /all just
activates every rule in the package. This might have been fine when this
package was added a couple of years ago, but it doesn't make sense anymore.

27.0.0 requires parserOptions.project to be set, but this returned an error:

    0:0  error  Parsing error: ESLint was configured to run on
    `<tsconfigRootDir>/web/packages/teleport/vite.config.mts` using `parserOptions.project`:
    /users/rav/src/teleport/tsconfig.json
    However, that TSConfig does not include this file. Either:
    - Change ESLint's list of included files to not include this file
    - Change that TSConfig to include this file
    - Create a new TSConfig that includes this file and include it in your parserOptions.project

I updated tsconfig.node.json so that it applies only to .mts files, as
I understand that was the original intention.

* Autofix jest/valid-title

* Do not set parserOptions.project

It makes ESLint slower by ~20s and it is not needed for recommended rules
from eslint-plugin-jest.
2024-03-13 11:39:11 +00:00
Michelle Bergquist 9e4a6c007e update table styles (#37276)
* update table styles

* apply feedback from design
2024-03-12 20:25:11 +00:00
Rafał Cieślak a5d909d479 Add rotate360 keyframes (#39014)
* Add rotate360 keyframes

* Move ClusterDropdown story to shared

This way it no longer is a single uncategorized story at the top of the list.
2024-03-07 09:51:37 +00:00
Rafał Cieślak 5c16e76c15 Add ButtonWithMenu (#39016)
* Add ButtonWithMenu

* Use ButtonWithMenu in DocumentCluster/ActionButtons

* Reorganize DocumentCluster story

Put ActionButtons into a separate category. Move the happy path as the
first story for DocumentCluster.

* Import ComponentType

* Update snapshots
2024-03-07 09:45:13 +00:00
Yassine Bounekhla 463e510546 [Web] Update database connection instructions (#38891)
* remove tsh db login from modal

* update commands based on dbprotocols
2024-03-05 17:26:33 +00:00
Michael 19fb2b7430 Fix menu positioning to be below the clicked element (#38550) 2024-02-22 18:44:35 +00:00
Grzegorz Zdunek 6ab80263f8 Fix incorrect color of resource cards after changing the theme (#38496) 2024-02-22 09:10:36 +00:00
Grzegorz ZdunekandRafał Cieślak 402472698a Allow copying proxy link in app gateways (#38254)
* Move `TextSelectCopy` to design package

* Show only URL to app instead of curl example

* Move `TextSelectCopy` to `shared`

* Show loading spinner when `changePortAttempt` is processing

* Make the button revert to "Copy" after clicking

* Move Online DocumentGatewayApp story to be the first one

This way the happy path opens first when you open the relevant story section.

* Adjust the story to showcase the spinner

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2024-02-16 13:50:20 +00:00
Lisa Kim 198521c9a6 Web UI Component Tweaks (#37887)
* Table tweak

- move table prop types to types file
- add a custom component field for pagination config

* FieldSelectCreatable: pass in custom props

* api.ts: add/set another error related field

Sometimes the backend can respond with a list of other related
error messages but in another field called `messages`

* Clarifying comments

* Fix grammar
2024-02-13 17:28:47 +00:00
Rafał Cieślak 17e342b722 Improve handling of unrecognized documents in Connect (#38015)
* Serialize unhandled case to console

* getResourceUri: Return undefined for unhandled cases
2024-02-12 10:06:07 +00:00
Grzegorz Zdunek 103f351eaf Update Prettier to 3.2.5 (#37837) 2024-02-08 10:39:20 +00:00
matheus 8e941fe785 Add buttons to download and copy to clipboard content to TextEditor (#37333)
* Add editor buttons

* Set icon size

* Move downloadObject to OSS

* remove unused test-id

* Use values from theme

* Fix buttons positioning

* Convert jsx files to tsx

* Use const instead of var

* Add z-index to buttons

* Add license
2024-02-01 20:12:23 +00:00
Sakshyam Shah fd65f29d63 updates TextSelectCopyMulti to save content as file (#37232)
* feat: save content as file

* add min height to have consistent height on empty text

* run linter and update snapshot

* move download icon to the right of copy icon

* increase left padding when showing download icon

* accomodate vertical and horizontal scroller and icon button view

* move download function to shared utils

* rename downloadContentAsFile to saveOnDisk, unit test

* original style with increased padding for download icon
2024-01-31 02:12:29 +00:00
Rafał Cieślak ab51257257 Prevent flash of card view when switching between tabs in Connect (#37524)
* Prevent flash of card view when switching between tabs in Connect

* Use useLayoutEffect when removing min-width from ContentMinWidth
2024-01-30 17:21:04 +00:00
Grzegorz Zdunek 47f8ccc447 Support SAML apps in Connect (#37507)
* Support SAML apps

* Add stories

* Add articles

* Remove 'app' from copy in the search bar

* Replace ternary condition with simple ifs

* Make test name more grammatically correct

* Report opening AWS and SAML apps

* Display button as link

* `it` -> `test`
2024-01-30 16:23:58 +00:00
Grzegorz ZdunekandRafał Cieślak e4fc2f9b18 Allow launching AWS apps from Connect (#37323)
* Move `AwsLaunchButton` to `shared`

* Move generating `launchUrl` to the parent

* Align styling of `AwsLaunchButton` with other action buttons

* Add AWS roles to proto

* Return AWS roles from tshd

* Launch AWS apps from resources view

* Set `textTransform="none"` on all buttons to align them with `AwsLaunchButton` (and Web UI in general)

* Change suggestions passed to `ParameterPicker` to be objects, so they can show a displayable name on the list

* Allow launching AWS apps form the search bar

* Move `AwsRole` to `shared/services/apps`

* Rename fields, add JSDoc

* Fix lint issue

* `make grpc`

* Display 'No roles found' in the search bar when the AWS app doesn't provide any

* `awsRolesList` -> `awsRoles`

* Do the check against correct attempt

* Use MoreVert instead of ChevronDown for web app button in Connect (#37406)

* Clean up URIs in tshd test helpers

* Add missing apps in stories

* Use MoreVert instead of ChevronDown for AWS apps

* Use https instead of cloud for AWS endpoints

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2024-01-29 17:11:25 +00:00
200553c474 Move Teleport Connect over to Vite (#36921)
* Move Teleport connect over to Vite

* Clean up the Electron Vite config

* Add mts to prettier/eslint

* Add license headers

* Dedupe @babel scope

* Remove console.log from mainProcess

* Set suggestedReviewers on CreateAccessRequestRequest

* Remove unneeded code added from strict null checks

* Move out dir to build/app

On masted it's build/app/dist.

We don't want to use build directly, as the app is being packaged in
build/release.

* Move Node-only deps to dependencies

https://electron-vite.org/guide/dev#dependencies-vs-devdependencies

cross-env has been removed since it's not needed at all.

* Remove eval warning suppression

* Fix default path of tsh

* Rename dev-term to start-term-skip-native-deps

* Use correct `oneofKind` value for `ptyEventOneOfIsStartError`

* Undo strict null check changes

* Correctly construct env vars struct for shell

Based on https://stackoverflow.com/a/66989401

* Allow reloading renderer app

* Move JSDoc for TshdEventContextBridgeService to correct position

* Remove outdated comment about type casting in tshdEvents/index.ts

* Drop type cast for error.cause['message']

* Ignore teleterm's build dir in .eslintignore

**/dist/** has been removed from ignorePatterns because it's no longer
necessary, neither Web UI nor Connect build in a dir matching this pattern.

* Define NODE_ENV for main and renderer

* Define only NODE_ENV, not whole process.env

Otherwise process.env in the main process is always replaced with an
object containing just NODE_ENV.

We need process.env to be properly populated since it's then used when
spawning tsh daemon and other processes.

Using define like this guarantees that only callsites using
process.env.NODE_ENV directly will be affected.

* Add support for the cluster preferences backend mismatch from the gRPC UserPreferences object

* Return resourceIds from preferences, convert preferences before updating

* Future proof all of the clusterPreferences object getting converted correctly

* Fix cluster preferences for leaf clusters

* Use correct `AssistViewMode` enum, remove the old one and unused interface

* Lint fix

* Add back in JS protobuf stuff, it can be removed in a later PR

* Remove `List` from property

* Add license header

* Remove console.logs

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
2024-01-26 15:47:33 +00:00
Michael 3c93c2d62b Update cluster dropdown styles (#37104) 2024-01-24 23:14:21 +00:00